Interface RequestAPI


  • public interface RequestAPI
    This defines the server request API. The commands below are the requests that can be issued against the server.
    • Method Detail

      • handleRequests

        void handleRequests​(NetworkRequest request)
                     throws java.lang.InterruptedException
        Handle a request.
        Parameters:
        request - The request to handle.
        Throws:
        java.lang.InterruptedException - if request processing is interrupted.
      • handlePutRequest

        void handlePutRequest​(NetworkRequest request)
                       throws java.io.IOException,
                              java.lang.InterruptedException
        Puts a blob into the store. It accepts a blob property, user metadata and the blob as a stream and stores them.
        Parameters:
        request - The request that contains the blob property, user metadata and blob as a stream.
        Throws:
        java.io.IOException - if there are I/O errors carrying our the required operation.
        java.lang.InterruptedException - if request processing is interrupted.
      • handleGetRequest

        void handleGetRequest​(NetworkRequest request)
                       throws java.io.IOException,
                              java.lang.InterruptedException
        Gets blob property, user metadata or the blob from the specified partition.
        Parameters:
        request - The request that contains the partition and id of the blob whose blob property, user metadata or blob needs to be returned.
        Throws:
        java.io.IOException - if there are I/O errors carrying our the required operation.
        java.lang.InterruptedException - if request processing is interrupted.
      • handleDeleteRequest

        void handleDeleteRequest​(NetworkRequest request)
                          throws java.io.IOException,
                                 java.lang.InterruptedException
        Deletes the blob from the store.
        Parameters:
        request - The request that contains the partition and id of the blob that needs to be deleted.
        Throws:
        java.io.IOException - if there are I/O errors carrying our the required operation.
        java.lang.InterruptedException - if request processing is interrupted.
      • handleTtlUpdateRequest

        void handleTtlUpdateRequest​(NetworkRequest request)
                             throws java.io.IOException,
                                    java.lang.InterruptedException
        Updates the TTL of a blob as required in request.
        Parameters:
        request - The request that contains the partition and id of the blob that needs to be updated.
        Throws:
        java.io.IOException - if there are I/O errors carrying our the required operation.
        java.lang.InterruptedException - if request processing is interrupted.
      • handleReplicaMetadataRequest

        void handleReplicaMetadataRequest​(NetworkRequest request)
                                   throws java.io.IOException,
                                          java.lang.InterruptedException
        Gets the metadata required for replication.
        Parameters:
        request - The request that contains the partition for which the metadata is needed.
        Throws:
        java.io.IOException - if there are I/O errors carrying our the required operation.
        java.lang.InterruptedException - if request processing is interrupted.
      • handleAdminRequest

        default void handleAdminRequest​(NetworkRequest request)
                                 throws java.lang.InterruptedException,
                                        java.io.IOException
        Handles an administration request. These requests can query for or change the internal state of the server.
        Parameters:
        request - the request that needs to be handled.
        Throws:
        java.io.IOException - if there are I/O errors carrying our the required operation.
        java.lang.InterruptedException - if request processing is interrupted.
      • handleUndeleteRequest

        default void handleUndeleteRequest​(NetworkRequest request)
                                    throws java.lang.InterruptedException,
                                           java.io.IOException
        Undelete the blob from the store.
        Parameters:
        request - the request that contains the partition and the id of the blob that needs to be undeleted.
        Throws:
        java.io.IOException - if there are I/O errors carrying our the required operation.
        java.lang.InterruptedException - if request processing is interrupted.