|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object dk.i1.diameter.node.NodeManager dk.i1.diameter.session.SessionManager
public class SessionManager
A go-between sessions and NodeManager. The SessionManager keeps track of outstanding requests and dispatches answers to the sessions. It also keeps track of the timeouts in the sessions.
SessionManager instances logs with the name "dk.i1.diameter.session", so you can get detailed logging (including hex-dumps of incoming and outgoing packets) by putting "dk.i1.diameter.session.level = ALL" into your log.properties file (or equivalent)
Constructor Summary | |
---|---|
SessionManager(NodeSettings settings,
Peer[] peers)
Constructor for SessionManager. |
Method Summary | |
---|---|
protected void |
handleAnswer(Message answer,
ConnectionKey answer_connkey,
Object state)
Handle an answer to an outstanding request. |
protected void |
handleRequest(Message request,
ConnectionKey connkey,
Peer peer)
Handle incoming request. |
Peer[] |
peers()
Retrieve the default set of peers. |
Peer[] |
peers(Message request)
Retrieve a set of peers suitable for the specified request. |
void |
register(Session s)
Register a session for management. |
void |
sendRequest(Message request,
Session session,
Object state)
Send a request for a session. |
void |
start()
Start the session manager. |
void |
stop(long grace_time)
Stop the SessionManager. |
void |
unregister(Session s)
Unregister a session for management. |
void |
updateTimeouts(Session s)
Update the timeouts for a session. |
Methods inherited from class dk.i1.diameter.node.NodeManager |
---|
answer, forwardAnswer, forwardRequest, forwardRequest, handle, handle, node, sendRequest, sendRequest, sendRequest, sendRequest, settings, stop, waitForConnection, waitForConnection, waitForConnectionTimeout |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SessionManager(NodeSettings settings, Peer[] peers) throws InvalidSettingException
settings
- The node settingspeers
- The default set of peers. If a subclass overrides the
peers() methods then this parameter can be null.
InvalidSettingException
Method Detail |
---|
public void start() throws java.io.IOException, UnsupportedTransportProtocolException
start
in class NodeManager
java.io.IOException
UnsupportedTransportProtocolException
public void stop(long grace_time)
stop
in class NodeManager
grace_time
- Maximum time (milliseconds) to wait for connections to close gracefully.protected void handleRequest(Message request, ConnectionKey connkey, Peer peer)
handleRequest
in class NodeManager
request
- The incoming request.connkey
- The connection from where the request came.peer
- The peer that sent the request. This is not the originating peer but the peer directly connected to us that sent us the request.protected void handleAnswer(Message answer, ConnectionKey answer_connkey, Object state)
handleAnswer
in class NodeManager
answer
- The answer message. Null if the connection broke.answer_connkey
- The connection from where the answer came.state
- The state object passed to sendRequest() or forwardRequest()public void sendRequest(Message request, Session session, Object state) throws NotRoutableException, NotARequestException
request
- The request to send-session
- The session the request is sent on behalf of.state
- A state object that will be given in the Session.handleAnswer(dk.i1.diameter.Message, java.lang.Object)
or Session.handleNonAnswer(int, java.lang.Object)
call.
NotRoutableException
NotARequestException
public Peer[] peers()
public Peer[] peers(Message request)
request
- The request that will be sent to one of the returned peers.
public void register(Session s)
s
- The Session to be registered.public void unregister(Session s)
s
- The Session to be registered.public void updateTimeouts(Session s)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |