Package org.craftercms.deployer.api
Interface Target
- All Known Implementing Classes:
TargetImpl
public interface Target
Represents a deployment target.
- Author:
- avasquez
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidPerforms a cleanup of the local repository.voidclose()Closes the target, releases any open resources and stops any running threads associated to the target.voiddelete()Deletes the target, executing any delete hooks.Starts a new deployment for the target (asynchronous operation ifwaitTillDoneis false).Returns all deployments (pending and current).org.springframework.context.ConfigurableApplicationContextReturns this target's Spring application contextorg.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> Returns the configuration of the target.Returns the YAML configuration file of the target.Returns the current deployment.getEnv()Returns the environment of the target.getId()Returns the ID of the target.intReturns the number of retry attempts left for the current deployment.Returns the load date of the target.Returns the pending deployments.longReturn the runtime warning threshold in seconds.Returns the site name of the target.Returns the status of the targetvoidhandleEvent(TargetEvent<?> event) Call the appropriate event listeners for the given event type.voidinit()Starts the initialization of the target (asynchronous operation).voidunlock()Deletes the git lock file is present in the local repository.
-
Field Details
-
INDEX_ID_FORMAT_CONFIG_KEY
- See Also:
-
AUTHORING_ENV
- See Also:
-
-
Method Details
-
getId
String getId()Returns the ID of the target. -
getEnv
String getEnv()Returns the environment of the target. -
getSiteName
String getSiteName()Returns the site name of the target. -
getLoadDate
ZonedDateTime getLoadDate()Returns the load date of the target. -
getStatus
Target.Status getStatus()Returns the status of the target -
getConfigurationFile
File getConfigurationFile()Returns the YAML configuration file of the target. -
getRuntimeWarningThreshold
long getRuntimeWarningThreshold()Return the runtime warning threshold in seconds. This is the maximum time a deployment can run before a warning is triggered.- Returns:
- the runtime threshold in seconds
-
getConfiguration
org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> getConfiguration()Returns the configuration of the target. -
getApplicationContext
org.springframework.context.ConfigurableApplicationContext getApplicationContext()Returns this target's Spring application context -
init
void init()Starts the initialization of the target (asynchronous operation). Called when the create target API is called or the target config is loaded. -
deploy
Starts a new deployment for the target (asynchronous operation ifwaitTillDoneis false).- Parameters:
waitTillDone- if the method should wait till the deployment is done or return immediatelyparams- miscellaneous parameters that can be used by the processors.- Returns:
- the deployment info
- Throws:
TargetNotReadyException- if the target is not inTarget.Status.INIT_COMPLETED
-
getPendingDeployments
Collection<Deployment> getPendingDeployments()Returns the pending deployments. -
getCurrentDeployment
Deployment getCurrentDeployment()Returns the current deployment. -
getAllDeployments
Collection<Deployment> getAllDeployments()Returns all deployments (pending and current). -
getInitRetryAttempts
int getInitRetryAttempts()Returns the number of retry attempts left for the current deployment. This is used to retry deployments a maximum number of attempts if they fail to init after creation- Returns:
- the number of retry attempts left
-
cleanRepo
void cleanRepo()Performs a cleanup of the local repository. -
close
void close()Closes the target, releases any open resources and stops any running threads associated to the target. -
delete
void delete()Deletes the target, executing any delete hooks. Callsclose()too. -
unlock
void unlock()Deletes the git lock file is present in the local repository. -
handleEvent
Call the appropriate event listeners for the given event type.- Parameters:
event- the target event to handle
-