Package org.openstack4j.api.storage
Interface ObjectStorageObjectService
-
- All Superinterfaces:
RestService
- All Known Implementing Classes:
ObjectStorageObjectServiceImpl
public interface ObjectStorageObjectService extends RestService
A service responsible for maintaining directory and file objects within containers for an Object Service within OpenStack- Author:
- Jeremy Unruh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringcopy(ObjectLocation source, ObjectLocation dest)Copies an object to another object in the object storeActionResponsedelete(String containerName, String name)Deletes an Object from the specified containerActionResponsedelete(ObjectLocation location)Deletes an Object from the specified containerActionResponsedelete(ObjectLocation location, ObjectDeleteOptions options)Deletes an Object from the specified containerDLPayloaddownload(String containerName, String name)Retrieves the Payload for the data backing the givencontainerNameandnameDLPayloaddownload(String containerName, String name, DownloadOptions options)Retrieves the Payload for the data backing the givencontainerNameandnameDLPayloaddownload(ObjectLocation location, DownloadOptions options)Retrieves the Payload for the data backing the givenlocationSwiftObjectget(String containerName, String name)Gets the specified object based on thecontainerNameandnameof the objectSwiftObjectget(ObjectLocation location)Gets the specified object based on the ObjectLocationlocationMap<String,String>getMetadata(String containerName, String name)Map<String,String>getMetadata(ObjectLocation location)Gets the metadata for the specified object locationList<? extends SwiftObject>list(String containerName)Lists all objects for the given container nameList<? extends SwiftObject>list(String containerName, ObjectListOptions options)Lists all objects for the given container name and list optionsStringput(String containerName, String name, Payload<?> payload)Adds/Updates a file to the specified containerStringput(String containerName, String name, Payload<?> payload, ObjectPutOptions options)Adds/Updates a file to the specified containerbooleanupdateMetadata(ObjectLocation location, Map<String,String> metadata)Creates or Updates the given metadata for the specified object location
-
-
-
Method Detail
-
list
List<? extends SwiftObject> list(String containerName)
Lists all objects for the given container name- Parameters:
containerName- the container name- Returns:
- List of File objects including Directories
-
list
List<? extends SwiftObject> list(String containerName, ObjectListOptions options)
Lists all objects for the given container name and list options- Parameters:
containerName- the container nameoptions- additional filter based options- Returns:
- List of File objects including Directories
-
get
SwiftObject get(ObjectLocation location)
Gets the specified object based on the ObjectLocationlocation- Parameters:
location- the object location- Returns:
- SwiftObject or null if not found
-
get
SwiftObject get(String containerName, String name)
Gets the specified object based on thecontainerNameandnameof the object- Parameters:
containerName- the objects container namename- the name of the object- Returns:
- SwiftObject or null if not found
-
put
String put(String containerName, String name, Payload<?> payload)
Adds/Updates a file to the specified container- Parameters:
containerName- the container namename- the name of the filepayload- the file payload- Returns:
- the ETAG checksum
-
put
String put(String containerName, String name, Payload<?> payload, ObjectPutOptions options)
Adds/Updates a file to the specified container- Parameters:
containerName- the container namename- the name of the filepayload- the file payloadoptions- extended options to associate with this object- Returns:
- the ETAG checksum
-
download
DLPayload download(String containerName, String name)
Retrieves the Payload for the data backing the givencontainerNameandname- Parameters:
containerName- the container namename- the object name- Returns:
- the download payload
-
download
DLPayload download(String containerName, String name, DownloadOptions options)
Retrieves the Payload for the data backing the givencontainerNameandname- Parameters:
containerName- the container namename- the object nameoptions- the download options- Returns:
- the download payload
-
download
DLPayload download(ObjectLocation location, DownloadOptions options)
Retrieves the Payload for the data backing the givenlocation- Parameters:
location- the object locationoptions- the download options- Returns:
- the download payload
-
delete
ActionResponse delete(String containerName, String name)
Deletes an Object from the specified container- Parameters:
containerName- the container namename- the name of the object (full path if directories are used)- Returns:
- the action response
-
delete
ActionResponse delete(ObjectLocation location)
Deletes an Object from the specified container- Parameters:
location- location containing container name and object name- Returns:
- the action response
-
delete
ActionResponse delete(ObjectLocation location, ObjectDeleteOptions options)
Deletes an Object from the specified container- Parameters:
location- location containing container name and object nameoptions- the deleting options- Returns:
- the action response
-
copy
String copy(ObjectLocation source, ObjectLocation dest)
Copies an object to another object in the object store- Parameters:
source- the source container and object namedest- the destination container and object name- Returns:
- the ETAG checksum if successful
-
getMetadata
Map<String,String> getMetadata(ObjectLocation location)
Gets the metadata for the specified object location- Parameters:
location- the object location- Returns:
- Map of Key to Value metadata
-
getMetadata
Map<String,String> getMetadata(String containerName, String name)
- Parameters:
containerName- the container namename- the object name- Returns:
- Map of Key to Value metadata
-
updateMetadata
boolean updateMetadata(ObjectLocation location, Map<String,String> metadata)
Creates or Updates the given metadata for the specified object location- Parameters:
location- the location of the object to create/update metadatametadata- the metadata- Returns:
- true if successful
-
-