org.gcube.vremanagement.resourcemanager.impl.resources
Class ScopedDeployedSoftware

java.lang.Object
  extended by org.gcube.vremanagement.resourcemanager.impl.resources.ScopedResource
      extended by org.gcube.vremanagement.resourcemanager.impl.resources.ScopedDeployedSoftware

public class ScopedDeployedSoftware
extends ScopedResource

Models any kind of scoped deployed software

Author:
Manuele Simi (ISTI-CNR)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gcube.vremanagement.resourcemanager.impl.resources.ScopedResource
ScopedResource.ResourceNotFound, ScopedResource.STATUS
 
Field Summary
static String TYPE
           
 
Fields inherited from class org.gcube.vremanagement.resourcemanager.impl.resources.ScopedResource
action, errorMessage, hostedOn, id, jointTime, lastModificationTime, logger, scope, status, success, type
 
Constructor Summary
protected ScopedDeployedSoftware(String id, org.gcube.common.core.scope.GCUBEScope scope)
           
 
Method Summary
protected  void addToScope()
          Adds the resource to the scope
protected  void find()
          Custom
 List<Dependency> getLastMissingDependencies()
          Gets the list of missing dependencies for the last (failed) deployment
 List<Dependency> getLastResolvedDependencies()
          Gets the list of resolved dependencies to be used in the next deployment
protected  int getMaxFindAttempts()
          Number of times the resource is searched in the IS before to declare it lost
 List<Dependency> getMissingDependencies(String ghnName)
          Gets the list of missing dependencies when the deployment was performed on a specific node
 List<Dependency> getResolvedDependencies(String ghnName)
          Gets the list of resolved dependencies when the deployment was performed on a specific node
 String getRI()
          Gets the RI generated by this software or null
 GCUBEPackage getSourcePackage()
           
 String getTargetNodeID()
          Gets the ID of the target gHN
 String getTargetNodeName()
          Gets the name of VirtualNode where the service is actually deployed within this scope
protected  void removeFromScope()
          Removes the resource from the scope
 void scheduleDeploy(VirtualNode node)
          Sets the GHN where the service will be deployed
 void scheduleUndeploy(VirtualNode node)
          Schedules the undeployment of an instance of this service from the node
 void setCallbackID(String id)
          Sets the callback ID from now on for all the service's operations
 void setMissingDependencies(List<Dependency> dependencies)
          Sets the list of missing dependencies for the next deployment
 void setResolvedDependencies(List<Dependency> dependencies)
          Sets the list of resolved dependencies to be used in the next deployment
 void setRI(String ri)
          Sets the RI generated by this software
 void setSourcePackage(GCUBEPackage sourcePackage)
           
 
Methods inherited from class org.gcube.vremanagement.resourcemanager.impl.resources.ScopedResource
doAction, equals, findResource, getAction, getErrorMessage, getHostedOn, getId, getJointTime, getLastModificationTime, getLogger, getScope, getStatus, getType, hashCode, isSuccess, noHopeForMe, setErrorMessage, setHostedON, setJointTime, setScope, setStatus, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final String TYPE
See Also:
Constant Field Values
Constructor Detail

ScopedDeployedSoftware

protected ScopedDeployedSoftware(String id,
                                 org.gcube.common.core.scope.GCUBEScope scope)
Method Detail

setSourcePackage

public void setSourcePackage(GCUBEPackage sourcePackage)

getSourcePackage

public GCUBEPackage getSourcePackage()

getResolvedDependencies

public List<Dependency> getResolvedDependencies(String ghnName)
Gets the list of resolved dependencies when the deployment was performed on a specific node

Parameters:
ghnName - the ID of the node
Returns:
the resolved dependencies

getLastResolvedDependencies

public List<Dependency> getLastResolvedDependencies()
Gets the list of resolved dependencies to be used in the next deployment

Returns:
the resolved dependencies

setResolvedDependencies

public void setResolvedDependencies(List<Dependency> dependencies)
Sets the list of resolved dependencies to be used in the next deployment

Parameters:
dependencies - the resolved dependencies

getMissingDependencies

public List<Dependency> getMissingDependencies(String ghnName)
Gets the list of missing dependencies when the deployment was performed on a specific node

Parameters:
ghnName - the name of the node
Returns:
the missing dependencies

getLastMissingDependencies

public List<Dependency> getLastMissingDependencies()
Gets the list of missing dependencies for the last (failed) deployment

Returns:
the missing dependencies

setMissingDependencies

public void setMissingDependencies(List<Dependency> dependencies)
Sets the list of missing dependencies for the next deployment

Parameters:
dependencies - the missign dependencies

find

protected void find()
             throws Exception
Description copied from class: ScopedResource
Custom

Specified by:
find in class ScopedResource
Throws:
ScopedResource.ResourceNotFound - if it is impossible to locate the resource
Exception

addToScope

protected void addToScope()
                   throws ScopedResource.ResourceNotFound,
                          Exception
Description copied from class: ScopedResource
Adds the resource to the scope

Specified by:
addToScope in class ScopedResource
Throws:
ScopedResource.ResourceNotFound - if the resource does not exist in the infrastructure
Exception - if the operation fails

removeFromScope

protected void removeFromScope()
                        throws ScopedResource.ResourceNotFound,
                               Exception
Description copied from class: ScopedResource
Removes the resource from the scope

Specified by:
removeFromScope in class ScopedResource
Throws:
ScopedResource.ResourceNotFound - if the resource does not exist in the infrastructure
Exception - if the operation fails

scheduleUndeploy

public void scheduleUndeploy(VirtualNode node)
                      throws VirtualNode.NoGHNFoundException
Schedules the undeployment of an instance of this service from the node

Parameters:
node - the node from where to undeploy the service
Throws:
VirtualNode.NoGHNFoundException
Exception - if the operation fails

scheduleDeploy

public void scheduleDeploy(VirtualNode node)
Sets the GHN where the service will be deployed

Parameters:
node - the target GHN

getTargetNodeID

public String getTargetNodeID()
Gets the ID of the target gHN

Returns:
the ID of the target gHN

setRI

public void setRI(String ri)
Sets the RI generated by this software

Parameters:
ri - the RI identifier

getRI

public String getRI()
Gets the RI generated by this software or null


setCallbackID

public void setCallbackID(String id)
                   throws VirtualNode.NoGHNFoundException
Sets the callback ID from now on for all the service's operations

Parameters:
id - the callback ID
Throws:
VirtualNode.NoGHNFoundException

getTargetNodeName

public String getTargetNodeName()
Gets the name of VirtualNode where the service is actually deployed within this scope

Returns:
the name of the VirtualNode

getMaxFindAttempts

protected int getMaxFindAttempts()
Number of times the resource is searched in the IS before to declare it lost

Overrides:
getMaxFindAttempts in class ScopedResource
Returns:
the number of attempts to do


Copyright © 2012. All Rights Reserved.