com.esri.arcgis.server
Class ServerCluster3

java.lang.Object
  extended by com.esri.arcgis.server.ServerConnection
      extended by com.esri.arcgis.server.ServerCluster3
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IServerConnection, Serializable

public class ServerCluster3
extends ServerConnection
implements Serializable

Use this class to get a ServerConnection object or IServerObjectManager interface to a SOM machine based on the clustering configuration. You can choose between various types defined in ServerClusterType class. This class will attempt to give you a connection to SOM from the input list of SOM machines. This class is thread safe and does not block other threads for long periods of time which could be caused due to communication error.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.esri.arcgis.server.IServerConnection
IID, IID425b0a5b_bf1b_4f0e_9e75_37324a12e5f9, xxDummy
 
Constructor Summary
ServerCluster3(Collection soms, ServerClusterType serverClusterType)
          Constructor that takes in a list of machine names and the clustering algorithm.
ServerCluster3(Collection soms, ServerClusterType serverClusterType, String domain, String username, String password)
          Constructor that takes in a list of machine names, the clustering algorithm and user credentials to use while attempting to connect to a SOM.
 
Method Summary
 void addSOM(String som)
          Add SOM to list
 IServer getAsIServer()
          Access this COM class's com.esri.arcgis.server.IServer interface
 String getHostName()
          Returns the name of the server machine to which this connection was created.
 com.esri.arcgis.interop.Dispatch getJintegraDispatch()
          J-Integra internal method
protected  String getJintegraVersion()
           
 Object getPropertyByName(String name)
          getPropertyByName.
 Object getPropertyByName(String name, Object rhs)
          getPropertyByName.
 int getReconnectTimeInMins()
          Function to get the time value in mins after which time this class will attempt to reconnect to a bad SOM.
 int getServerClusterSize()
          Returns the cluster size.
 ServerClusterType getServerClusterType()
          Return the ServerClusterType configured for this class.
 ServerCluster3 getServerConnection()
          Method that returns a ServerCluster, that has a connection to the SOM machine based on the ServerClusterType that has been configured on this class.
 IServerObjectAdmin getServerObjectAdmin()
          getServerObjectAdmin.
 IServerObjectManager getServerObjectManager()
          getServerObjectManager.
 IServerObjectManager getServerObjectManager2(String userInfo)
          getServerObjectManager2.
 String getUserDomain()
          Return the user domain that is used to connect to a SOM.
 String getUserName()
          Return the username that is used to connect to a SOM.
 String getUserPassword()
          Return the user password that is used to connect to a SOM.
 int hashCode()
          the hashcode for this object
 boolean hasServer()
          Returns true if there is atleast 1 SOM in the list.
 Object invokeMethodByName(String name, Object[] parameters)
          invokeMethodByName.
 String peek()
          This method returns the name of the host to which this class will attempt to connect next (for any thread) based on the configured clustering algorithm without actually making a connection.
 void release()
          Release a Server.
 void removeSOM(String som)
          Remove a SOM from the list
 void setConfigurationToCheck(String serverObjectName, String serverObjectType)
          Method to set configuration information to check when connected to SOMs.
 void setCredentials(String domain, String username, String password)
          Set the credentials to use while connecting to the SOM
 void setReconnectTimeInMins(int timeInMins)
          Function to set a time value in mins after which time this class will attempt to reconnect to a bad SOM.
 
Methods inherited from class com.esri.arcgis.server.ServerConnection
bindUsingMoniker, connect, connect, equals, getActiveObject, getClsid
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerCluster3

public ServerCluster3(Collection soms,
                      ServerClusterType serverClusterType)
               throws UnknownHostException,
                      IOException
Constructor that takes in a list of machine names and the clustering algorithm.

Parameters:
Collection - - list of SOM machine names
ServerClusterType - - clustering algorithm
Throws:
IOException
UnknownHostException

ServerCluster3

public ServerCluster3(Collection soms,
                      ServerClusterType serverClusterType,
                      String domain,
                      String username,
                      String password)
               throws UnknownHostException,
                      IOException
Constructor that takes in a list of machine names, the clustering algorithm and user credentials to use while attempting to connect to a SOM.

Parameters:
soms - - list of SOM machines for clustering.
serverClusterType - - clustering algorithm.
domain - - String representing the domain of the user
username - - String representing the name of the user
password - - String representing the password of the user
Throws:
IOException
UnknownHostException
Method Detail

setConfigurationToCheck

public void setConfigurationToCheck(String serverObjectName,
                                    String serverObjectType)
Method to set configuration information to check when connected to SOMs. While handing out connections to SOMs this class will test if the set configuration information is available with the SOM. If not, it will log an exception and search for the next SOM. If this information is not set, this class will not server for any configuration.

Parameters:
serverObjectName - - String representing the server object.
serverObjectType - - String representing the server object type.

setReconnectTimeInMins

public void setReconnectTimeInMins(int timeInMins)
Function to set a time value in mins after which time this class will attempt to reconnect to a bad SOM.


getReconnectTimeInMins

public int getReconnectTimeInMins()
Function to get the time value in mins after which time this class will attempt to reconnect to a bad SOM.

Returns:
int

getServerConnection

public ServerCluster3 getServerConnection()
                                   throws SOMNotAvailableException
Method that returns a ServerCluster, that has a connection to the SOM machine based on the ServerClusterType that has been configured on this class. If all the SOM machines in the cluster are down/cannot be reached this method will throw an exception.

