SecurePlayLibray J2SE
v2.1

com.SecurePlay.Comms.SPCcommsHTTP
Class SPCcommsHTTPclient

java.lang.Object
  extended bycom.SecurePlay.Comms.SPCGenericCommsServer.SPCGenericCommsDriverClass
      extended bycom.SecurePlay.Comms.SPCcommsTCP.SPCcommsTCP
          extended bycom.SecurePlay.Comms.SPCcommsHTTP.SPCcommsHTTP
              extended bycom.SecurePlay.Comms.SPCcommsHTTP.SPCcommsHTTPclient

public class SPCcommsHTTPclient
extends SPCcommsHTTP

Simple HTTP client class. Extends from basic HTTP class and overrides and configures the class to be client.

Author:
IT GlobalSecure
See Also:
SecurePlay License Information
 

Nested Class Summary
private  class SPCcommsHTTPclient.poll
          Poll class designed to send poll message at time intervals to all the connections the main HTTP driver has.
 
Field Summary
(package private)  boolean poll
          Flag that tells the poll handler to keep polling.
(package private)  java.lang.Thread t1
          Thread in which the polling class lives in.
 
Fields inherited from class com.SecurePlay.Comms.SPCcommsTCP.SPCcommsTCP
listen, listeners, socketConnections, uniqueAddress
 
Fields inherited from class com.SecurePlay.Comms.SPCGenericCommsServer.SPCGenericCommsDriverClass
commsServer
 
Constructor Summary
SPCcommsHTTPclient(boolean relay)
          Wraps SPCcommsHTTP constructor.
 
Method Summary
 boolean createConnection(java.lang.String address, java.net.Socket s)
          Override.
 java.lang.String getCommsDriverType()
          This method returns the driver type.
 boolean isPoll()
          Returns the poll flag.
 boolean prpoll(java.lang.String address)
          Sends a poll request message to the reciever.
 boolean prsend(java.lang.String address, byte[] messages)
          Sends the message.
 void SPincoming(java.lang.String message)
          Incoming method that recieves a byte[] and deserializes it and processes it.
 boolean StartListen(int portIN)
          Override.
 void StartPOLL(int PollTimer)
          Starts a polling class and pushes it into a thread.
 void StopListen()
          Override.
 
Methods inherited from class com.SecurePlay.Comms.SPCcommsHTTP.SPCcommsHTTP
createConnection, removeConnection
 
Methods inherited from class com.SecurePlay.Comms.SPCcommsTCP.SPCcommsTCP
containsUniqueAddress, getAddress, getListenerCount, isListen, isReady, numConnections, setUniqueAddress, unsetUniqueAddress
 
Methods inherited from class com.SecurePlay.Comms.SPCGenericCommsServer.SPCGenericCommsDriverClass
addAddress, addressSupportsRelay, clearAddresses, containsAddress, getAddressList, getServer, isConfigured, isPush, isRelay, MessArrAddMessArr, 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

t1

java.lang.Thread t1
Thread in which the polling class lives in.


poll

boolean poll
Flag that tells the poll handler to keep polling.

Constructor Detail

SPCcommsHTTPclient

public SPCcommsHTTPclient(boolean relay)
Wraps SPCcommsHTTP constructor.

Parameters:
relay - boolean - flag to set relay or no relay.
Method Detail

isPoll

public boolean isPoll()
Returns the poll flag.

Returns:
boolean

StartPOLL

public void StartPOLL(int PollTimer)
Starts a polling class and pushes it into a thread. This polling class keeps polling messages until the poll flag in this class is set to false.

Parameters:
PollTimer - int - periodic time interval in which the poll messages are sent out.

StartListen

public boolean StartListen(int portIN)
Override. This is a client, it does not listen for new connections.

Overrides:
StartListen in class SPCcommsTCP
Parameters:
portIN - int - NOT USED. void

StopListen

public void StopListen()
Override. This is a client, it does not listen for new connections. void

Overrides:
StopListen in class SPCcommsTCP

createConnection

public boolean createConnection(java.lang.String address,
                                java.net.Socket s)
                         throws java.io.IOException
Override. This is a client, it does create connections, it only accepts or adds connections.

Overrides:
createConnection in class SPCcommsHTTP
Throws:
java.io.IOException
Parameters:
address - String - NOT USED.
s - Socket - NOT USED.
Returns:
boolean

getCommsDriverType

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

Overrides:
getCommsDriverType in class SPCcommsHTTP
Returns:
String

prsend

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

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

SPincoming

public void SPincoming(java.lang.String message)
Incoming method that recieves a byte[] and deserializes it and processes it.

Overrides:
SPincoming in class SPCcommsHTTP
Parameters:
message - byte[] - byte array that is incoming. void

prpoll

public boolean prpoll(java.lang.String address)
Sends a poll request message to the reciever.

Overrides:
prpoll in class SPCGenericCommsDriverClass
Parameters:
address - String - address the poll request message will be sent to.
Returns:
boolean

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.