|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object eu.planets_project.services.datatypes.ServiceDescription
public final class ServiceDescription
A entity to hold metadata about services. The content of this object was first defined at the IF meeting in September 2008. This is intended to be used primarily as an XML schema, but is defined in Java to make reading/writing easier. See also, DOAP: http://trac.usefulinc.com/doap
This class is immutable in practice; its instances can therefore be shared freely and concurrently. Instances are created using a builder to allow optional named constructor parameters and ensure consistent state during creation. E.g. to create a service description with only the required arguments, you'd use:ServiceDescription d = new ServiceDescription.Builder(name,
type).build();
You can cascade additional calls for optional arguments:
ServiceDescription d = new ServiceDescription.Builder(name,
type).paths(path1,path2).logo(logo).build();
ServiceDescription instances can be serialized to XML. Given such an XML
representation, a service description can be instantiated using a static
factory method:
ServiceDescription d = ServiceDescription.of(xml);
To use a given service description (either as an object or as XML) as a
template for your service description, you can give it to the builder and add
or override values:
ServiceDescription d = new
ServiceDescription.Builder(xml).paths(path1, path2).logo(logo).build();
A corresponding XML schema can be generated from this class by running this
class as a Java application, see main(String[])
.
For usage examples, see the tests in ServiceDescriptionTest
.
ServiceDescriptionTest
Nested Class Summary | |
---|---|
static class |
ServiceDescription.Builder
Builder for ServiceDescription instances. |
Field Summary | |
---|---|
static java.lang.String |
AUTHORIZED_ROLES
Key to be used for properties indicating authorized roles. |
static java.net.URI |
PROPERTY
URI to use for service description properties. |
Method Summary | |
---|---|
static ServiceDescription.Builder |
copy(ServiceDescription serviceDescription)
|
static ServiceDescription.Builder |
create(java.lang.String name,
java.lang.String type)
|
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getAuthor()
|
java.lang.String |
getClassname()
|
java.lang.String |
getDescription()
|
java.net.URL |
getEndpoint()
|
java.net.URI |
getFurtherInfo()
|
java.lang.String |
getIdentifier()
|
java.util.List<java.net.URI> |
getInputFormats()
|
java.lang.String |
getInstructions()
|
java.net.URI |
getLogo()
|
java.lang.String |
getName()
|
java.util.List<Parameter> |
getParameters()
|
java.util.List<MigrationPath> |
getPaths()
|
java.util.List<Property> |
getProperties()
|
java.lang.String |
getServiceProvider()
|
Tool |
getTool()
|
java.lang.String |
getType()
|
java.lang.String |
getVersion()
|
int |
hashCode()
|
static void |
main(java.lang.String[] args)
Generates the XML schema for this class. |
static ServiceDescription |
of(java.lang.String xml)
|
java.lang.String |
toString()
|
java.lang.String |
toXml()
|
java.lang.String |
toXmlFormatted()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.net.URI PROPERTY
public static final java.lang.String AUTHORIZED_ROLES
Method Detail |
---|
public static ServiceDescription.Builder create(java.lang.String name, java.lang.String type)
name
- The name of the service description to buildtype
- The type of service description to build
public static ServiceDescription.Builder copy(ServiceDescription serviceDescription)
serviceDescription
- The service description to copy
public java.lang.String getName()
public java.lang.String getClassname()
public java.lang.String getType()
public java.net.URL getEndpoint()
public java.util.List<Parameter> getParameters()
public Tool getTool()
public java.lang.String getDescription()
public java.lang.String getVersion()
public java.lang.String getAuthor()
public java.lang.String getServiceProvider()
public java.lang.String getInstructions()
public java.net.URI getFurtherInfo()
public java.net.URI getLogo()
public java.lang.String getIdentifier()
public java.util.List<MigrationPath> getPaths()
public java.util.List<java.net.URI> getInputFormats()
public java.util.List<Property> getProperties()
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public static ServiceDescription of(java.lang.String xml)
xml
- The XML representation of a service description (as created
from calling toXml)
public java.lang.String toXml()
public java.lang.String toXmlFormatted()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public static void main(java.lang.String[] args)
args
- Ignored
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |