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

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

public class PublishedScopeResource
extends java.lang.Object

The scope resource published in the IS

Author:
Manuele Simi (ISTI-CNR)

Nested Class Summary
static class PublishedScopeResource.UnknownScopeOptionException
          InvalidVREOption exception
 
Method Summary
 void addResource(ScopedResource resource)
          Adds a resource to PublishedScopeResource
 void dismiss()
          Dismisses the PublishedScopeResource from the IS and the scope
 java.lang.String getCreator()
           
 java.lang.String getDescription()
           
 java.lang.String getDesigner()
           
 java.lang.String getDisplayName()
           
 java.util.Date getEndTime()
           
static PublishedScopeResource getResource(GCUBEScope scope)
          Gets the current Scope Resource
 GCUBEScope getScope()
           
 java.util.Date getStartTime()
           
 Type getType()
          Returns the type of the scope.
 boolean isSecurityEnabled()
           
 boolean loaded()
           
 void loadFromLocalState(ScopeState scopeState)
          Fills this PublishedResourceList with the content of the input ScopeState
 void publish()
          Publishes the PublishedScopeResource into the IS
 void reload()
           
 void removeResource(ScopedResource resource)
          Removes a resource from the PublishedScopeResource
 void setOption(java.lang.String name, java.lang.String value)
          Sets a scope option
 void synchWithLocalState(ScopeState scopeState)
          Synchronizes this PublishedResourceList with the content of the input ScopeState
 void to(ScopeState scopeState)
          Fills the input ScopeState with the actual content of the PublishedResourceList
 java.lang.String toString()
          Returns a string representation of the PublishedScopeResource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

reload

public void reload()
            throws java.lang.Exception
Throws:
java.lang.Exception

getResource

public static PublishedScopeResource getResource(GCUBEScope scope)
                                          throws java.lang.Exception
Gets the current Scope Resource

Parameters:
scope - the scope of the resource to load
Returns:
the PublishedScopeResource
Throws:
java.lang.Exception

addResource

public void addResource(ScopedResource resource)
                 throws java.lang.Exception
Adds a resource to PublishedScopeResource

Parameters:
resource -
Throws:
PublishedScopeResource.UnknownScopeOptionException
java.lang.Exception

removeResource

public void removeResource(ScopedResource resource)
                    throws java.lang.Exception
Removes a resource from the PublishedScopeResource

Parameters:
resource -
Throws:
PublishedScopeResource.UnknownScopeOptionException
java.lang.Exception

toString

public java.lang.String toString()
Returns a string representation of the PublishedScopeResource

Overrides:
toString in class java.lang.Object
Throws:
java.io.IOException

getScope

public GCUBEScope getScope()
Returns:
the scope

getType

public Type getType()
Returns the type of the scope.

Returns:
the type.

setOption

public void setOption(java.lang.String name,
                      java.lang.String value)
               throws java.lang.Exception
Sets a scope option

Parameters:
name - the option name
value - the option value
Throws:
PublishedScopeResource.UnknownScopeOptionException
java.text.ParseException
java.lang.Exception

publish

public void publish()
             throws java.lang.Exception
Publishes the PublishedScopeResource into the IS

Throws:
java.lang.Exception

dismiss

public void dismiss()
             throws java.lang.Exception
Dismisses the PublishedScopeResource from the IS and the scope

Throws:
java.lang.Exception

getCreator

public java.lang.String getCreator()
Returns:
the creator

getDesigner

public java.lang.String getDesigner()
Returns:
the designer

getDescription

public java.lang.String getDescription()
Returns:
the description

getDisplayName

public java.lang.String getDisplayName()
Returns:
the display name

getStartTime

public java.util.Date getStartTime()
Returns:
the startTime

getEndTime

public java.util.Date getEndTime()
Returns:
the endTime

isSecurityEnabled

public boolean isSecurityEnabled()
Returns:
the securityEnabled

loaded

public boolean loaded()

to

public void to(ScopeState scopeState)
Fills the input ScopeState with the actual content of the PublishedResourceList

Parameters:
scopeState - the list to fill

loadFromLocalState

public void loadFromLocalState(ScopeState scopeState)
                        throws java.lang.Exception
Fills this PublishedResourceList with the content of the input ScopeState

Parameters:
scopeState - the list to load
Throws:
PublishedScopeResource.UnknownScopeOptionException - if the load fails
java.lang.Exception

synchWithLocalState

public void synchWithLocalState(ScopeState scopeState)
                         throws java.lang.Exception
Synchronizes this PublishedResourceList with the content of the input ScopeState

Parameters:
scopeState - the list to synchronize with
Throws:
PublishedScopeResource.UnknownScopeOptionException - if the synchronization fails
java.lang.Exception