tigase.server.xmppclient
Class SeeOtherHostDB

java.lang.Object
  extended by tigase.server.xmppclient.SeeOtherHostHashed
      extended by tigase.server.xmppclient.SeeOtherHostDB
All Implemented Interfaces:
SeeOtherHostIfc

public class SeeOtherHostDB
extends SeeOtherHostHashed

Extended implementation of SeeOtherHost using redirect information from database


Field Summary
static String DB_GET_ALL_DATA_DB_QUERY_KEY
           
static String DEF_DB_GET_HOST_QUERY
           
static String GET_ALL_QUERY_TIMEOUT_QUERY_KEY
           
static String NODE_ID
           
static String SEE_OTHER_HOST_DB_QUERY_KEY
           
static String SEE_OTHER_HOST_DB_URL_KEY
           
static String SEE_OTHER_HOST_TABLE
           
static String SERIAL_ID
           
static String USER_ID
           
 
Fields inherited from class tigase.server.xmppclient.SeeOtherHostHashed
connectedNodes, defaulHost
 
Fields inherited from interface tigase.server.xmppclient.SeeOtherHostIfc
CM_SEE_OTHER_HOST_CLASS_PROP_DEF_VAL, CM_SEE_OTHER_HOST_CLASS_PROP_DEF_VAL_CLUSTER, CM_SEE_OTHER_HOST_CLASS_PROP_KEY, CM_SEE_OTHER_HOST_CLASS_PROPERTY, CM_SEE_OTHER_HOST_DEFAULT_HOST, CM_SEE_OTHER_HOST_DEFAULT_PORT
 
Constructor Summary
SeeOtherHostDB()
           
 
Method Summary
 tigase.xmpp.BareJID findHostForJID(tigase.xmpp.BareJID jid, tigase.xmpp.BareJID host)
          Finds an appropriate host for a given JID
 void getDefaults(Map<String,Object> defs, Map<String,Object> params)
           
 void initRepository(String conn_str, Map<String,String> map)
           
 void setProperties(Map<String,Object> props)
           
 
Methods inherited from class tigase.server.xmppclient.SeeOtherHostHashed
setNodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEE_OTHER_HOST_TABLE

public static final String SEE_OTHER_HOST_TABLE
See Also:
Constant Field Values

SEE_OTHER_HOST_DB_URL_KEY

public static final String SEE_OTHER_HOST_DB_URL_KEY
See Also:
Constant Field Values

SEE_OTHER_HOST_DB_QUERY_KEY

public static final String SEE_OTHER_HOST_DB_QUERY_KEY
See Also:
Constant Field Values

DB_GET_ALL_DATA_DB_QUERY_KEY

public static final String DB_GET_ALL_DATA_DB_QUERY_KEY
See Also:
Constant Field Values

GET_ALL_QUERY_TIMEOUT_QUERY_KEY

public static final String GET_ALL_QUERY_TIMEOUT_QUERY_KEY
See Also:
Constant Field Values

SERIAL_ID

public static final String SERIAL_ID
See Also:
Constant Field Values

USER_ID

public static final String USER_ID
See Also:
Constant Field Values

NODE_ID

public static final String NODE_ID
See Also:
Constant Field Values

DEF_DB_GET_HOST_QUERY

public static final String DEF_DB_GET_HOST_QUERY
See Also:
Constant Field Values
Constructor Detail

SeeOtherHostDB

public SeeOtherHostDB()
Method Detail

findHostForJID

public tigase.xmpp.BareJID findHostForJID(tigase.xmpp.BareJID jid,
                                          tigase.xmpp.BareJID host)
Description copied from interface: SeeOtherHostIfc
Finds an appropriate host for a given JID

Specified by:
findHostForJID in interface SeeOtherHostIfc
Overrides:
findHostForJID in class SeeOtherHostHashed
Parameters:
jid - is a user JID extracted from the stream open attributes
host - is "this" host to which the user is now connected and which calls the method
Returns:
BareJID of possible host to which the user should connect or NULL

getDefaults

public void getDefaults(Map<String,Object> defs,
                        Map<String,Object> params)
Specified by:
getDefaults in interface SeeOtherHostIfc
Overrides:
getDefaults in class SeeOtherHostHashed

setProperties

public void setProperties(Map<String,Object> props)
Specified by:
setProperties in interface SeeOtherHostIfc
Overrides:
setProperties in class SeeOtherHostHashed

initRepository

public void initRepository(String conn_str,
                           Map<String,String> map)
                    throws SQLException,
                           ClassNotFoundException,
                           IllegalAccessException,
                           InstantiationException,
                           DBInitException
Throws:
SQLException
ClassNotFoundException
IllegalAccessException
InstantiationException
DBInitException


Copyright © 2012 Tigase. All Rights Reserved.