Class HostManager


  • public class HostManager
    extends AbstractAPIManager
    Class to manage hosts (i.e. nodes) using the Obsidian public embedded API. See AbstractAPIManager for details on how transactions are managed within all requests.

    Example:

        HostDetail host = new HostManager().getHost("obsidianHost");
        System.out.println("Host status: " + host);
     
    Since:
    2.3
    See Also:
    Embedded API Wiki, REST API Wiki, Carfey Date
    • Constructor Detail

      • HostManager

        public HostManager()
    • Method Detail

      • listEventHooksByHost

        public EventHookListing listEventHooksByHost()
                                              throws java.lang.Exception
        Returns:
        the EventHookListing for all event hooks on all hosts and their status
        Throws:
        java.lang.Exception - any type of unexpected exception.
        Since:
        5.4.0
      • listEventHooksByHost

        public EventHookListing listEventHooksByHost​(long hostId)
                                              throws java.lang.Exception
        Returns:
        the EventHookListing for the event hooks on the specified host
        Throws:
        MissingEntityException - If the host with the requested id does not exist.
        java.lang.Exception
        Since:
        5.4.0
      • listEventHooksByHost

        public EventHookListing listEventHooksByHost​(java.lang.String hostName)
                                              throws java.lang.Exception
        Returns:
        the EventHookListing for the event hooks on the specified host
        Throws:
        MissingEntityException - If the host with the requested name does not exist.
        java.lang.Exception
        Since:
        5.4.0
      • updateEventHook

        public EventHookListing updateEventHook​(UpdateEventHookRequest request,
                                                java.lang.String auditUser)
                                         throws java.lang.Exception
        Parameters:
        request - Request details for event hook changes
        Returns:
        the EventHookListing for the event hooks on the specified host
        Throws:
        MissingEntityException - If the specified host or event hook doesn't exist.
        java.lang.Exception
        Since:
        5.5.0
      • listHosts

        public HostListing listHosts()
                              throws java.lang.Exception
        Lists all known scheduling hosts.
        Returns:
        the HostListing of all configured hosts (never null)
        Throws:
        java.lang.Exception - any type of unexpected exception.
      • getHost

        public HostDetail getHost​(long hostId)
                           throws MissingEntityException,
                                  java.lang.Exception
        Loads a known scheduling host.
        Parameters:
        hostId - Id of the host to load
        Returns:
        the HostDetail (never null)
        Throws:
        MissingEntityException - If the host with the requested id does not exist.
        java.lang.Exception - Any other type of unexpected exception.
      • getHost

        public HostDetail getHost​(java.lang.String hostName)
                           throws MissingEntityException,
                                  java.lang.Exception
        Loads a known scheduling host.
        Parameters:
        hostName - Name of the host to load (not null)
        Returns:
        the HostDetail (never null)
        Throws:
        MissingEntityException - If the host with the requested name does not exist.
        java.lang.Exception - Any other type of unexpected exception.
      • getLicenceHealth

        public HostDetail getLicenceHealth​(long hostId)
                                    throws MissingEntityException,
                                           java.lang.Exception
        Loads the licence health for a known scheduling host.
        Parameters:
        hostId - Id of the host to load
        Returns:
        the HostDetail (never null)
        Throws:
        MissingEntityException - If the host with the requested id does not exist.
        java.lang.Exception - Any other type of unexpected exception.
        Since:
        4.3.0
      • getHealth

        public HostDetail getHealth​(java.lang.String hostName)
                             throws MissingEntityException,
                                    java.lang.Exception
        Loads the health for a known scheduling host.
        Parameters:
        hostName - Name of the host to load (not null)
        Returns:
        the HostDetail (never null)
        Throws:
        MissingEntityException - If the host with the requested name does not exist.
        java.lang.Exception - Any other type of unexpected exception.
        Since:
        6.3.0
      • getHealth

        public HostDetail getHealth​(long hostId)
                             throws MissingEntityException,
                                    java.lang.Exception
        Loads the health for a known scheduling host.
        Parameters:
        hostId - Id of the host to load
        Returns:
        the HostDetail (never null)
        Throws:
        MissingEntityException - If the host with the requested id does not exist.
        java.lang.Exception - Any other type of unexpected exception.
        Since:
        6.3.0
      • getLicenceHealth

        public HostDetail getLicenceHealth​(java.lang.String hostName)
                                    throws MissingEntityException,
                                           java.lang.Exception
        Loads the licence health for a known scheduling host.
        Parameters:
        hostName - Name of the host to load (not null)
        Returns:
        the HostDetail (never null)
        Throws:
        MissingEntityException - If the host with the requested name does not exist.
        java.lang.Exception - Any other type of unexpected exception.
        Since:
        4.3.0
      • updateHost

        public HostDetail updateHost​(long hostId,
                                     HostUpdateRequest request,
                                     java.lang.String auditUser)
                              throws MissingEntityException,
                                     ValidationException,
                                     java.lang.Exception
        Updates a known scheduling host's enabled status.
        Parameters:
        hostId - Id of the Host to update
        request - Details of the request (not null)
        auditUser - Optional user that is marked in audit columns. Defaults to "embeddedAPI".
        Returns:
        the HostDetail (never null)
        Throws:
        MissingEntityException - If the host with the requested id does not exist.
        ValidationException - A validation error which prevents the action from succeeding.
        java.lang.Exception - Any other type of unexpected exception.
      • updateHost

        public HostDetail updateHost​(java.lang.String hostName,
                                     HostUpdateRequest request,
                                     java.lang.String auditUser)
                              throws MissingEntityException,
                                     ValidationException,
                                     java.lang.Exception
        Updates a known scheduling host's enabled status.
        Parameters:
        hostName - Name of the host to update (not null)
        request - Details of the request (not null)
        auditUser - Optional user that is marked in audit columns. Defaults to "embeddedAPI".
        Returns:
        the HostDetail (never null)
        Throws:
        MissingEntityException - If the host with the requested name does not exist.
        ValidationException - A validation error which prevents the action from succeeding.
        java.lang.Exception - Any other type of unexpected exception.