org.gcube.common.vremanagement.deployer.impl.resources.deployment
Class DeployablePackage

java.lang.Object
  extended by org.gcube.common.vremanagement.deployer.impl.resources.BasePackage
      extended by org.gcube.common.vremanagement.deployer.impl.resources.BaseTypedPackage
          extended by org.gcube.common.vremanagement.deployer.impl.resources.deployment.DeployablePackage
All Implemented Interfaces:
Serializable, Deployable
Direct Known Subclasses:
DMainPackage, DPlatformApplication, DPlugin

public abstract class DeployablePackage
extends BaseTypedPackage
implements Deployable

Base deployable package

Author:
Manuele Simi (CNR-ISTI)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gcube.common.vremanagement.deployer.impl.resources.BaseTypedPackage
BaseTypedPackage.TYPE
 
Field Summary
protected  Calendar deploymentTime
          scopes to add after the next restart
protected  PackageExtractor extractor
          The extractor managing the package
protected  AntRunner run
          Local Ant runner
protected  String serviceID
          the service identifier to which the package belongs to
protected  org.gcube.common.core.resources.GCUBEService serviceprofile
          service profile extracted from the deployable package
 
Fields inherited from class org.gcube.common.vremanagement.deployer.impl.resources.BasePackage
dependencies, installScripts, key, logger, packageFiles, properties, rebootScripts, targetsToAdd, uninstallScripts
 
Method Summary
protected  void analysePackage()
           
 void clean()
          Cleans up all the temporary resources used to deploy the package
 void deploy(Set<org.gcube.common.core.scope.GCUBEScope> targets)
          Deploys the package
 String deployApp(Set<org.gcube.common.core.scope.GCUBEScope> targets)
          Deploys the package as an application
abstract  void deployPackage(Set<org.gcube.common.core.scope.GCUBEScope> targets)
           
 Calendar getDeploymentTime()
           
protected abstract  org.gcube.common.core.resources.service.Package getPackageProfile()
          Gets the package profile
 String getServiceID()
           
 org.gcube.common.core.resources.GCUBEService getServiceProfile()
          Gets the service profile
 BaseTypedPackage getSourcePackage()
           
protected  void notifyDeployCompleted()
          Does the latest stuffs and cleanup after a successful deployment
 void postDeploy()
          Performs the post-deployment operations
 void preDeploy()
          Performs the pre-deployment operations
protected  void runInstallScripts()
          Executes the installation scripts for the package
 
Methods inherited from class org.gcube.common.vremanagement.deployer.impl.resources.BaseTypedPackage
getType, setType
 
Methods inherited from class org.gcube.common.vremanagement.deployer.impl.resources.BasePackage
addDependencies, addFile2Package, addInstallScript, addRebootScript, addScope, addUninstallScript, getDependencies, getInstallScripts, getKey, getPackageFileList, getProperty, getRebootScripts, getScopes, getScopesToAdd, getSerializationFile, getTargetPlatform, getTargetsToAdd, getUninstallScripts, notifiyTargetsAdded, printFiles, removeFileFromPackage, removeScope, removeScopes, setProperty, setScopes, setScopesToAdd, setTargetPlatform, setTargetsToAdd, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.gcube.common.vremanagement.deployer.impl.resources.deployment.Deployable
getTargetPlatform, getTargetsToAdd, notifiyTargetsAdded, requireRestart, setTargetsToAdd, verify
 

Field Detail

extractor

protected transient PackageExtractor extractor
The extractor managing the package


run

protected transient AntRunner run
Local Ant runner


serviceprofile

protected transient org.gcube.common.core.resources.GCUBEService serviceprofile
service profile extracted from the deployable package


serviceID

protected String serviceID
the service identifier to which the package belongs to


deploymentTime

protected Calendar deploymentTime
scopes to add after the next restart

Method Detail

analysePackage

protected final void analysePackage()

deploy

public final void deploy(Set<org.gcube.common.core.scope.GCUBEScope> targets)
                  throws PackageAldreadyDeployedException,
                         DeployException,
                         InvalidPackageArchiveException
Description copied from interface: Deployable
Deploys the package

Specified by:
deploy in interface Deployable
Throws:
PackageAldreadyDeployedException - if the package is already deployed in the node
DeployException - if something fails during the deployment activities
InvalidPackageArchiveException - if the format of the downloaded package is not valid

deployPackage

public abstract void deployPackage(Set<org.gcube.common.core.scope.GCUBEScope> targets)
                            throws PackageAldreadyDeployedException,
                                   DeployException,
                                   InvalidPackageArchiveException
Throws:
PackageAldreadyDeployedException
DeployException
InvalidPackageArchiveException

getPackageProfile

protected abstract org.gcube.common.core.resources.service.Package getPackageProfile()
Gets the package profile

Returns:
the package profile

getServiceProfile

public org.gcube.common.core.resources.GCUBEService getServiceProfile()
Gets the service profile

Returns:
the service profile

runInstallScripts

protected void runInstallScripts()
                          throws DeployException,
                                 InvalidPackageArchiveException
Executes the installation scripts for the package

Throws:
DeployException - if an error occurs during the execution of one of the given scripts
InvalidPackageArchiveException - if the format of the downloaded package is not valid

clean

public final void clean()
                 throws DeployException
Description copied from interface: Deployable
Cleans up all the temporary resources used to deploy the package

Specified by:
clean in interface Deployable
Throws:
DeployException

preDeploy

public void preDeploy()
               throws InvalidPackageArchiveException,
                      DeployException
Description copied from interface: Deployable
Performs the pre-deployment operations

Specified by:
preDeploy in interface Deployable
Throws:
InvalidPackageArchiveException
DeployException

postDeploy

public void postDeploy()
                throws InvalidPackageArchiveException,
                       DeployException
Description copied from interface: Deployable
Performs the post-deployment operations

Specified by:
postDeploy in interface Deployable
Throws:
DeployException
InvalidPackageArchiveException

getServiceID

public String getServiceID()
Returns:
the serviceID

getDeploymentTime

public final Calendar getDeploymentTime()
Returns:
the deploymentTime

notifyDeployCompleted

protected final void notifyDeployCompleted()
Does the latest stuffs and cleanup after a successful deployment


deployApp

public String deployApp(Set<org.gcube.common.core.scope.GCUBEScope> targets)
                 throws PackageAldreadyDeployedException,
                        DeployException,
                        InvalidPackageArchiveException
Description copied from interface: Deployable
Deploys the package as an application

Specified by:
deployApp in interface Deployable
Parameters:
targets - target scopes
Returns:
Throws:
PackageAldreadyDeployedException
DeployException
InvalidPackageArchiveException

getSourcePackage

public BaseTypedPackage getSourcePackage()
Specified by:
getSourcePackage in interface Deployable
Returns:
the source package of this deployable


Copyright © 2013. All Rights Reserved.