org.gcube.vremanagement.resourcemanager.impl.deployment
Class VirtualNode

java.lang.Object
  extended by org.gcube.vremanagement.resourcemanager.impl.deployment.VirtualNode

public class VirtualNode
extends java.lang.Object

A target node for deployment and undeployment operations

Author:
Manuele Simi (ISTI-CNR)

Nested Class Summary
static class VirtualNode.NoGHNFoundException
          NoGHNFoundException exception
 
Method Summary
 void deploy(GCUBEScope scope)
          Sends a request to the physical node to deploy the active list of packages to add
 java.lang.String detectName()
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getID()
          Gets the node ghnID
 java.util.Set<PackageInfo> getScheduledPackages()
          Gets the packages scheduled for the next deployment on this node
 GCUBEScope getWorkingScope()
          Gets the current scope used on this node
 int hashCode()
           
 void isNotWorking()
          Marks the node as not working node (usually called when a closed DeployerReport is received from the node)
 void setCallbackID(java.lang.String id)
           
 void setPackagesToAdd(java.util.Set<PackageInfo> packages)
          Sets the packages to remove in the next #deploy() invocation
 void setPackagesToRemove(java.util.Set<PackageInfo> packages)
          Sets the packages to remove in the nect #undeploy() invocation
 void setWorkingScope(GCUBEScope scope)
          Assigns a working scope to the node
 java.lang.String toString()
           
 void undeploy(GCUBEScope scope)
          Undeploys the packages from the node
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

setCallbackID

public void setCallbackID(java.lang.String id)

detectName

public java.lang.String detectName()
                            throws VirtualNode.NoGHNFoundException
Throws:
VirtualNode.NoGHNFoundException

setPackagesToAdd

public void setPackagesToAdd(java.util.Set<PackageInfo> packages)
Sets the packages to remove in the next #deploy() invocation

Parameters:
packages - the list of packagesT to add

getID

public java.lang.String getID()
Gets the node ghnID

Returns:
the node ghnID

deploy

public void deploy(GCUBEScope scope)
            throws java.lang.Exception
Sends a request to the physical node to deploy the active list of packages to add

Throws:
VirtualNode.NoGHNFoundException - if the deployment fails
java.lang.Exception

undeploy

public void undeploy(GCUBEScope scope)
              throws java.lang.Exception
Undeploys the packages from the node

Parameters:
scope - the scope to use for the undeployment
Throws:
VirtualNode.NoGHNFoundException - if the operation fails
java.lang.Exception

isNotWorking

public void isNotWorking()
Marks the node as not working node (usually called when a closed DeployerReport is received from the node)


setPackagesToRemove

public void setPackagesToRemove(java.util.Set<PackageInfo> packages)
Sets the packages to remove in the nect #undeploy() invocation

Parameters:
packages - the packages to remove from the node

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

setWorkingScope

public void setWorkingScope(GCUBEScope scope)
Assigns a working scope to the node

Parameters:
scope - the scope to set

getScheduledPackages

public java.util.Set<PackageInfo> getScheduledPackages()
Gets the packages scheduled for the next deployment on this node

Returns:
the set of packages

getWorkingScope

public GCUBEScope getWorkingScope()
Gets the current scope used on this node

Returns:
the current scope