Class ServerlessDeliveryDeployer

java.lang.Object
org.craftercms.studio.impl.v2.deployment.AbstractDeployer
org.craftercms.studio.impl.v2.deployment.ServerlessDeliveryDeployer
All Implemented Interfaces:
Deployer

public class ServerlessDeliveryDeployer extends AbstractDeployer
Implementation of Deployer that interacts with the Serverless Delivery Deployer, only if serverless delivery is enabled.
Author:
avasquez
  • Constructor Details

    • ServerlessDeliveryDeployer

      public ServerlessDeliveryDeployer(StudioConfiguration studioConfiguration, org.craftercms.commons.rest.RestTemplate restTemplate)
  • Method Details

    • createTargets

      public void createTargets(String site) throws org.springframework.web.client.RestClientException
      Description copied from interface: Deployer
      Calls a Crafter Deployer to create any necessary targets for the site.
      Parameters:
      site - the site
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs
    • deleteTargets

      public void deleteTargets(String site) throws org.springframework.web.client.RestClientException
      Description copied from interface: Deployer
      Deletes the targets associated with the site.
      Parameters:
      site - the site
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs
    • duplicateTargets

      public void duplicateTargets(String sourceSiteId, String siteId)
      Description copied from interface: Deployer
      Call Crafter Deployer API to duplicate the site targets
      Parameters:
      sourceSiteId - the site to duplicate from
      siteId - the new site id
    • getSourceTemplateParams

      protected Map<String,Object> getSourceTemplateParams(String sourceSiteId)
      Description copied from class: AbstractDeployer
      Get a source site parameters Map to pass to the target template. This is useful for deployer to get context on the duplicate source site
      Overrides:
      getSourceTemplateParams in class AbstractDeployer
      Parameters:
      sourceSiteId - the source site to duplicate from
      Returns:
      a Map containing the parameters
    • getCreateTargetUrl

      protected String getCreateTargetUrl()
      Specified by:
      getCreateTargetUrl in class AbstractDeployer
    • getDeleteTargetUrl

      protected String getDeleteTargetUrl(String site, String environment)
      Specified by:
      getDeleteTargetUrl in class AbstractDeployer
    • isServerlessDeliveryEnabled

      protected boolean isServerlessDeliveryEnabled()