TPTP 4.6.0 Platform Project
Internal API Specification

org.eclipse.tptp.platform.execution.client.core.internal
Class ConnectionImpl

java.lang.Object
  extended by org.eclipse.tptp.platform.execution.client.core.internal.ConnectionImpl
All Implemented Interfaces:
IConnection
Direct Known Subclasses:
SecureConnectionImpl

public class ConnectionImpl
extends java.lang.Object
implements IConnection


Field Summary
protected  org.eclipse.tptp.platform.execution.client.core.INode _node
           
protected  int _port
           
protected  java.net.Socket _socket
           
protected  java.net.InetAddress inetAddress
           
 
Constructor Summary
ConnectionImpl()
           
 
Method Summary
 void addConnectionListener(IConnectionListener listener)
          Adds a ConnectionListener to this Connection instance.
 void addContext(long contextID, org.eclipse.tptp.platform.execution.util.ICommandHandler handler)
           
 int addDataListener(int dataConnectionId, org.eclipse.tptp.platform.execution.client.core.IDataProcessor dataProcessor)
           
protected  boolean authenticateUser(org.eclipse.tptp.platform.execution.security.User user)
           
static int checkForRACMessage(byte[] buffer, int offset)
           
 void close()
           
 void connect(org.eclipse.tptp.platform.execution.client.core.INode node, org.eclipse.tptp.platform.execution.client.core.ConnectionInfo connInfo)
           
 void connect(org.eclipse.tptp.platform.execution.client.core.INode node, int port)
           
protected  java.net.Socket connectSocket()
           
protected  java.net.Socket connectSocket(java.net.InetAddress[] addrs, int port)
           
 void destroyDataConnection(int dataConnID)
           
 void disconnect()
           
 int getConnectionId()
           
protected  ContextMapper getContextMapper()
           
 java.net.InetAddress getInetAddress()
           
 long getNextContextId()
           
 org.eclipse.tptp.platform.execution.client.core.INode getNode()
           
 int getPort()
           
 int getProtocolVersion()
           
 java.net.Socket getSocket()
           
protected  void init()
           
protected  int initDataConnection(java.net.Socket datasock, int direction)
           
 boolean isActive()
           
 boolean isAuthenticated()
           
 boolean isNewAC()
           
