public final class ScopeState extends Observable
| Modifier and Type | Class and Description |
|---|---|
static class |
ScopeState.OPERATION |
| Modifier and Type | Field and Description |
|---|---|
protected ScopeState.OPERATION |
lastOperationPerformed
last operation performed on the list
|
protected org.gcube.common.core.utils.logging.GCUBELog |
logger |
| Modifier | Constructor and Description |
|---|---|
protected |
ScopeState() |
| Modifier and Type | Method and Description |
|---|---|
void |
addResources(Set<ScopedResource> newresources)
Adds a new resources to the list
|
void |
changeDescription(String description)
Changes the scope description
|
boolean |
containsResource(String id) |
void |
forceResourceRemoval(Set<ScopedResource> resources)
Removes the resource from the state, no matter about its actual status
|
Collection<ScopedResource> |
getAllResources()
Gets all the
ScopedResources |
String |
getDescription() |
String |
getDesigner()
Gets the scope designer
|
Date |
getEndTime() |
ScopeState.OPERATION |
getLastOperationPerformed() |
Session |
getLastReport()
Gets the last active
Session |
String |
getManager()
Gets the scope manager
|
String |
getName() |
VirtualNode |
getNode(String name)
Gets the node by its name
|
VirtualNode |
getNodeById(String id)
Gets the node by its identifier
|
RawScopeState |
getRawScopeState()
Gets the
RawScopeState |
ScopedDeployedSoftware |
getRelatedDeployedSoftware(GCUBEPackage sourceService)
Gets the deployed service of the given service, if any
|
ScopedResource |
getResource(String id)
Gets the resource with the given id
|
Set<ScopedResource> |
getResourcesByType(String type)
Gets resources of the given type
|
org.gcube.common.core.scope.GCUBEScope |
getScope()
Gets the resource's scope
|
Date |
getStartTime() |
protected void |
initialize(org.gcube.common.core.scope.GCUBEScope scope,
String name,
boolean securityEnabled,
String... description) |
boolean |
isDisposed() |
boolean |
isSecurityEnabled() |
void |
markAsDisposed() |
void |
notifyObservers() |
void |
notifyObservers(Object whatschanged) |
protected void |
removeAllResources()
Empty the list of resources
|
void |
removeAllResourcesByType(String type)
Removes all the resource of the given type
|
void |
removeResources(Set<ScopedResource> oldresources)
Removes the resources from the scope
|
void |
setDesigner(String designer)
Sets the scope designer identity
|
void |
setEndTime(Date endTime) |
void |
setLastOperationPerformed(ScopeState.OPERATION operation) |
void |
setLastSession(Session report)
Sets the last active
Session |
void |
setManager(String manager)
Sets the scope manager identity
|
void |
setName(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(Date startTime) |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, setChangedprotected org.gcube.common.core.utils.logging.GCUBELog logger
protected ScopeState.OPERATION lastOperationPerformed
protected void initialize(org.gcube.common.core.scope.GCUBEScope scope,
String name,
boolean securityEnabled,
String... description)
public void setManager(String manager)
manager - the managerpublic void setDesigner(String designer)
manager - the managerpublic void changeDescription(String description)
description - the descriptionpublic void addResources(Set<ScopedResource> newresources)
newresources - the resources to addpublic Set<ScopedResource> getResourcesByType(String type)
type - the type to filterpublic ScopedResource getResource(String id)
id - the resource identifiedpublic boolean containsResource(String id)
public void removeAllResourcesByType(String type)
type - the type of resources to removepublic void removeResources(Set<ScopedResource> oldresources) throws VirtualNode.NoGHNFoundException
oldresources - the resources to removeVirtualNode.NoGHNFoundExceptionpublic void forceResourceRemoval(Set<ScopedResource> resources)
resources - protected void removeAllResources()
public org.gcube.common.core.scope.GCUBEScope getScope()
public void notifyObservers(Object whatschanged)
notifyObservers in class Observablepublic void notifyObservers()
notifyObservers in class Observablepublic Collection<ScopedResource> getAllResources()
ScopedResourcesScopedResourcespublic String getManager()
public String getDesigner()
public String getDescription()
public String getName()
public Date getEndTime()
public Date getStartTime()
public boolean isSecurityEnabled()
public void setEndTime(Date endTime)
public void setStartTime(Date startTime)
public void setName(String name)
public ScopeState.OPERATION getLastOperationPerformed()
public void setLastOperationPerformed(ScopeState.OPERATION operation)
operation - the last operation performed on the listpublic RawScopeState getRawScopeState()
RawScopeStatepublic void setRawScopeState(RawScopeState state)
RawScopeState
it usually invoked at deserialization time, see Serializer.load(ScopeState, GCUBEScope)state - public void setSecurity(boolean securityEnabled)
public void setLastSession(Session report)
Sessionsession - the sessionpublic boolean isDisposed()
public void markAsDisposed()
isDisposed - the isDisposed to setpublic VirtualNode getNode(String name) throws VirtualNode.NoGHNFoundException
name - the nameVirtualNode.NoGHNFoundException - if the node does not existpublic VirtualNode getNodeById(String id) throws VirtualNode.NoGHNFoundException
id - the identifierVirtualNode.NoGHNFoundException - if the node does not existpublic ScopedDeployedSoftware getRelatedDeployedSoftware(GCUBEPackage sourceService) throws ServiceNotFoundException
scopeState - the state where to search the deployed servicesourceService - the serviceServiceNotFoundExceptionCopyright © 2015. All Rights Reserved.