Class RACKSPACE_PING.RackspaceClient

  • Enclosing class:
    RACKSPACE_PING

    protected static class RACKSPACE_PING.RackspaceClient
    extends java.lang.Object
    A thread safe Rackspace ReST client
    • Constructor Summary

      Constructors 
      Constructor Description
      RackspaceClient​(java.net.URL apiEndpoint, java.lang.String username, java.lang.String apiKey)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void authenticate()
      Authenticate
      void createContainer​(java.lang.String containerName)
      Create a container, which is equivalent to a bucket
      void createObject​(java.lang.String containerName, java.lang.String objectName, byte[] contents)
      Create an object (=file)
      void deleteObject​(java.lang.String containerName, java.lang.String objectName)
      Delete a object (=file) from the storage
      java.util.List<java.lang.String> listObjects​(java.lang.String containerName)
      List files in a folder
      byte[] readObject​(java.lang.String containerName, java.lang.String objectName)
      Read the content of a file
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RackspaceClient

        public RackspaceClient​(java.net.URL apiEndpoint,
                               java.lang.String username,
                               java.lang.String apiKey)
        Constructor
        Parameters:
        apiEndpoint - UK or US authentication endpoint
        username - Rackspace username
        apiKey - Rackspace apiKey
    • Method Detail

      • authenticate

        public void authenticate()
        Authenticate
      • deleteObject

        public void deleteObject​(java.lang.String containerName,
                                 java.lang.String objectName)
        Delete a object (=file) from the storage
        Parameters:
        containerName - Folder name
        objectName - File name
      • createContainer

        public void createContainer​(java.lang.String containerName)
        Create a container, which is equivalent to a bucket
        Parameters:
        containerName - Name of the container
      • createObject

        public void createObject​(java.lang.String containerName,
                                 java.lang.String objectName,
                                 byte[] contents)
        Create an object (=file)
        Parameters:
        containerName - Name of the container
        objectName - Name of the file
        contents - Binary content of the file
      • readObject

        public byte[] readObject​(java.lang.String containerName,
                                 java.lang.String objectName)
        Read the content of a file
        Parameters:
        containerName - Name of the folder
        objectName - name of the file
        Returns:
        Content of the files
      • listObjects

        public java.util.List<java.lang.String> listObjects​(java.lang.String containerName)
        List files in a folder
        Parameters:
        containerName - Folder name
        Returns:
        List of file names