tigase.server
Class AbstractMessageReceiver

java.lang.Object
  extended by tigase.server.AbstractMessageReceiver
All Implemented Interfaces:
Configurable, MessageReceiver, ServerComponent, StatisticsContainer
Direct Known Subclasses:
ConnectionManager, Gateway, MessageRouter, SessionManager, StanzaReceiver, StanzaSender

public abstract class AbstractMessageReceiver
extends java.lang.Object
implements StatisticsContainer, MessageReceiver, Configurable

Describe class AbstractMessageReceiver here. Created: Tue Nov 22 07:07:11 2005

Version:
$Rev: 806 $
Author:
Artur Hefczyc

Field Summary
protected static long HOUR
           
static java.lang.String MAX_QUEUE_SIZE_PROP_KEY
           
static java.lang.Integer MAX_QUEUE_SIZE_PROP_VAL
           
protected  int maxQueueSize
           
protected static long MINUTE
           
protected static long SECOND
           
 
Fields inherited from interface tigase.conf.Configurable
ADMINS_PROP_KEY, BOSH_COMP_CLASS_NAME, C2S_COMP_CLASS_NAME, DEF_HOSTNAME_PROP_KEY, DRUPAL_REPO_CLASS_PROP_VAL, DRUPAL_REPO_URL_PROP_VAL, EXT_COMP_CLASS_NAME, GEN_ADMINS, GEN_AUTH_DB, GEN_AUTH_DB_URI, GEN_COMP_CLASS, GEN_COMP_NAME, GEN_CONF, GEN_CONFIG, GEN_CONFIG_ALL, GEN_CONFIG_COMP, GEN_CONFIG_CS, GEN_CONFIG_DEF, GEN_CONFIG_SM, GEN_DEBUG, GEN_EXT_COMP, GEN_SM_PLUGINS, GEN_SREC_ADMINS, GEN_SREC_DB, GEN_SREC_DB_URI, GEN_TEST, GEN_TRUSTED, GEN_USER_DB, GEN_USER_DB_URI, GEN_VIRT_HOSTS, HOSTNAMES_PROP_KEY, LIBRESOURCE_REPO_CLASS_PROP_VAL, LIBRESOURCE_REPO_URL_PROP_VAL, MYSQL_REPO_CLASS_PROP_VAL, MYSQL_REPO_URL_PROP_VAL, NULL_ROUTING, PGSQL_REPO_CLASS_PROP_VAL, PGSQL_REPO_URL_PROP_VAL, ROUTER_COMP_CLASS_NAME, S2S_COMP_CLASS_NAME, SM_COMP_CLASS_NAME, SRECV_COMP_CLASS_NAME, SSEND_COMP_CLASS_NAME, TRUSTED_PROP_KEY, XML_REPO_CLASS_PROP_VAL, XML_REPO_URL_PROP_VAL
 
Constructor Summary
AbstractMessageReceiver()
           
 
Method Summary
protected  boolean addOutPacket(Packet packet)
           
protected  boolean addOutPacketNB(Packet packet)
          Non blocking version of addOutPacket.
protected  boolean addOutPackets(java.util.Queue<Packet> packets)
           
 boolean addPacket(Packet packet)
          Describe addMessage method here.
 boolean addPackets(java.util.Queue<Packet> packets)
          Describe addPackets method here.
 void addRegexRouting(java.lang.String address)
           
 void addRouting(java.lang.String address)
           
 void clearRegexRoutings()
           
 void clearRoutings()
           
 java.util.Map<java.lang.String,java.lang.Object> getDefaults(java.util.Map<java.lang.String,java.lang.Object> params)
          Returns defualt configuration settings for this object.
 java.lang.String getDefHostName()
           
protected  java.lang.Integer getDefMaxQueueSize()
           
 java.lang.String getName()
          Get object name.
 java.util.Set<java.util.regex.Pattern> getRegexRoutings()
           
 java.util.Set<java.lang.String> getRoutings()
           
 java.util.List<StatRecord> getStatistics()
           
 boolean isInRegexRoutings(java.lang.String address)
           
 boolean isInRoutings(java.lang.String host)
           
 java.lang.String myDomain()
          Describe myDomain method here.
