Interface SitesService

All Known Implementing Classes:
SitesServiceImpl, SitesServiceInternalImpl

public interface SitesService
  • Method Details

    • checkSiteExists

      default void checkSiteExists(String siteId) throws SiteNotFoundException
      Checks if a site exists. If it does not, it throws a SiteNotFoundException
      Parameters:
      siteId - site ID
      Throws:
      SiteNotFoundException - if no site is found for the given site ID
    • exists

      boolean exists(String siteId)
      Check if site already exists
      Parameters:
      siteId - site ID
      Returns:
      true if site exists, false otherwise
    • getAvailableBlueprints

      List<org.craftercms.commons.plugin.model.PluginDescriptor> getAvailableBlueprints()
      Get list of available blueprints
      Returns:
      list of blueprints
    • getBlueprintDescriptor

      org.craftercms.commons.plugin.model.PluginDescriptor getBlueprintDescriptor(String id)
      Get the blueprint descriptor from the global repo
      Parameters:
      id - the id of the blueprint
      Returns:
      the descriptor object or null if not found
    • getBlueprintLocation

      String getBlueprintLocation(String blueprintId)
      Get blueprint location
      Parameters:
      blueprintId - blueprint id
      Returns:
      blueprint location
    • getSiteBlueprintDescriptor

      org.craftercms.commons.plugin.model.PluginDescriptor getSiteBlueprintDescriptor(String id)
      Get the blueprint descriptor from a site repo
      Parameters:
      id - the id of the site
      Returns:
      the blueprint object or null if not found
    • updateSite

      void updateSite(String siteId, String name, String description) throws SiteNotFoundException, SiteAlreadyExistsException, InvalidParametersException
      Updates the name and description for the given site
      Parameters:
      siteId - the id of the site
      name - the name of the site
      description - the description of the site
      Throws:
      SiteNotFoundException - if the site doesn't exist
      SiteAlreadyExistsException
      InvalidParametersException
    • unlockSite

      void unlockSite(String siteId) throws SiteNotFoundException, InvalidSiteStateException
      Unlock a site which is locked with state `LOCKED`
      Parameters:
      siteId - the id of the site
      Throws:
      SiteNotFoundException - if the site doesn't exist
      InvalidSiteStateException - if the site is not in LOCKED state
    • getPublishingStatus

      PublishStatus getPublishingStatus(String siteId) throws SiteNotFoundException
      Get publishing status for site
      Parameters:
      siteId - site identifier
      Returns:
      publishing status
      Throws:
      SiteNotFoundException
    • clearPublishingLock

      void clearPublishingLock(String siteId) throws SiteNotFoundException
      Clear publishing lock for site
      Parameters:
      siteId - site identifier
      Throws:
      SiteNotFoundException
    • checkSiteState

      void checkSiteState(String siteId, String state) throws InvalidSiteStateException, SiteNotFoundException
      Check if current site state is matches the given state
      Parameters:
      siteId - site id
      state - desired state
      Throws:
      InvalidSiteStateException - if the site state doesn't match the given state
      SiteNotFoundException - if the site doesn't exist
    • duplicate

      void duplicate(String sourceSiteId, String siteId, String siteName, String description, String sandboxBranch, boolean readOnlyBlobStores) throws ServiceLayerException
      Duplicate a site
      Parameters:
      sourceSiteId - the id of the site to duplicate
      siteId - the id of the new site
      siteName - the name of the new site
      description - the description of the new site
      sandboxBranch - the sandbox branch to use
      readOnlyBlobStores - whether the blob stores should be read only. Notice that this value is overridden (forced to false) if serverless delivery is enabled
      Throws:
      ServiceLayerException - if there is an error duplicating the site
    • getSitesByState

      List<Site> getSitesByState(String state)
      Get the sites matching a given state
      Parameters:
      state - the state to match. See Site.State
      Returns:
      the list of sites matching the given state