com.esri.arcgis.trackinganalyst
Class PlugIn

java.lang.Object
  extended by com.esri.arcgis.trackinganalyst.PlugIn
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IClientConnection, ICOMClient, IConnection, IPlugin, Serializable

public class PlugIn
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IPlugin, IConnection, ICOMClient, IClientConnection

Base class for data links for Tracking Server.

Description

Server plug-in classes.

Product Availability

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

See Also:
Serialized Form

Constructor Summary
PlugIn()
          Constructs a PlugIn using ArcGIS Engine.
PlugIn(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
PlugIn thePlugIn = (PlugIn) obj;
 
Method Summary
 void add_IPlugInEventsListener(_IPlugInEvents theListener)
          add_IPlugInEventsListener.
 void connect(String szConnectionString)
          Connects the client to the Tracking Server.
 void disableDataDefinition(String bstrDataDefinitionID)
          Disables data definition for the data link.
 void disconnect()
          Disconnects data link.
 void enableDataDefinition(String bstrDataDefinitionID)
          Enables data definition for the data link.
 boolean equals(Object o)
          Compare this object with another
 int getClientQueueCount()
          Number of messages in the client queue.waiting to be read by the client object or system of this data link.
static String getClsid()
          getClsid.
 Object getDataFilters()
          An array of Dataset Definition IDs that are currently Allowed to be read by the plugin when data filtering is enabled.
 IDatasetDef getDataSetDefinition(String bstrName)
          Gets dataset definition information for the data link.
 Object getDataSetDefinitionList()
          An array of all dataset defintion names that are defined in the TrackingServer that the data link is connected to.
 int getErrorCode()
          Value for the error code in the data connection.
 int getEventHandle()
          The handle to the event that is signaled when data is ready to be received.
 String getID()
          Unique identifier of the current instance of the data link.
 IMessage getMessage(int nTimeOut)
          Returns a message from the Tracking Server.
 String getName()
          Name of data link plugin.
 int getServerQueueCount()
          Number of messages waiting to be published to the server.
 int getStatus()
          Indicates status of the data link plugin.
 Object getTimeEstablished()
          Indicates the time the data link plugin was established.
 int getTotalClientMessageCount()
          Total number of client messages in the data link plugin.
 int getTotalServerMessageCount()
          Total number of server messages in the data link plugin.
 int hashCode()
          the hashcode for this object
 boolean isEnableDataFiltering()
          Indicates whether data filtering is enabled for the data link.
 IMessage popClientMessage(int nTimeOut)
          Retrieves a client message from the data link.
 void postClientMessage(IMessage piMessage)
          Posts a client message to the data link.
 void postMessage(IMessage piMessage)
          Posts a message to the Tracking Server.
 void remove_IPlugInEventsListener(_IPlugInEvents theListener)
          remove_IPlugInEventsListener.
 void returnDataSetDefinition(IDatasetDef piDataSetDef)
          Returns dataset definition information for the dta link.
 IResponseMessage sendCommand(ICommandMessage piCmdMsg, int nTimeOut)
          Sends a command to the data link.
 void setEnableDataFiltering(boolean pbvVal)
          Indicates whether data filtering is enabled for the data link.
 void setErrorCode(int pVal)
          Value for the error code in the data connection.
 void setID(String pVal)
          ID value for the data in the connection.
 void setName(String pVal)
          Name of data link plugin.
 
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

PlugIn

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

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

PlugIn

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

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

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.

getDataFilters

public Object getDataFilters()
                      throws IOException,
                             AutomationException
An array of Dataset Definition IDs that are currently Allowed to be read by the plugin when data filtering is enabled.

Product Availability

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

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

getID

public String getID()
             throws IOException,
                    AutomationException
Unique identifier of the current instance of the data link.

Product Availability

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

Specified by:
getID in interface IClientConnection
Specified by:
getID in interface ICOMClient
Specified by:
getID in interface IConnection
Specified by:
getID in interface IPlugin
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getName

public String getName()
               throws IOException,
                      AutomationException
Name of data link plugin.

Product Availability

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

Specified by:
getName in interface IClientConnection
Specified by:
getName in interface ICOMClient
Specified by:
getName in interface IConnection
Specified by:
getName in interface IPlugin
Returns:
The pVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setName

public void setName(String pVal)
             throws IOException,
                    AutomationException
Name of data link plugin.

Product Availability

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

Specified by:
setName in interface IClientConnection
Specified by:
setName in interface ICOMClient
Specified by:
setName in interface IConnection
Specified by:
setName in interface IPlugin
Parameters:
pVal - The pVal (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getServerQueueCount

public int getServerQueueCount()
                        throws IOException,
                               AutomationException
Number of messages waiting to be published to the server.

Product Availability

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

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

getClientQueueCount

public int getClientQueueCount()
                        throws IOException,
                               AutomationException
Number of messages in the client queue.waiting to be read by the client object or system of this data link.

Product Availability

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

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

getTimeEstablished

public Object getTimeEstablished()
                          throws IOException,
                                 AutomationException
Indicates the time the data link plugin was established.

Product Availability

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

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

getTotalServerMessageCount

public int getTotalServerMessageCount()
                               throws IOException,
                                      AutomationException
Total number of server messages in the data link plugin.

Product Availability

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

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

getTotalClientMessageCount

public int getTotalClientMessageCount()
                               throws IOException,
                                      AutomationException
Total number of client messages in the data link plugin.

Product Availability

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

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

getStatus

public int getStatus()
              throws IOException,
                     AutomationException
Indicates status of the data link plugin.

Product Availability

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

Specified by:
getStatus in interface IClientConnection
Specified by:
getStatus in interface IConnection
Specified by:
getStatus in interface IPlugin
Returns:
A com.esri.arcgis.trackinganalyst.enumConnectionStatus constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

disconnect

public void disconnect()
                throws IOException,
                       AutomationException
Disconnects data link.

Product Availability

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

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

postClientMessage

public void postClientMessage(IMessage piMessage)
                       throws IOException,
                              AutomationException
Posts a client message to the data link.

Product Availability

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

Specified by:
postClientMessage in interface IClientConnection
Specified by:
postClientMessage in interface IPlugin
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.

popClientMessage

public IMessage popClientMessage(int nTimeOut)
                          throws IOException,
                                 AutomationException
Retrieves a client message from the data link.

Product Availability

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

Specified by:
popClientMessage in interface IClientConnection
Specified by:
popClientMessage in interface IPlugin
Parameters:
nTimeOut - The nTimeOut (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.

getDataSetDefinitionList

public Object getDataSetDefinitionList()
                                throws IOException,
                                       AutomationException
An array of all dataset defintion names that are defined in the TrackingServer that the data link is connected to.

Product Availability

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

Specified by:
getDataSetDefinitionList in interface IPlugin
Returns:
A Variant
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 data link.

Product Availability

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

Specified by:
isEnableDataFiltering in interface IPlugin
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 data link.

Product Availability

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

Specified by:
setEnableDataFiltering in interface IPlugin
Parameters:
pbvVal - The pbvVal (in)
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 data link.

Product Availability

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

Specified by:
enableDataDefinition in interface IPlugin
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 data link.

Product Availability

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

Specified by:
disableDataDefinition in interface IPlugin
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 dta link.

Product Availability

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

Specified by:
returnDataSetDefinition in interface IPlugin
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 data link.

Product Availability

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

Specified by:
getDataSetDefinition in interface IPlugin
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 data link.

Product Availability

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

Specified by:
sendCommand in interface IPlugin
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.

setID

public void setID(String pVal)
           throws IOException,
                  AutomationException
ID value for the data in the connection.

Description

This property contains a unique identifier for this instance of the Object in which this interface is implemented with. This Unique ID is used internally by the Tracking Server to route command, data, status, and response message. This is the same ID that should be used in the message's destination property for routing a message to a specific Datalink. The implementation must verify that the ID is a valid GUID before changing the internal value.

Product Availability

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

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

getEventHandle

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

Description

Reserved for future use.

Product Availability

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

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

getErrorCode

public int getErrorCode()
                 throws IOException,
                        AutomationException
Value for the error code in the data connection.

Description

This property indicates the last error code that has occured.

Product Availability

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

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

setErrorCode

public void setErrorCode(int pVal)
                  throws IOException,
                         AutomationException
Value for the error code in the data connection.

Description

This property indicates the last error code that has occured.

Product Availability

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

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

postMessage

public void postMessage(IMessage piMessage)
                 throws IOException,
                        AutomationException
Posts a message to the Tracking Server.

Description

The postMessage method allows the Tracking server to send messages to the implementation's client. This method should only be valid if the Status is CONNECTED, see the IConnection interface definition. The implementation should return an S_OK if successful and an E_FAIL if not successful or if the implementation is not connected.

Product Availability

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

Specified by:
postMessage in interface ICOMClient
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 nTimeOut)
                    throws IOException,
                           AutomationException
Returns a message from the Tracking Server.

Description

The getMessage method is called by the tracking server process and retrieves a message from the implementations client. This method is only valid if the Status is CONNECTED. The implementation should return an S_OK if successful and an E_FAIL if not successful or the implementation is not connected. Additionally this routine should only block for the timeout, in milliseconds, passed in as nTimeOut. If a timeout occurs then the IMessage* value should be NULL and the return result must be S_FALSE; This is a requirement in order for the Tracking Server to properly process timeouts. Timeouts are normal operation as messages are not normally streaming steadily through the implementation.

Product Availability

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

Specified by:
getMessage in interface ICOMClient
Parameters:
nTimeOut - The nTimeOut (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.

connect

public void connect(String szConnectionString)
             throws IOException,
                    AutomationException
Connects the client to the Tracking Server.

Description

The connect method provides the entry point for connecting to the implementations client. This method takes one argument, the connection string. This connection string will contain the PROGID as the first section of the string and may contain additional information needed to connect the implementation. This additional information is dependent on the user-developed object. The format past the PROGID is at the discretion of the developer however it is recommended that TAGS be used to identify properties. The TAG format is an ALL CAPS TAG that is terminated with a colon e.g. CONNECTIONSTRING:user=self. The connect method returns S_OK on a successful connection or E_FAIL on a failed connection. Additionally it is desired for the implementation to use the Error Macros defined in ATL 3.0 for returning a descriptive error message. This message is logged into the TMS log and the Windows NT Event Log mechanism.

Product Availability

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

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