Package com.bea.wcp.diameter.util
Class Simulator
java.lang.Object
com.bea.wcp.diameter.Application
com.bea.wcp.diameter.util.Simulator
- Direct Known Subclasses:
HssSimulator,RfSimulator,RoSimulator,SySimulator
Base class for simulator applications.
- Author:
- Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHistory(Message msg) voidabstract SessioncreateSession(String id) booleanprotected voidinit()Called by the container to initialize the application.protected voidMethod to be overridden.protected voidinitialClientRequest(Session session) Method to be overridden.booleanisServer()protected voidrcvRequest(Request req) Called by the container when a new Request has been received for this application.voidvoidsetHistoryEnabled(boolean enabled) voidsetServer(boolean server) Methods inherited from class com.bea.wcp.diameter.Application
createRequest, createSession, createSession, createSessionId, getDestinationHost, getDestinationRealm, getId, getName, getNode, getOriginHost, getOriginRealm, getParameter, getParameter, log, log, rcvAnswer, rcvMessage, setDestinationHost, setDestinationRealm
-
Constructor Details
-
Simulator
public Simulator()
-
-
Method Details
-
init
protected void init()Description copied from class:ApplicationCalled by the container to initialize the application. Applications override this method to perform application specific initialization.- Overrides:
initin classApplication
-
addHistory
-
clearHistory
public void clearHistory() -
setHistoryEnabled
public void setHistoryEnabled(boolean enabled) -
getHistory
-
historyEnabled
public boolean historyEnabled() -
isServer
public boolean isServer() -
setServer
public void setServer(boolean server) -
initialClientRequest
Method to be overridden. It will be called at the appropriate time when the simulator in client mode can send its first request.- Throws:
IOException- Exception when sending the request
-
initialClientRequest
Method to be overridden. It will be called at the appropriate time when the simulator in client mode can send its first request.- Parameters:
session- A new session instance- Throws:
IOException- Exception when sending the request
-
sendASR
- Throws:
IOException
-
rcvRequest
Description copied from class:ApplicationCalled by the container when a new Request has been received for this application. The default behavior is to respond with the Answer UNKNOWN_SESSION_ID for requests with a Session-Id AVP or otherwise the Answer UNABLE_TO_COMPLY. Requests are first delivered to a matching Session object if found, so overriding this method is only necessary if the application does not use sessions or is a server application which will be creating new Session objects for received requests.- Overrides:
rcvRequestin classApplication- Parameters:
req- the Request that was received- Throws:
DiameterException- if an error occurred while processing the messageIOException- if an I/O error occurred
-
createSession
- Overrides:
createSessionin classApplication
-