public abstract class OpenStackStorageProvider extends StorageProviderBase
StorageProviderBase.SpaceDeleteWorker
ACL_DELIM, ACL_GROUP_READ, ACL_GROUP_WRITE, ACL_USER_READ, ACL_USER_WRITE
DEFAULT_MAX_RESULTS, DEFAULT_MIMETYPE, ISO8601_DATE_FORMAT, PROPERTIES_CONTENT_CHECKSUM, PROPERTIES_CONTENT_CREATOR, PROPERTIES_CONTENT_FILE_CREATED, PROPERTIES_CONTENT_FILE_LAST_ACCESSED, PROPERTIES_CONTENT_FILE_MODIFIED, PROPERTIES_CONTENT_FILE_PATH, PROPERTIES_CONTENT_MD5, PROPERTIES_CONTENT_MIMETYPE, PROPERTIES_CONTENT_MODIFIED, PROPERTIES_CONTENT_SIZE, PROPERTIES_COPY_SOURCE, PROPERTIES_COPY_SOURCE_STORE, PROPERTIES_SPACE_ACL, PROPERTIES_SPACE_ACL_GROUP, PROPERTIES_SPACE_ACL_PUBLIC, PROPERTIES_SPACE_COUNT, PROPERTIES_SPACE_CREATED, PROPERTIES_SPACE_SIZE, PROPERTIES_STREAMING_HOST
Constructor and Description |
---|
OpenStackStorageProvider(String username,
String apiAccessKey) |
OpenStackStorageProvider(String username,
String apiAccessKey,
String authUrl) |
OpenStackStorageProvider(org.jclouds.openstack.swift.SwiftClient swiftClient) |
Modifier and Type | Method and Description |
---|---|
String |
addContent(String spaceId,
String contentId,
String contentMimeType,
Map<String,String> userProperties,
long contentSize,
String contentChecksum,
InputStream content)
Adds content to a space.
|
String |
copyContent(String sourceSpaceId,
String sourceContentId,
String destSpaceId,
String destContentId)
This method copies the content item found in source-space with the id of
source-content-id into the dest-space, naming it to dest-content-id.
|
void |
createSpace(String spaceId)
Creates a new space.
|
protected com.google.common.util.concurrent.ListeningExecutorService |
createThreadPool() |
void |
deleteContent(String spaceId,
String contentId)
Removes content from a space.
|
protected void |
doSetSpaceProperties(String spaceId,
Map<String,String> spaceProperties) |
protected Map<String,String> |
getAllSpaceProperties(String spaceId) |
abstract String |
getAuthUrl() |
protected String |
getContainerName(String spaceId)
Converts a provided space ID into a valid Rackspace container name.
|
InputStream |
getContent(String spaceId,
String contentId)
Gets content from a space.
|
Map<String,String> |
getContentProperties(String spaceId,
String contentId)
Retrieves the properties associated with content.
|
abstract String |
getProviderName() |
Iterator<String> |
getSpaceContents(String spaceId,
String prefix)
Provides access to the content files within a space.
|
List<String> |
getSpaceContentsChunked(String spaceId,
String prefix,
long maxResults,
String marker)
Provides a listing of the content files within a space.
|
protected String |
getSpaceFree(String name)
Replaces all spaces with "%20"
|
Iterator<String> |
getSpaces()
Provides a listing of all spaces owned by a customer.
|
protected String |
getWithSpace(String name)
Converts "%20" back to spaces
|
void |
removeSpace(String spaceId) |
static String |
sanitizeForURI(String str)
Encode any unicode characters that will cause us problems.
|
void |
setContentProperties(String spaceId,
String contentId,
Map<String,String> contentProperties)
Sets the properties associated with content.
|
protected boolean |
spaceExists(String spaceId) |
deleteSpace, deleteSpaceSync, getSpaceACLs, getSpaceDeleteWorker, getSpaceProperties, packACLs, removeCalculatedProperties, setNewSpaceProperties, setSpaceACLs, setWrappedStorageProvider, throwIfSpaceExists, throwIfSpaceNotExist, throwIfSpaceNotExist, unpackACLs
public OpenStackStorageProvider(String username, String apiAccessKey, String authUrl)
public OpenStackStorageProvider(org.jclouds.openstack.swift.SwiftClient swiftClient)
protected com.google.common.util.concurrent.ListeningExecutorService createThreadPool()
public abstract String getAuthUrl()
public abstract String getProviderName()
public Iterator<String> getSpaces()
public Iterator<String> getSpaceContents(String spaceId, String prefix)
spaceId
- - ID of the spaceprefix
- - The prefix of the content id (null for no constraints)public List<String> getSpaceContentsChunked(String spaceId, String prefix, long maxResults, String marker)
spaceId
- - ID of the spaceprefix
- - Only retrieve content IDs with this prefix (null for all content ids)maxResults
- - The maximum number of content IDs to return in the list (0 indicates default (1000))marker
- - The content ID marking the last item in the previous set (null indicates the first set of ids)protected boolean spaceExists(String spaceId)
spaceExists
in class StorageProviderBase
public void createSpace(String spaceId)
spaceId
- - ID of the spaceprotected void doSetSpaceProperties(String spaceId, Map<String,String> spaceProperties)
doSetSpaceProperties
in class StorageProviderBase
public void removeSpace(String spaceId)
removeSpace
in class StorageProviderBase
protected Map<String,String> getAllSpaceProperties(String spaceId)
getAllSpaceProperties
in class StorageProviderBase
public String addContent(String spaceId, String contentId, String contentMimeType, Map<String,String> userProperties, long contentSize, String contentChecksum, InputStream content)
spaceId
- - ID of the spacecontentId
- - ID of the content in the spacecontentMimeType
- - the MIME type of the content being addeduserProperties
- - the metadata associated with the contentcontentSize
- - the file size (in bytes) of the content being addedcontentChecksum
- - the MD5 checksum of the content being added (null if no checksum is known)content
- - content to addpublic String copyContent(String sourceSpaceId, String sourceContentId, String destSpaceId, String destContentId)
StorageProvider
sourceSpaceId
- of content to copysourceContentId
- of content to copydestSpaceId
- where copied content will end updestContentId
- given to copied contentpublic InputStream getContent(String spaceId, String contentId)
spaceId
- - ID of the spacecontentId
- - ID of the content in the spacepublic void deleteContent(String spaceId, String contentId)
spaceId
- - ID of the spacecontentId
- - ID of the content in the spacepublic void setContentProperties(String spaceId, String contentId, Map<String,String> contentProperties)
spaceId
- - ID of the spacecontentId
- - ID of the content in the spacecontentProperties
- - new content propertiespublic Map<String,String> getContentProperties(String spaceId, String contentId)
spaceId
- - ID of the spacecontentId
- - ID of the content in the spaceprotected String getContainerName(String spaceId)
spaceId
- user preferred ID of the spacepublic static String sanitizeForURI(String str)
str
- protected String getSpaceFree(String name)
name
- string with possible spaceCopyright © 2009–2014 DuraSpace. All rights reserved.