Throws:
SOMNotAvailableException - - when there are no SOM machines to connect to.

peek

public String peek()
This method returns the name of the host to which this class will attempt to connect next (for any thread) based on the configured clustering algorithm without actually making a connection. However, the class does not guarantee that the next connection it will hand out will be to the same host that is returned by this method.

Returns:
String - name of the SOM machine to which it could attempt to connect next or returns null if no active SOM could be found.

addSOM

public void addSOM(String som)
            throws NullPointerException
Add SOM to list

Throws:
NullPointerException

removeSOM

public void removeSOM(String som)
               throws NullPointerException
Remove a SOM from the list

Throws:
NullPointerException

setCredentials

public void setCredentials(String domain,
                           String username,
                           String password)
Set the credentials to use while connecting to the SOM


getServerClusterType

public ServerClusterType getServerClusterType()
Return the ServerClusterType configured for this class.


getUserName

public String getUserName()
Return the username that is used to connect to a SOM.


getUserPassword

public String getUserPassword()
Return the user password that is used to connect to a SOM.


getUserDomain

public String getUserDomain()
Return the user domain that is used to connect to a SOM.


hasServer

public boolean hasServer()
Returns true if there is atleast 1 SOM in the list.


getServerClusterSize

public int getServerClusterSize()
Returns the cluster size.


getServerObjectAdmin

public IServerObjectAdmin getServerObjectAdmin()
                                        throws IOException,
                                               AutomationException
Description copied from class: ServerConnection
getServerObjectAdmin. Gets the server object admin for the connected GIS server.

Specified by:
getServerObjectAdmin in interface IServerConnection
Overrides:
getServerObjectAdmin in class ServerConnection
Returns:
return value. An reference to a com.esri.arcgis.server.IServerObjectAdmin
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getServerObjectManager

public IServerObjectManager getServerObjectManager()
                                            throws IOException,
                                                   AutomationException
Description copied from class: ServerConnection
getServerObjectManager. Gets the server object manager for the connected GIS server.

Specified by:
getServerObjectManager in interface IServerConnection
Overrides:
getServerObjectManager in class ServerConnection
Returns:
return value. An reference to a com.esri.arcgis.server.IServerObjectManager
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getServerObjectManager2

public IServerObjectManager getServerObjectManager2(String userInfo)
                                             throws IOException,
                                                    AutomationException
Description copied from class: ServerConnection
getServerObjectManager2. Gets the server object manager for the connected GIS server.

Overrides:
getServerObjectManager2 in class ServerConnection
Parameters:
userInfo - String
Returns:
return value. An reference to a com.esri.arcgis.server.IServerObjectManager
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getAsIServer

public IServer getAsIServer()
Description copied from class: ServerConnection
Access this COM class's com.esri.arcgis.server.IServer interface

Overrides:
getAsIServer in class ServerConnection

getPropertyByName

public Object getPropertyByName(String name,
                                Object rhs)
                         throws NoSuchFieldException,
                                IOException,
                                AutomationException
Description copied from class: ServerConnection
getPropertyByName. Get the value of a property dynamically at run-time, based on its name and a parameter

Overrides:
getPropertyByName in class ServerConnection
Parameters:
name - The name of the property to get.
rhs - A parameter used when getting the proxy
Returns:
return value. The value of the property.
Throws:
NoSuchFieldException - If the property does not exit.
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getPropertyByName

public Object getPropertyByName(String name)
                         throws NoSuchFieldException,
                                IOException,
                                AutomationException
Description copied from class: ServerConnection
getPropertyByName. Get the value of a property dynamically at run-time, based on its name

Overrides:
getPropertyByName in class ServerConnection
Parameters:
name - The name of the property to get.
Returns:
return value. The value of the property.
Throws:
NoSuchFieldException - If the property does not exit.
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

invokeMethodByName

public Object invokeMethodByName(String name,
                                 Object[] parameters)
                          throws NoSuchMethodException,
                                 IOException,
                                 AutomationException
Description copied from class: ServerConnection
invokeMethodByName. Invoke a method dynamically at run-time

Overrides:
invokeMethodByName in class ServerConnection
Parameters:
name - The name of the method to be invoked
parameters - One element for each parameter. Use primitive type wrappers to pass primitive types (eg Integer to pass an int).
Returns:
return value. The value returned by the method (null if none).
Throws:
NoSuchMethodException - If the method does not exit.
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getHostName

public String getHostName()
Description copied from class: ServerConnection
Returns the name of the server machine to which this connection was created.

Overrides:
getHostName in class ServerConnection
Returns:
String - name of the server machine

getJintegraDispatch

public com.esri.arcgis.interop.Dispatch getJintegraDispatch()
Description copied from class: ServerConnection
J-Integra internal method

Specified by:
getJintegraDispatch in interface com.esri.arcgis.interop.RemoteObjRef
Overrides:
getJintegraDispatch in class ServerConnection

getJintegraVersion

protected String getJintegraVersion()
Overrides:
getJintegraVersion in class ServerConnection

hashCode

public int hashCode()
Description copied from class: ServerConnection
the hashcode for this object

Overrides:
hashCode in class ServerConnection

release

public void release()
Description copied from class: ServerConnection
Release a Server.

Specified by:
release in interface com.esri.arcgis.interop.RemoteObjRef
Overrides:
release in class ServerConnection