|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectgov.nist.javax.sip.stack.SIPMessageStack
public abstract class SIPMessageStack
This class defines a SIP Stack. In order to build a SIP server (UAS/UAC or Proxy etc.) you need to extend this class and instantiate it in your application. After you have done so, call createMessageProcessor to create message processors and then start these message processors to get the stack the process messages. This will start the necessary threads that wait for incoming SIP messages.
フィールドの概要 | |
---|---|
static int |
DEFAULT_PORT
Default UDP port (5060) |
コンストラクタの概要 | |
---|---|
SIPMessageStack()
Default constructor. |
|
SIPMessageStack(StackMessageFactory messageFactory,
java.lang.String stackAddress,
java.lang.String stackName)
Construcor for the stack. |
メソッドの概要 | |
---|---|
void |
addMessageProcessor(MessageProcessor newMessageProcessor)
Adds a new MessageProcessor to the list of running processors for this SIPStack and starts it. |
MessageChannel |
createMessageChannel(javax.sip.address.Hop nextHop)
Creates a new MessageChannel for a given Hop. |
MessageProcessor |
createMessageProcessor(int port,
java.lang.String transport)
Creates the equivalent of a JAIN listening point and attaches to the stack. |
java.lang.String |
getBadMessageLog()
Get the file name of the bad message log. |
javax.sip.address.Hop |
getDefaultRoute()
Get the default route. |
Route |
getDefaultRouteHeader()
Get the route header corresponding to the default route. |
java.lang.String |
getHostAddress()
Get my address. |
LogWriter |
getLogWriter()
|
int |
getMaxMessageSize()
|
MessageProcessor |
getMessageProcessor(java.lang.String transport)
Get a message processor for the given transport. |
MessageProcessor[] |
getMessageProcessors()
Gets an array of running MessageProcessors on this SIPStack. |
javax.sip.address.Hop |
getNextHop()
Get the default next hop from the router. |
java.util.Iterator |
getNextHop(SIPRequest sipRequest)
Get the default route string. |
int |
getPort(java.lang.String transport)
get port of the message processor (based on the transport). |
Route |
getRouteHeader(javax.sip.address.Hop hop)
Get the route header for this hop. |
javax.sip.address.Router |
getRouter()
Get the router algorithm. |
ServerLog |
getServerLog()
|
java.lang.String |
getStackName()
Get the Stack name. |
boolean |
isAlive()
return the status of the toExit flag. |
boolean |
isTransportEnabled(java.lang.String transport)
Return true if a transport is enabled. |
boolean |
isTransportEnabled(java.lang.String transport,
int port)
Return true if the transport is enabled for a given port. |
void |
logBadMessage(java.lang.String message)
Log a bad message (invoked when a parse exception arises). |
void |
logMessage(java.lang.String message)
debug log writer. |
void |
logStackTrace()
Log the stack trace. |
ServerRequestInterface |
newSIPServerRequest(SIPRequest siprequest,
MessageChannel msgchan)
Generate a new SIPSeverRequest from the given SIPRequest. |
ServerResponseInterface |
newSIPServerResponse(SIPResponse sipresponse,
MessageChannel msgchan)
Generate a new SIPSeverResponse from the given SIPResponse. |
void |
removeMessageProcessor(MessageProcessor oldMessageProcessor)
Removes a MessageProcessor from this SIPStack. |
void |
setMaxConnections(int nconnections)
Set the max # of simultaneously handled TCP connections. |
void |
setRouter(javax.sip.address.Router router)
Set the router algorithm. |
void |
setSingleThreaded()
Set the flag that instructs the stack to only start a single thread for sequentially processing incoming udp messages (thus serializing the processing). |
void |
setStackMessageFactory(StackMessageFactory messageFactory)
Set the server Request and response factories. |
void |
setStackName(java.lang.String stackName)
Set the descriptive name of the stack. |
void |
setThreadPoolSize(int size)
Set the thread pool size for processing incoming UDP messages. |
void |
stopStack()
Make the stack close all accept connections and return. |
クラス java.lang.Object から継承されたメソッド |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
---|
public static final int DEFAULT_PORT
コンストラクタの詳細 |
---|
public SIPMessageStack(StackMessageFactory messageFactory, java.lang.String stackAddress, java.lang.String stackName) throws java.net.UnknownHostException
messageFactory
- User-implemented factory for processing
messages.stackAddress
- -- IP address or host name of the stack.stackName
- -- descriptive name for the stack.
java.net.UnknownHostException
public SIPMessageStack()
メソッドの詳細 |
---|
public void logBadMessage(java.lang.String message)
message
- is a string that contains the bad message to log.public void logMessage(java.lang.String message)
message
- is the message to log.public LogWriter getLogWriter()
public ServerLog getServerLog()
public int getMaxMessageSize()
public void logStackTrace()
public java.lang.String getBadMessageLog()
public void setSingleThreaded()
public void setThreadPoolSize(int size)
public void setMaxConnections(int nconnections)
public java.util.Iterator getNextHop(SIPRequest sipRequest)
sipRequest
- is the request for which we want to compute
the next hop.public void setStackMessageFactory(StackMessageFactory messageFactory)
messageFactory
- User-implemented factory for processing
messages.public void setStackName(java.lang.String stackName)
stackName
- -- descriptive name of the stack.public java.lang.String getStackName()
public java.lang.String getHostAddress()
public javax.sip.address.Hop getNextHop()
public int getPort(java.lang.String transport)
transport
- is the transport for which to get the port.public boolean isTransportEnabled(java.lang.String transport)
transport
- is the transport to check.public boolean isTransportEnabled(java.lang.String transport, int port)
transport
- transport to checkport
- port to check transport at.public ServerRequestInterface newSIPServerRequest(SIPRequest siprequest, MessageChannel msgchan)
siprequest
- SIPRequest for which we want to generate
thsi SIPServerRequest.msgchan
- Message channel for the request for which
we want to generate the SIPServerRequest
public ServerResponseInterface newSIPServerResponse(SIPResponse sipresponse, MessageChannel msgchan)
sipresponse
- SIPResponse from which the SIPServerResponse
is to be generated. Note - this just calls the factory interface
to do its work. The factory interface is provided by the user.msgchan
- Message channel for the SIPServerResponse
public void setRouter(javax.sip.address.Router router)
router
- A class that implements the Router interface.public javax.sip.address.Router getRouter()
public javax.sip.address.Hop getDefaultRoute()
public Route getRouteHeader(javax.sip.address.Hop hop)
public Route getDefaultRouteHeader()
public boolean isAlive()
public void stopStack()
public void addMessageProcessor(MessageProcessor newMessageProcessor) throws java.io.IOException
java.io.IOException
public void removeMessageProcessor(MessageProcessor oldMessageProcessor)
oldMessageProcessor
- public MessageProcessor[] getMessageProcessors()
public MessageProcessor getMessageProcessor(java.lang.String transport)
public MessageProcessor createMessageProcessor(int port, java.lang.String transport) throws java.io.IOException
java.io.IOException
public MessageChannel createMessageChannel(javax.sip.address.Hop nextHop) throws java.net.UnknownHostException
nextHop
- Hop to create a MessageChannel to.
UnknwonHostException
- If the host in the Hop doesn't
exist.
java.net.UnknownHostException
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |