|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents application instances. The SipApplicationSession
interface acts as a store for application data and provides access to
contained protocol sessions.
Method Summary | |
java.lang.String |
encodeURL(java.lang.String url)
Encodes the specified URL by including this SipApplicationSession s ID in it. |
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.Iterator |
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 |
getLastAccessedTime()
Returns the last time an event occurred on this application session. |
java.util.Iterator |
getSessions()
Returns an Iterator over all "protocol" sessions
associated with this application session. |
java.util.Iterator |
getSessions(java.lang.String protocol)
Returns an Iterator over the "protocol" session objects
associated of the specified protocol associated with this application
session. |
void |
invalidate()
Invalidates this application session. |
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. |
int |
setExpires(int deltaMinutes)
Sets the time of expiry for this application session. |
Method Detail |
public long getCreationTime()
java.lang.IllegalStateException
- if this method is called on an invalidated sessionpublic long getLastAccessedTime()
Actions that applications take, such as getting or setting a value associated with the session, do not affect the access time.
public int setExpires(int deltaMinutes)
This allows servlets to programmatically extend the lifetime
of application sessions. This method may be invoked by an
application in the notification that the application session has
expired: SipApplicationSessionListener.sessionExpired
.
If the server is willing to extend the session lifetime it returns
the actual number of minutes the session lifetime has been extended
with, and the listener will be invoked about session expiry again
at a later time.
This helps applications clean up resources in a reasonable amount of time in situations where it depends on external events to complete an application session. Being able to extend session lifetime means the application is not forced to choose a very high session lifetime to begin with.
It is entirely up to server policy whether to grant or deny the
applications request to extend session lifetime.
Note that any attempt to extend the lifetime of an explicitly
invalidated application session, one for which setExpires(int)
has been invoked, will always fail.
deltaMinutes
- the number of minutes that the lifetime of this
SipApplicationSession
is extended withjava.lang.IllegalArgumentException
- if the argument is less than 1public void invalidate()
java.lang.IllegalStateException
- if this method is called on an invalidated sessionpublic java.util.Iterator getSessions()
Iterator
over all "protocol" sessions
associated with this application session. This may include a mix
of different types of protocol sessions, e.g. SipSession
and javax.servlet.http.HttpSession
objects.Iterator
over set of protocol session belonging
to this application sessionpublic java.util.Iterator getSessions(java.lang.String protocol)
Iterator
over the "protocol" session objects
associated of the specified protocol associated with this application
session. If the specified protocol is not supported, an empty
Iterator
is returned.
If "SIP" is specified the result will be an Iterator
over the set of SipSession
objects belonging to this application
session. For "HTTP" the result will be a list of
javax.servlet.http.HttpSession
objects.
protocol
- a string identifying the protocol name, e.g. "SIP"Iterator
over protocol sessions of the
specified protocolpublic java.lang.String encodeURL(java.lang.String url)
SipApplicationSession
s ID in it. An incoming request
triggered by activating the encoded URL will be associated with
the specified session object.url
- the url to be encodedjava.lang.IllegalArgumentException
- if the container doesn't know how
to rewrite the specified URL, for example, because it doesn't
know the specific schemepublic 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.Iterator getAttributeNames()
Iterator
over the String
objects containing the names of all the objects bound to this session.Iterator
over the String
objects
specifying the names of all the objects bound to this sessionjava.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 |