cnrg.itx.signal
Class SignalConnection

java.lang.Object
  |
  +--cnrg.itx.signal.SignalConnection

public class SignalConnection
extends java.lang.Object

This class contains vital signaling information to identify and hangup peer applications. It also contains the data exchange connection that allows for data transfer.


Constructor Summary
SignalConnection()
          Default Constructor
SignalConnection(Connection c, java.lang.String ip, int p)
          Constructor
SignalConnection(Connection c, java.lang.String ip, int p, UserID puid, cnrg.itx.signal.DialThread d)
          Constructor
 
Method Summary
 void abortCall()
          Aborts the current dial sequence.
 void close()
           
 Connection getConnection()
          Returns the data exchange connection
 int getCurrentState()
           
 Channel getInputChannel()
           
 java.lang.String getIP()
          Returns the IP address of the peer
 cnrg.itx.signal.KeepAlive getKeepAlive()
           
 Channel getOutputChannel()
           
 java.lang.Long getPeerSeqNumber()
          Returns the uniques sequence number being used by the peer for this call
 UserID getPeerUID()
           
 int getPort()
          Returns the listening port of the peer
 PropertiesCollection getProperties()
           
 java.lang.Long getSeqNumber()
          Returns the uniques sequence number being used for this call
 Stats getStatistics()
           
 boolean isConnected()
           
 boolean isDialing()
           
 boolean isIdle()
           
 void open()
           
 void setConnection(Connection c)
          Sets the conection object to use for data exchange
 void setDialer(cnrg.itx.signal.DialThread d)
          Sets the DialThread to be used for the call.
 void setInputChannel(Channel c)
           
 void setIP(java.lang.String ip)
          Sets the peer's IP address
 void setKeepAlive(cnrg.itx.signal.KeepAlive ka)
          Sets the KeepAlive object handle
 void setKeepAliveTime(int timeout)
          Sets the KeepAlive object's wait period
 void setOutputChannel(Channel c)
           
 void setPeerProperties(PropertiesCollection pc)
           
 void setPeerSeqNumber(java.lang.Long s)
          Sets the sequence number being used by the peer for this connection
 void setPeerUID(UserID uid)
          Sets the peer's UserID
 void setPort(int p)
          Sets the peer's listening port
 void setProperties(PropertiesCollection pc)
           
 void setSeqNumber(java.lang.Long s)
          Sets the sequence number for this connection
 void startCall()
          Starts dialing the peer.
 void startKeepAlive(DesktopSignaling ds)
          Creates and starts the KeepAlive thread for the connection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignalConnection

public SignalConnection()
Default Constructor
Parameters:
None. -  

SignalConnection

public SignalConnection(Connection c,
                        java.lang.String ip,
                        int p)
Constructor
Parameters:
c - is the connection for data exchange
ip - is the IP address of peer
p - is the listening port of peer

SignalConnection

public SignalConnection(Connection c,
                        java.lang.String ip,
                        int p,
                        UserID puid,
                        cnrg.itx.signal.DialThread d)
Constructor
Parameters:
c - is the connection for data exchange
ip - is the IP address of peer
p - is the listening port of peer
puid - is the userID of the peer
d - is the DialThread to make the call
See Also:
DialThread
Method Detail

getConnection

public Connection getConnection()
Returns the data exchange connection
Parameters:
None -  
Returns:
Connection object

getIP

public java.lang.String getIP()
Returns the IP address of the peer
Parameters:
None -  
Returns:
String representation of peer's IP address

getPort

public int getPort()
Returns the listening port of the peer
Parameters:
None -  
Returns:
integer representation of peer's listening port

getSeqNumber

public java.lang.Long getSeqNumber()
Returns the uniques sequence number being used for this call
Parameters:
None -  
Returns:
Long object representing the sequence number

getPeerSeqNumber

public java.lang.Long getPeerSeqNumber()
Returns the uniques sequence number being used by the peer for this call
Parameters:
None -  
Returns:
Long object representing the sequence number being used by the peer

