Package org.jcsp.net

Class LinkFactory.Builder

  • Enclosing class:
    LinkFactory

    public abstract static class LinkFactory.Builder
    extends Object
    An abstract inner class which should be implemented by comunication protocol implementations. The Builder class provides an abstract method which should be implemented to take a NodeAddressID object which should be used to construct a Link which is then returned by the method to the factory.
    • Constructor Detail

      • Builder

        public Builder​(ProtocolID protocolID)
        A constructor which takes the ProtocolID identifying the protocol that this Builder supports. This must be called by sub-classes.
        Parameters:
        protocolID - the ProtocolID for the protocol that the implementation supports.
    • Method Detail

      • testAndBuild

        public abstract Link testAndBuild​(NodeAddressID addressID)
                                   throws IllegalArgumentException
        Takes a NodeAddressID and constructs and returns a Link object.
        Parameters:
        addressID - the AddressID for the remote Node.
        Returns:
        the constructed Link.
        Throws:
        IllegalArgumentException - if the AddressID object is invalid.
      • getProtocolID

        public final ProtocolID getProtocolID()
        Gets the ProtocolID that this Builder supports.
        Returns:
        the ProtocolID that this Builder supports.