Class PortsMeta

  • All Implemented Interfaces:
    java.io.Serializable

    public class PortsMeta
    extends java.lang.Object
    implements java.io.Serializable
    Track meta information about the ports of a service.
    Author:
    Vidar Larsen
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      PortsMeta()
      Create a new PortsMeta object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(int offset, java.lang.String meta)
      Check if the port at a specific offset contains a particular meta attribute.
      java.lang.Integer getHttpAdminOffset()
      Get the offset to the http port used for admin.
      java.lang.Integer getHttpStatusOffset()
      Get the offset to the http port used for status.
      int getNumPorts()
      Get the number of ports with registered meta.
      java.lang.Integer getRpcAdminOffset()
      Get the offset to the rpc port used for admin.
      java.lang.Integer getRpcStatusOffset()
      Get the offset to the rpc port used for status.
      java.util.List<java.lang.String> getTagsAt​(int offset)
      Get an iterator of the Strings registered at the specific point.
      PortsMeta on​(int offset)
      Set up the port to tag, for chained usage.
      PortsMeta tag​(java.lang.String meta)
      Tag a previously setup port (using 'on') with the specified tag.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PortsMeta

        public PortsMeta()
        Create a new PortsMeta object.
    • Method Detail

      • on

        public PortsMeta on​(int offset)
        Set up the port to tag, for chained usage.
        Parameters:
        offset - The relative port to tag.
        Returns:
        this portsmeta, to allow .tag calls.
      • tag

        public PortsMeta tag​(java.lang.String meta)
        Tag a previously setup port (using 'on') with the specified tag.
        Parameters:
        meta - The tag to apply to the current port.
        Returns:
        this portsmeta, to allow further .tag calls.
      • contains

        public boolean contains​(int offset,
                                java.lang.String meta)
        Check if the port at a specific offset contains a particular meta attribute.
        Parameters:
        offset - The relative port offset
        meta - The meta info we want to check for
        Returns:
        boolean true if the specific port has registered the meta
      • getNumPorts

        public int getNumPorts()
        Get the number of ports with registered meta.
        Returns:
        the number of ports that have been registered.
      • getTagsAt

        public java.util.List<java.lang.String> getTagsAt​(int offset)
        Get an iterator of the Strings registered at the specific point.
        Parameters:
        offset - The relative offset to inquire about tags.
        Returns:
        List of tags.
      • getRpcAdminOffset

        public java.lang.Integer getRpcAdminOffset()
        Get the offset to the rpc port used for admin.
        Returns:
        Integer the offset, or null if none set.
      • getRpcStatusOffset

        public java.lang.Integer getRpcStatusOffset()
        Get the offset to the rpc port used for status.
        Returns:
        Integer the offset, or null if none set.
      • getHttpAdminOffset

        public java.lang.Integer getHttpAdminOffset()
        Get the offset to the http port used for admin.
        Returns:
        Integer the offset, or null if none set.
      • getHttpStatusOffset

        public java.lang.Integer getHttpStatusOffset()
        Get the offset to the http port used for status.
        Returns:
        Integer the offset, or null if none set.