abstract  void processPacket(Packet packet)
           
 void processPacket(Packet packet, java.util.Queue<Packet> results)
           
 void release()
           
 boolean removeRegexRouting(java.lang.String address)
           
 boolean removeRouting(java.lang.String address)
           
 void setMaxQueueSize(int maxQueueSize)
           
 void setName(java.lang.String name)
           
 void setParent(MessageReceiver parent)
          Describe setParent method here.
 void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
          Sets all configuration properties for object.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECOND

protected static final long SECOND
See Also:
Constant Field Values

MINUTE

protected static final long MINUTE
See Also:
Constant Field Values

HOUR

protected static final long HOUR
See Also:
Constant Field Values

MAX_QUEUE_SIZE_PROP_KEY

public static final java.lang.String MAX_QUEUE_SIZE_PROP_KEY
See Also:
Constant Field Values

MAX_QUEUE_SIZE_PROP_VAL

public static final java.lang.Integer MAX_QUEUE_SIZE_PROP_VAL

maxQueueSize

protected int maxQueueSize
Constructor Detail

AbstractMessageReceiver

public AbstractMessageReceiver()
Method Detail

myDomain

public java.lang.String myDomain()
Describe myDomain method here.

Returns:
a String value

addPacket

public boolean addPacket(Packet packet)
Describe addMessage method here.

Specified by:
addPacket in interface MessageReceiver
Parameters:
packet - a Packet value
Returns:
a boolean value true if packet has been successfully added, false otherwise.

addPackets

public boolean addPackets(java.util.Queue<Packet> packets)
Description copied from interface: MessageReceiver
Describe addPackets method here.

Specified by:
addPackets in interface MessageReceiver
Returns:
a boolean value

addOutPacket

protected boolean addOutPacket(Packet packet)

addOutPacketNB

protected boolean addOutPacketNB(Packet packet)
Non blocking version of addOutPacket.

Parameters:
packet - a Packet value
Returns:
a boolean value

addOutPackets

protected boolean addOutPackets(java.util.Queue<Packet> packets)

processPacket

public abstract void processPacket(Packet packet)

getStatistics

public java.util.List<StatRecord> getStatistics()
Specified by:
getStatistics in interface StatisticsContainer

setProperties

public void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
Sets all configuration properties for object.

Specified by:
setProperties in interface Configurable

setMaxQueueSize

public void setMaxQueueSize(int maxQueueSize)

getDefMaxQueueSize

protected java.lang.Integer getDefMaxQueueSize()

getDefaults

public java.util.Map<java.lang.String,java.lang.Object> getDefaults(java.util.Map<java.lang.String,java.lang.Object> params)
Returns defualt configuration settings for this object.

Specified by:
getDefaults in interface Configurable

release

public void release()
Specified by:
release in interface ServerComponent

setParent

public void setParent(MessageReceiver parent)
Description copied from interface: MessageReceiver
Describe setParent method here.

Specified by:
setParent in interface MessageReceiver
Parameters:
parent - a MessageReceiver value

setName

public void setName(java.lang.String name)
Specified by:
setName in interface ServerComponent

getName

public java.lang.String getName()
Description copied from interface: Configurable
Get object name. This name corresponds to section in configuration.

Specified by:
getName in interface Configurable
Specified by:
getName in interface ServerComponent
Returns:
a String value of object name.

start

public void start()
Specified by:
start in interface MessageReceiver

stop

public void stop()

getDefHostName

public java.lang.String getDefHostName()
Specified by:
getDefHostName in interface MessageReceiver

getRoutings

public java.util.Set<java.lang.String> getRoutings()
Specified by:
getRoutings in interface MessageReceiver

getRegexRoutings

public java.util.Set<java.util.regex.Pattern> getRegexRoutings()

addRouting

public void addRouting(java.lang.String address)

removeRouting

public boolean removeRouting(java.lang.String address)

clearRoutings

public void clearRoutings()

isInRoutings

public boolean isInRoutings(java.lang.String host)

addRegexRouting

public void addRegexRouting(java.lang.String address)

removeRegexRouting

public boolean removeRegexRouting(java.lang.String address)

clearRegexRoutings

public void clearRegexRoutings()

isInRegexRoutings

public boolean isInRegexRoutings(java.lang.String address)
Specified by:
isInRegexRoutings in interface MessageReceiver

processPacket

public void processPacket(Packet packet,
                          java.util.Queue<Packet> results)
Specified by:
processPacket in interface ServerComponent


Copyright © 2008 Tigase. All Rights Reserved.