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

java.lang.Object
  extended by java.util.Observable
      extended by org.gcube.vremanagement.resourcemanager.impl.state.ScopeState

public class ScopeState
extends java.util.Observable

A list of scoped resources

Author:
Manuele Simi (ISTI-CNR)

Nested Class Summary
static class ScopeState.OPERATION
           
 
Method Summary
 void addResources(java.util.Set<ScopedResource> newresources)
          Adds a new resources to the list
 void changeDescription(java.lang.String description)
          Changes the scope description
 boolean containsResource(java.lang.String id)
           
 void forceResourceRemoval(java.util.Set<ScopedResource> resources)
          Removes the resource from the state, no matter about its actual status
 java.util.Collection<ScopedResource> getAllResources()
          Gets all the ScopedResources
 java.lang.String getDescription()
           
 java.lang.String getDesigner()
          Gets the scope designer
 java.util.Date getEndTime()
           
 ScopeState.OPERATION getLastOperationPerformed()
           
 Session getLastReport()
          Gets the last active Session
 java.lang.String getManager()
          Gets the scope manager
 java.lang.String getName()
           
 RawScopeState getRawScopeState()
          Gets the RawScopeState
 ScopedResource getResource(java.lang.String id)
          Gets the resource with the given id
 java.util.Set<ScopedResource> getResourcesByType(java.lang.String type)
          Gets resources of the given type
 GCUBEScope getScope()
          Gets the resource's scope
 java.util.Date getStartTime()
           
 boolean isSecurityEnabled()
           
 void notifyObservers()
           
 void notifyObservers(java.lang.Object whatschanged)
           
 void removeAllResourcesByType(java.lang.String type)
          Removes all the resource of the given type
 void removeResources(java.util.Set<ScopedResource> oldresources)
          Removes the resources from the scope
 void setDesigner(java.lang.String designer)
          Sets the scope designer identity
 void setEndTime(java.util.Date endTime)
           
 void setLastOperationPerformed(ScopeState.OPERATION operation)
           
 void setLastSession(Session report)
          Sets the last active Session
 void setManager(java.lang.String manager)
          Sets the scope manager identity
 void setName(java.lang.String name)
           
 void setRawScopeState(RawScopeState state)
          Sets the new RawScopeState it usually invoked at deserialization time, see Serializer.load(ScopeState, GCUBEScope)
 void setSecurity(boolean securityEnabled)
           
 void setStartTime(java.util.Date startTime)
           
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setManager

public void setManager(java.lang.String manager)
Sets the scope manager identity

Parameters:
manager - the manager

setDesigner

public void setDesigner(java.lang.String designer)
Sets the scope designer identity

Parameters:
manager - the manager

changeDescription

public void changeDescription(java.lang.String description)
Changes the scope description

Parameters:
description - the description

addResources

public void addResources(java.util.Set<ScopedResource> newresources)
Adds a new resources to the list

Parameters:
newresources - the resources to add

getResourcesByType

public java.util.Set<ScopedResource> getResourcesByType(java.lang.String type)
Gets resources of the given type

Parameters:
type - the type to filter
Returns:
the collection of resources

getResource

public ScopedResource getResource(java.lang.String id)
Gets the resource with the given id

Parameters:
id - the resource identified
Returns:
the resource

containsResource

public boolean containsResource(java.lang.String id)

removeAllResourcesByType

public void removeAllResourcesByType(java.lang.String type)
Removes all the resource of the given type

Parameters:
type - the type of resources to remove

removeResources

public void removeResources(java.util.Set<ScopedResource> oldresources)
Removes the resources from the scope

Parameters:
oldresources - the resources to remove

forceResourceRemoval

public void forceResourceRemoval(java.util.Set<ScopedResource> resources)
Removes the resource from the state, no matter about its actual status

Parameters:
resources -

getScope

public GCUBEScope getScope()
Gets the resource's scope

Returns:
the scope

notifyObservers

public void notifyObservers(java.lang.Object whatschanged)
Overrides:
notifyObservers in class java.util.Observable

notifyObservers

public void notifyObservers()
Overrides:
notifyObservers in class java.util.Observable

getAllResources

public java.util.Collection<ScopedResource> getAllResources()
Gets all the ScopedResources

Returns:
all the ScopedResources

getManager

public java.lang.String getManager()
Gets the scope manager

Returns:
the scope manger

getDesigner

public java.lang.String getDesigner()
Gets the scope designer

Returns:
the scope designer

getDescription

public java.lang.String getDescription()

getName

public java.lang.String getName()

getEndTime

public java.util.Date getEndTime()

getStartTime

public java.util.Date getStartTime()

isSecurityEnabled

public boolean isSecurityEnabled()

setEndTime

public void setEndTime(java.util.Date endTime)

setStartTime

public void setStartTime(java.util.Date startTime)

setName

public void setName(java.lang.String name)

getLastOperationPerformed

public ScopeState.OPERATION getLastOperationPerformed()
Returns:
the the last operation performed on the list

setLastOperationPerformed

public void setLastOperationPerformed(ScopeState.OPERATION operation)
Parameters:
operation - the last operation performed on the list

getRawScopeState

public RawScopeState getRawScopeState()
Gets the RawScopeState

Returns:
the raw state

setRawScopeState

public void setRawScopeState(RawScopeState state)
Sets the new RawScopeState it usually invoked at deserialization time, see Serializer.load(ScopeState, GCUBEScope)

Parameters:
state -

setSecurity

public void setSecurity(boolean securityEnabled)

getLastReport

public Session getLastReport()
Gets the last active Session

Returns:
the session

setLastSession

public void setLastSession(Session report)
Sets the last active Session

Parameters:
session - the session