Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Product of NIST/ITL Advanced Networking Technologies Division (ANTD). * /
  
  package gov.nist.javax.sip.header.extensions;
  
  /*
 * This code is in the public domain.
 */

Join SIPHeader.

Author(s):
jean.deruelle@gmail.com
Version:
JAIN-SIP-1.2
 
 
 public class Join
     extends ParametersHeader implements ExtensionHeaderJoinHeader {

    
 
     private static final long serialVersionUID = -840116548918120056L;
 
     public static final String NAME = "Join";

    
callIdentifier field
 
     public CallIdentifier callIdentifier;
     public String callId;

    
Default constructor
 
     public Join() {
         super();
     }

    
Constructor given the call Identifier.

Parameters:
callId string call identifier (should be localid@host)
Throws:
java.lang.IllegalArgumentException if call identifier is bad.
 
     public Join(String callIdthrows IllegalArgumentException {
         super();
         this. = new CallIdentifier(callId);
     }

    
Encode the body part of this header (i.e. leave out the hdrName).

Returns:
String encoded body part of the header.
 
     public StringBuilder encodeBody(StringBuilder retval) {
         if ( == null)
             return retval;
         else {
             retval.append();
             if (!.isEmpty()) {
                 retval.append();
                 .encode(retval);
             }
             return retval;
         }
     }

    
get the CallId field. This does the same thing as encodeBody

Returns:
String the encoded body part of the
 
     public String getCallId() {
         return ;
     }

    
get the call Identifer member.

Returns:
CallIdentifier
 
     public CallIdentifier getCallIdentifer() {
         return ;
     }

    
set the CallId field

Parameters:
cid String to set. This is the body part of the Call-Id header. It must have the form localId@host or localId.
Throws:
java.lang.IllegalArgumentException if cid is null, not a token, or is not a token@token.
 
     public void setCallId(String cid) {
          = cid;
     }

    
Set the callIdentifier member.

Parameters:
cid CallIdentifier to set (localId@host).
    public void setCallIdentifier(CallIdentifier cid) {
         = cid;
    }

    
Get the to-tag parameter from the address parm list.

Returns:
tag field
    public String getToTag() {
        if ( == null)
            return null;
        return getParameter(.);
    }
    
Set the to-tag member

Parameters:
t tag to set. From tags are mandatory.
    public void setToTag(String tthrows ParseException {
        if (t == null)
            throw new NullPointerException("null tag ");
        else if (t.trim().equals(""))
            throw new ParseException("bad tag", 0);
        this.setParameter(.t);
    }
    
Boolean function

Returns:
true if the Tag exist
    public boolean hasToTag() {
        return hasParameter(.);
    }

    
remove Tag member
    public void removeToTag() {
    }
    
Get the from-tag parameter from the address parm list.

Returns:
tag field
    public String getFromTag() {
        if ( == null)
            return null;
        return getParameter(.);
    }
    
Set the to-tag member

Parameters:
t tag to set. From tags are mandatory.
    public void setFromTag(String tthrows ParseException {
        if (t == null)
            throw new NullPointerException("null tag ");
        else if (t.trim().equals(""))
            throw new ParseException("bad tag", 0);
        this.setParameter(.t);
    }
    
Boolean function

Returns:
true if the Tag exist
    public boolean hasFromTag() {
        return hasParameter(.);
    }

    
remove Tag member
    public void removeFromTag() {
    }
    public void setValue(String valuethrows ParseException {
        // not implemented.
        throw new ParseException(value,0);
    }
//  public Object clone() {
//      CallID retval = (CallID) super.clone();
//      if (this.callIdentifier != null)
//      retval.setCallIdentifier( (CallIdentifier) this.callIdentifier.clone() );
//      return retval;
//  }
New to GrepCode? Check out our FAQ X