protected  int processControlMessage(byte[] buffer, int offset, int length)
           
 void removeConnectionListener(IConnectionListener listener)
          Removes a ConnectionListener from this Connection instance.
 int removeDataListener(int dataConnectionId, org.eclipse.tptp.platform.execution.client.core.IDataProcessor dataProcessor)
           
 void sendData(int dataConnectionId, byte[] buffer, int bufferLength)
           
 void sendMessage(IControlMessage msg, org.eclipse.tptp.platform.execution.util.ICommandHandler handler)
           
 void setSocket(java.net.Socket socket)
           
 void setSoTimeout(int timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_socket

protected java.net.Socket _socket

_node

protected org.eclipse.tptp.platform.execution.client.core.INode _node

_port

protected int _port

inetAddress

protected java.net.InetAddress inetAddress
Constructor Detail

ConnectionImpl

public ConnectionImpl()
Method Detail

getConnectionId

public int getConnectionId()

isNewAC

public boolean isNewAC()

getNextContextId

public long getNextContextId()
Specified by:
getNextContextId in interface IConnection

addContext

public void addContext(long contextID,
                       org.eclipse.tptp.platform.execution.util.ICommandHandler handler)

connectSocket

protected java.net.Socket connectSocket()
                                 throws java.io.IOException
Throws:
java.io.IOException

connectSocket

protected java.net.Socket connectSocket(java.net.InetAddress[] addrs,
                                        int port)
                                 throws java.io.IOException
Throws:
java.io.IOException

connect

public void connect(org.eclipse.tptp.platform.execution.client.core.INode node,
                    org.eclipse.tptp.platform.execution.client.core.ConnectionInfo connInfo)
             throws java.io.IOException,
                    org.eclipse.tptp.platform.execution.exceptions.SecureConnectionRequiredException,
                    org.eclipse.tptp.platform.execution.exceptions.LoginFailedException,
                    org.eclipse.tptp.platform.execution.exceptions.UntrustedAgentControllerException,
                    org.eclipse.tptp.platform.execution.exceptions.ReconnectRequestedException
Specified by:
connect in interface IConnection
Throws:
java.io.IOException
org.eclipse.tptp.platform.execution.exceptions.SecureConnectionRequiredException
org.eclipse.tptp.platform.execution.exceptions.LoginFailedException
org.eclipse.tptp.platform.execution.exceptions.UntrustedAgentControllerException
org.eclipse.tptp.platform.execution.exceptions.ReconnectRequestedException

connect

public void connect(org.eclipse.tptp.platform.execution.client.core.INode node,
                    int port)
             throws java.io.IOException,
                    org.eclipse.tptp.platform.execution.exceptions.SecureConnectionRequiredException,
                    org.eclipse.tptp.platform.execution.exceptions.LoginFailedException,
                    org.eclipse.tptp.platform.execution.exceptions.UntrustedAgentControllerException,
                    org.eclipse.tptp.platform.execution.exceptions.ReconnectRequestedException
Throws:
java.io.IOException
org.eclipse.tptp.platform.execution.exceptions.SecureConnectionRequiredException
org.eclipse.tptp.platform.execution.exceptions.LoginFailedException
org.eclipse.tptp.platform.execution.exceptions.UntrustedAgentControllerException
org.eclipse.tptp.platform.execution.exceptions.ReconnectRequestedException

init

protected void init()
             throws org.eclipse.tptp.platform.execution.exceptions.SecureConnectionRequiredException,
                    org.eclipse.tptp.platform.execution.exceptions.LoginFailedException,
                    java.io.IOException,
                    org.eclipse.tptp.platform.execution.exceptions.ReconnectRequestedException
Throws:
org.eclipse.tptp.platform.execution.exceptions.SecureConnectionRequiredException
org.eclipse.tptp.platform.execution.exceptions.LoginFailedException
java.io.IOException
org.eclipse.tptp.platform.execution.exceptions.ReconnectRequestedException

initDataConnection

protected int initDataConnection(java.net.Socket datasock,
                                 int direction)
                          throws java.io.IOException,
                                 org.eclipse.tptp.platform.execution.exceptions.SecureConnectionRequiredException
Throws:
java.io.IOException
org.eclipse.tptp.platform.execution.exceptions.SecureConnectionRequiredException

addDataListener

public int addDataListener(int dataConnectionId,
                           org.eclipse.tptp.platform.execution.client.core.IDataProcessor dataProcessor)

removeDataListener

public int removeDataListener(int dataConnectionId,
                              org.eclipse.tptp.platform.execution.client.core.IDataProcessor dataProcessor)

destroyDataConnection

public void destroyDataConnection(int dataConnID)

sendData

public void sendData(int dataConnectionId,
                     byte[] buffer,
                     int bufferLength)
Specified by:
sendData in interface IConnection

sendMessage

public void sendMessage(IControlMessage msg,
                        org.eclipse.tptp.platform.execution.util.ICommandHandler handler)
                 throws java.io.IOException
Specified by:
sendMessage in interface IConnection
Throws:
java.io.IOException

disconnect

public void disconnect()
Specified by:
disconnect in interface IConnection

close

public void close()

getNode

public org.eclipse.tptp.platform.execution.client.core.INode getNode()
Specified by:
getNode in interface IConnection

isActive

public boolean isActive()
Specified by:
isActive in interface IConnection

checkForRACMessage

public static int checkForRACMessage(byte[] buffer,
                                     int offset)

getPort

public int getPort()
Specified by:
getPort in interface IConnection

getInetAddress

public java.net.InetAddress getInetAddress()

getContextMapper

protected ContextMapper getContextMapper()

processControlMessage

protected int processControlMessage(byte[] buffer,
                                    int offset,
                                    int length)

addConnectionListener

public void addConnectionListener(IConnectionListener listener)
Description copied from interface: IConnection
Adds a ConnectionListener to this Connection instance.

Specified by:
addConnectionListener in interface IConnection
See Also:
Connection#addConnectionListener(ConnectionListener)

removeConnectionListener

public void removeConnectionListener(IConnectionListener listener)
Description copied from interface: IConnection
Removes a ConnectionListener from this Connection instance.

Specified by:
removeConnectionListener in interface IConnection
See Also:
Connection#removeConnectionListener(ConnectionListener)

setSoTimeout

public void setSoTimeout(int timeout)

getProtocolVersion

public int getProtocolVersion()

getSocket

public java.net.Socket getSocket()

setSocket

public void setSocket(java.net.Socket socket)

isAuthenticated

public boolean isAuthenticated()

authenticateUser

protected boolean authenticateUser(org.eclipse.tptp.platform.execution.security.User user)

TPTP 4.6.0 Platform Project
Internal API Specification