org.gcube.common.core.resources
Class GCUBEService

java.lang.Object
  extended by org.gcube.common.core.resources.GCUBEResource
      extended by org.gcube.common.core.resources.GCUBEService
Direct Known Subclasses:
KGCUBEService

public abstract class GCUBEService
extends GCUBEResource

Specifies the behaviour common to all gCUBE services.

Author:
Andrea Manzi (ISTI-CNR), Manuele Simi (ISTI-CNR), Fabio Simeoni (University of Strathclyde), Luca Frosini (ISTI-CNR)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gcube.common.core.resources.GCUBEResource
GCUBEResource.AddScopeEvent, GCUBEResource.InvalidScopeException, GCUBEResource.RemoveScopeEvent, GCUBEResource.ResourceConsumer, GCUBEResource.ResourceEvent<PAYLOAD>, GCUBEResource.ResourceTopic
 
Field Summary
protected  Configuration configuration
          The configuration of the service.
protected  List<ServiceDependency> dependencies
          VRE Dependencies
protected  String specificData
          Service-specific data.
static String TYPE
          The type of the resource.
 
Fields inherited from class org.gcube.common.core.resources.GCUBEResource
eventProducer, logger, resourceVersion, type
 
Constructor Summary
GCUBEService()
           
 
Method Summary
 boolean equals(Object obj)
           
 Configuration getConfiguration()
          Returns the service configuration.
 List<ServiceDependency> getDependencies()
          Returns the service dependencies.
 String getDescription()
          Returns the description of the service
 String getLastResourceVersion()
           
 List<Package> getPackages()
          Returns the list of service packages.
 String getServiceClass()
          Returns the class of the service.
 String getServiceName()
          Returns the name of the service.
 String getSpecificData()
          Return service-specific data.
 String getVersion()
          Returns the service version
 boolean inScope(GCUBEScope... scopes)
          Indicates whether the resource is in one or more given scopes.
 void setConfiguration(Configuration configuration)
          Sets the service configuration.
 void setDescription(String description)
          Sets the description of the service.
 boolean setServiceClass(String clazz)
          Sets the class of the service.
 boolean setServiceName(String name)
          Sets the name of the service.
 void setSpecificData(String specificData)
          Sets service-specific data.
 boolean setVersion(String version)
          Sets the service version As the version is a one-time constant, the operation returns successfully from the first invocation only.
 
Methods inherited from class org.gcube.common.core.resources.GCUBEResource
addScope, getID, getResourceVersion, getScopes, getType, load, removeScope, setID, setLogger, setResourceVersion, store, subscribeResourceEvents, validateAddScopes, validateRemoveScopes
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final String TYPE
The type of the resource.

See Also:
Constant Field Values

configuration

protected Configuration configuration
The configuration of the service.


dependencies

protected List<ServiceDependency> dependencies
VRE Dependencies


specificData

protected String specificData
Service-specific data.

Constructor Detail

GCUBEService

public GCUBEService()
Method Detail

inScope

public boolean inScope(GCUBEScope... scopes)
Indicates whether the resource is in one or more given scopes.

Overrides:
inScope in class GCUBEResource
Parameters:
scopes - the scopes.
Returns:
true if it is in all the input scopes, false otherwise.

getServiceClass

public String getServiceClass()
Returns the class of the service.

Returns:
the class.

setServiceClass

public boolean setServiceClass(String clazz)
Sets the class of the service. As the class is a one-time constant, the operation returns successfully from the first invocation only.

Parameters:
clazz - the class.
Returns:
true if the class was set, false otherwise.

getServiceName

public String getServiceName()
Returns the name of the service. As the name is a one-time constant, the operation returns successfully from the first invocation only.

Returns:
the name.

setServiceName

public boolean setServiceName(String name)
Sets the name of the service. As the class is a one-time constant, the operation returns successfully from the first invocation only.

Parameters:
name - the name.
Returns:
true if the identifier was set, false otherwise.

setDescription

public void setDescription(String description)
Sets the description of the service.

Parameters:
description - the description.

getDescription

public String getDescription()
Returns the description of the service

Returns:
the description.

getConfiguration

public Configuration getConfiguration()
Returns the service configuration.

Returns:
the configuration.

setConfiguration

public void setConfiguration(Configuration configuration)
Sets the service configuration.

Parameters:
configuration - the configuration.

getSpecificData

public String getSpecificData()
Return service-specific data.

Returns:
the data.

setSpecificData

public void setSpecificData(String specificData)
Sets service-specific data.

Parameters:
specificData - the data.

getPackages

public List<Package> getPackages()
Returns the list of service packages.

Returns:
the packages.

getDependencies

public List<ServiceDependency> getDependencies()
Returns the service dependencies.

Returns:
the dependencies.

getVersion

public String getVersion()
Returns the service version

Returns:
the version

setVersion

public boolean setVersion(String version)
Sets the service version As the version is a one-time constant, the operation returns successfully from the first invocation only.

Parameters:
version - the version
Returns:
true if the class was set, false otherwise.

getLastResourceVersion

public String getLastResourceVersion()
Overrides:
getLastResourceVersion in class GCUBEResource
Returns:
the last version available of the resource

equals

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


Copyright © 2012. All Rights Reserved.