com.esri.arcgis.trackinganalyst
Class ServerConnection

java.lang.Object
  extended by com.esri.arcgis.trackinganalyst.ServerConnection
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IServerConnection, IServerConnection2, ITxConnectionMessages, Serializable

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

Manages connection to Tracking Server.

Description

The Server Connection object serves as a direct interface or connection to the Tracking Server. This connection object uses DCOM to communicate with the Tracking Server. The Tracking Server Manager and Simulator applications use this object as thier communications interface to the Tracking Server system.

Remarks

The Server Connector uses the connection properties to manage all user modifiable features of the connector. Below summarizes the properties, their defaults and descriptions.

Property Name

Required

Default Value

Description

SERVERNAME

Y

localhost

Name of Server or IP

AMS_CONNECTION_NAME

Y

Tracking Connector

The Name or label of the connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

See Also:
Serialized Form

Constructor Summary
ServerConnection()
          Constructs a ServerConnection using ArcGIS Engine.
ServerConnection(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
ServerConnection theServerConnection = (ServerConnection) obj;
 
Method Summary
 void add_IPlugInEventsListener(_IPlugInEvents theListener)
          add_IPlugInEventsListener.
 void connect(String bstrUserName, String bstrPassword)
          Creates connection to the server.
 void disableDataDefinition(String bstrDataDefinitionID)
          Disables data definition for the server connection.
 void disconnect()
          Disconnects connection from the server.
 void enableDataDefinition(String bstrDataDefinitionID)
          Enables data definition for the server connection.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 String getConnectionName()
          Indicates the name of the connection to the server.
 IPropSet getConnectionProperties()
          Properties for the server connection.
 String getConnectionString()
          Connection string value for the server connection.
 IDatasetDef getDataSetDefinition(String bstrName)
          Gets dataset definition information for the server connection.
 Object getDataSetDefinitionList()
          Lists the dataset definition information for the connection.
 Object getEnabledDataDefinitions()
          Indicates which data definitions are enabled.
 int getEventReadyHandle()
          The handle to the event that is signaled when a message is ready to be received.
 int getLastConnectionErrorCode()
          Indicates the error code for the last connection to the server.
 String getLastConnectionErrorMessage()
          Indicates the error message for the last connection to the server.
 IMessage getMessage(int nTimeOutInMilliseconds)
          Retrieves a message from the server connection.
 int getMessageCount()
          The count of messages ready to retrieve.
 IPlugin getPlugIn()
          Data link plugin information for the server connection.
 Object getServerActions(boolean bForEditing)
          Actions used on data in the server connection.
 String getServerName()
          Name for the server.
 ITrackingServiceDef getTrackingService(String bstrName)
          Gets tracking service for the server connection.
 Object getTrackingServicesList()
          List of tracking services.
 String getUserName()
          User's login name.
 int hashCode()
          the hashcode for this object
 boolean isConnected()
          Indicates whether the server connection is connected.
 boolean isEnableDataFiltering()
          Indicates whether data filtering is enabled for the connection.
 IMessage nextMessage()
          Retrieves a message from the server connection.
 void remove_IPlugInEventsListener(_IPlugInEvents theListener)
          remove_IPlugInEventsListener.
 void returnDataSetDefinition(IDatasetDef piDataSetDef)
          Returns dataset definition information for the server connection.
 void returnServerActions(boolean bSave, Object piActionCollection)
          Actions used on data in the server connection.
 void returnTrackingService(ITrackingServiceDef piTrackingServiceDef)
          Returns tracking service for the server connection.
 IResponseMessage sendCommand(ICommandMessage piCmdMsg, int nTimeOut)
          Sends a command to the server connection.
 void sendMessage(IMessage piMessage)
          Sends a message through the server connection path.
 void setConnectionName(String pbstrConnectionName)
          Indicates the name of the connection to the server.
 void setConnectionProperties(IPropSet ppiProperties)
          Properties for the server connection.
 void setConnectionString(String pbstrConnectionString)
          Connection string value for the server connection.
 void setEnableDataFiltering(boolean pbvVal)
          Indicates whether data filtering is enabled for the connection.
 void setServerName(String pVal)
          Name for the server.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

ServerConnection

public ServerConnection()
                 throws IOException,
                        UnknownHostException
Constructs a ServerConnection using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

ServerConnection

public ServerConnection(Object obj)
                 throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
ServerConnection theServerConnection = (ServerConnection) obj;

Construct a ServerConnection using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to ServerConnection.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


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

add_IPlugInEventsListener

public void add_IPlugInEventsListener(_IPlugInEvents theListener)
                               throws IOException
add_IPlugInEventsListener. Listen to events generated by this class.

Parameters:
theListener - An object that implements the com.esri.arcgis.trackinganalyst._IPlugInEvents interface.
Throws:
IOException - If there are communications problems.

remove_IPlugInEventsListener

public void remove_IPlugInEventsListener(_IPlugInEvents theListener)
                                  throws IOException
remove_IPlugInEventsListener. Stop listening to events generated by this class.

Parameters:
theListener - An object that implements the com.esri.arcgis.trackinganalyst._IPlugInEvents interface.
Throws:
IOException - If there are communications problems.

isConnected

public boolean isConnected()
                    throws IOException,
                           AutomationException
Indicates whether the server connection is connected.

Description

This property indicates the connection state to the TMS Server.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
isConnected in interface IServerConnection
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getServerName

public String getServerName()
                     throws IOException,
                            AutomationException
Name for the server.

Description

This property indicates the current server that we are connected to. If a connection does not exist this property contains an empty string.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getServerName in interface IServerConnection
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setServerName

public void setServerName(String pVal)
                   throws IOException,
                          AutomationException
Name for the server.

Description

This property sets the TMS server to connected to. The default of an empty string is localhost

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
setServerName in interface IServerConnection
Parameters:
pVal - The pVal (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getUserName

public String getUserName()
                   throws IOException,
                          AutomationException
User's login name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getUserName in interface IServerConnection
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isEnableDataFiltering

public boolean isEnableDataFiltering()
                              throws IOException,
                                     AutomationException
Indicates whether data filtering is enabled for the connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
isEnableDataFiltering in interface IServerConnection
Returns:
The pbvVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setEnableDataFiltering

public void setEnableDataFiltering(boolean pbvVal)
                            throws IOException,
                                   AutomationException
Indicates whether data filtering is enabled for the connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
setEnableDataFiltering in interface IServerConnection
Parameters:
pbvVal - The pbvVal (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDataSetDefinitionList

public Object getDataSetDefinitionList()
                                throws IOException,
                                       AutomationException
Lists the dataset definition information for the connection.

Description

This read only property returns an array of all available datasetdefinitions names. A user can then use the getDataSetDefinition and returnDataSetDefinition methods to retrieve and return the actual object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getDataSetDefinitionList in interface IServerConnection
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getEnabledDataDefinitions

public Object getEnabledDataDefinitions()
                                 throws IOException,
                                        AutomationException
Indicates which data definitions are enabled.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getEnabledDataDefinitions in interface IServerConnection
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLastConnectionErrorCode

public int getLastConnectionErrorCode()
                               throws IOException,
                                      AutomationException
Indicates the error code for the last connection to the server.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getLastConnectionErrorCode in interface IServerConnection
Returns:
The pnErrorCode
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLastConnectionErrorMessage

public String getLastConnectionErrorMessage()
                                     throws IOException,
                                            AutomationException
Indicates the error message for the last connection to the server.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getLastConnectionErrorMessage in interface IServerConnection
Returns:
The pbstrErrorMessage
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getConnectionName

public String getConnectionName()
                         throws IOException,
                                AutomationException
Indicates the name of the connection to the server.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getConnectionName in interface IServerConnection
Returns:
The pbstrConnectionName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setConnectionName

public void setConnectionName(String pbstrConnectionName)
                       throws IOException,
                              AutomationException
Indicates the name of the connection to the server.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
setConnectionName in interface IServerConnection
Parameters:
pbstrConnectionName - The pbstrConnectionName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getConnectionString

public String getConnectionString()
                           throws IOException,
                                  AutomationException
Connection string value for the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getConnectionString in interface IServerConnection
Returns:
The pbstrConnectionString
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setConnectionString

public void setConnectionString(String pbstrConnectionString)
                         throws IOException,
                                AutomationException
Connection string value for the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
setConnectionString in interface IServerConnection
Parameters:
pbstrConnectionString - The pbstrConnectionString (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

connect

public void connect(String bstrUserName,
                    String bstrPassword)
             throws IOException,
                    AutomationException
Creates connection to the server.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
connect in interface IServerConnection
Parameters:
bstrUserName - The bstrUserName (in)
bstrPassword - The bstrPassword (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

disconnect

public void disconnect()
                throws IOException,
                       AutomationException
Disconnects connection from the server.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
disconnect in interface IServerConnection
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

sendMessage

public void sendMessage(IMessage piMessage)
                 throws IOException,
                        AutomationException
Sends a message through the server connection path.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
sendMessage in interface IServerConnection
Parameters:
piMessage - A reference to a com.esri.arcgis.trackinganalyst.IMessage (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMessage

public IMessage getMessage(int nTimeOutInMilliseconds)
                    throws IOException,
                           AutomationException
Retrieves a message from the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getMessage in interface IServerConnection
Parameters:
nTimeOutInMilliseconds - The nTimeOutInMilliseconds (in)
Returns:
A reference to a com.esri.arcgis.trackinganalyst.IMessage
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

enableDataDefinition

public void enableDataDefinition(String bstrDataDefinitionID)
                          throws IOException,
                                 AutomationException
Enables data definition for the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
enableDataDefinition in interface IServerConnection
Parameters:
bstrDataDefinitionID - The bstrDataDefinitionID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

disableDataDefinition

public void disableDataDefinition(String bstrDataDefinitionID)
                           throws IOException,
                                  AutomationException
Disables data definition for the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
disableDataDefinition in interface IServerConnection
Parameters:
bstrDataDefinitionID - The bstrDataDefinitionID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

returnDataSetDefinition

public void returnDataSetDefinition(IDatasetDef piDataSetDef)
                             throws IOException,
                                    AutomationException
Returns dataset definition information for the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
returnDataSetDefinition in interface IServerConnection
Parameters:
piDataSetDef - A reference to a com.esri.arcgis.trackinganalyst.IDatasetDef (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDataSetDefinition

public IDatasetDef getDataSetDefinition(String bstrName)
                                 throws IOException,
                                        AutomationException
Gets dataset definition information for the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getDataSetDefinition in interface IServerConnection
Parameters:
bstrName - The bstrName (in)
Returns:
A reference to a com.esri.arcgis.trackinganalyst.IDatasetDef
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

sendCommand

public IResponseMessage sendCommand(ICommandMessage piCmdMsg,
                                    int nTimeOut)
                             throws IOException,
                                    AutomationException
Sends a command to the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
sendCommand in interface IServerConnection
Parameters:
piCmdMsg - A reference to a com.esri.arcgis.trackinganalyst.ICommandMessage (in)
nTimeOut - The nTimeOut (in)
Returns:
A reference to a com.esri.arcgis.trackinganalyst.IResponseMessage
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getConnectionProperties

public IPropSet getConnectionProperties()
                                 throws IOException,
                                        AutomationException
Properties for the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getConnectionProperties in interface IServerConnection2
Returns:
A reference to a com.esri.arcgis.trackinganalyst.IPropSet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setConnectionProperties

public void setConnectionProperties(IPropSet ppiProperties)
                             throws IOException,
                                    AutomationException
Properties for the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
setConnectionProperties in interface IServerConnection2
Parameters:
ppiProperties - A reference to a com.esri.arcgis.trackinganalyst.IPropSet (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPlugIn

public IPlugin getPlugIn()
                  throws IOException,
                         AutomationException
Data link plugin information for the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getPlugIn in interface IServerConnection2
Returns:
A reference to a com.esri.arcgis.trackinganalyst.IPlugin
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTrackingServicesList

public Object getTrackingServicesList()
                               throws IOException,
                                      AutomationException
List of tracking services.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getTrackingServicesList in interface IServerConnection2
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTrackingService

public ITrackingServiceDef getTrackingService(String bstrName)
                                       throws IOException,
                                              AutomationException
Gets tracking service for the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getTrackingService in interface IServerConnection2
Parameters:
bstrName - The bstrName (in)
Returns:
A reference to a com.esri.arcgis.trackinganalyst.ITrackingServiceDef
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

returnTrackingService

public void returnTrackingService(ITrackingServiceDef piTrackingServiceDef)
                           throws IOException,
                                  AutomationException
Returns tracking service for the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
returnTrackingService in interface IServerConnection2
Parameters:
piTrackingServiceDef - A reference to a com.esri.arcgis.trackinganalyst.ITrackingServiceDef (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getServerActions

public Object getServerActions(boolean bForEditing)
                        throws IOException,
                               AutomationException
Actions used on data in the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getServerActions in interface IServerConnection2
Parameters:
bForEditing - The bForEditing (in)
Returns:
A reference to another Object (IUnknown)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

returnServerActions

public void returnServerActions(boolean bSave,
                                Object piActionCollection)
                         throws IOException,
                                AutomationException
Actions used on data in the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
returnServerActions in interface IServerConnection2
Parameters:
bSave - The bSave (in)
piActionCollection - A reference to another Object (IUnknown) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMessageCount

public int getMessageCount()
                    throws IOException,
                           AutomationException
The count of messages ready to retrieve.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getMessageCount in interface ITxConnectionMessages
Returns:
The plNumberOfMessages
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getEventReadyHandle

public int getEventReadyHandle()
                        throws IOException,
                               AutomationException
The handle to the event that is signaled when a message is ready to be received.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
getEventReadyHandle in interface ITxConnectionMessages
Returns:
The phReadyEvent (A COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

nextMessage

public IMessage nextMessage()
                     throws IOException,
                            AutomationException
Retrieves a message from the server connection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
nextMessage in interface ITxConnectionMessages
Returns:
A reference to a com.esri.arcgis.trackinganalyst.IMessage
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.