Interface SpecificCloudServiceProvider

    • Method Detail

      • getServiceInfoSnapshot

        ServiceInfoSnapshot getServiceInfoSnapshot()
        Gets the info of the service this provider is for.
        Returns:
        the info or null, if the service doesn't exist
        Throws:
        java.lang.IllegalArgumentException - if no uniqueId/name/serviceInfo was given on creating this provider
      • addServiceTemplate

        void addServiceTemplate​(ServiceTemplate serviceTemplate)
        Adds a service template to this service. This template won't be copied directly after adding it but when the service is prepared.
        Parameters:
        serviceTemplate - the template to be added to the list of templates of this service
      • addServiceRemoteInclusion

        void addServiceRemoteInclusion​(ServiceRemoteInclusion serviceRemoteInclusion)
        Adds a remote inclusion to this service. This remote inclusion won't be included directly after adding it but when the service is prepared.
        Parameters:
        serviceRemoteInclusion - the inclusion to be added to the list of inclusions of this service
      • addServiceDeployment

        void addServiceDeployment​(ServiceDeployment serviceDeployment)
        Adds a deployment to this service, which will be used when deployResources() or deployResources(boolean) is called.
        Parameters:
        serviceDeployment - the deployment to be added to the list of deployments of this service
      • getCachedLogMessages

        java.util.Queue<java.lang.String> getCachedLogMessages()
        Gets a queue containing the last messages of this services console. The max size of this queue can be configured in the nodes config.json.
        Returns:
        a queue with the cached messages of this services console
      • stop

        default void stop()
        Stops this service by executing the "stop" and "end" commands in its console if it is running.
      • start

        default void start()
        Starts this service if it is prepared or stopped.
      • delete

        default void delete()
        Deletes this service if it is not deleted yet. If this service is running, it will be stopped like kill() does.
      • setCloudServiceLifeCycle

        void setCloudServiceLifeCycle​(ServiceLifeCycle lifeCycle)
        Sets the life cycle of this service and starts, prepares, stops or deletes this service.
        Parameters:
        lifeCycle - the lifeCycle to be set
      • restart

        void restart()
        Stops this service like stop() and starts it after it like start().
      • kill

        void kill()
        Tries to stop this service like stop() but if the service is still running after 5 seconds, it is destroyed forcibly
      • runCommand

        void runCommand​(java.lang.String command)
        Executes the given command in the console of this service if it is running
        Parameters:
        command - the command to be executed
      • getServiceInfoSnapshotAsync

        ITask<ServiceInfoSnapshot> getServiceInfoSnapshotAsync()
        Gets the info of the service this provider is for
        Returns:
        the info or null, if the service doesn't exist
        Throws:
        java.lang.IllegalArgumentException - if no uniqueId/name/serviceInfo was given on creating this provider
      • addServiceTemplateAsync

        ITask<java.lang.Void> addServiceTemplateAsync​(ServiceTemplate serviceTemplate)
        Adds a service template to this service. This template won't be copied directly after adding it but when the service is prepared
        Parameters:
        serviceTemplate - the template to be added to the list of templates of this service
      • addServiceRemoteInclusionAsync

        ITask<java.lang.Void> addServiceRemoteInclusionAsync​(ServiceRemoteInclusion serviceRemoteInclusion)
        Adds a remote inclusion to this service. This remote inclusion won't be included directly after adding it but when the service is prepared
        Parameters:
        serviceRemoteInclusion - the inclusion to be added to the list of inclusions of this service
      • addServiceDeploymentAsync

        ITask<java.lang.Void> addServiceDeploymentAsync​(ServiceDeployment serviceDeployment)
        Adds a deployment to this service, which will be used when deployResources() or deployResources(boolean) is called
        Parameters:
        serviceDeployment - the deployment to be added to the list of deployments of this service
      • getCachedLogMessagesAsync

        ITask<java.util.Queue<java.lang.String>> getCachedLogMessagesAsync()
        Gets a queue containing the last messages of this services console. The max size of this queue can be configured in the nodes config.json.
        Returns:
        a queue with the cached messages of this services console
      • stopAsync

        default ITask<java.lang.Void> stopAsync()
        Stops this service by executing the "stop" and "end" commands in its console if it is running.
      • startAsync

        default ITask<java.lang.Void> startAsync()
        Starts this service if it is prepared or stopped.
      • deleteAsync

        default ITask<java.lang.Void> deleteAsync()
        Deletes this service if it is not deleted yet. If this service is running, it will be stopped like kill() does.
      • setCloudServiceLifeCycleAsync

        ITask<java.lang.Void> setCloudServiceLifeCycleAsync​(ServiceLifeCycle lifeCycle)
        Sets the life cycle of this service and starts, prepares, stops or deletes this service
        Parameters:
        lifeCycle - the lifeCycle to be set
      • restartAsync

        ITask<java.lang.Void> restartAsync()
        Stops this service like stop() and starts it after it like start().
      • killAsync

        ITask<java.lang.Void> killAsync()
        Tries to stop this service like stop() but if the service is still running after 5 seconds, it is destroyed forcibly
      • runCommandAsync

        ITask<java.lang.Void> runCommandAsync​(java.lang.String command)
        Executes the given command in the console of this service if it is running
        Parameters:
        command - the command to be executed