Interface SitesService
- All Known Implementing Classes:
SitesServiceImpl,SitesServiceInternalImpl
public interface SitesService
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidcheckSiteExists(String siteId) Checks if a site exists.voidcheckSiteState(String siteId, String state) Check if current site state is matches the given statevoidclearPublishingLock(String siteId) Clear publishing lock for sitevoidduplicate(String sourceSiteId, String siteId, String siteName, String description, String sandboxBranch, boolean readOnlyBlobStores) Duplicate a sitebooleanCheck if site already existsList<org.craftercms.commons.plugin.model.PluginDescriptor> Get list of available blueprintsorg.craftercms.commons.plugin.model.PluginDescriptorGet the blueprint descriptor from the global repogetBlueprintLocation(String blueprintId) Get blueprint locationgetPublishingStatus(String siteId) Get publishing status for siteorg.craftercms.commons.plugin.model.PluginDescriptorGet the blueprint descriptor from a site repogetSitesByState(String state) Get the sites matching a given statevoidunlockSite(String siteId) Unlock a site which is locked with state `LOCKED`voidupdateSite(String siteId, String name, String description) Updates the name and description for the given site
-
Method Details
-
checkSiteExists
Checks if a site exists. If it does not, it throws aSiteNotFoundException- Parameters:
siteId- site ID- Throws:
SiteNotFoundException- if no site is found for the given site ID
-
exists
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
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
Get blueprint location- Parameters:
blueprintId- blueprint id- Returns:
- blueprint location
-
getSiteBlueprintDescriptor
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 sitename- the name of the sitedescription- the description of the site- Throws:
SiteNotFoundException- if the site doesn't existSiteAlreadyExistsExceptionInvalidParametersException
-
unlockSite
Unlock a site which is locked with state `LOCKED`- Parameters:
siteId- the id of the site- Throws:
SiteNotFoundException- if the site doesn't existInvalidSiteStateException- if the site is not in LOCKED state
-
getPublishingStatus
Get publishing status for site- Parameters:
siteId- site identifier- Returns:
- publishing status
- Throws:
SiteNotFoundException
-
clearPublishingLock
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 idstate- desired state- Throws:
InvalidSiteStateException- if the site state doesn't match the given stateSiteNotFoundException- 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 duplicatesiteId- the id of the new sitesiteName- the name of the new sitedescription- the description of the new sitesandboxBranch- the sandbox branch to usereadOnlyBlobStores- 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
Get the sites matching a given state- Parameters:
state- the state to match. SeeSite.State- Returns:
- the list of sites matching the given state
-