com.esri.arcgis.server
Class ServerConnection

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

public class ServerConnection
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IServerConnection

Used for connecting to the GIS server and getting the ServerObjectManager and ServerObjectAdmin.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.esri.arcgis.server.IServerConnection
IID, IID425b0a5b_bf1b_4f0e_9e75_37324a12e5f9, xxDummy
 
Constructor Summary
ServerConnection()
          Constructs a ServerConnection on the local host.
ServerConnection(com.esri.arcgis.interop.AuthInfo authInfo)
          Deprecated. use AuthInfo.setDefault(...) or AuthInfo.setThreadDefault(...) See Security section in the J-Integra documentation
ServerConnection(Object obj)
          Construct a ServerConnection using a reference to such an object returned from a COM server
ServerConnection(String host)
          Construct a ServerConnection on specified host.
ServerConnection(String host, com.esri.arcgis.interop.AuthInfo authInfo)
          Deprecated. use AuthInfo.setDefault(...) or AuthInfo.setThreadDefault(...) See Security section in the J-Integra documentation
 
Method Summary
static ServerConnection bindUsingMoniker(String moniker)
          bindUsingMoniker.
 void connect(String machineName)
          connect.
 void connect(String machineName, String domain, String user, String password)
          Connects to the GIS server specified by the machineName and authenticates the user with the credentials provided as arguments.
 boolean equals(Object o)
          Compare this object with another
static ServerConnection getActiveObject()
          getActiveObject.
 IServer getAsIServer()
          Access this COM class's com.esri.arcgis.server.IServer interface
static String getClsid()
           
 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.
 IServerObjectAdmin getServerObjectAdmin()
          getServerObjectAdmin.
 IServerObjectManager getServerObjectManager()
          getServerObjectManager.
 IServerObjectManager getServerObjectManager2(String userInfo)
          getServerObjectManager2.
 int hashCode()
          the hashcode for this object
 Object invokeMethodByName(String name, Object[] parameters)
          invokeMethodByName.
 void release()
          Release a Server.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerConnection

public ServerConnection()
                 throws IOException,
                        UnknownHostException
Constructs a ServerConnection on the local host.

Throws:
IOException - if there are problems communicating via DCOM
UnknownHostException - if the host can not be found

ServerConnection

public ServerConnection(String host)
                 throws IOException,
                        UnknownHostException
Construct a ServerConnection on specified host.

Parameters:
host - the host on which the object should be created
Throws:
IOException - if there are problems communicating via DCOM
UnknownHostException - if the host can not be found

ServerConnection

public ServerConnection(com.esri.arcgis.interop.AuthInfo authInfo)
                 throws IOException,
                        UnknownHostException
Deprecated. use AuthInfo.setDefault(...) or AuthInfo.setThreadDefault(...) See Security section in the J-Integra documentation

Throws:
IOException
UnknownHostException
See Also:
com.esri.arcgis.interop.AuthInfo.setDefault(..)

ServerConnection

public ServerConnection(String host,
                        com.esri.arcgis.interop.AuthInfo authInfo)
                 throws IOException,
                        UnknownHostException
Deprecated. use AuthInfo.setDefault(...) or AuthInfo.setThreadDefault(...) See Security section in the J-Integra documentation

Throws:
IOException
UnknownHostException
See Also:
com.esri.arcgis.interop.AuthInfo.setDefault(..)

ServerConnection

public ServerConnection(Object obj)
                 throws IOException
Construct a ServerConnection using a reference to such an object returned from a COM server

Parameters:
obj - an object returned from a COM server
Throws:
IOException - if there are problems communicating via DCOM
Method Detail

getClsid

public static String getClsid()

getJintegraVersion

protected String getJintegraVersion()

getAsIServer

public IServer getAsIServer()
Access this COM class's com.esri.arcgis.server.IServer interface


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getActiveObject

public static ServerConnection getActiveObject()
                                        throws AutomationException,
                                               IOException
getActiveObject. Get a reference to a running instance of this class on the current machine using native code. Uses native code (See GetActiveObject() in MS doc) and thus can only be used on MS Windows

