public abstract class Simulator extends Application
Modifier and Type | Class and Description |
---|---|
static class |
Simulator.ServerSession |
Constructor and Description |
---|
Simulator() |
Modifier and Type | Method and Description |
---|---|
void |
addHistory(Message msg) |
void |
clearHistory() |
abstract Session |
createSession(String id) |
List<Message> |
getHistory() |
boolean |
historyEnabled() |
protected void |
init()
Called by the container to initialize the application.
|
protected void |
initialClientRequest()
Method to be overridden.
|
protected void |
initialClientRequest(Session session)
Method to be overridden.
|
boolean |
isServer() |
protected void |
rcvRequest(Request req)
Called by the container when a new Request has been received for this
application.
|
void |
sendASR(Session session) |
void |
setHistoryEnabled(boolean enabled) |
void |
setServer(boolean server) |
createRequest, createSession, createSession, createSessionId, getDestinationHost, getDestinationRealm, getId, getName, getNode, getOriginHost, getOriginRealm, getParameter, getParameter, log, log, rcvAnswer, rcvMessage, setDestinationHost, setDestinationRealm
protected void init()
Application
init
in class Application
public void addHistory(Message msg)
public void clearHistory()
public void setHistoryEnabled(boolean enabled)
public boolean historyEnabled()
public boolean isServer()
public void setServer(boolean server)
protected void initialClientRequest() throws IOException
IOException
- Exception when sending the requestprotected void initialClientRequest(Session session) throws IOException
session
- A new session instanceIOException
- Exception when sending the requestpublic void sendASR(Session session) throws IOException
IOException
protected void rcvRequest(Request req) throws DiameterException, IOException
Application
rcvRequest
in class Application
req
- the Request that was receivedDiameterException
- if an error occurred while processing the messageIOException
- if an I/O error occurredpublic abstract Session createSession(String id)
createSession
in class Application