|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.server.AbstractMessageReceiver
tigase.server.gateways.Gateway
public class Gateway
Describe class Gateway here. Created: Thu Nov 8 08:54:23 2007
| Field Summary | |
|---|---|
static java.lang.String |
GEN_GW_ADMINS
|
static java.lang.String |
GEN_GW_DB
|
static java.lang.String |
GEN_GW_DB_URI
|
static java.lang.String |
GW_CLASS_NAME_PROP_KEY
|
static java.lang.String |
GW_CLASS_NAME_PROP_VAL
|
static java.lang.String |
GW_DOMAIN_NAME_PROP_KEY
|
static java.lang.String |
GW_DOMAIN_NAME_PROP_VAL
|
static java.lang.String |
GW_MODERATED_PROP_KEY
|
static boolean |
GW_MODERATED_PROP_VAL
|
static java.lang.String |
GW_REPO_CLASS_PROP_KEY
|
static java.lang.String |
GW_REPO_URL_PROP_KEY
|
| Fields inherited from class tigase.server.AbstractMessageReceiver |
|---|
HOUR, MAX_QUEUE_SIZE_PROP_KEY, MAX_QUEUE_SIZE_PROP_VAL, maxQueueSize, MINUTE, SECOND, vHostManager |
| Fields inherited from interface tigase.disco.XMPPService |
|---|
CMD_FEATURES, DEF_FEATURES, INFO_XMLNS, ITEMS_XMLNS |
| Constructor Summary | |
|---|---|
Gateway()
|
|
| Method Summary | |
|---|---|
java.lang.String |
decodeLegacyName(java.lang.String jid)
The decodeLegacyName method is used to do the opposite processing
to the formatJID(...) method. |
java.lang.String |
formatJID(java.lang.String legacyName)
The formatJID method is used to transform the external network
user ID to the Jabber ID for this gateway. |
void |
gatewayException(GatewayConnection gc,
java.lang.Throwable exc)
The gatewayException method should be called when the exception
occurs in side the gateway connection library. |
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.util.List<tigase.xml.Element> |
getDiscoFeatures()
Returns features for top level disco info |
tigase.xml.Element |
getDiscoInfo(java.lang.String node,
java.lang.String jid)
|
java.util.List<tigase.xml.Element> |
getDiscoItems(java.lang.String node,
java.lang.String jid)
|
void |
loginCompleted(GatewayConnection gc)
The loginCompleted method is called when the login to the
external network has been completed. |
void |
logout(GatewayConnection gc)
The logout method is called when the connection to the external
network has been terminated (closed). |
void |
packetReceived(Packet packet)
The packetReceived method is called when data packet has
been received from the external network. |
void |
processPacket(Packet packet)
|
void |
setProperties(java.util.Map<java.lang.String,java.lang.Object> props)
Sets all configuration properties for object. |
void |
updateStatus(GatewayConnection gc,
RosterItem item)
The updateStatus method is called to update status of the single
roster contact. |
void |
userRoster(GatewayConnection gc)
The userRoster method should be called whenever the user roster
in the external network has changed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface tigase.conf.Configurable |
|---|
getName |
| Methods inherited from interface tigase.server.ServerComponent |
|---|
getComponentId, initializationCompleted, processPacket, release, setName |
| Field Detail |
|---|
public static final java.lang.String GEN_GW_DB
public static final java.lang.String GEN_GW_DB_URI
public static final java.lang.String GEN_GW_ADMINS
public static final java.lang.String GW_REPO_CLASS_PROP_KEY
public static final java.lang.String GW_REPO_URL_PROP_KEY
public static final java.lang.String GW_CLASS_NAME_PROP_KEY
public static final java.lang.String GW_CLASS_NAME_PROP_VAL
public static final java.lang.String GW_DOMAIN_NAME_PROP_KEY
public static final java.lang.String GW_DOMAIN_NAME_PROP_VAL
public static final java.lang.String GW_MODERATED_PROP_KEY
public static final boolean GW_MODERATED_PROP_VAL
| Constructor Detail |
|---|
public Gateway()
| Method Detail |
|---|
public void setProperties(java.util.Map<java.lang.String,java.lang.Object> props)
AbstractMessageReceiver
setProperties in interface ConfigurablesetProperties in class AbstractMessageReceiverpublic java.util.Map<java.lang.String,java.lang.Object> getDefaults(java.util.Map<java.lang.String,java.lang.Object> params)
AbstractMessageReceiver
getDefaults in interface ConfigurablegetDefaults in class AbstractMessageReceiverpublic java.lang.String formatJID(java.lang.String legacyName)
GatewayListenerformatJID method is used to transform the external network
user ID to the Jabber ID for this gateway. Normally the method calls:
XMLUtils.escape(legacyName.replace("@", "%") + "@" + myDomain())
but this maybe changed in the future therefore it is recomended to use this
method instead of internal implementation.
formatJID in interface GatewayListenerlegacyName - a String value of the user ID in the external
network.
String value of the transormed user ID to the Jabber's
form valid for this gateway deployment - including correct gateway domain name.public java.lang.String decodeLegacyName(java.lang.String jid)
GatewayListenerdecodeLegacyName method is used to do the opposite processing
to the formatJID(...) method. It extracts user ID used in the
external network from the Jabber's ID used in this Gateway deployment.
Normally it calls the following method:
XMLUtils.unescape(jid).split("@")[0].replace("%", "@") but
this can be changed in the future, therefore using this method is recommended
over own implementations.
decodeLegacyName in interface GatewayListenerjid - a String value
String valuepublic void processPacket(Packet packet)
processPacket in class AbstractMessageReceiverpublic java.util.List<tigase.xml.Element> getDiscoFeatures()
XMPPService
getDiscoFeatures in interface XMPPService
public java.util.List<tigase.xml.Element> getDiscoItems(java.lang.String node,
java.lang.String jid)
getDiscoItems in interface XMPPService
public tigase.xml.Element getDiscoInfo(java.lang.String node,
java.lang.String jid)
getDiscoInfo in interface XMPPServicepublic void packetReceived(Packet packet)
GatewayListenerpacketReceived method is called when data packet has
been received from the external network. The data received from the
external must be translated to one of packets known in the XMPP network:
message or presence or iq.
packetReceived in interface GatewayListenerpacket - a Packet value with the data packet received
from the external network.public void logout(GatewayConnection gc)
GatewayListenerlogout method is called when the connection to the external
network has been terminated (closed).
logout in interface GatewayListenergc - a GatewayConnection value of this object
identifying the user connection to the external network.public void loginCompleted(GatewayConnection gc)
GatewayListenerloginCompleted method is called when the login to the
external network has been completed. Normally when login()
method is called the whole process make take some time (establishing network
connectio, authenticating and so on...). Therefore it is recommended that
the login() method returns immediately and the process is run
in background (in threads pooling). Therefore on the successful loging
completion this method must be called.
loginCompleted in interface GatewayListenergc - a GatewayConnection value of this object
identifying the user connection to the external network.
public void gatewayException(GatewayConnection gc,
java.lang.Throwable exc)
GatewayListenergatewayException method should be called when the exception
occurs in side the gateway connection library. Normally the exception is
recorded in the log file and no more actions are performed. If the exception
is severe and irrecoverable then the GatewayConnection should
call logout(...) method.
gatewayException in interface GatewayListenergc - a GatewayConnection value of this object
identifying the user connection to the external network.exc - a Throwable value of the exception thrown.public void userRoster(GatewayConnection gc)
GatewayListeneruserRoster method should be called whenever the user roster
in the external network has changed. After (inside) this call
GatewayConnection.getRoster() method is called to retrieve
user roster from the gateway connection.
userRoster in interface GatewayListenergc - a GatewayConnection value of this object
identifying the user connection to the external network.
public void updateStatus(GatewayConnection gc,
RosterItem item)
GatewayListenerupdateStatus method is called to update status of the single
roster contact.
updateStatus in interface GatewayListenergc - a GatewayConnection value of this object
identifying the user connection to the external network.item - a RosterItem value of the roster contact.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||