Class StudioAwsS3BlobStore
- java.lang.Object
-
- org.craftercms.commons.file.blob.impl.AbstractBlobStore<org.craftercms.commons.config.profiles.aws.S3Profile>
-
- org.craftercms.commons.file.blob.impl.s3.AwsS3BlobStore
-
- org.craftercms.studio.impl.v2.repository.blob.s3.StudioAwsS3BlobStore
-
- All Implemented Interfaces:
org.craftercms.commons.file.blob.BlobStore
,ContentRepository
,StudioBlobStore
,StudioBlobStoreAdapter
,ContentRepository
public class StudioAwsS3BlobStore extends org.craftercms.commons.file.blob.impl.s3.AwsS3BlobStore implements StudioBlobStoreAdapter
Implementation ofStudioBlobStore
for AWS S3- Since:
- 3.1.6
- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description static String
OK
protected ServicesConfig
servicesConfig
-
Constructor Summary
Constructors Constructor Description StudioAwsS3BlobStore(ServicesConfig servicesConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelPublishAll(String siteId, String publishingTarget)
Performs the cleanup after a failed publish all operation for the given site & targetvoid
checkContentExists(String site, String path)
Checks if a content exists at a given path and throw an exception if it does not.void
completePublishAll(String siteId, String publishingTarget, RepositoryChanges changes, String comment)
Performs the actual publish of all changes for the given site & targetboolean
contentExists(String site, String path)
Determine if content exists in the repository at a given pathString
copyContent(String site, String fromPath, String toPath)
copy content from PathA to pathBString
createFolder(String site, String path, String name)
create a folderString
deleteContent(String site, String path, String approver)
delete contentInputStream
getContent(String site, String path)
get document from wcm contentlong
getContentSize(String site, String path)
get file sizeprotected String
getFullKey(org.craftercms.commons.file.blob.impl.AbstractBlobStore.Mapping mapping, String path)
org.craftercms.commons.file.blob.Blob
getReference(String path)
Return a reference to a file in the storevoid
initialPublish(String siteId)
Execute initial publish for given siteprotected boolean
isFolder(String path)
Map<String,String>
moveContent(String site, String fromPath, String toPath, String newName)
move content from PathA to pathBvoid
populateGitLog(String siteId)
Populates the full git log of the sandbox repository into the databaseRepositoryChanges
preparePublishAll(String siteId, String publishingTarget)
Prepares the repository to publish all changes for the given site & targetvoid
publish(String site, String sandboxBranch, List<DeploymentItemTO> deploymentItems, String environment, String author, String comment)
Publish content to specified environment.RepositoryChanges
publishAll(String siteId, String publishingTarget, String comment)
Publishes all changes for the given site & targetboolean
shallowContentExists(String site, String path)
This is a faster, but less accurate, version of contentExists.String
writeContent(String site, String path, InputStream content)
write content-
Methods inherited from class org.craftercms.commons.file.blob.impl.s3.AwsS3BlobStore
doGetContent, doInit, getClient, getKey, setClientFactory
-
Methods inherited from class org.craftercms.commons.file.blob.impl.AbstractBlobStore
getId, getMapping, getResource, init, isCompatible, setId, setPattern, setProfileMapper, setPublishingTargetResolver
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.craftercms.commons.file.blob.BlobStore
getId, getResource, init, isCompatible
-
Methods inherited from interface org.craftercms.studio.api.v1.repository.ContentRepository
moveContent
-
Methods inherited from interface org.craftercms.studio.api.v2.repository.blob.StudioBlobStoreAdapter
addRemote, cleanupRepositories, commitIdExists, commitIdExists, countUnprocessedCommits, createSiteCloneRemote, createSiteFromBlueprint, createVersion, createVersion, deleteGitLogForSite, deleteSite, getChangeSetPathsFromDelta, getContentByCommitId, getContentChildren, getContentVersionHistory, getEditCommitIds, getGitLog, getItem, getItemEnvironmentProperties, getLastEditCommitId, getOperations, getOperationsFromDelta, getPreviousCommitId, getPublishingHistory, getRepoFirstCommitId, getRepoLastCommitId, getSubtreeItems, getUnauditedCommits, getUnprocessedCommits, initialPublish, insertFullGitLog, insertGitLog, insertGitLog, isFolder, itemUnlock, listRemote, lockItem, lockItemForPublishing, markGitLogAudited, markGitLogProcessedBeforeMarker, markGitLogVerifiedProcessed, markGitLogVerifiedProcessedBulk, publishedRepositoryExists, pullFromRemote, pushToRemote, reloadRepository, removeRemote, removeRemoteRepositoriesForSite, repositoryExists, resetStagingRepository, revertContent, unLockItem, unLockItemForPublishing, updateGitlog, upsertGitLogList
-
-
-
-
Field Detail
-
OK
public static final String OK
- See Also:
- Constant Field Values
-
servicesConfig
protected ServicesConfig servicesConfig
-
-
Constructor Detail
-
StudioAwsS3BlobStore
public StudioAwsS3BlobStore(ServicesConfig servicesConfig)
-
-
Method Detail
-
isFolder
protected boolean isFolder(String path)
-
getFullKey
protected String getFullKey(org.craftercms.commons.file.blob.impl.AbstractBlobStore.Mapping mapping, String path)
-
getReference
public org.craftercms.commons.file.blob.Blob getReference(String path)
Description copied from interface:StudioBlobStore
Return a reference to a file in the store- Specified by:
getReference
in interfaceStudioBlobStore
- Parameters:
path
- the path of the file- Returns:
- the blob object
-
contentExists
public boolean contentExists(String site, String path)
Description copied from interface:ContentRepository
Determine if content exists in the repository at a given path- Specified by:
contentExists
in interfaceContentRepository
- Specified by:
contentExists
in interfaceContentRepository
- Parameters:
site
- site id where the operation will be executedpath
- path to check if content exists- Returns:
- true if site has content object at path
-
checkContentExists
public void checkContentExists(String site, String path) throws ServiceLayerException
Description copied from interface:ContentRepository
Checks if a content exists at a given path and throw an exception if it does not.- Specified by:
checkContentExists
in interfaceContentRepository
- Parameters:
site
- id of the sitepath
- the content path- Throws:
ServiceLayerException
- if no content is found at the given path
-
shallowContentExists
public boolean shallowContentExists(String site, String path)
Description copied from interface:ContentRepository
This is a faster, but less accurate, version of contentExists. This prioritizes performance over checking the actual underlying repository if the content is actually in the store or we simply hold a reference to the object in the actual store.- Specified by:
shallowContentExists
in interfaceContentRepository
- Returns:
- true if site has content object at path
-
getContent
public InputStream getContent(String site, String path)
Description copied from interface:ContentRepository
get document from wcm content- Specified by:
getContent
in interfaceContentRepository
- Parameters:
site
- site id where the operation will be executedpath
- path of the content- Returns:
- document
-
getContentSize
public long getContentSize(String site, String path)
Description copied from interface:ContentRepository
get file size- Specified by:
getContentSize
in interfaceContentRepository
- Parameters:
site
- site id where the operation will be executedpath
- path to content- Returns:
- Size in bytes
-
writeContent
public String writeContent(String site, String path, InputStream content)
Description copied from interface:ContentRepository
write content- Specified by:
writeContent
in interfaceContentRepository
- Parameters:
site
- site id where the operation will be executedpath
- path to contentcontent
- stream of content to write- Returns:
- Commit Id if successful, null otherwise
-
createFolder
public String createFolder(String site, String path, String name)
Description copied from interface:ContentRepository
create a folder- Specified by:
createFolder
in interfaceContentRepository
- Parameters:
site
- site id where the operation will be executedpath
- path to create a folder inname
- a folder name to create- Returns:
- Commit Id if successful, null otherwise
-
deleteContent
public String deleteContent(String site, String path, String approver)
Description copied from interface:ContentRepository
delete content- Specified by:
deleteContent
in interfaceContentRepository
- Parameters:
site
- site id where the operation will be executedpath
- path to contentapprover
- user that approves delete content- Returns:
- Commit ID if successful, null otherwise
-
moveContent
public Map<String,String> moveContent(String site, String fromPath, String toPath, String newName)
Description copied from interface:ContentRepository
move content from PathA to pathB- Specified by:
moveContent
in interfaceContentRepository
- Parameters:
site
- site id where the operation will be executedfromPath
- source contenttoPath
- target pathnewName
- new file name for rename- Returns:
- Commit ID if successful, empty string otherwise
-
copyContent
public String copyContent(String site, String fromPath, String toPath)
Description copied from interface:ContentRepository
copy content from PathA to pathB- Specified by:
copyContent
in interfaceContentRepository
- Parameters:
site
- site id where the operation will be executedfromPath
- paths to contenttoPath
- target path- Returns:
- Commit ID if successful, empty string otherwise
-
publish
public void publish(String site, String sandboxBranch, List<DeploymentItemTO> deploymentItems, String environment, String author, String comment)
Description copied from interface:ContentRepository
Publish content to specified environment.- Specified by:
publish
in interfaceContentRepository
- Parameters:
site
- site identifiersandboxBranch
- sandbox branch namedeploymentItems
- items to be publishedenvironment
- environment to publish toauthor
- authorcomment
- submission comment
-
initialPublish
public void initialPublish(String siteId)
Description copied from interface:ContentRepository
Execute initial publish for given site- Specified by:
initialPublish
in interfaceContentRepository
- Parameters:
siteId
- site identifier
-
publishAll
public RepositoryChanges publishAll(String siteId, String publishingTarget, String comment)
Description copied from interface:ContentRepository
Publishes all changes for the given site & target- Specified by:
publishAll
in interfaceContentRepository
- Parameters:
siteId
- the id of the sitepublishingTarget
- the publishing targetcomment
- submission comment
-
preparePublishAll
public RepositoryChanges preparePublishAll(String siteId, String publishingTarget)
Description copied from interface:ContentRepository
Prepares the repository to publish all changes for the given site & target- Specified by:
preparePublishAll
in interfaceContentRepository
- Parameters:
siteId
- the id of the sitepublishingTarget
- the publishing target- Returns:
- the set of changed files
-
completePublishAll
public void completePublishAll(String siteId, String publishingTarget, RepositoryChanges changes, String comment)
Description copied from interface:ContentRepository
Performs the actual publish of all changes for the given site & target- Specified by:
completePublishAll
in interfaceContentRepository
- Parameters:
siteId
- the id of the sitepublishingTarget
- the publishing targetchanges
- the set of changed filescomment
- submission comment
-
cancelPublishAll
public void cancelPublishAll(String siteId, String publishingTarget)
Description copied from interface:ContentRepository
Performs the cleanup after a failed publish all operation for the given site & target- Specified by:
cancelPublishAll
in interfaceContentRepository
- Parameters:
siteId
- the id of the sitepublishingTarget
- the publishing target
-
populateGitLog
public void populateGitLog(String siteId)
Description copied from interface:ContentRepository
Populates the full git log of the sandbox repository into the database- Specified by:
populateGitLog
in interfaceContentRepository
- Parameters:
siteId
- the id of the site
-
-