public interface SipApplicationSession
| Modifier and Type | Interface and Description |
|---|---|
static class |
SipApplicationSession.Protocol
Possible protocols to which sessions contained in the SipApplicationSession belong to.
|
| Modifier and Type | Method and Description |
|---|---|
void |
encodeURI(URI uri)
Deprecated.
Encodes the ID of this SipApplicationSession into the specified URI. The container must then be prepared to associate this application session with an incoming request which was triggered by activating the encoded URI.
In the case of SIP and SIPS URIs, the container may also rewrite the host, port, and transport protocol components of the URI based on its knowledge of local listen points. When doing so it should take existing settings as a hint as to which listen point to select when it has more than one.
This method allow applications to correlate events which would otherwise be treated as being independent, that is, as belonging to different application sessions. For example, an application might send an instant message with an HTML body to someone. The IM body may then contain a SIP URI pointing back to the SIP servlet container and the application session in which the IM was generated, thus ensuring that an INVITE triggered by the IM recipient triggering that URI is associated with this application session when received by the container.
Containers are required to support rewriting of SIP and SIPS URIs.
|
URL |
encodeURL(URL url)
Encode specified URL to include the application session ID in a way such that
the parameter used to encode the application session ID should be unique across implementations.
|
String |
getApplicationName()
Returns the name of the SIP application this SipApplicationSession is associated with.
|
Object |
getAttribute(String name)
Returns the object bound with the specified name in this session, or null if no object is bound under the name.
|
Iterator<String> |
getAttributeNames()
Returns an Iterator over the String objects containing the names of all the objects bound to this session.
|
long |
getCreationTime()
Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT.
|
long |
getExpirationTime()
Returns the time in future when this SipApplicationSession will expire.
|
String |
getId()
Returns a string containing the unique identifier assigned to this session.
|
boolean |
getInvalidateWhenReady()
Returns true if the container will notify the application when this SipApplicationSession is in the ready-to-invalidate state.
|
long |
getLastAccessedTime()
Returns the last time an event occurred on this application session.
|
Object |
getSession(String id,
SipApplicationSession.Protocol protocol)
Returns the session object with the specified id associated with the specified protocol belonging to this application session, or null if not found.
|
Iterator<?> |
getSessions()
Returns an Iterator over all "protocol" sessions associated with this application session.
|
Iterator<?> |
getSessions(String protocol)
Returns an Iterator over the "protocol" session objects associated of the specified protocol associated with this application session.
|
SipSession |
getSipSession(String id)
Returns the SipSession with the specified id belonging to this application session, or null if not found.
|
ServletTimer |
getTimer(String id)
Returns the active timer identified by a specific id that is associated with this application session.
|
Collection<ServletTimer> |
getTimers()
Returns all active timers associated with this application session.
|
void |
invalidate()
Invalidates this application session and unbinds any objects bound to it.
|
boolean |
isReadyToInvalidate()
Returns true if this application session is in a ready-to-invalidate state.
|
boolean |
isValid()
Returns if this SipApplicationSession is valid, false otherwise.
|
void |
removeAttribute(String name)
Removes the object bound with the specified name from this session.
|
void |
setAttribute(String name,
Object attribute)
Binds an object to this session, using the name specified.
|
int |
setExpires(int deltaMinutes)
Sets the time of expiry for this application session.
|
void |
setInvalidateWhenReady(boolean invalidateWhenReady)
Specifies whether the container should notify the application when the SipApplicationSession
is in the ready-to-invalidate state as defined above.
|
void encodeURI(URI uri)
URL encodeURL(URL url)
String getApplicationName()
Object getAttribute(String name)
Iterator<String> getAttributeNames()
long getCreationTime()
long getExpirationTime()
IllegalStateException - if this application session is not validString getId()
boolean getInvalidateWhenReady()
IllegalStateException - if this application session is not validvoid setInvalidateWhenReady(boolean invalidateWhenReady)
invalidateWhenReady - if true, the container will observe this application session
and notify the application when it is in the ready-to-invalidate state.
The application session is not observed if the flag is false.
The default is true for v1.1 applications and false for v1.0 applications.IllegalStateException - if this application session is not validlong getLastAccessedTime()
Iterator<?> getSessions()
Iterator<?> getSessions(String protocol)
SipSession getSipSession(String id)
Object getSession(String id, SipApplicationSession.Protocol protocol)
id - the session idprotocol - an Enum identifying the protocolNullPointerException - on null id or protocolIllegalStateException - if this application session is not validServletTimer getTimer(String id)
id - IllegalStateException - if this application session is not validCollection<ServletTimer> getTimers()
void invalidate()
boolean isReadyToInvalidate()
IllegalStateException - if this application session is not validboolean isValid()
void removeAttribute(String name)
void setAttribute(String name, Object attribute)
int setExpires(int deltaMinutes)
Copyright © 2016. All Rights Reserved.