Package org.jcsp.net

Class 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. 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 Summary

      Constructors 
      Constructor Description
      Builder​(ProtocolID protocolID)
      A constructor which takes the ProtocolID identifying the protocol that this Builder supports.
    • Field Detail

    • 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 java.lang.IllegalArgumentException
        Takes a NodeAddressID and constructs and returns a Link object.
        Parameters:
        addressID - the AddressID for the remote Node.
        Returns:
        the constructed Link.
        Throws:
        java.lang.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.