Interface StudioBlobStoreAdapter

All Superinterfaces:
org.craftercms.commons.file.blob.BlobStore, ContentRepository, ContentRepository, StudioBlobStore
All Known Implementing Classes:
StudioAwsS3BlobStore

public interface StudioBlobStoreAdapter extends StudioBlobStore
Base class for all implementations of StudioBlobStore
Since:
3.1.6
Author:
joseross
  • Method Details

    • getContentChildren

      default RepositoryItem[] getContentChildren(String site, String path)
      Description copied from interface: ContentRepository
      get immediate children for path
      Specified by:
      getContentChildren in interface ContentRepository
      Parameters:
      site - site id where the operation will be executed
      path - path to content
      Returns:
      a list of children
    • getContentVersionHistory

      default VersionTO[] getContentVersionHistory(String site, String path)
      Description copied from interface: ContentRepository
      get the version history for an item
      Specified by:
      getContentVersionHistory in interface ContentRepository
      Parameters:
      site - - the project ID
      path - - the path of the item
      Returns:
      a list of versions
    • getContentItemHistory

      default List<ItemVersion> getContentItemHistory(String site, String path)
      Description copied from interface: ContentRepository
      Get the history of a content item.
      Note: the results of this method are not guaranteed when the path does not currently exist in the repository.
      Specified by:
      getContentItemHistory in interface ContentRepository
      Parameters:
      site - site id
      path - path of the content item
      Returns:
      list of item versions
    • createVersion

      default String createVersion(String site, String path, boolean majorVersion)
      Description copied from interface: ContentRepository
      create a version
      Specified by:
      createVersion in interface ContentRepository
      Parameters:
      site - site id where the operation will be executed
      path - location of content
      majorVersion - true if major
      Returns:
      the created version ID or null on failure
    • createVersion

      default String createVersion(String site, String path, String comment, boolean majorVersion)
      Description copied from interface: ContentRepository
      create a version
      Specified by:
      createVersion in interface ContentRepository
      Parameters:
      site - site id where the operation will be executed
      path - location of content
      comment - version history comment
      majorVersion - true if major
      Returns:
      the created version ID or null on failure
    • revertContent

      default String revertContent(String site, String path, String version, boolean major, String comment)
      Description copied from interface: ContentRepository
      revert a version (create a new version based on an old version)
      Specified by:
      revertContent in interface ContentRepository
      Parameters:
      site - site id where the operation will be executed
      path - - the path of the item to "revert"
      version - - old version ID to base to version on
      major - flag if it is major version
      comment - add comment when committing content
      Returns:
      Commit ID if successful, empty string otherwise
    • getContentByCommitId

      default Optional<org.springframework.core.io.Resource> getContentByCommitId(String site, String path, String commitId)
      Description copied from interface: ContentRepository
      return a specific version of the content
      Specified by:
      getContentByCommitId in interface ContentRepository
      Parameters:
      site - site id where the operation will be executed
      path - path of the content
      commitId - version to return
      Returns:
      the resource if available
    • lockItem

      default void lockItem(String site, String path)
      Description copied from interface: ContentRepository
      lock an item NOTE: site will be removed from this interface
      Specified by:
      lockItem in interface ContentRepository
      Parameters:
      site - site id where the operation will be executed
      path - path of the item
    • lockItemForPublishing

      default void lockItemForPublishing(String site, String path)
      Description copied from interface: ContentRepository
      lock an item NOTE: site will be removed from this interface
      Specified by:
      lockItemForPublishing in interface ContentRepository
      Parameters:
      site - site id where the operation will be executed
      path - path of the item
    • unLockItem

      default void unLockItem(String site, String path)
      Description copied from interface: ContentRepository
      unlock an item for publishing NOTE: site will be removed from this interface
      Specified by:
      unLockItem in interface ContentRepository
      Parameters:
      site - site id where the operation will be executed
      path - path of the item
    • unLockItemForPublishing

      default void unLockItemForPublishing(String site, String path)
      Description copied from interface: ContentRepository
      unlock an item for publishing NOTE: site will be removed from this interface
      Specified by:
      unLockItemForPublishing in interface ContentRepository
      Parameters:
      site - site id where the operation will be executed
      path - path of the item
    • isFolder

      default boolean isFolder(String siteId, String path)
      Description copied from interface: ContentRepository
      Check if content at given path is folder
      Specified by:
      isFolder in interface ContentRepository
      Parameters:
      siteId - site identifier
      path - content path
      Returns:
      true if path is folder, otherwise false
    • createSiteFromBlueprint

      default boolean createSiteFromBlueprint(String blueprintLocation, String siteId, String sandboxBranch, Map<String,String> params, String creator)
      Description copied from interface: ContentRepository
      Create a new site based on a blueprint
      Specified by:
      createSiteFromBlueprint in interface ContentRepository
      Parameters:
      blueprintLocation - blueprint location
      siteId - site identifier
      sandboxBranch - sandbox branch name
      params - site parameters
      creator - site creator
      Returns:
      true if successful, false otherwise
    • deleteSite

      default boolean deleteSite(String siteId)
      Description copied from interface: ContentRepository
      Deletes an existing site.
      Specified by:
      deleteSite in interface ContentRepository
      Parameters:
      siteId - site to delete
      Returns:
      true if successful, false otherwise
    • initialPublish

      default void initialPublish(String site, String sandboxBranch, String environment, String author, String comment)
      Description copied from interface: ContentRepository
      Initial publish to specified environment.
      Specified by:
      initialPublish in interface ContentRepository
      Parameters:
      site - site identifier
      sandboxBranch - sandbox branch name
      environment - environment to publish
      author - author
      comment - comment
    • getRepoLastCommitId

      default String getRepoLastCommitId(String site)
      Description copied from interface: ContentRepository
      Get last commit id from repository for given site.
      Specified by:
      getRepoLastCommitId in interface ContentRepository
      Specified by:
      getRepoLastCommitId in interface ContentRepository
      Parameters:
      site - site id
      Returns:
      last commit id (current HEAD)
    • getRepoFirstCommitId

      default String getRepoFirstCommitId(String site)
      Description copied from interface: ContentRepository
      Get first id from repository for given site
      Specified by:
      getRepoFirstCommitId in interface ContentRepository
      Specified by:
      getRepoFirstCommitId in interface ContentRepository
      Parameters:
      site - site id
      Returns:
      first commit id
    • getEditCommitIds

      default List<String> getEditCommitIds(String site, String path, String commitIdFrom, String commitIdTo)
      Description copied from interface: ContentRepository
      Get a list of commits for updates on a content
      Specified by:
      getEditCommitIds in interface ContentRepository
      Parameters:
      site - site id
      path - path
      commitIdFrom - range from commit id (inclusive)
      commitIdTo - range to commit id (inclusive)
      Returns:
      list of edit commit ids
    • commitIdExists

      default boolean commitIdExists(String site, String commitId)
      Description copied from interface: ContentRepository
      Check if given commit id exists
      Specified by:
      commitIdExists in interface ContentRepository
      Parameters:
      site - site id
      commitId - commit id to check
      Returns:
      true if it exists in site repository, otherwise false
    • commitIdExists

      default boolean commitIdExists(String site, GitRepositories repoType, String commitId)
      Description copied from interface: ContentRepository
      Check if given commit id (or revision string) exists
      Specified by:
      commitIdExists in interface ContentRepository
      Parameters:
      site - site id
      repoType - repository type
      commitId - commit id or revision to check
      Returns:
      true if it exists in site repository, otherwise false
    • insertFullGitLog

      default void insertFullGitLog(String siteId, int processed)
      Description copied from interface: ContentRepository
      Insert Full Git Log
      Specified by:
      insertFullGitLog in interface ContentRepository
      Parameters:
      siteId - site
      processed - processed
    • deleteGitLogForSite

      default void deleteGitLogForSite(String siteId)
      Description copied from interface: ContentRepository
      Delete Git log for site
      Specified by:
      deleteGitLogForSite in interface ContentRepository
      Parameters:
      siteId - site identifier
    • createSiteCloneRemote

      default boolean createSiteCloneRemote(String siteId, String sandboxBranch, String remoteName, String remoteUrl, String remoteBranch, boolean singleBranch, String authenticationType, String remoteUsername, String remotePassword, String remoteToken, String remotePrivateKey, Map<String,String> params, boolean createAsOrphan, String creator)
      Description copied from interface: ContentRepository
      Create new site as a clone from remote repository
      Specified by:
      createSiteCloneRemote in interface ContentRepository
      Parameters:
      siteId - site identifier
      sandboxBranch - sandbox branch name
      remoteName - remote name
      remoteUrl - remote repository url
      remoteBranch - remote branch name
      singleBranch - flag to signal if clone single branch or full repository
      authenticationType - type of authentication to use to connect remote repository
      remoteUsername - remote username
      remotePassword - remote password
      remoteToken - remote token
      remotePrivateKey - remote private key
      params - site parameters
      createAsOrphan - create as orphan
      creator - site creator
      Returns:
      true if success
    • addRemote

      default boolean addRemote(String siteId, String remoteName, String remoteUrl, String authenticationType, String remoteUsername, String remotePassword, String remoteToken, String remotePrivateKey)
      Description copied from interface: ContentRepository
      Add remote repository for site content repository
      Specified by:
      addRemote in interface ContentRepository
      Parameters:
      siteId - site identifier
      remoteName - remote name
      remoteUrl - remote url
      authenticationType - authentication type
      remoteUsername - remote username
      remotePassword - remote password
      remoteToken - remote token
      remotePrivateKey - remote private key
      Returns:
      true if operation was successful
    • removeRemote

      default boolean removeRemote(String siteId, String remoteName)
      Description copied from interface: ContentRepository
      Remove remote with given name for site
      Specified by:
      removeRemote in interface ContentRepository
      Parameters:
      siteId - site identifier
      remoteName - remote name
      Returns:
      true if operation was successful
    • removeRemoteRepositoriesForSite

      default void removeRemoteRepositoriesForSite(String siteId)
      Description copied from interface: ContentRepository
      Remove all remotes for given site
      Specified by:
      removeRemoteRepositoriesForSite in interface ContentRepository
      Parameters:
      siteId - site identifier
    • listRemote

      default List<RemoteRepositoryInfoTO> listRemote(String siteId, String sandboxBranch)
      Description copied from interface: ContentRepository
      List remote repositories for given site
      Specified by:
      listRemote in interface ContentRepository
      Parameters:
      siteId - site identifier
      sandboxBranch - sandbox branch name
      Returns:
      list of names of remote repositories
    • pushToRemote

      default boolean pushToRemote(String siteId, String remoteName, String remoteBranch)
      Description copied from interface: ContentRepository
      Push content to remote repository
      Specified by:
      pushToRemote in interface ContentRepository
      Parameters:
      siteId - site identifier
      remoteName - remote name
      remoteBranch - remote branch
      Returns:
      true if operation was successful
    • pullFromRemote

      default boolean pullFromRemote(String siteId, String remoteName, String remoteBranch)
      Description copied from interface: ContentRepository
      Pull from remote repository
      Specified by:
      pullFromRemote in interface ContentRepository
      Parameters:
      siteId - site identifier
      remoteName - remote name
      remoteBranch - remote branch
      Returns:
      true if operation was successful
    • resetStagingRepository

      default void resetStagingRepository(String siteId)
      Description copied from interface: ContentRepository
      Reset staging repository to live for given site
      Specified by:
      resetStagingRepository in interface ContentRepository
      Parameters:
      siteId - site identifier to use for resetting
    • cleanupRepositories

      default void cleanupRepositories(String siteId)
      Description copied from interface: ContentRepository
      Performs a cleanup all repositories for the given site
      Specified by:
      cleanupRepositories in interface ContentRepository
      Parameters:
      siteId - site identifier
    • repositoryExists

      default boolean repositoryExists(String site)
      Description copied from interface: ContentRepository
      Check if repository exists for given site
      Specified by:
      repositoryExists in interface ContentRepository
      Parameters:
      site - site id
      Returns:
      true if repository exists, otherwise false
    • getSubtreeItems

      default List<String> getSubtreeItems(String site, String path, GitRepositories repoType, String branch)
      Description copied from interface: ContentRepository
      List subtree items for give site and path
      Specified by:
      getSubtreeItems in interface ContentRepository
      Parameters:
      site - site identifier
      path - path for subtree root
      repoType - repository type
      branch - A git object references expression (e.g.: HEAD, branch name, commit id)
      Returns:
      list of item paths contained in the subtree
    • getOperations

      default List<RepoOperation> getOperations(String site, String commitIdFrom, String commitIdTo)
      Description copied from interface: ContentRepository
      Get a list of operations since the commit ID provided (compare that commit to HEAD)
      Specified by:
      getOperations in interface ContentRepository
      Parameters:
      site - site to use
      commitIdFrom - commit ID to start at
      commitIdTo - commit ID to end at
      Returns:
      commit ID of current HEAD, updated operationsSinceCommit
    • getOperationsFromDelta

      default List<RepoOperation> getOperationsFromDelta(String site, String commitIdFrom, String commitIdTo)
      Description copied from interface: ContentRepository
      Get a list of operations since the commit ID provided (compare that commit to HEAD)
      Specified by:
      getOperationsFromDelta in interface ContentRepository
      Parameters:
      site - site to use
      commitIdFrom - commit ID to start at
      commitIdTo - commit ID to end at
      Returns:
      commit ID of current HEAD, updated operationsSinceCommit
    • getGitLog

      default GitLog getGitLog(String siteId, String commitId)
      Description copied from interface: ContentRepository
      Get git log object from database
      Specified by:
      getGitLog in interface ContentRepository
      Parameters:
      siteId - site id
      commitId - commit ID
      Returns:
      git log object
    • markGitLogVerifiedProcessed

      default void markGitLogVerifiedProcessed(String siteId, String commitId)
      Description copied from interface: ContentRepository
      Mark Git log as verified
      Specified by:
      markGitLogVerifiedProcessed in interface ContentRepository
      Parameters:
      siteId - site identifier
      commitId - commit id
    • insertGitLog

      default void insertGitLog(String siteId, String commitId, int processed)
      Description copied from interface: ContentRepository
      Insert Git Log
      Specified by:
      insertGitLog in interface ContentRepository
      Parameters:
      siteId - site
      commitId - commit ID
      processed - processed
    • insertGitLog

      default void insertGitLog(String siteId, String commitId, int processed, int audited)
      Description copied from interface: ContentRepository
      Insert Git Log
      Specified by:
      insertGitLog in interface ContentRepository
      Parameters:
      siteId - site
      commitId - commit ID
      processed - processed
      audited - audited
    • getPublishingHistory

      default List<PublishingHistoryItem> getPublishingHistory(String siteId, String environment, String path, String publisher, ZonedDateTime fromDate, ZonedDateTime toDate, int limit)
      Description copied from interface: ContentRepository
      Get publishing history
      Specified by:
      getPublishingHistory in interface ContentRepository
      Parameters:
      siteId - site identifier
      environment - environment
      path - path regular expression to use as filter
      publisher - user to filter by
      fromDate - lower boundary for published date
      toDate - upper boundary for published date
      limit - number of records to return
      Returns:
      publishing history
    • getItem

      default org.craftercms.core.service.Item getItem(String siteId, String path, boolean flatten)
      Specified by:
      getItem in interface ContentRepository
    • getLastEditCommitId

      default String getLastEditCommitId(String siteId, String path)
      Specified by:
      getLastEditCommitId in interface ContentRepository
    • getChangeSetPathsFromDelta

      default Map<String,String> getChangeSetPathsFromDelta(String site, String commitIdFrom, String commitIdTo)
      Description copied from interface: ContentRepository
      Get a list of paths that changed since the commit ID provided to commit ID provided
      Specified by:
      getChangeSetPathsFromDelta in interface ContentRepository
      Parameters:
      site - site to use
      commitIdFrom - commit ID to start at
      commitIdTo - commit ID to end at
      Returns:
      list of paths of files that changed between two commits
    • markGitLogAudited

      default void markGitLogAudited(String siteId, String commitId)
      Description copied from interface: ContentRepository
      Mark Git log as audited
      Specified by:
      markGitLogAudited in interface ContentRepository
      Parameters:
      siteId - site identifier
      commitId - commit id
    • updateGitlog

      default void updateGitlog(String siteId, String lastProcessedCommitId, int batchSize)
      Description copied from interface: ContentRepository
      Update gitlog table with commit ids from repository
      Specified by:
      updateGitlog in interface ContentRepository
      Parameters:
      siteId - site identifier
      lastProcessedCommitId - last processed commit id
      batchSize - size of a batch to update
    • getUnauditedCommits

      default List<GitLog> getUnauditedCommits(String siteId, int batchSize)
      Description copied from interface: ContentRepository
      Get unaudited commits from database
      Specified by:
      getUnauditedCommits in interface ContentRepository
      Parameters:
      siteId - site identifier
      batchSize - size of a batch to retrieve
      Returns:
      list of gitlog records
    • getUnprocessedCommits

      default List<GitLog> getUnprocessedCommits(String siteId, long marker)
      Description copied from interface: ContentRepository
      Get unprocessed commits from database
      Specified by:
      getUnprocessedCommits in interface ContentRepository
      Parameters:
      siteId - site identifier
      marker - id of last verified commit Id
      Returns:
      list of gitlog records
    • getItemEnvironmentProperties

      default DetailedItem.Environment getItemEnvironmentProperties(String siteId, GitRepositories repo, String environment, String path)
      Description copied from interface: ContentRepository
      Get environment properties for item
      Specified by:
      getItemEnvironmentProperties in interface ContentRepository
      Parameters:
      siteId - site identifier
      repo - repository type
      environment - branch
      path - path of the item
      Returns:
      environment properties
    • countUnprocessedCommits

      default int countUnprocessedCommits(String siteId, long marker)
      Description copied from interface: ContentRepository
      Count unprocessed commits from database
      Specified by:
      countUnprocessedCommits in interface ContentRepository
      Parameters:
      siteId - site identifier
      marker - id of last verified commit Id
      Returns:
      number of unprocessed gitlog records
    • markGitLogProcessedBeforeMarker

      default void markGitLogProcessedBeforeMarker(String siteId, long marker, int processed)
      Description copied from interface: ContentRepository
      Mark all git logs as processed if they are inserted before marker
      Specified by:
      markGitLogProcessedBeforeMarker in interface ContentRepository
      Parameters:
      siteId - site identifier
      marker - marker git commit
      processed - value for processed
    • getPreviousCommitId

      default String getPreviousCommitId(String siteId, String commitId)
      Description copied from interface: ContentRepository
      Get the previous commit id from repository for given a site id and a commit id
      Specified by:
      getPreviousCommitId in interface ContentRepository
      Parameters:
      siteId - site identifier
      commitId - commit Id
      Returns:
    • itemUnlock

      default void itemUnlock(String site, String path)
      Description copied from interface: ContentRepository
      unlock an item
      Specified by:
      itemUnlock in interface ContentRepository
      Parameters:
      site - site id where the operation will be executed
      path - path of the item
    • markGitLogVerifiedProcessedBulk

      default void markGitLogVerifiedProcessedBulk(String siteId, List<String> commitIds)
      Description copied from interface: ContentRepository
      Mark Git logs as verified
      Specified by:
      markGitLogVerifiedProcessedBulk in interface ContentRepository
      Parameters:
      siteId - site identifier
      commitIds - list of commit ids
    • upsertGitLogList

      default void upsertGitLogList(String siteId, List<String> commitIds, boolean processed, boolean audited)
      Description copied from interface: ContentRepository
      Upsert git logs as processed and audited
      Specified by:
      upsertGitLogList in interface ContentRepository
      Parameters:
      siteId - site identifier
      commitIds - commit ids
      processed - true if already processed
      audited - true if already audited
    • publishedRepositoryExists

      default boolean publishedRepositoryExists(String siteId)
      Description copied from interface: ContentRepository
      Check if published repository exists for given site.
      Specified by:
      publishedRepositoryExists in interface ContentRepository
      Parameters:
      siteId - site identifier
      Returns:
      true if PUBLISHED repository exists, otherwise false