org.gcube.common.vremanagement.deployer.impl.resources
Class BasePackage

java.lang.Object
  extended by org.gcube.common.vremanagement.deployer.impl.resources.BasePackage
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BaseTypedPackage

public class BasePackage
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
protected  Set<KeyData> dependencies
          package's dependencies
protected  List<String> installScripts
          The list of installation scripts
protected  KeyData key
          the package unique key
 org.gcube.common.core.utils.logging.GCUBELog logger
          local logger
protected  List<File> packageFiles
          The list of files installed with the package
protected  Map<String,String> properties
          package-specific properties
protected  List<String> rebootScripts
          The list of reboot scripts
protected  ArrayList<String> targetsToAdd
          scopes to add after the next restart
protected  List<String> uninstallScripts
          The list of uninstall scripts
 
Constructor Summary
protected BasePackage()
           
  BasePackage(String serviceClass, String serviceName, String serviceVersion, String packagename, String packageVersion)
           
 
Method Summary
 void addDependencies(Set<KeyData> dependencies)
          Adds new depencencies to the package
 void addFile2Package(File file)
          Adds a file to the list of package files.
 void addInstallScript(String installScript)
           
 void addRebootScript(String rebootScript)
           
 void addScope(org.gcube.common.core.scope.GCUBEScope scope)
          Adds a new scope to the package
 void addUninstallScript(String uninstallScript)
           
 Set<KeyData> getDependencies()
          Gets the list of dependencies of the package
 List<String> getInstallScripts()
           
 KeyData getKey()
          Gets the package unique key.
 List<File> getPackageFileList()
          Gets the list of files installed with the package
 String getProperty(String name)
          Gets a property from the package
 List<String> getRebootScripts()
           
 Set<org.gcube.common.core.scope.GCUBEScope> getScopes()
          Gets the target scopes to which the package is joined
 Set<org.gcube.common.core.scope.GCUBEScope> getScopesToAdd()
          Gets the target scopes to add to the package at the next restart
 File getSerializationFile()
           
 org.gcube.common.core.resources.common.PlatformDescription getTargetPlatform()
          Gets the target platform of this package
 List<org.gcube.common.core.scope.GCUBEScope> getTargetsToAdd()
          Sets the target scopes to add to the package at the next restart
 List<String> getUninstallScripts()
           
 void notifiyTargetsAdded(List<org.gcube.common.core.scope.GCUBEScope> targets)
          Notifies to the package that it has been added to the given target scopes
 void printFiles()
           
 void removeFileFromPackage(File file)
          Removes a file from the list of package files
 void removeScope(org.gcube.common.core.scope.GCUBEScope scope)
          Removes a scope from the package
 void removeScopes(Set<org.gcube.common.core.scope.GCUBEScope> scopes)
          Removes the given scopes from the package
 void setProperty(String name, String value)
          Adds a property to the packge
 void setScopes(Set<org.gcube.common.core.scope.GCUBEScope> scopes)
          Sets the target scopes to which the package is joined
 void setScopesToAdd(Set<org.gcube.common.core.scope.GCUBEScope> scopesToAdd)
          Sets the target scopes to add to the package at the next restart
 void setTargetPlatform(org.gcube.common.core.resources.common.PlatformDescription description)
          Sets the target platform of this package
 void setTargetsToAdd(List<org.gcube.common.core.scope.GCUBEScope> targetsToAdd)
          Sets the target scopes to add to the package at the next restart
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

public transient org.gcube.common.core.utils.logging.GCUBELog logger
local logger


packageFiles

protected List<File> packageFiles
The list of files installed with the package


installScripts

protected List<String> installScripts
The list of installation scripts


rebootScripts

protected List<String> rebootScripts
The list of reboot scripts


uninstallScripts

protected List<String> uninstallScripts
The list of uninstall scripts


dependencies

protected Set<KeyData> dependencies
package's dependencies


key

protected KeyData key
the package unique key


properties

protected Map<String,String> properties
package-specific properties


targetsToAdd

protected ArrayList<String> targetsToAdd
scopes to add after the next restart

Constructor Detail

BasePackage

protected BasePackage()

BasePackage

public BasePackage(String serviceClass,
                   String serviceName,
                   String serviceVersion,
                   String packagename,
                   String packageVersion)
