Package org.jgroups.protocols
Class SWIFT_PING.SwiftClient
- java.lang.Object
-
- org.jgroups.protocols.SWIFT_PING.SwiftClient
-
- Enclosing class:
- SWIFT_PING
protected static class SWIFT_PING.SwiftClient extends java.lang.ObjectA thread safe Swift client
-
-
Constructor Summary
Constructors Constructor Description SwiftClient(org.jgroups.protocols.SWIFT_PING.Authenticator authenticator, Log l)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidauthenticate()AuthenticatevoidcreateContainer(java.lang.String containerName)Create a container, which is equivalent to a bucketvoidcreateObject(java.lang.String containerName, java.lang.String objectName, byte[] contents)Create an object (=file)voiddeleteObject(java.lang.String containerName, java.lang.String objectName)Delete a object (=file) from the storagejava.util.List<java.lang.String>listObjects(java.lang.String containerName)List files in a folderbyte[]readObject(java.lang.String containerName, java.lang.String objectName)Read the content of a file
-
-
-
Constructor Detail
-
SwiftClient
public SwiftClient(org.jgroups.protocols.SWIFT_PING.Authenticator authenticator, Log l)Constructor- Parameters:
authenticator- Swift auth provider
-
-
Method Detail
-
authenticate
public void authenticate() throws java.lang.ExceptionAuthenticate- Throws:
java.lang.Exception
-
deleteObject
public void deleteObject(java.lang.String containerName, java.lang.String objectName) throws java.lang.ExceptionDelete a object (=file) from the storage- Parameters:
containerName- Folder nameobjectName- File name- Throws:
java.io.IOExceptionjava.lang.Exception
-
createContainer
public void createContainer(java.lang.String containerName) throws java.lang.ExceptionCreate a container, which is equivalent to a bucket- Parameters:
containerName- Name of the container- Throws:
java.io.IOExceptionjava.lang.Exception
-
createObject
public void createObject(java.lang.String containerName, java.lang.String objectName, byte[] contents) throws java.lang.ExceptionCreate an object (=file)- Parameters:
containerName- Name of the containerobjectName- Name of the filecontents- Binary content of the file- Throws:
java.io.IOExceptionjava.lang.Exception
-
readObject
public byte[] readObject(java.lang.String containerName, java.lang.String objectName) throws java.lang.ExceptionRead the content of a file- Parameters:
containerName- Name of the folderobjectName- name of the file- Returns:
- Content of the files
- Throws:
java.io.IOExceptionjava.lang.Exception
-
listObjects
public java.util.List<java.lang.String> listObjects(java.lang.String containerName) throws java.lang.ExceptionList files in a folder- Parameters:
containerName- Folder name- Returns:
- List of file names
- Throws:
java.io.IOExceptionjava.lang.Exception
-
-