Class UDPNodeMonitoringService

  • All Implemented Interfaces:
    Service

    public class UDPNodeMonitoringService
    extends NodeMonitoringService
    UDP based implementation of the NodeMonitoringService.
    • Field Detail

      • HOST

        public static final String HOST
        This constant is the name of the property whose value contains the hostname where the Main Container is listening for UDP pings. If not specified the value of the Profile.LOCAL_HOST option is used. If this is null too the default network name is used.
        See Also:
        Constant Field Values
      • ACCEPT_LOCAL_HOST_ONLY

        public static final String ACCEPT_LOCAL_HOST_ONLY
        This constant is the name of the property whose value contains a boolean indication that specifies whether or not UDP pings must be accepted on the indicated local-host only (default = false).
        See Also:
        Constant Field Values
      • PORT

        public static final String PORT
        This constant is the name of the property whose value contains an integer representing the port number where the Main Container is listening for UDP pings.
        See Also:
        Constant Field Values
      • PING_DELAY

        public static final String PING_DELAY
        This constant is the name of the property whose value contains an integer representing the time interval (in milliseconds) in which a peripheral container sends UDP ping messages to the Main Container.
        This property is only meaningful on a peripheral container.
        See Also:
        Constant Field Values
      • PING_DELAY_LIMIT

        public static final String PING_DELAY_LIMIT
        This constant is the name of the property whose value contains an integer representing the maximum time (in milliseconds) the main container waits for a ping message before considering the peripheral container unreachable.
        This property is only meaningful on a main container.
        See Also:
        Constant Field Values
      • UNREACHABLE_LIMIT

        public static final String UNREACHABLE_LIMIT
        This constant is the name of the property whose value contains an integer representing the maximum time a node can stay unreachable after it gets removed from the platform.
        This property is only meaningful on a main container.
        See Also:
        Constant Field Values
      • ORPHAN_NODE_PINGS_CNT

        public static final String ORPHAN_NODE_PINGS_CNT
        This constant is the name of the property whose value contains an integer representing the number of UDP ping packets that must be received from an un-monitored node before considering it an orphan node and issuing an Orphan-Node Vertical command.
        The default for this property is 10.
        This property is only meaningful on a main container.
        See Also:
        Constant Field Values
      • MAX_TRACED_UNKNOWN_PINGS

        public static final String MAX_TRACED_UNKNOWN_PINGS
        This constant is the name of the property whose value contains an integer representing the maximum number of UDP ping packets received from an un-monitored node that are traced. Successive packets from the same un-monitored node will be completely ignored The default for this property is 100.
        This property is only meaningful on a main container.
        See Also:
        Constant Field Values
      • NETWORK_CHECKER

        public static final String NETWORK_CHECKER
        This constants is the name of the property whose value contains the fully qualified class name of a concrete implementation of the NetworkChecker interface. If this property is set, before considering dead a monitored node that remains unreachable for more than the unreachable-limit, the specified NetworkChecker is activated to check if the lack of UDP ping packets depends on a network disconnection. If this is the case the node is kept in the UNREACHABLE state and is not removed.
        This property is only meaningful on a main container.
        See Also:
        NetworkChecker, Constant Field Values
      • DEFAULT_PORT

        public static final int DEFAULT_PORT
        Default port on which the server is waiting for ping messages
        See Also:
        Constant Field Values
      • DEFAULT_PING_DELAY

        public static final int DEFAULT_PING_DELAY
        Default time between two outgoing pings
        See Also:
        Constant Field Values
      • DEFAULT_PING_DELAY_LIMIT

        public static final int DEFAULT_PING_DELAY_LIMIT
        Default maximum time the server waits for a ping
        See Also:
        Constant Field Values
      • DEFAULT_UNREACHABLE_LIMIT

        public static final int DEFAULT_UNREACHABLE_LIMIT
        Default maximum time a node can stay unreachable
        See Also:
        Constant Field Values
      • ORPHAN_NODE

        public static final String ORPHAN_NODE
        Vertical command issued on the Main Container when a given number of ping packets are received from an unknown node
        See Also:
        Constant Field Values
    • Constructor Detail

      • UDPNodeMonitoringService

        public UDPNodeMonitoringService()
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: Service
        Retrieve the name of this service, that can be used to look up its slices in the Service Finder.
        Returns:
        The name of this service.
        See Also:
        ServiceFinder
      • getOwnedCommands

        public String[] getOwnedCommands()
        Description copied from class: BaseService
        This should be properly implemented by the services that owns vertival commands.
        Specified by:
        getOwnedCommands in interface Service
        Overrides:
        getOwnedCommands in class NodeMonitoringService
        Returns:
        An array containing the names of all the vertical commands this service wants to own. If this service has no such commands (it acts purely as a command filter), it can return an empty array, or null as well.
        See Also:
        jade.core.Service#getCommandSink()
      • init

        public void init​(AgentContainer ac,
                         Profile p)
                  throws ProfileException
        Description copied from interface: Service
        Performs the passive initialization step of the service. This method is called before activating the service. Its role should be simply the one of a constructor, setting up the internal data as needed. Service implementations should not use the Service Manager and Service Finder facilities from within this method. A distributed initialization protocol, if needed, should be exectuted within the boot() method.
        Specified by:
        init in interface Service
        Overrides:
        init in class NodeMonitoringService
        Parameters:
        ac - The agent container this service is activated on.
        p - The configuration profile for this service.
        Throws:
        ProfileException - If the given profile is not valid.
      • shutdown

        public void shutdown()
        Description copied from interface: Service
        Performs the shutdown step of a kernel-level service. The JADE kernel calls this method just before uninstalling this service
        Specified by:
        shutdown in interface Service
        Overrides:
        shutdown in class BaseService
      • getCommandFilter

        public Filter getCommandFilter​(boolean direction)
        Description copied from class: BaseService
        This should be properly implemented by the services that have filters. Note that when called multiple times with the same value of the direction parameter this method MUST always return the same object!
        Specified by:
        getCommandFilter in interface Service
        Overrides:
        getCommandFilter in class BaseService
        Parameters:
        direction - One of the two constants Filter.INCOMING and Filter.OUTGOING, distinguishing between the two filter chains managed by the command processor.
        Returns:
        A Filter object, used by this service to intercept and process kernel-level commands. If the service does not wish to install a command filter for one or both directions, it can just return null when appropriate.
        See Also:
        CommandProcessor
      • getHorizontalInterface

        public Class getHorizontalInterface()
        Description copied from class: BaseService
        This should be properly implemented by the services that have non-empty slices.
        Specified by:
        getHorizontalInterface in interface Service
        Overrides:
        getHorizontalInterface in class BaseService
        Returns:
        A Class object, representing the interface that is implemented by the slices of this service. Let s be the Class object corresponding to the Service.Slice interface, and let c be the returned Class object. Then, the two following conditions must hold:
        1. c.isInterface() == true
        2. s.isAssignableFrom(c) == true
      • getLocalSlice

        public Service.Slice getLocalSlice()
        Description copied from class: BaseService
        This should be properly implemented by the services that have non-empty slices.
        Specified by:
        getLocalSlice in interface Service
        Overrides:
        getLocalSlice in class BaseService
        Returns:
        The slice of this service that resides on the local platform node, or null if no such slice exists.
      • setClientsPingDelay

        protected void setClientsPingDelay​(int delay)