setIP

public void setIP(java.lang.String ip)
Sets the peer's IP address
Parameters:
ip - is the String representation of peer's IP address
Returns:
void.

setPort

public void setPort(int p)
Sets the peer's listening port
Parameters:
p - is the integer representation of peer's port
Returns:
void.

setSeqNumber

public void setSeqNumber(java.lang.Long s)
Sets the sequence number for this connection
Parameters:
s - is the Long representation of the sequence number
Returns:
void.

setPeerSeqNumber

public void setPeerSeqNumber(java.lang.Long s)
Sets the sequence number being used by the peer for this connection
Parameters:
s - is the Long representation of the sequence number being used by the peer
Returns:
void.

setKeepAlive

public void setKeepAlive(cnrg.itx.signal.KeepAlive ka)
Sets the KeepAlive object handle
Parameters:
ks - is the KeepAlive object
Returns:
void.

getKeepAlive

public cnrg.itx.signal.KeepAlive getKeepAlive()
Returns:
the KeepAlive object

setKeepAliveTime

public void setKeepAliveTime(int timeout)
Sets the KeepAlive object's wait period
Parameters:
timeout - is the wait period in milli seconds
Returns:
void.

setPeerUID

public void setPeerUID(UserID uid)
Sets the peer's UserID
Parameters:
uid - is the UserID object representing the peer's userID.
Returns:
void.

getPeerUID

public UserID getPeerUID()
Returns:
the peer UserID object

setDialer

public void setDialer(cnrg.itx.signal.DialThread d)
Sets the DialThread to be used for the call.
Parameters:
d - is the instantiated DialThread object
Returns:
void.

isIdle

public boolean isIdle()
Returns:
TRUE if the current state is idle, FALSE otherwise.

isDialing

public boolean isDialing()
Returns:
TRUE if the current state is Dialing, FALSE otherwise.

isConnected

public boolean isConnected()
Returns:
TRUE if the current state is Connected, FALSE otherwise.

getCurrentState

public int getCurrentState()
Returns:
the current state

setConnection

public void setConnection(Connection c)
Sets the conection object to use for data exchange
Parameters:
c - is the Connection object to be used
Returns:
void.

startCall

public void startCall()
Starts dialing the peer.
Parameters:
None. -  
Returns:
void

abortCall

public void abortCall()
Aborts the current dial sequence.
Parameters:
None. -  
Returns:
void.

startKeepAlive

public void startKeepAlive(DesktopSignaling ds)
Creates and starts the KeepAlive thread for the connection
Parameters:
ds - the handle to DesktopSignaling.
Returns:
void.

open

public void open()
          throws DataException
See Also:
cnrg.itx.datax.Connection.open()

close

public void close()
           throws DataException
See Also:
cnrg.itx.datax.Connection.close()

getInputChannel

public Channel getInputChannel()
See Also:
cnrg.itx.datax.Connection.getInputChannel()

getOutputChannel

public Channel getOutputChannel()
See Also:
cnrg.itx.datax.Connection.getOutputChannel()

setInputChannel

public void setInputChannel(Channel c)
See Also:
cnrg.itx.datax.Connection.setInputChannel(Channel c)

setOutputChannel

public void setOutputChannel(Channel c)
See Also:
cnrg.itx.datax.Connection.setOutputChannel(Channel c)

getStatistics

public Stats getStatistics()
See Also:
cnrg.itx.datax.Connection.getStatistics()

getProperties

public PropertiesCollection getProperties()
See Also:
cnrg.itx.datax.Connection.getProperties()

setProperties

public void setProperties(PropertiesCollection pc)
See Also:
cnrg.itx.datax.Connection.setProperties(PropertiesCollection pc)

setPeerProperties

public void setPeerProperties(PropertiesCollection pc)
                       throws DataException
See Also:
cnrg.itx.datax.Connection.setPeerProperties(PropertiesCollection pc)