Interface ServiceBase

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      static java.lang.String composeId​(java.lang.String serviceId, java.lang.String applicationId)
      Composes an (internal) id from a service and an application id.
      static java.lang.String composeId​(java.lang.String serviceId, java.lang.String applicationId, java.lang.String applicationInstanceId)
      Composes an (internal) id from a service and an application id.
      static java.lang.String getApplicationId​(java.lang.String id)
      Returns the application id from an (internal) id.
      static java.lang.String getApplicationInstanceId​(java.lang.String id)
      Returns the application instance id from an (internal) id.
      java.lang.String getId()
      Returns the unique id of the service.
      static java.lang.String getServiceId​(java.lang.String id)
      Returns the service id from an (internal) id.
      ServiceState getState()
      Returns the state the service is currently in.
      void setState​(ServiceState state)
      Changes the state.
      static java.lang.String validateApplicationInstanceId​(java.lang.String appInstanceId)
      Validates an application instance id.
    • Field Detail

      • APPLICATION_SEPARATOR

        static final java.lang.String APPLICATION_SEPARATOR
        See Also:
        Constant Field Values
      • DEFAULT_APPLICATION_INSTANCE_ID

        static final java.lang.String DEFAULT_APPLICATION_INSTANCE_ID
        See Also:
        Constant Field Values
    • Method Detail

      • getId

        java.lang.String getId()
        Returns the unique id of the service. May be a single service id, a service id and a postfixed application id (after APPLICATION_SEPARATOR) or a service id with application id and postfixed application instance id (after APPLICATION_SEPARATOR)
        Returns:
        the unique id
      • getState

        ServiceState getState()
        Returns the state the service is currently in. [R4c]
        Returns:
        the state
      • setState

        void setState​(ServiceState state)
               throws java.util.concurrent.ExecutionException
        Changes the state. [R133c]
        Parameters:
        state - the new state
        Throws:
        java.util.concurrent.ExecutionException - if changing the state fails for some reason
      • getServiceId

        static java.lang.String getServiceId​(java.lang.String id)
        Returns the service id from an (internal) id.
        Parameters:
        id - the id to split
        Returns:
        the service id, may be id if there is no application id
        See Also:
        composeId(String, String), composeId(String, String, String)
      • getApplicationId

        static java.lang.String getApplicationId​(java.lang.String id)
        Returns the application id from an (internal) id.
        Parameters:
        id - the id to split
        Returns:
        the application id, may be empty if there is none
        See Also:
        composeId(String, String), composeId(String, String, String)
      • getApplicationInstanceId

        static java.lang.String getApplicationInstanceId​(java.lang.String id)
        Returns the application instance id from an (internal) id.
        Parameters:
        id - the id to split
        Returns:
        the application id, may be empty if there is none
        See Also:
        composeId(String, String), composeId(String, String, String)
      • validateApplicationInstanceId

        static java.lang.String validateApplicationInstanceId​(java.lang.String appInstanceId)
        Validates an application instance id.
        Parameters:
        appInstanceId - the id to validate
        Returns:
        the validated id, if appInstanceId would be null or empty, DEFAULT_APPLICATION_INSTANCE_ID is returned
      • composeId

        static java.lang.String composeId​(java.lang.String serviceId,
                                          java.lang.String applicationId)
        Composes an (internal) id from a service and an application id.
        Parameters:
        serviceId - the service id
        applicationId - the application id, may be null or empty for none, APPLICATION_SEPARATOR in applicationId will be removed
        Returns:
        the composed id
      • composeId

        static java.lang.String composeId​(java.lang.String serviceId,
                                          java.lang.String applicationId,
                                          java.lang.String applicationInstanceId)
        Composes an (internal) id from a service and an application id.
        Parameters:
        serviceId - the service id, APPLICATION_SEPARATOR in serviceId will be removed
        applicationId - the application id, may be null or empty for none, APPLICATION_SEPARATOR in applicationId will be removed
        applicationInstanceId - the application instance id, may be null or empty for none, used only if applicationId is given, APPLICATION_SEPARATOR in applicationInstanceId will be removed
        Returns:
        the composed id