org.cipango.diameter.api
Interface DiameterSession


public interface DiameterSession

Point-to-point Diameter relationship.


Method Summary
 DiameterServletRequest createRequest(DiameterCommand command, boolean maintained)
          Returns a new DiameterRequest.
 ApplicationId getApplicationId()
           
 javax.servlet.sip.SipApplicationSession getApplicationSession()
           
 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<java.lang.String> getAttributeNames()
          Returns an Enumeration over the String objects containing the names of all the objects bound to this session.
 java.lang.String getDestinationHost()
          Return the destination host associated with this session.
 java.lang.String getDestinationRealm()
          Return the destination realm associated with this session.
 java.lang.String getId()
          Returns the session ID.
 void invalidate()
          Invalidates this session and unbinds any objects bound to it.
 boolean isValid()
          Returns true if this DiameterSession is valid, false otherwise.
 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 value)
          Binds an object to this session, using the name specified.
 

Method Detail

getApplicationSession

javax.servlet.sip.SipApplicationSession getApplicationSession()

createRequest

DiameterServletRequest createRequest(DiameterCommand command,
                                     boolean maintained)
Returns a new DiameterRequest.

Parameters:
command - the command of the new DiameterRequest.
maintained - if true, add the AVP Auth-Session-State with the value AuthSessionState.STATE_MAINTAINED.
Returns:
a new DiameterRequest.
Throws:
java.lang.IllegalStateException - if this DiameterSession has been invalidated.
See Also:
Common.AUTH_SESSION_STATE, Common.AuthSessionState.STATE_MAINTAINED

getId

java.lang.String getId()
Returns the session ID.

Returns:
the session ID.
See Also:
Common.SESSION_ID

getApplicationId

ApplicationId getApplicationId()

getDestinationRealm

java.lang.String getDestinationRealm()
Return the destination realm associated with this session.

Returns:
the destination realm associated with this session.
See Also:
Common.DESTINATION_REALM

getDestinationHost

java.lang.String getDestinationHost()
Return the destination host associated with this session.

Returns:
the destination host associated with this session.
See Also:
Common.DESTINATION_HOST

isValid

boolean isValid()
Returns true if this DiameterSession is valid, false otherwise. The DiameterSession can be invalidated by calling the method invalidate() on it.

Returns:
true if this DiameterSession is valid, false otherwise.

invalidate

void invalidate()
Invalidates this session and unbinds any objects bound to it.

Throws:
java.lang.IllegalStateException - if this method is called on an invalidated session

getAttribute

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.

Parameters:
name - a string specifying the name of the object
Returns:
the object with the specified name
Throws:
java.lang.NullPointerException - if the name is null.
java.lang.IllegalStateException - if session is invalidated

getAttributeNames

java.util.Enumeration<java.lang.String> getAttributeNames()
Returns an Enumeration over the String objects containing the names of all the objects bound to this session.

Returns:
Returns an Enumeration over the String objects containing the names of all the objects bound to this session.
Throws:
java.lang.IllegalStateException - if session is invalidated

removeAttribute

void removeAttribute(java.lang.String name)
Removes the object bound with the specified name from this session. If the session does not have an object bound with the specified name, this method does nothing.

Parameters:
name - the name of the object to remove from this session
Throws:
java.lang.IllegalStateException - if session is invalidated

setAttribute

void setAttribute(java.lang.String name,
                  java.lang.Object value)
Binds an object to this session, using the name specified. If an object of the same name is already bound to the session, the object is replaced.

Parameters:
name - the name to which the object is bound
value - the object to be bound
Throws:
java.lang.IllegalStateException - if session is invalidated
java.lang.NullPointerException - on null name or value.


Copyright © 2010. All Rights Reserved.