public class Client extends java.lang.Object implements java.lang.Comparable<Client>, java.io.Serializable
| Constructor and Description |
|---|
Client(java.net.InetAddress address,
java.lang.String name,
int dataPort,
java.lang.String id,
java.lang.String osName,
DeviceType deviceType)
Creates a new
Client instance with the given Information. |
Client(java.net.InetAddress address,
java.lang.String name,
int dataPort,
java.lang.String id,
java.lang.String osName,
java.lang.String deviceType)
Creates a new
Client instance with the given Information. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Client o) |
void |
copy(Client source)
Copies all values from the given source
Client. |
boolean |
equals(java.lang.Object obj) |
java.net.InetAddress |
getAddress()
Returns the client's
InetAddress. |
int |
getDataPort()
Returns the port on which the client is listening for incoming data transmissions.
|
DeviceType |
getDeviceType()
Returns the client's
DeviceType. |
java.lang.String |
getId()
Returns the client's id.
|
java.lang.String |
getName()
Returns the client's name.
|
java.lang.String |
getOsName()
Returns the name of the client's os.
|
void |
sendData(java.io.InputStream inputStream,
int inputStreamLength,
NetworkEnvironmentSettings settings)
Sends the data from the stream to the client.
|
void |
sendData(java.io.InputStream inputStream,
int inputStreamLength,
java.lang.String sourceName,
NetworkEnvironmentSettings settings)
Sends the data from the stream to the client.
|
void |
sendData(java.io.InputStream inputStream,
long inputStreamLength,
java.lang.String sourceName,
EncryptionType encryptionType,
byte[] encryptionKey)
Sends the data from the stream to the client.
|
void |
sendData(java.io.InputStream inputStream,
long inputStreamLength,
java.lang.String sourceName,
NetworkEnvironmentSettings settings)
Sends the data from the stream to the client.
|
void |
sendData(java.io.InputStream inputStream,
NetworkEnvironmentSettings settings)
Sends the data from the stream to the client.
|
java.lang.String |
toString() |
public Client(java.net.InetAddress address,
java.lang.String name,
int dataPort,
java.lang.String id,
java.lang.String osName,
java.lang.String deviceType)
Client instance with the given Information.address - the client's InetAddressname - the client's namedataPort - the port on which the client is listening for incoming data tranmissionsid - the client's id (from NetworkEnvironmentSettingsosName - the name of the client's operating systemdeviceType - a String representing the client's DeviceTypepublic Client(java.net.InetAddress address,
java.lang.String name,
int dataPort,
java.lang.String id,
java.lang.String osName,
DeviceType deviceType)
Client instance with the given Information.address - the client's InetAddressname - the client's namedataPort - the port on which the client is listening for incoming data tranmissionsid - the client's id (from NetworkEnvironmentSettingsosName - the name of the client's operating systemdeviceType - the client's DeviceTypepublic java.net.InetAddress getAddress()
InetAddress.InetAddresspublic java.lang.String getName()
public int getDataPort()
public java.lang.String getId()
public java.lang.String getOsName()
public DeviceType getDeviceType()
DeviceType.DeviceType.public void sendData(java.io.InputStream inputStream,
NetworkEnvironmentSettings settings)
throws java.lang.Exception
inputStream - the InputStream to send the data fromsettings - the NetworkEnvironmentSettings to get all necessary information fromjava.lang.Exceptionpublic void sendData(java.io.InputStream inputStream,
int inputStreamLength,
NetworkEnvironmentSettings settings)
throws java.lang.Exception
inputStream - the InputStream to send the data frominputStreamLength - the length of inputStream or -1 if inputStream is endlesssettings - the NetworkEnvironmentSettings to get all necessary information fromjava.lang.Exceptionpublic void sendData(java.io.InputStream inputStream,
int inputStreamLength,
java.lang.String sourceName,
NetworkEnvironmentSettings settings)
throws java.lang.Exception
inputStream - the InputStream to send the data frominputStreamLength - the length of inputStream or -1 if inputStream is endlesssourceName - the name of the source represented by inputStream e.g. the filenamesettings - the NetworkEnvironmentSettings to get all necessary information fromjava.lang.Exceptionpublic void sendData(java.io.InputStream inputStream,
long inputStreamLength,
java.lang.String sourceName,
NetworkEnvironmentSettings settings)
throws java.lang.Exception
inputStream - the InputStream to send the data frominputStreamLength - the length of inputStream or -1 if inputStream is endlesssourceName - the name of the source represented by inputStream e.g. the filenamesettings - the NetworkEnvironmentSettings to get all necessary information fromjava.lang.Exceptionpublic void sendData(java.io.InputStream inputStream,
long inputStreamLength,
java.lang.String sourceName,
EncryptionType encryptionType,
byte[] encryptionKey)
throws java.lang.Exception
inputStream - the InputStream to send the data frominputStreamLength - the length of inputStream or -1 if inputStream is endlesssourceName - the name of the source represented by inputStream e.g. the filenameencryptionType - the EncryptionType to be usedencryptionKey - the key to encrypt the data or null if no encryption is usedjava.lang.Exceptionpublic void copy(Client source)
Client.source - the Client to copy all values from.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object