Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unpublished - rights reserved under the Copyright Laws of the United States. Copyright � 2003 Sun Microsystems, Inc. All rights reserved. Copyright � 2005 BEA Systems, Inc. All rights reserved. Use is subject to license terms. This distribution may include materials developed by third parties. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Module Name : JSIP Specification File Name : DialogState.java Author : Phelim O'Doherty HISTORY Version Date Author Comments 1.1 08/10/2002 Phelim O'Doherty Initial version 1.2 07/07/2005 Phelim O'Doherty Deprecated the completed state. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
 package javax.sip;
 
 import java.io.*;

This class contains the enumerations that define the underlying state of an existing dialog. There are three explicit states for a dialog, namely:
  • Early - A dialog is in the "early" state, which occurs when it is created when a provisional response is recieved to the INVITE Request.
  • Confirmed - A dialog transitions to the "confirmed" state when a 2xx final response is received to the INVITE Request.
  • Terminated - A dialog transitions to the "terminated" state for all other reasons or if no response arrives at all on the dialog.

Author(s):
BEA Systems, NIST
Version:
1.2
 
 public final class DialogState implements Serializable{

    
Constructor for the DialogState

Parameters:
dialogState The integer value for the DialogueState
 
     private DialogState(int dialogState) {
          = dialogState;
         [] = this;
     }

    
This method returns the object value of the DialogState

Parameters:
dialogState The integer value of the DialogState
Returns:
The DialogState Object
 
     public static DialogState getObject(int dialogState){
         if (dialogState >= 0 && dialogState < ) {
             return [dialogState];
         } else {
             throw new IllegalArgumentException("Invalid dialogState value");
         }
     }

    
This method returns the integer value of the DialogState

Returns:
The integer value of the DialogState
 
     public int getValue() {
         return ;
     }


    
Returns the designated type as an alternative object to be used when writing an object to a stream. This method would be used when for example serializing DialogState.EARLY and deserializing it afterwards results again in DialogState.EARLY. If you do not implement readResolve(), you would not get DialogState.EARLY but an instance with similar content.

Returns:
the DialogState
Throws:
java.io.ObjectStreamException
 
     private Object readResolve() throws ObjectStreamException {
         return [];
     }

    
    
Compare this dialog state for equality with another.

Parameters:
obj the object to compare this with.
Returns:
true if obj is an instance of this class representing the same dialog state as this, false otherwise.
Since:
1.2
    public boolean equals(Object obj) {
        if (obj == thisreturn true;
        return (obj instanceof DialogState) && ((DialogState)obj). == ;
    }

    
Get a hash code value for this dialog state.

Returns:
a hash code value.
Since:
1.2
    public int hashCode() {
        return ;
    }        
    
    
    
This method returns a string version of this class.

Returns:
The string version of the DialogState
    public String toString() {
        String text = "";
        switch () {
            case :
                text = "Early Dialog";
                break;
            case :
                text = "Confirmed Dialog";
                break;
            case :
                text = "Completed Dialog";
                break;    
            case :
                text = "Terminated Dialog";
                break;                  
            default:
                text = "Error while printing Dialog State";
                break;
        }
        return text;
    }
    // internal variables
    private int m_dialogState;
    private static int m_size = 4;
    private static DialogState[] m_dialogStateArray = new DialogState[];
        
    
This constant value indicates the internal value of the "Early" constant.
This constant has an integer value of 0.
    
    public static final int _EARLY = 0;

    
This constant value indicates that the dialog state is "Early".
        
    public final static DialogState EARLY = new DialogState();
    
    
This constant value indicates the internal value of the "Confirmed" constant.
This constant has an integer value of 1.
    
    public static final int _CONFIRMED = 1;

    
This constant value indicates that the dialog state is "Confirmed".
        
    public final static DialogState CONFIRMED = new DialogState();
    
    
This constant value indicates the internal value of the "Completed" constant.
This constant has an integer value of 2.

Deprecated:
Since v1.2. This state does not exist in a dialog.
    
    public static final int _COMPLETED = 2;
    
    
This constant value indicates that the dialog state is "Completed".

Deprecated:
Since v1.2. This state does not exist in a dialog.
        
    public final static DialogState COMPLETED = new DialogState();

    
This constant value indicates the internal value of the "Terminated" constant.
This constant has an integer value of 3.
    
    public static final int _TERMINATED = 3;
    
    
This constant value indicates that the dialog state is "Terminated".
        
    public final static DialogState TERMINATED = new DialogState();    
    
New to GrepCode? Check out our FAQ X