Package org.jcsp.net.tcpip
Class TCPIPProtocolID
- java.lang.Object
-
- org.jcsp.net.ProtocolID
-
- org.jcsp.net.tcpip.TCPIPProtocolID
-
- All Implemented Interfaces:
java.io.Serializable
public class TCPIPProtocolID extends ProtocolID
Defines a protocol ID for the TCP/IP link implementation.- Author:
- Quickstone Technologies Limited
- See Also:
ProtocolID
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TCPIPProtocolID()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NodeAddressID
createAddressID(java.lang.String stAddressID, boolean uniqueAddress)
Creates an address from a string form.boolean
equals(java.lang.Object o)
Compares two protocol IDsprotected LinkFactory.Builder
getLinkBuilder(java.util.Hashtable settings)
Returns the factory builder for this protocol.boolean
isActive()
Always returns true.boolean
requiresUserInteraction()
Always returns false.protected LinkServer
startLinkServer(NodeAddressID addressID)
Starts the TCP/IP link server at this node using the given address ID.-
Methods inherited from class org.jcsp.net.ProtocolID
getPosition, hashCode
-
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
Compares two protocol IDs- Overrides:
equals
in classProtocolID
- Parameters:
o
- an object to compare with this object.- Returns:
true
iff the supplied object's class is the same as the class of this object.
-
isActive
public boolean isActive()
Always returns true.- Specified by:
isActive
in classProtocolID
- Returns:
- boolean indicating whether protocol is active.
-
requiresUserInteraction
public boolean requiresUserInteraction()
Always returns false.- Specified by:
requiresUserInteraction
in classProtocolID
- Returns:
- boolean indicating whether user interaction is required.
-
getLinkBuilder
protected LinkFactory.Builder getLinkBuilder(java.util.Hashtable settings)
Returns the factory builder for this protocol.- Specified by:
getLinkBuilder
in classProtocolID
- Parameters:
settings
-Hashtable
containing settings.- Returns:
- the
Builder
for constructing Links.
-
startLinkServer
protected LinkServer startLinkServer(NodeAddressID addressID) throws java.lang.IllegalArgumentException
Starts the TCP/IP link server at this node using the given address ID.- Specified by:
startLinkServer
in classProtocolID
- Parameters:
addressID
- The address for the server to listen on.- Returns:
- the constructed
LinkServer
- Throws:
java.lang.IllegalArgumentException
- if the suppliedNodeAddressID
is invalid.
-
createAddressID
protected NodeAddressID createAddressID(java.lang.String stAddressID, boolean uniqueAddress) throws java.lang.IllegalArgumentException
Creates an address from a string form.- Specified by:
createAddressID
in classProtocolID
- Parameters:
stAddressID
- The address in String form.uniqueAddress
- boolean indicating whether address is unique.- Returns:
- the constructed
NodeAddressID
- Throws:
java.lang.IllegalArgumentException
- if theString
supplied is invalid.
-
-