SecurePlayLibray J2SE
v2.1

com.SecurePlay.Comms.SPCcommsTCP
Class SPCcommsTCP

java.lang.Object
  extended bycom.SecurePlay.Comms.SPCGenericCommsServer.SPCGenericCommsDriverClass
      extended bycom.SecurePlay.Comms.SPCcommsTCP.SPCcommsTCP
Direct Known Subclasses:
SPCcommsHTTP, SPCcommsTCPclient, SPCcommsTCPserver

public class SPCcommsTCP
extends SPCGenericCommsDriverClass

TCP comms class is an extention of a GenericCommsDriver class. This class supports TCP.

Author:
IT GlobalSecure
See Also:
SecurePlay License Information
 

Field Summary
protected  boolean listen
          Flag to continue to listen to a port.
protected  java.util.Vector listeners
          Stores all the listeners that this driver has.
protected  SPMap socketConnections
          Map that contains all the connections this driver has made.
protected  SPMap uniqueAddress
          Map that contains the common address that SPL uses and the unique address that TCP uses.
 
Fields inherited from class com.SecurePlay.Comms.SPCGenericCommsServer.SPCGenericCommsDriverClass
commsServer
 
Constructor Summary
SPCcommsTCP()
          Constructor
SPCcommsTCP(boolean push, boolean relay)
           
 
Method Summary
 boolean containsUniqueAddress(java.net.InetAddress add)
          Checks to see if the unique address exists in this driver.
 boolean createConnection(java.lang.String address, int portIN)
          Creates a connection.
 boolean createConnection(java.lang.String address, java.net.Socket socket)
          Creates a connection.
 java.lang.String getAddress(java.net.InetAddress add)
          Checks to see if the unique address exists in this driver.
 java.lang.String getCommsDriverType()
          This method returns the driver type.
 int getListenerCount()
          Returns the number of listeners this driver has.
 boolean isListen()
          Returns the listener flag.
 boolean isReady()
          Checks to see if every address has a unique address set.
 int numConnections()
          Returns number of connections available.
 boolean prsend(java.lang.String address, byte[] messages)
          Sends the message.
 boolean removeConnection(java.lang.String address)
          Removes the connection and closes the connection class.
 boolean setUniqueAddress(java.lang.String address, java.net.InetAddress uniqueAddress)
          Sets a unique address and associates it with an address.
 boolean StartListen(int portIN)
          Start to listen.
 void StopListen()
          Stops the listener by setting the listener flag to false.
 boolean unsetUniqueAddress(java.lang.String address)
          Unsets a unique address.
 
Methods inherited from class com.SecurePlay.Comms.SPCGenericCommsServer.SPCGenericCommsDriverClass
addAddress, addressSupportsRelay, clearAddresses, containsAddress, getAddressList, getServer, isConfigured, isPush, isRelay, MessArrAddMessArr, prpoll, removeAddress, sendFromQMessages, sendMessage, SPdeserializeProcessByteArr, SPincoming, SPserialize, SPserialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socketConnections

protected SPMap socketConnections
Map that contains all the connections this driver has made. map


uniqueAddress

protected SPMap uniqueAddress
Map that contains the common address that SPL uses and the unique address that TCP uses. map


listen

protected boolean listen
Flag to continue to listen to a port.


listeners

protected java.util.Vector listeners
Stores all the listeners that this driver has.

Constructor Detail

SPCcommsTCP

public SPCcommsTCP()
Constructor


SPCcommsTCP

public SPCcommsTCP(boolean push,
                   boolean relay)
Method Detail

StartListen

public boolean StartListen(int portIN)
Start to listen. Creates a server socket listener.

Parameters:
portIN - int - port it will listen to. void

StopListen

public void StopListen()
Stops the listener by setting the listener flag to false. void


isListen

public boolean isListen()
Returns the listener flag.

Returns:
boolean

setUniqueAddress

public boolean setUniqueAddress(java.lang.String address,
                                java.net.InetAddress uniqueAddress)
Sets a unique address and associates it with an address.

Parameters:
address - String - address
uniqueAddress - InetAddress - unique address that gets associated with the address.
Returns:
boolean

unsetUniqueAddress

public boolean unsetUniqueAddress(java.lang.String address)
Unsets a unique address.

Parameters:
address - String - address associated with the unique address.
Returns:
boolean

removeConnection

public boolean removeConnection(java.lang.String address)
Removes the connection and closes the connection class.

Parameters:
address - String - connection to be closed.
Returns:
boolean

createConnection

public boolean createConnection(java.lang.String address,
                                int portIN)
                         throws java.io.IOException
Creates a connection.

Throws:
java.io.IOException
Parameters:
address - String - address to which the connection will be created.
portIN - int - port number through which to send messages.
Returns:
boolean

createConnection

public boolean createConnection(java.lang.String address,
                                java.net.Socket socket)
                         throws java.io.IOException
Creates a connection.

Throws:
java.io.IOException
Parameters:
address - String - address to which the connection will be created.
socket - Socket - port number through which to send messages.
Returns:
boolean

prsend

public boolean prsend(java.lang.String address,
                      byte[] messages)
Sends the message.

Overrides:
prsend in class SPCGenericCommsDriverClass
Parameters:
address - String - address that this message is sent to.
messages - byte[] - message void

getCommsDriverType

public java.lang.String getCommsDriverType()
This method returns the driver type. It will be overridden with specific driver type.

Overrides:
getCommsDriverType in class SPCGenericCommsDriverClass
Returns:
String

isReady

public boolean isReady()
Checks to see if every address has a unique address set.

Overrides:
isReady in class SPCGenericCommsDriverClass
Returns:
boolean

numConnections

public int numConnections()
Returns number of connections available.

Returns:
int

containsUniqueAddress

public boolean containsUniqueAddress(java.net.InetAddress add)
Checks to see if the unique address exists in this driver.

Parameters:
add - InetAddress - address to be checked
Returns:
boolean

getAddress

public java.lang.String getAddress(java.net.InetAddress add)
Checks to see if the unique address exists in this driver.

Parameters:
add - InetAddress - address to be checked
Returns:
String

getListenerCount

public int getListenerCount()
Returns the number of listeners this driver has.

Returns:
int

SecurePlayLibray J2SE
v2.1

2006 Copyright Filed by IT GlobalSecure, Inc. All Rights Reserved. Not to be used without authorization by Author. SecurePlay, IT GlobalSecure, and IT Armor are registered trademarks by IT GlobalSecure, Inc. Software protected by software license, and one or more the following U.S. and International patent numbers: U.S. Patent 6,030,288, U.S. Patent 6,165,072, European Patent Office EP1016049A1,and World Intellectual Property Organization WO9912135C1 and additional filings worldwide.