Class RepositoriesService

  • All Implemented Interfaces:
    ClusterStateApplier

    public class RepositoriesService
    extends java.lang.Object
    implements ClusterStateApplier
    Service responsible for maintaining and providing access to snapshot repositories on nodes.
    • Method Detail

      • registerRepository

        public void registerRepository​(PutRepositoryRequest request,
                                       ActionListener<ClusterStateUpdateResponse> listener)
        Registers new repository in the cluster

        This method can be only called on the master node. It tries to create a new repository on the master and if it was successful it adds new repository to cluster metadata.

        Parameters:
        request - register repository request
        listener - register repository listener
      • unregisterRepository

        public void unregisterRepository​(DeleteRepositoryRequest request,
                                         ActionListener<ClusterStateUpdateResponse> listener)
        Unregisters repository in the cluster

        This method can be only called on the master node. It removes repository information from cluster metadata.

        Parameters:
        request - unregister repository request
        listener - unregister repository listener
      • verifyRepository

        public void verifyRepository​(java.lang.String repositoryName,
                                     ActionListener<java.util.List<DiscoveryNode>> listener)
      • applyClusterState

        public void applyClusterState​(ClusterChangedEvent event)
        Checks if new repositories appeared in or disappeared from cluster metadata and updates current list of repositories accordingly.
        Specified by:
        applyClusterState in interface ClusterStateApplier
        Parameters:
        event - cluster changed event
      • repository

        public Repository repository​(java.lang.String repositoryName)
        Returns registered repository

        This method is called only on the master node

        Parameters:
        repositoryName - repository name
        Returns:
        registered repository
        Throws:
        RepositoryMissingException - if repository with such name isn't registered
      • registerInternalRepository

        public void registerInternalRepository​(java.lang.String name,
                                               java.lang.String type)
      • unregisterInternalRepository

        public void unregisterInternalRepository​(java.lang.String name)