Returns:
return value. A reference to the running object.
Throws:
IOException - If there are communications problems.
AutomationException - If there was an error attaching to the instance.

bindUsingMoniker

public static ServerConnection bindUsingMoniker(String moniker)
                                         throws AutomationException,
                                                IOException
bindUsingMoniker. Bind to a running instance of this class using the supplied ObjRef moniker

Parameters:
moniker - The ObjRef Moniker (Created using Windows CreateObjrefMoniker() and IMoniker->GetDisplayName)
Returns:
return value. A reference to the running object.
Throws:
IOException - If there are communications problems.
AutomationException - If there was an error attaching to the instance.

getJintegraDispatch

public com.esri.arcgis.interop.Dispatch getJintegraDispatch()
J-Integra internal method

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

release

public void release()
Release a Server.

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

getPropertyByName

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

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.

getPropertyByName

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

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.

invokeMethodByName

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

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.

connect

public void connect(String machineName,
                    String domain,
                    String user,
                    String password)
             throws IOException,
                    AutomationException
Connects to the GIS server specified by the machineName and authenticates the user with the credentials provided as arguments. LM, NTLM, NTLMv2 authentication or NTLMv2 session security can be used for connecting to the server, depending upon the ARCGIS_LM_COMPATABILITY_LEVEL property. The ARCGIS_LM_COMPATABILITY_LEVEL property is a JVM system property that can be set using System.setProperty("ARCGIS_LM_COMPATIBILITY_LEVEL", "5");

The supported values range from 0 to 5, and should be compatible with the LmCompatabilityLevel setting on the Server. When connecting with Unix servers, only LM and NTLM security is used.

ValueMeaning
0Clients use LM and NTLM authentication, but they never use NTLMv2 session security. Domain controllers accept LM, NTLM, and NTLMv2 authentication.
1Clients use LM and NTLM authentication, and they use NTLMv2 session security if the server supports it. Domain controllers accept LM, NTLM, and NTLMv2 authentication.
2Clients use only NTLM authentication, and they use NTLMv2 session security if the server supports it. Domain controller accepts LM, NTLM, and NTLMv2 authentication.
3Clients use only NTLMv2 authentication, and they can work with NTLMv2 session security if the server supports it. Domain controllers accept LM, NTLM, and NTLMv2 authentication.
4Clients use only NTLMv2 authentication, and they can work with NTLMv2 session security if the server supports it. Domain controller refuses LM authentication responses, but it accepts NTLM and NTLMv2.
5Clients use only NTLMv2 authentication, and they can work with NTLMv2 session security if the server supports it. Domain controller refuses LM and NTLM authentication responses, but it accepts NTLMv2.


This table is adapted from http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/76052.mspx?mfr=true

The default value of ARCGIS_LM_COMPATIBILITY_LEVEL is 1, and this value is used if it is not set explicitly.

Parameters:
machineName - The machineName (in)
domain - The domain name (in)
user - The user name (in)
password - The password (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

connect

public void connect(String machineName)
             throws IOException,
                    AutomationException
connect. Connects to the GIS server specified by the machineName.

Specified by:
connect in interface IServerConnection
Parameters:
machineName - The machineName (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getServerObjectManager

public IServerObjectManager getServerObjectManager()
                                            throws IOException,
                                                   AutomationException
getServerObjectManager. Gets the server object manager for the connected GIS server.

Specified by:
getServerObjectManager in interface IServerConnection
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.

getServerObjectAdmin

public IServerObjectAdmin getServerObjectAdmin()
                                        throws IOException,
                                               AutomationException
getServerObjectAdmin. Gets the server object admin for the connected GIS server.

Specified by:
getServerObjectAdmin in interface IServerConnection
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.

getServerObjectManager2

public IServerObjectManager getServerObjectManager2(String userInfo)
                                             throws IOException,
                                                    AutomationException
getServerObjectManager2. Gets the server object manager for the connected GIS server.

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.

getHostName

public String getHostName()
Returns the name of the server machine to which this connection was created.

Returns:
String - name of the server machine