Interface ClusterState

  • All Known Implementing Classes:
    ConsulState

    public interface ClusterState
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void deleteAPIToken​(java.lang.String id)  
      void deleteCredential​(uk.co.ractf.polaris.api.namespace.NamespacedId id)  
      void deleteInstance​(uk.co.ractf.polaris.api.instance.Instance instance)
      Unregisters an Instance from a given Task, probably because its been descheduled
      void deleteNamespace​(java.lang.String id)  
      void deleteNotificationReceiver​(uk.co.ractf.polaris.api.namespace.NamespacedId id)  
      void deleteTask​(uk.co.ractf.polaris.api.namespace.NamespacedId id)  
      uk.co.ractf.polaris.api.authentication.APIToken getAPIToken​(java.lang.String id)  
      java.util.Map<java.lang.String,​uk.co.ractf.polaris.api.authentication.APIToken> getAPITokens()  
      uk.co.ractf.polaris.api.registry.credentials.ContainerRegistryCredentials getCredential​(uk.co.ractf.polaris.api.namespace.NamespacedId id)  
      java.util.Map<uk.co.ractf.polaris.api.namespace.NamespacedId,​uk.co.ractf.polaris.api.registry.credentials.ContainerRegistryCredentials> getCredentials()  
      java.util.Map<uk.co.ractf.polaris.api.namespace.NamespacedId,​uk.co.ractf.polaris.api.registry.credentials.ContainerRegistryCredentials> getCredentials​(java.lang.String namespace)  
      @Nullable uk.co.ractf.polaris.api.instance.Instance getInstance​(java.lang.String id)
      Gets an Instance by id
      java.util.Map<uk.co.ractf.polaris.api.namespace.NamespacedId,​java.lang.Integer> getInstanceCounts()  
      java.util.List<java.lang.String> getInstanceIds()  
      java.util.Map<java.lang.String,​uk.co.ractf.polaris.api.instance.Instance> getInstances()  
      java.util.Map<java.lang.String,​uk.co.ractf.polaris.api.instance.Instance> getInstancesOfTask​(uk.co.ractf.polaris.api.namespace.NamespacedId namespacedId)  
      @NotNull java.util.Map<java.lang.String,​uk.co.ractf.polaris.api.instance.Instance> getInstancesOnNode​(java.lang.String node)
      Gets a list of Instances on a given node.
      uk.co.ractf.polaris.api.namespace.Namespace getNamespace​(java.lang.String id)  
      java.util.Map<java.lang.String,​uk.co.ractf.polaris.api.namespace.Namespace> getNamespaces()  
      @Nullable uk.co.ractf.polaris.api.node.NodeInfo getNode​(java.lang.String id)
      Gets a NodeInfo by id
      @NotNull java.util.Map<java.lang.String,​uk.co.ractf.polaris.api.node.NodeInfo> getNodes()
      Gets a Map of host id to Node
      uk.co.ractf.polaris.api.notification.NotificationReceiver getNotificationReceiver​(uk.co.ractf.polaris.api.namespace.NamespacedId id)  
      java.util.Map<uk.co.ractf.polaris.api.namespace.NamespacedId,​uk.co.ractf.polaris.api.notification.NotificationReceiver> getNotificationReceivers()  
      java.util.Map<uk.co.ractf.polaris.api.namespace.NamespacedId,​uk.co.ractf.polaris.api.notification.NotificationReceiver> getNotificationReceivers​(java.lang.String namespace)  
      uk.co.ractf.polaris.api.task.Task getTask​(uk.co.ractf.polaris.api.namespace.NamespacedId id)  
      java.util.List<uk.co.ractf.polaris.api.namespace.NamespacedId> getTaskIds()  
      java.util.Map<uk.co.ractf.polaris.api.namespace.NamespacedId,​uk.co.ractf.polaris.api.task.Task> getTasks()  
      java.util.Map<uk.co.ractf.polaris.api.namespace.NamespacedId,​uk.co.ractf.polaris.api.task.Task> getTasks​(java.lang.String namespace)  
      boolean instanceExists​(java.lang.String id)  
      boolean lockTask​(uk.co.ractf.polaris.api.task.Task task)  
      void setAPIToken​(uk.co.ractf.polaris.api.authentication.APIToken apiToken)  
      void setCredential​(uk.co.ractf.polaris.api.registry.credentials.ContainerRegistryCredentials credential)  
      void setInstance​(uk.co.ractf.polaris.api.instance.Instance instance)
      Sets the state of an instance
      void setNamespace​(uk.co.ractf.polaris.api.namespace.Namespace namespace)  
      void setNodeInfo​(uk.co.ractf.polaris.api.node.NodeInfo nodeInfo)
      Sets the info for a node
      void setNotificationReceiver​(uk.co.ractf.polaris.api.notification.NotificationReceiver receiver)  
      void setTask​(uk.co.ractf.polaris.api.task.Task task)  
      boolean unlockTask​(uk.co.ractf.polaris.api.task.Task task)  
    • Method Detail

      • getNodes

        @NotNull
        @NotNull java.util.Map<java.lang.String,​uk.co.ractf.polaris.api.node.NodeInfo> getNodes()
        Gets a Map of host id to Node
        Returns:
        map of hosts
      • getNode

        @Nullable
        @Nullable uk.co.ractf.polaris.api.node.NodeInfo getNode​(java.lang.String id)
        Gets a NodeInfo by id
        Parameters:
        id - host id
        Returns:
        the host
      • setNodeInfo

        void setNodeInfo​(uk.co.ractf.polaris.api.node.NodeInfo nodeInfo)
        Sets the info for a node
        Parameters:
        nodeInfo - node info
      • getInstance

        @Nullable
        @Nullable uk.co.ractf.polaris.api.instance.Instance getInstance​(java.lang.String id)
        Gets an Instance by id
        Parameters:
        id - the instance id
        Returns:
        the instance
      • deleteInstance

        void deleteInstance​(uk.co.ractf.polaris.api.instance.Instance instance)
        Unregisters an Instance from a given Task, probably because its been descheduled
        Parameters:
        instance - the instance
      • setInstance

        void setInstance​(uk.co.ractf.polaris.api.instance.Instance instance)
        Sets the state of an instance
        Parameters:
        instance - the instance details
      • instanceExists

        boolean instanceExists​(java.lang.String id)
      • getInstancesOnNode

        @NotNull
        @NotNull java.util.Map<java.lang.String,​uk.co.ractf.polaris.api.instance.Instance> getInstancesOnNode​(java.lang.String node)
        Gets a list of Instances on a given node. Returns an empty collection if the node id is invalid.
        Parameters:
        node - node id
        Returns:
        instances on the node
      • getInstancesOfTask

        java.util.Map<java.lang.String,​uk.co.ractf.polaris.api.instance.Instance> getInstancesOfTask​(uk.co.ractf.polaris.api.namespace.NamespacedId namespacedId)
      • getInstanceIds

        java.util.List<java.lang.String> getInstanceIds()
      • getInstances

        java.util.Map<java.lang.String,​uk.co.ractf.polaris.api.instance.Instance> getInstances()
      • getInstanceCounts

        java.util.Map<uk.co.ractf.polaris.api.namespace.NamespacedId,​java.lang.Integer> getInstanceCounts()
      • getTasks

        java.util.Map<uk.co.ractf.polaris.api.namespace.NamespacedId,​uk.co.ractf.polaris.api.task.Task> getTasks()
      • getTaskIds

        java.util.List<uk.co.ractf.polaris.api.namespace.NamespacedId> getTaskIds()
      • getTasks

        java.util.Map<uk.co.ractf.polaris.api.namespace.NamespacedId,​uk.co.ractf.polaris.api.task.Task> getTasks​(java.lang.String namespace)
      • getTask

        uk.co.ractf.polaris.api.task.Task getTask​(uk.co.ractf.polaris.api.namespace.NamespacedId id)
      • setTask

        void setTask​(uk.co.ractf.polaris.api.task.Task task)
      • deleteTask

        void deleteTask​(uk.co.ractf.polaris.api.namespace.NamespacedId id)
      • lockTask

        boolean lockTask​(uk.co.ractf.polaris.api.task.Task task)
      • unlockTask

        @CanIgnoreReturnValue
        boolean unlockTask​(uk.co.ractf.polaris.api.task.Task task)
      • getNamespaces

        java.util.Map<java.lang.String,​uk.co.ractf.polaris.api.namespace.Namespace> getNamespaces()
      • getNamespace

        uk.co.ractf.polaris.api.namespace.Namespace getNamespace​(java.lang.String id)
      • setNamespace

        void setNamespace​(uk.co.ractf.polaris.api.namespace.Namespace namespace)
      • deleteNamespace

        void deleteNamespace​(java.lang.String id)
      • getCredentials

        java.util.Map<uk.co.ractf.polaris.api.namespace.NamespacedId,​uk.co.ractf.polaris.api.registry.credentials.ContainerRegistryCredentials> getCredentials()
      • getCredentials

        java.util.Map<uk.co.ractf.polaris.api.namespace.NamespacedId,​uk.co.ractf.polaris.api.registry.credentials.ContainerRegistryCredentials> getCredentials​(java.lang.String namespace)
      • getCredential

        uk.co.ractf.polaris.api.registry.credentials.ContainerRegistryCredentials getCredential​(uk.co.ractf.polaris.api.namespace.NamespacedId id)
      • setCredential

        void setCredential​(uk.co.ractf.polaris.api.registry.credentials.ContainerRegistryCredentials credential)
      • deleteCredential

        void deleteCredential​(uk.co.ractf.polaris.api.namespace.NamespacedId id)
      • getAPITokens

        java.util.Map<java.lang.String,​uk.co.ractf.polaris.api.authentication.APIToken> getAPITokens()
      • getAPIToken

        uk.co.ractf.polaris.api.authentication.APIToken getAPIToken​(java.lang.String id)
      • setAPIToken

        void setAPIToken​(uk.co.ractf.polaris.api.authentication.APIToken apiToken)
      • deleteAPIToken

        void deleteAPIToken​(java.lang.String id)
      • setNotificationReceiver

        void setNotificationReceiver​(uk.co.ractf.polaris.api.notification.NotificationReceiver receiver)
      • deleteNotificationReceiver

        void deleteNotificationReceiver​(uk.co.ractf.polaris.api.namespace.NamespacedId id)
      • getNotificationReceivers

        java.util.Map<uk.co.ractf.polaris.api.namespace.NamespacedId,​uk.co.ractf.polaris.api.notification.NotificationReceiver> getNotificationReceivers()
      • getNotificationReceivers

        java.util.Map<uk.co.ractf.polaris.api.namespace.NamespacedId,​uk.co.ractf.polaris.api.notification.NotificationReceiver> getNotificationReceivers​(java.lang.String namespace)
      • getNotificationReceiver

        uk.co.ractf.polaris.api.notification.NotificationReceiver getNotificationReceiver​(uk.co.ractf.polaris.api.namespace.NamespacedId id)