Method Detail

getKey

public KeyData getKey()
Gets the package unique key. The package key holds the quintuple: serviceclass, servicename, serviceversion, packagename, packageversion

Returns:
the package key

getSerializationFile

public File getSerializationFile()

getPackageFileList

public List<File> getPackageFileList()
Gets the list of files installed with the package

Returns:
the list of files installed with the package

addFile2Package

public void addFile2Package(File file)
Adds a file to the list of package files. The file will be removed when the package is undeployed,

Parameters:
file - the new file belonging the package

removeFileFromPackage

public void removeFileFromPackage(File file)
Removes a file from the list of package files

Parameters:
file - the file to remove

printFiles

public void printFiles()

getInstallScripts

public List<String> getInstallScripts()
Returns:
the installScripts

addInstallScript

public void addInstallScript(String installScript)
Parameters:
installScripts - the installScripts to set

getRebootScripts

public List<String> getRebootScripts()
Returns:
the rebootScripts

addRebootScript

public void addRebootScript(String rebootScript)
Parameters:
rebootScripts - the rebootScripts to set

getUninstallScripts

public List<String> getUninstallScripts()
Returns:
the uninstallScripts

addUninstallScript

public void addUninstallScript(String uninstallScript)
Parameters:
uninstallScripts - the uninstallScripts to set

getScopes

public Set<org.gcube.common.core.scope.GCUBEScope> getScopes()
Gets the target scopes to which the package is joined

Returns:
the targets scopes to which the package is joined

setScopes

public void setScopes(Set<org.gcube.common.core.scope.GCUBEScope> scopes)
Sets the target scopes to which the package is joined

Parameters:
scopes - the targets to set

addScope

public void addScope(org.gcube.common.core.scope.GCUBEScope scope)
Adds a new scope to the package

Parameters:
scope - the new scope

removeScope

public void removeScope(org.gcube.common.core.scope.GCUBEScope scope)
Removes a scope from the package

Parameters:
scope - the scope to remove

removeScopes

public void removeScopes(Set<org.gcube.common.core.scope.GCUBEScope> scopes)
Removes the given scopes from the package

Parameters:
scopes - the scopes to remove

getScopesToAdd

public Set<org.gcube.common.core.scope.GCUBEScope> getScopesToAdd()
Gets the target scopes to add to the package at the next restart

Returns:
the scopes to add

setScopesToAdd

public void setScopesToAdd(Set<org.gcube.common.core.scope.GCUBEScope> scopesToAdd)
Sets the target scopes to add to the package at the next restart

Parameters:
scopesToAdd - the scopesToAdd to set

getDependencies

public Set<KeyData> getDependencies()
Gets the list of dependencies of the package

Returns:
the dependencies

addDependencies

public void addDependencies(Set<KeyData> dependencies)
Adds new depencencies to the package

Parameters:
dependencies - the dependencies to add

setProperty

public void setProperty(String name,
                        String value)
Adds a property to the packge

Parameters:
name - the property to set
value - the value of the property

getProperty

public String getProperty(String name)
Gets a property from the package

Returns:
the value of the property

toString

public String toString()
Overrides:
toString in class Object

getTargetPlatform

public org.gcube.common.core.resources.common.PlatformDescription getTargetPlatform()
Gets the target platform of this package

Returns:
the platform on which the package is supposed to run

setTargetPlatform

public void setTargetPlatform(org.gcube.common.core.resources.common.PlatformDescription description)
Sets the target platform of this package

Parameters:
description - the description of the target platform

getTargetsToAdd

public final List<org.gcube.common.core.scope.GCUBEScope> getTargetsToAdd()
Sets the target scopes to add to the package at the next restart

Returns:
the targetsToAdd

setTargetsToAdd

public final void setTargetsToAdd(List<org.gcube.common.core.scope.GCUBEScope> targetsToAdd)
Sets the target scopes to add to the package at the next restart

Parameters:
targetsToAdd - the targets scopes

notifiyTargetsAdded

public final void notifiyTargetsAdded(List<org.gcube.common.core.scope.GCUBEScope> targets)
Notifies to the package that it has been added to the given target scopes

Parameters:
targets - the target scope


Copyright © 2013. All Rights Reserved.