Class SWIFT_PING.SwiftClient

java.lang.Object
org.jgroups.protocols.SWIFT_PING.SwiftClient
Enclosing class:
SWIFT_PING

protected static class SWIFT_PING.SwiftClient extends Object
A thread safe Swift client
  • Field Details

  • Constructor Details

    • SwiftClient

      public SwiftClient(SWIFT_PING.Authenticator authenticator, Log l)
      Constructor
      Parameters:
      authenticator - Swift auth provider
  • Method Details

    • authenticate

      public void authenticate() throws Exception
      Authenticate
      Throws:
      Exception
    • deleteObject

      public void deleteObject(String containerName, String objectName) throws Exception
      Delete a object (=file) from the storage
      Parameters:
      containerName - Folder name
      objectName - File name
      Throws:
      IOException
      Exception
    • createContainer

      public void createContainer(String containerName) throws Exception
      Create a container, which is equivalent to a bucket
      Parameters:
      containerName - Name of the container
      Throws:
      IOException
      Exception
    • createObject

      public void createObject(String containerName, String objectName, byte[] contents) throws Exception
      Create an object (=file)
      Parameters:
      containerName - Name of the container
      objectName - Name of the file
      contents - Binary content of the file
      Throws:
      IOException
      Exception
    • readObject

      public byte[] readObject(String containerName, String objectName) throws Exception
      Read the content of a file
      Parameters:
      containerName - Name of the folder
      objectName - name of the file
      Returns:
      Content of the files
      Throws:
      IOException
      Exception
    • listObjects

      public List<String> listObjects(String containerName) throws Exception
      List files in a folder
      Parameters:
      containerName - Folder name
      Returns:
      List of file names
      Throws:
      IOException
      Exception
    • getConnBuilder

      private SWIFT_PING.ConnBuilder getConnBuilder(String container, String object) throws IOException
      Throws:
      IOException