|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents point-to-point SIP relationships. It roughly corresponds
to a SIP dialog. In particular, for UAs it maintains (or is otherwise
associated with) dialog state so as to be able to create subequent
requests belonging to that dialog (using createRequest
).
For UACs, SipSession
extend the notion of SIP dialogs
to have well-defined state before a dialog has been established and
after a final non-2xx terminates an early dialog. This allows UACs to
create "subsequent" requests without having an established dialog. The
effect is that the subsequent request will have the same Call-ID,
From and To headers (with the same From tag and without a To tag),
the will exist in the same CSeq space.
All messages are potentially associated with a SipSession
.
The SipSession
can be retrieved from the message by calling
SipServletMessage.getSession()
.
Method Summary | |
SipServletRequest |
createRequest(java.lang.String method)
Returns a new request |
SipApplicationSession |
getApplicationSession()
Returns the application session with which this SipSession
is associated. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the object bound with the specified name in this session, or null if no object is bound under the name. |
java.util.Enumeration |
getAttributeNames()
Returns an Enumeration over the String
objects containing the names of all the objects bound to this session. |
java.lang.String |
getCallId()
Returns the Call-ID for this SipSession . |
long |
getCreationTime()
Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT. |
java.lang.String |
getId()
Returns a string containing the unique identifier assigned to this session. |
long |
getLastAccessedTime()
Returns the last time the client sent a request associated with this session, as the number of milliseconds since midnight January 1, 1970 GMT. |
Address |
getLocalParty()
Returns the Address identifying the local party. |
Address |
getRemoteParty()
Returns the Address identifying the remote party. |
void |
invalidate()
Invalidates this session and unbinds any objects bound to it. |
void |
removeAttribute(java.lang.String name)
Removes the object bound with the specified name from this session. |
void |
setAttribute(java.lang.String name,
java.lang.Object attribute)
Binds an object to this session, using the name specified. |
void |
setHandler(java.lang.String name)
Sets the handler for this SipSession . |
Method Detail |
public long getCreationTime()
java.lang.IllegalStateException
- if this method is called on an invalidated sessionpublic java.lang.String getId()
public long getLastAccessedTime()
public void invalidate()
java.lang.IllegalStateException
- if this method is called on an invalidated sessionpublic SipApplicationSession getApplicationSession()
SipSession
is associated.SipSession
public java.lang.String getCallId()
SipSession
. This is the
value of the Call-ID header for all messages belonging to this session.SipSession
public Address getLocalParty()
Address
identifying the local party. This is
the value of the From header of locally initiated requests in this leg.public Address getRemoteParty()
Address
identifying the remote party. This is
the value of the To header of locally initiated requests in this leg.public SipServletRequest createRequest(java.lang.String method)
method
- the SIP method of the new requestjava.lang.IllegalStateException
- if this SipSession
has been invalidatedpublic void setHandler(java.lang.String name) throws javax.servlet.ServletException
SipSession
.
This method can be used to
explicitly specify the name of the servlet which should handle all
subsequently received messages for this SipSession
.
The servlet must belong to the same application (i.e. same
ServletContext
) as the caller.name
- name of the servlet to be invoked for incoming
SIP messages belonging to this SipSession
javax.servlet.ServletException
- if no servlet with the specified name
exists in this applicationpublic java.lang.Object getAttribute(java.lang.String name)
name
- a string specifying the name of the objectjava.lang.IllegalStateException
- if this method is called on an invalidated sessionpublic java.util.Enumeration getAttributeNames()
Enumeration
over the String
objects containing the names of all the objects bound to this session.java.lang.IllegalStateException
- if this method is called on an invalidated sessionpublic void setAttribute(java.lang.String name, java.lang.Object attribute)
name
- the name to which the object is bound; cannot be nullattribute
- the object to be bound; cannot be nulljava.lang.IllegalStateException
- if this method is called on an invalidated sessionpublic void removeAttribute(java.lang.String name)
name
- the name of the object to remove from this sessionjava.lang.IllegalStateException
- if this method is called on an invalidated session
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |