org.jgroups.protocols
Class SWIFT_PING.SwiftClient

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

protected static class SWIFT_PING.SwiftClient
extends java.lang.Object

A thread safe Swift client


Constructor Summary
SWIFT_PING.SwiftClient(org.jgroups.protocols.SWIFT_PING.Authenticator authenticator)
          Constructor
 
Method Summary
 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

SWIFT_PING.SwiftClient

public SWIFT_PING.SwiftClient(org.jgroups.protocols.SWIFT_PING.Authenticator authenticator)
Constructor

Parameters:
authenticator - Swift auth provider
Method Detail

authenticate

public void authenticate()
                  throws java.lang.Exception
Authenticate

Throws:
java.lang.Exception

deleteObject

public void deleteObject(java.lang.String containerName,
                         java.lang.String objectName)
                  throws java.lang.Exception
Delete a object (=file) from the storage

Parameters:
containerName - Folder name
objectName - File name
Throws:
java.io.IOException
java.lang.Exception

createContainer

public void createContainer(java.lang.String containerName)
                     throws java.lang.Exception
Create a container, which is equivalent to a bucket

Parameters:
containerName - Name of the container
Throws:
java.io.IOException
java.lang.Exception

createObject

public void createObject(java.lang.String containerName,
                         java.lang.String objectName,
                         byte[] contents)
                  throws java.lang.Exception
Create an object (=file)

Parameters:
containerName - Name of the container
objectName - Name of the file
contents - Binary content of the file
Throws:
java.io.IOException
java.lang.Exception

readObject

public byte[] readObject(java.lang.String containerName,
                         java.lang.String objectName)
                  throws java.lang.Exception
Read the content of a file

Parameters:
containerName - Name of the folder
objectName - name of the file
Returns:
Content of the files
Throws:
java.io.IOException
java.lang.Exception

listObjects

public java.util.List<java.lang.String> listObjects(java.lang.String containerName)
                                             throws java.lang.Exception
List files in a folder

Parameters:
containerName - Folder name
Returns:
List of file names
Throws:
java.io.IOException
java.lang.Exception


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.