public abstract class BaseCallManager extends java.lang.Object implements CallManager, TerminalListener
CallManager.| Constructor and Description |
|---|
BaseCallManager()
Constructs a new object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addTerminal(java.lang.String terminal,
ConfiguredApplication application)
Adds the terminal with the given URI to the list of known terminals.
|
Session |
createSession(Terminal term,
CallParameters parameters)
Creates a session for the given terminal and initiates a call at
JVoiceXml.
|
protected abstract java.util.Collection<Terminal> |
createTerminals()
Creates all terminals without starting them.
|
ConfiguredApplication |
getApplication(java.lang.String terminal)
Retrieves the application for the given terminal.
|
java.util.Collection<ConfiguredApplication> |
getApplications()
Retrieves all configured applications.
|
JVoiceXml |
getJVoiceXml()
Retrieves the reference to the interpreter.
|
protected void |
handleStop()
Possible post processing when the call manager is shut down after
all terminals have been stopped.
|
protected void |
hangupSessions()
Calls the hangup for each connected session and stops the terminals.
|
boolean |
isConnected(Terminal terminal)
Checks if the given terminal is connected.
|
void |
setApplications(java.util.Collection<ConfiguredApplication> apps)
Adds the given list of applications.
|
void |
setConnectionInformationFactory(TerminalConnectionInformationFactory factory)
Sets the connection information factory.
|
void |
setJVoiceXml(JVoiceXml jvoicexml)
Sets a reference to JVoiceXml.
|
void |
start()
Starts the call manager asynchronously.
|
void |
stop()
Stops the call manager and all terminals.
|
void |
terminalConnected(Terminal terminal,
CallParameters parameters)
A connection has been established with the given terminal.
|
void |
terminalDisconnected(Terminal terminal)
A connection has been disconnected with the given terminal.
|
void |
terminalError(Terminal terminal,
java.lang.String message,
java.lang.Throwable cause)
An error has occurred while interacting with the terminal.
|
public final void setJVoiceXml(JVoiceXml jvoicexml)
setJVoiceXml in interface CallManagerjvoicexml - reference to JVoiceXml.public final JVoiceXml getJVoiceXml()
public final void setConnectionInformationFactory(TerminalConnectionInformationFactory factory)
factory - the connection information container factory.public final void setApplications(java.util.Collection<ConfiguredApplication> apps)
apps - list of applicationpublic final boolean addTerminal(java.lang.String terminal,
ConfiguredApplication application)
terminal - identifier for the terminalapplication - URI of the application to add.true if the terminal was added.public final ConfiguredApplication getApplication(java.lang.String terminal)
terminal - name of the terminalpublic final java.util.Collection<ConfiguredApplication> getApplications()
public final void start()
throws NoresourceError,
java.io.IOException
This means that all terminals are initialized and started. Upon a successful run, all terminal are waiting for incoming connections.
This implementation first creates all terminals by callingcreateTerminals(). These terminals are then requested to wait
for incoming connections by calling
Terminal.waitForConnections().start in interface CallManagerNoresourceError - Error starting the call manager.java.io.IOException - unable to start a terminalprotected abstract java.util.Collection<Terminal> createTerminals() throws NoresourceError
NoresourceError - error creating a terminal.public final Session createSession(Terminal term, CallParameters parameters) throws ErrorEvent
term - the connecting terminalparameters - additional parametersErrorEvent - Error creating the session.public final void terminalConnected(Terminal terminal, CallParameters parameters)
terminalConnected in interface TerminalListenerterminal - the connected terminal.parameters - additional call parameterspublic final void terminalDisconnected(Terminal terminal)
terminalDisconnected in interface TerminalListenerterminal - the disconnected terminal.public final void terminalError(Terminal terminal, java.lang.String message, java.lang.Throwable cause)
terminalError in interface TerminalListenerterminal - the terminalmessage - a detailed message about the errorcause - the error cause.public final boolean isConnected(Terminal terminal)
terminal - the terminaltrue if the given terminal is connectedprotected final void hangupSessions()
public final void stop()
terminalDisconnected(Terminal). Next, all terminals are
requested to stop waiting for incoming connections by calling
Terminal.stopWaiting(). Afterwards it is possible to do
some further cleanup by overriding handleStop().stop in interface CallManagerprotected void handleStop()