ArcGIS Server Geoportal extension
10

com.esri.gpt.catalog.arcims
Class SocketToken

java.lang.Object
  extended by com.esri.gpt.catalog.arcims.SocketToken

public class SocketToken
extends Object

Represents a token for socket based communication with an ArcIMS metadata server.


Constructor Summary
protected SocketToken(SocketQueue parent, String host, int port, int id, long orphanSeconds)
          Constructs a token.
 
Method Summary
protected  void checkOut()
          Checks out the token.
 String getHost()
          Gets host name of Socket
 SocketQueue getParent()
          Gets parent refecnce of Socket
 int getPort()
          Gets the port number of Socket
protected  boolean isInUse()
          Method to check if the token is in use
protected  boolean isOrphaned()
          Method to check if the token is orphaned.
 void onSocketConnectionRefused(Exception e, String command)
          Call back method on socket connection refused
 void onSocketIOException(Exception e)
          Call back method on socket connection refused
 void release()
          Releases the token.
 String toString()
          Returns the string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SocketToken

protected SocketToken(SocketQueue parent,
                      String host,
                      int port,
                      int id,
                      long orphanSeconds)
Constructs a token.

Parameters:
parent - the parent reference to the socket token
host - the host name
port - the port
id - the unique identifier
orphanSeconds - the number of seconds at which a a token in use will be considered orphaned
Method Detail

getHost

public String getHost()
Gets host name of Socket

Returns:
_host

getPort

public int getPort()
Gets the port number of Socket

Returns:
_port

getParent

public SocketQueue getParent()
Gets parent refecnce of Socket

Returns:
_parent

isOrphaned

protected boolean isOrphaned()
Method to check if the token is orphaned.

Returns:
boolean true if the token is orphaned

isInUse

protected boolean isInUse()
Method to check if the token is in use

Returns:
boolean true if the token is in use

checkOut

protected void checkOut()
Checks out the token.


release

public void release()
Releases the token.


toString

public String toString()
Returns the string representation of the object.

Overrides:
toString in class Object
Returns:
the string

onSocketConnectionRefused

public void onSocketConnectionRefused(Exception e,
                                      String command)
Call back method on socket connection refused

Parameters:
e - the exception object

onSocketIOException

public void onSocketIOException(Exception e)
Call back method on socket connection refused

Parameters:
e - the exception object

ArcGIS Server Geoportal extension
10

Copyright 2010 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.