client.net.commun
Class NormalClient

java.lang.Object
  extended by client.net.commun.AbstractClient
      extended by client.net.commun.AbstractNormalClient
          extended by client.net.commun.NormalClient
All Implemented Interfaces:
NormalClientDescriptor, java.lang.Runnable

public class NormalClient
extends AbstractNormalClient
implements java.lang.Runnable, NormalClientDescriptor


Field Summary
static java.lang.String FILES_INFO_PROVIDED_STATE
           
 
Fields inherited from class client.net.commun.AbstractNormalClient
CONNECTED_STATE, description, DISCONNECTED_STATE, docBuilder, id, INITIALIZING_STATE, passive, state
 
Fields inherited from class client.net.commun.AbstractClient
clientManager, messageReciever, messageSender, messageWaiterThread, name, socket, UNKNOWN_CLIENT_NAME
 
Constructor Summary
NormalClient(ClientManager cm, java.net.Socket s, java.io.OutputStream os, java.io.InputStream is, Profile p)
           
NormalClient(ClientManager cm, java.net.Socket s, java.io.OutputStream os, java.io.InputStream is, Profile p, ServerClient c, int comport)
          Constructor for ATP connection
 
Method Summary
 void disconnect()
           
 int getCommunicationPort()
           
 ServerClient getConAssistantServer()
          returns null if the assistant dont exists
protected  java.lang.String getMessage(int type)
           
 Profile getProfileConnectedWith()
           
 java.util.ArrayList<ClientFileDescriptor> getSharedFiles()
           
 void requestATPConnectionForTransfer()
           
 void run()
           
 
Methods inherited from class client.net.commun.AbstractNormalClient
getDescription, getID, getState, isPassive
 
Methods inherited from class client.net.commun.AbstractClient
disconnectSocket, getIPAdress, getName, sendMessage, sendMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface client.net.commun.NormalClientDescriptor
getID, getIPAdress, getName, isPassive
 

Field Detail

FILES_INFO_PROVIDED_STATE

public static final java.lang.String FILES_INFO_PROVIDED_STATE
See Also:
Constant Field Values
Constructor Detail

NormalClient

public NormalClient(ClientManager cm,
                    java.net.Socket s,
                    java.io.OutputStream os,
                    java.io.InputStream is,
                    Profile p,
                    ServerClient c,
                    int comport)
             throws java.io.IOException
Constructor for ATP connection

Throws:
java.io.IOException

NormalClient

public NormalClient(ClientManager cm,
                    java.net.Socket s,
                    java.io.OutputStream os,
                    java.io.InputStream is,
                    Profile p)
             throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getMessage

protected java.lang.String getMessage(int type)
Overrides:
getMessage in class AbstractNormalClient

requestATPConnectionForTransfer

public void requestATPConnectionForTransfer()

run

public void run()
Specified by:
run in interface java.lang.Runnable

getSharedFiles

public java.util.ArrayList<ClientFileDescriptor> getSharedFiles()

getProfileConnectedWith

public Profile getProfileConnectedWith()
Specified by:
getProfileConnectedWith in interface NormalClientDescriptor

disconnect

public void disconnect()

getConAssistantServer

public ServerClient getConAssistantServer()
Description copied from interface: NormalClientDescriptor
returns null if the assistant dont exists

Specified by:
getConAssistantServer in interface NormalClientDescriptor

getCommunicationPort

public int getCommunicationPort()
Specified by:
getCommunicationPort in interface NormalClientDescriptor
Overrides:
getCommunicationPort in class AbstractClient