public abstract class Application extends Object
Constructor and Description |
---|
Application() |
Modifier and Type | Method and Description |
---|---|
Request |
createRequest(Command cmd)
Creates a new Request for this application but with no associated
session.
|
Session |
createSession() |
Session |
createSession(String id) |
Session |
createSession(String id,
Object parent) |
protected String |
createSessionId()
Called by Session constructor when creating new session ids.
|
String |
getDestinationHost()
Returns the defautl destination host for requests.
|
String |
getDestinationRealm()
Returns the default destination realm for requests.
|
abstract ApplicationId |
getId()
Returns the ApplicationId for the application.
|
String |
getName()
Returns the name of the application.
|
Node |
getNode()
Returns the Diameter Node hosting the application.
|
String |
getOriginHost()
Returns the configured host name for the Diameter entity hosting this
application.
|
String |
getOriginRealm()
Returns the configured realm name for the Diameter entity hosting this
application.
|
String |
getParameter(String name)
Returns the value of the initialization parameter with the specified name.
|
String |
getParameter(String name,
String def)
Returns the value of the initialization parameter with the specified name,
or a default value if not found.
|
protected void |
init()
Called by the container to initialize the application.
|
void |
log(String msg)
Writes the specified message to the application log.
|
void |
log(String msg,
Throwable e)
Writes the specified message and exception to the application log.
|
protected void |
rcvAnswer(Answer ans)
Called by the container when a new Answer has been received for this
application.
|
void |
rcvMessage(Message msg)
Called by the container when a new Message has been received for this
application.
|
protected void |
rcvRequest(Request req)
Called by the container when a new Request has been received for this
application.
|
void |
setDestinationHost(String host)
Sets the default destination host for requests.
|
void |
setDestinationRealm(String realm)
Sets the default destination realm for requests.
|
protected void init() throws DiameterException
DiameterException
- if the initialization failedpublic final String getName()
public abstract ApplicationId getId()
public Session createSession()
public final String getParameter(String name)
name
- the parameter namepublic final String getParameter(String name, String def)
name
- the parameter namedef
- the default value of the parameter if not foundpublic final Node getNode()
public void rcvMessage(Message msg) throws DiameterException, IOException
msg
- the Message that has been receivedDiameterException
- if an error occurred while processing the messageIOException
- if an I/O error occurredprotected void rcvRequest(Request req) throws DiameterException, IOException
req
- the Request that was receivedDiameterException
- if an error occurred while processing the messageIOException
- if an I/O error occurredprotected void rcvAnswer(Answer ans) throws DiameterException, IOException
ans
- the Answer that was receivedDiameterException
- if an error occurred while processing the answerIOException
- if an I/O error occurredpublic Request createRequest(Command cmd)
cmd
- the Command for the requestprotected String createSessionId()
public String getOriginRealm()
public String getOriginHost()
public void setDestinationRealm(String realm)
realm
- the new default destination realmpublic void setDestinationHost(String host)
host
- the new default destination hostpublic String getDestinationRealm()
public String getDestinationHost()
public void log(String msg)
msg
- the message to be logged