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

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

public class VirtualNode
extends Object

A target node for deployment and undeployment operations

Author:
Manuele Simi (ISTI-CNR)

Nested Class Summary
static class VirtualNode.NoGHNFoundException
          NoGHNFoundException exception
 
Field Summary
protected  org.gcube.common.core.utils.logging.GCUBELog logger
          Object logger
 
Method Summary
 void deploy()
          Sends a request to the physical node to deploy the active list of packages to add
 boolean equals(Object obj)
           
protected static VirtualNode fromID(String ID, org.gcube.common.core.scope.GCUBEScope scope)
           
protected static VirtualNode fromName(String name, org.gcube.common.core.scope.GCUBEScope scope)
           
 String getID()
          Gets the node ghnID
 String getName()
           
protected  Set<org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo> getPackages()
          Gets the packagesToAdd available on this node
 Set<org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo> getScheduledPackages()
          Gets the packages scheduled for the next deployment on this node
 org.gcube.common.core.scope.GCUBEScope getWorkingScope()
          Gets the current scope used on this node
 int hashCode()
           
protected  boolean hasPackages(Set<org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo> packages)
          Checks if a list of packagesToAdd is already on this node
 void isNotWorking()
          Marks the node as not working node (usually called when a closed DeployerReport is received from the node)
 void setCallbackID(String id)
           
 void setPackagesToAdd(Set<org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo> packages)
          Sets the packages to remove in the next deploy() invocation
 void setPackagesToRemove(Set<org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo> packages)
          Sets the packages to remove in the next undeploy() invocation
 void setPackagesToUpgrade(Set<org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo> packages)
          Sets the packages to upgrade in the next upgrade() invocation
 void setWorkingScope(org.gcube.common.core.scope.GCUBEScope scope)
          Assigns a working scope to the node
 String toString()
           
 void undeploy()
          Undeploys the packages from the node
 void upgrade()
          Upgrades packages on the node
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final org.gcube.common.core.utils.logging.GCUBELog logger
Object logger

Method Detail

fromID

protected static VirtualNode fromID(String ID,
                                    org.gcube.common.core.scope.GCUBEScope scope)
                             throws VirtualNode.NoGHNFoundException
Throws:
VirtualNode.NoGHNFoundException

fromName

protected static VirtualNode fromName(String name,
                                      org.gcube.common.core.scope.GCUBEScope scope)
                               throws VirtualNode.NoGHNFoundException
Throws:
VirtualNode.NoGHNFoundException

setCallbackID

public void setCallbackID(String id)

setPackagesToAdd

public void setPackagesToAdd(Set<org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo> packages)
Sets the packages to remove in the next deploy() invocation

Parameters:
packages - the list of packagesT to add

getPackages

protected Set<org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo> getPackages()
Gets the packagesToAdd available on this node

Returns:
the packagesToAdd

hasPackages

protected boolean hasPackages(Set<org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo> packages)
Checks if a list of packagesToAdd is already on this node

Parameters:
packagesToAdd - the list of packagesToAdd to check
Returns:
true if all the packagesToAdd are already on this node, false otherwise

getID

public String getID()
Gets the node ghnID

Returns:
the node ghnID

deploy

public void deploy()
            throws Exception
Sends a request to the physical node to deploy the active list of packages to add

Throws:
VirtualNode.NoGHNFoundException - if the deployment fails
Exception

undeploy

public void undeploy()
              throws Exception
Undeploys the packages from the node

Throws:
VirtualNode.NoGHNFoundException - if the operation fails
Exception

upgrade

public void upgrade()
             throws Exception
Upgrades packages on the node

Throws:
VirtualNode.NoGHNFoundException
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(Set<org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo> packages)
Sets the packages to remove in the next undeploy() invocation

Parameters:
packages - the packages to remove from the node

setPackagesToUpgrade

public void setPackagesToUpgrade(Set<org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo> packages)
Sets the packages to upgrade in the next upgrade() invocation

Parameters:
packages - the packages to remove from the node

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

setWorkingScope

public void setWorkingScope(org.gcube.common.core.scope.GCUBEScope scope)
Assigns a working scope to the node

Parameters:
scope - the scope to set

getScheduledPackages

public Set<org.gcube.common.vremanagement.deployer.stubs.common.PackageInfo> getScheduledPackages()
Gets the packages scheduled for the next deployment on this node

Returns:
the set of packages

getWorkingScope

public org.gcube.common.core.scope.GCUBEScope getWorkingScope()
Gets the current scope used on this node

Returns:
the current scope

getName

public String getName()


Copyright © 2012. All Rights Reserved.