Package org.jcsp.net
Class LinkFactory.Builder
- java.lang.Object
-
- org.jcsp.net.LinkFactory.Builder
-
- Enclosing class:
- LinkFactory
public abstract static class LinkFactory.Builder extends java.lang.Object
An abstract inner class which should be implemented by comunication protocol implementations. TheBuilder
class provides an abstract method which should be implemented to take aNodeAddressID
object which should be used to construct aLink
which is then returned by the method to the factory.
-
-
Constructor Summary
Constructors Constructor Description Builder(ProtocolID protocolID)
A constructor which takes theProtocolID
identifying the protocol that thisBuilder
supports.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ProtocolID
getProtocolID()
Gets theProtocolID
that thisBuilder
supports.abstract Link
testAndBuild(NodeAddressID addressID)
Takes aNodeAddressID
and constructs and returns aLink
object.
-
-
-
Constructor Detail
-
Builder
public Builder(ProtocolID protocolID)
A constructor which takes theProtocolID
identifying the protocol that thisBuilder
supports. This must be called by sub-classes.- Parameters:
protocolID
- theProtocolID
for the protocol that the implementation supports.
-
-
Method Detail
-
testAndBuild
public abstract Link testAndBuild(NodeAddressID addressID) throws java.lang.IllegalArgumentException
Takes aNodeAddressID
and constructs and returns aLink
object.- Parameters:
addressID
- theAddressID
for the remote Node.- Returns:
- the constructed
Link
. - Throws:
java.lang.IllegalArgumentException
- if theAddressID
object is invalid.
-
getProtocolID
public final ProtocolID getProtocolID()
Gets theProtocolID
that thisBuilder
supports.- Returns:
- the
ProtocolID
that thisBuilder
supports.
-
-