NIST SIP Parser and Stack (v1.2) API

gov.nist.javax.sip.stack
Class MessageProcessor

java.lang.Object
  |
  +--gov.nist.javax.sip.stack.MessageProcessor
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
TCPMessageProcessor, UDPMessageProcessor

public abstract class MessageProcessor
extends Object
implements Runnable

This is the Stack abstraction for the active object that waits for messages to appear on the wire and processes these messages by calling the MessageFactory interface to create a ServerRequest or ServerResponse object. The main job of the message processor is to instantiate message channels for the given transport.

Version:
JAIN-SIP-1.1
Author:
M. Ranganathan
This code is in the public domain.
Enhancements contributed by Jeff Keyser.

Constructor Summary
MessageProcessor()
           
 
Method Summary
abstract  MessageChannel createMessageChannel(HostPort targetHostPort)
          Create a message channel for the specified host/port.
abstract  MessageChannel createMessageChannel(InetAddress targetHost, int port)
          Create a message channel for the specified host/port.
abstract  int getDefaultTargetPort()
          Default target port used by this processor.
abstract  int getMaximumMessageSize()
          Maximum number of bytes that this processor can handle.
abstract  int getPort()
          Get the port identifier.
abstract  SIPStack getSIPStack()
          Get the SIP Stack.
abstract  String getTransport()
          Get the transport string.
 Via getViaHeader()
          Get the Via header to assign for this message processor.
abstract  boolean inUse()
          Return true if there are pending messages to be processed (which prevents the message channel from being closed).
abstract  boolean isSecure()
          Flags whether this processor is secure or not.
abstract  void run()
          Run method.
abstract  void start()
          Start our thread.
abstract  void stop()
          Stop method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageProcessor

public MessageProcessor()
Method Detail

getTransport

public abstract String getTransport()
Get the transport string.

Returns:
A string that indicates the transport. (i.e. "tcp" or "udp")

getPort

public abstract int getPort()
Get the port identifier.

Returns:
the port for this message processor. This is where you receive messages.

getSIPStack

public abstract SIPStack getSIPStack()
Get the SIP Stack.

Returns:
the sip stack.

createMessageChannel

public abstract MessageChannel createMessageChannel(HostPort targetHostPort)
                                             throws IOException
Create a message channel for the specified host/port.

Returns:
New MessageChannel for this processor.
IOException

createMessageChannel

public abstract MessageChannel createMessageChannel(InetAddress targetHost,
                                                    int port)
                                             throws IOException
Create a message channel for the specified host/port.

Returns:
New MessageChannel for this processor.
IOException

start

public abstract void start()
                    throws IOException
Start our thread.

IOException

stop

public abstract void stop()
Stop method.


getDefaultTargetPort

public abstract int getDefaultTargetPort()
Default target port used by this processor. This is 5060 for TCP / UDP


isSecure

public abstract boolean isSecure()
Flags whether this processor is secure or not.


getMaximumMessageSize

public abstract int getMaximumMessageSize()
Maximum number of bytes that this processor can handle.


inUse

public abstract boolean inUse()
Return true if there are pending messages to be processed (which prevents the message channel from being closed).


getViaHeader

public Via getViaHeader()
Get the Via header to assign for this message processor.


run

public abstract void run()
Run method.

Specified by:
run in interface Runnable

NIST SIP Parser and Stack (v1.2) API

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Get the latest distribution.
Submit a bug report or feature request.