Interface Admin

  • All Known Implementing Classes:
    DatabaseAdmin, UpdateableAdminData

    public interface Admin
    The interface for the administration of the storage. This can be either a data file or a database.
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      void addEntry​(java.lang.String filename, StoreMessage msg, java.lang.String checksum)
      Method for adding an entry for administration.
      void close()
      Close and cleanup of this class.
      java.util.Set<java.lang.String> getAllFileNames()
      Retrieves a set of the names for all the known files.
      java.util.Set<java.lang.String> getAllFileNames​(Replica rep, ReplicaStoreState state)
      Retrieves a set with the name of the files with a specific ReplicaStoreState in a specific replica.
      java.lang.String getCheckSum​(java.lang.String filename)
      Retrieves the checksum of a given file.
      ReplicaStoreState getState​(java.lang.String filename, java.lang.String replicaChannelName)
      Returns the ReplicaStoreState of a given file in a specific replica.
      boolean hasEntry​(java.lang.String filename)
      Method for telling whether a file entry exists.
      boolean hasReplyInfo​(java.lang.String filename)
      Determines whether the StoreMessage of a given file exists.
      boolean hasState​(java.lang.String filename, java.lang.String repChannelId)
      Determines whether a given file in a specific replica has a valid store state.
      StoreMessage removeReplyInfo​(java.lang.String filename)
      Retrieves the StoreMessage of a specific file.
      void setCheckSum​(java.lang.String filename, java.lang.String checksum)
      Deprecated.
      It should not be change the checksum through Admin.
      void setReplyInfo​(java.lang.String filename, StoreMessage msg)
      Assign a StoreMessage to a specific file.
      void setState​(java.lang.String filename, java.lang.String repChannelId, ReplicaStoreState state)
      Sets the store state of an entry to a specific value.
    • Method Detail

      • hasEntry

        boolean hasEntry​(java.lang.String filename)
        Method for telling whether a file entry exists.
        Parameters:
        filename - The name of the file, the existence of whose entry is to be determined.
        Returns:
        Whether the entry exists.
      • addEntry

        void addEntry​(java.lang.String filename,
                      StoreMessage msg,
                      java.lang.String checksum)
        Method for adding an entry for administration.
        Parameters:
        filename - The name of the file to be stored.
        msg - The StoreMessage of the entry.
        checksum - The checksum of the entry.
      • getCheckSum

        java.lang.String getCheckSum​(java.lang.String filename)
        Retrieves the checksum of a given file.
        Parameters:
        filename - The name of the file, whose checksum should be retrieved.
        Returns:
        The checksum of the file.
      • setCheckSum

        void setCheckSum​(java.lang.String filename,
                         java.lang.String checksum)
        Deprecated.
        It should not be change the checksum through Admin. Only by voting through the bitpreservation interface should it be possible.
        Sets the checksum of a given file. TODO Should it really be possible to change the checksum through arcrepository?
        Parameters:
        filename - The name of the file to have the checksum changed.
        checksum - The new checksum for the file.
      • hasReplyInfo

        boolean hasReplyInfo​(java.lang.String filename)
        Determines whether the StoreMessage of a given file exists.
        Parameters:
        filename - The name of the file to which the existence of the StoreMessage should be determined.
        Returns:
        Whether the StoreMessage of the file exists.
      • setReplyInfo

        void setReplyInfo​(java.lang.String filename,
                          StoreMessage msg)
        Assign a StoreMessage to a specific file.
        Parameters:
        filename - The name of the file to have a StoreMessage assigned.
        msg - The StoreMessage to be assigned to a file.
      • removeReplyInfo

        StoreMessage removeReplyInfo​(java.lang.String filename)
        Retrieves the StoreMessage of a specific file.
        Parameters:
        filename - The name of the file whose StoreMessage should be retrieved.
        Returns:
        The StoreMessage corresponding to the file.
      • getState

        ReplicaStoreState getState​(java.lang.String filename,
                                   java.lang.String replicaChannelName)
        Returns the ReplicaStoreState of a given file in a specific replica.
        Parameters:
        filename - The name of the file for the ReplicaStoreState.
        replicaChannelName - The name of the identification channel for the replica of for the ReplicaStoreState.
        Returns:
        The ReplicaStoreState of a given file in a specific replica.
      • hasState

        boolean hasState​(java.lang.String filename,
                         java.lang.String repChannelId)
        Determines whether a given file in a specific replica has a valid store state.
        Parameters:
        filename - The name of the file for the ReplicaStoreState.
        repChannelId - The identification channel of the replica for the ReplicaStoreState.
        Returns:
        Whether a given file in a specific replica has a valid store state.
      • setState

        void setState​(java.lang.String filename,
                      java.lang.String repChannelId,
                      ReplicaStoreState state)
        Sets the store state of an entry to a specific value.
        Parameters:
        filename - The name of the file for the entry.
        repChannelId - The identification channel of the replica for the entry.
        state - The new state for the entry.
      • getAllFileNames

        java.util.Set<java.lang.String> getAllFileNames()
        Retrieves a set of the names for all the known files.
        Returns:
        A set of the names for all the known file.
      • getAllFileNames

        java.util.Set<java.lang.String> getAllFileNames​(Replica rep,
                                                        ReplicaStoreState state)
        Retrieves a set with the name of the files with a specific ReplicaStoreState in a specific replica.
        Parameters:
        rep - The replica where the files belong.
        state - The ReplicaStoreState for the files.
        Returns:
        A set with the names of the files with a specific ReplicaStoreState in a specific replica.
      • close

        void close()
        Close and cleanup of this class.