public class ServiceProfile extends FinalizedResource implements UtilityAdvertisement
ServiceCallee
s register to the
service bus by providing a set of instances of this class as registration
parameters, one for each "exported" operation that can be called by arbitrary
ServiceCaller
s. A such operation
has
Modifier and Type | Field and Description |
---|---|
static String |
MY_URI |
static String |
OWLS_PROFILE_NAMESPACE |
static String |
PROP_AVERAGE_QOS_RATING
A sub-property of profile:serviceParameter as a non-functional parameter
provided by the middleware for all registered services.
|
static String |
PROP_AVERAGE_RESPONSE_TIME
A sub-property of profile:serviceParameter as a non-functional parameter
provided by the middleware for all registered services.
|
static String |
PROP_HOST_LOCATION
A sub-property of profile:serviceParameter as a non-functional parameter
to be provided by a registered service to indicate where the physical
node hosting the service resides.
|
static String |
PROP_MAX_QOS_RATING
A sub-property of profile:serviceParameter as a non-functional parameter
provided by the middleware for all registered services.
|
static String |
PROP_MAX_RESPONSE_TIME
A sub-property of profile:serviceParameter as a non-functional parameter
provided by the middleware for all registered services.
|
static String |
PROP_MIN_QOS_RATING
A sub-property of profile:serviceParameter as a non-functional parameter
provided by the middleware for all registered services.
|
static String |
PROP_MIN_RESPONSE_TIME
A sub-property of profile:serviceParameter as a non-functional parameter
provided by the middleware for all registered services.
|
static String |
PROP_NUMBER_OF_QOS_RATINGS
A sub-property of profile:serviceParameter as a non-functional parameter
provided by the middleware for all registered services.
|
static String |
PROP_NUMBER_OF_RESPONSE_TIME_MEASUREMENTS
A sub-property of profile:serviceParameter as a non-functional parameter
provided by the middleware for all registered services.
|
static String |
PROP_OWLS_PROFILE_HAS_INPUT
The OWL-S property profile:hasInput
|
static String |
PROP_OWLS_PROFILE_HAS_OUTPUT
The OWL-S property profile:hasOutput
|
static String |
PROP_OWLS_PROFILE_HAS_PARAMETER
The OWL-S property profile:hasParameter
|
static String |
PROP_OWLS_PROFILE_HAS_PROCESS
The OWL-S property profile:has_process
|
static String |
PROP_OWLS_PROFILE_HAS_RESULT
The OWL-S property profile:hasResult
|
static String |
PROP_OWLS_PROFILE_SERVICE_NAME
The OWL-S property profile:serviceName
|
static String |
PROP_OWLS_PROFILE_SERVICE_PARAMETER
The OWL-S property profile:serviceParameter
|
static String |
PROP_OWLS_PROFILE_TEXT_DESCRIPTION
The OWL-S property profile:textDescription
|
static String |
PROP_RESPONSE_TIMEOUT
A sub-property of profile:serviceParameter as a non-functional parameter
to be provided by a registered service to indicate after how many
milliseconds of waiting for a response from the service, the middleware
must send a timeout failure message to the caller.
|
static String |
PROP_SPATIAL_COVERAGE
A sub-property of profile:serviceParameter as a non-functional parameter
to be provided by a registered service to indicate in which physical area
it makes sense to utilize the service.
|
ANON_URI_PREFIX, blockAddingTypes, isXMLLiteral, NAMESPACE_PREFIX, ns_delim_index, PROP_INVOLVED_HUMAN_USER, PROP_RDF_FIRST, PROP_RDF_REST, PROP_RDF_TYPE, PROP_RDFS_COMMENT, PROP_RDFS_LABEL, PROP_SERIALIZATION_FULL, PROP_SERIALIZATION_OPTIONAL, PROP_SERIALIZATION_REDUCED, PROP_SERIALIZATION_UNDEFINED, props, RDF_EMPTY_LIST, RDF_NAMESPACE, RDFS_NAMESPACE, SERVICE_NAMESPACE, TYPE_RDF_LIST, TYPE_RDFS_CLASS, uri, VOCABULARY_NAMESPACE
Constructor and Description |
---|
ServiceProfile()
Only for use by deserializers.
|
ServiceProfile(Service s,
String processURI)
The constructor to be used by
ServiceCallee s. |
ServiceProfile(String uri) |
Modifier and Type | Method and Description |
---|---|
void |
addAddEffect(String[] ppath,
Object value)
Declares that a call to the service described by this profile adds the
given
value to the property reachable by the given
ppath . |
void |
addChangeEffect(String[] ppath,
Object value)
Declares that a call to the service described by this profile changes the
value of the property reachable by the given
ppath to the
given value . |
void |
addClassConversionOutputBinding(ProcessOutput toParam,
String[] sourceProp,
TypeURI targetClass)
Declares that the output parameter specified by
toParam will
be an instance of the given targetClass as a result of
converting the actual value of a property reachable by the given property
path sourceProp . |
void |
addInput(ProcessInput in)
Adds the given input parameter to the set of this service's input
parameters.
|
void |
addLangConversionOutputBinding(ProcessOutput toParam,
String[] sourceProp,
String targetLang)
Declares that the output parameter specified by
toParam will
be the translation of the actual value of a property reachable by the
given property path sourceProp into the given
targetLang . |
static void |
addNonFunctionalParameter(String subPropertyOfServiceParameter,
Class subclassOfProfileParameter)
Sub-properties of profile:serviceParameter can be made known to the
middleware by calling this method.
|
void |
addOutput(ProcessOutput out)
Adds the given output parameter to the set of this service's output
parameters.
|
void |
addRemoveEffect(String[] ppath)
Declares that a call to the service described by this profile removes the
value of the property reachable by the given
ppath . |
void |
addSimpleOutputBinding(ProcessOutput toParam,
String[] sourceProp)
Declares that the output parameter specified by
toParam will
reflect the value of a property reachable by the given property path
sourceProp . |
void |
addUnitConversionOutputBinding(ProcessOutput toParam,
String[] sourceProp,
String targetUnit)
Declares that the output parameter specified by
toParam will
reflect the value of a property reachable by the given property path
sourceProp in terms of the given measurement unit
targetUnit . |
static ServiceProfile |
deserializeProfile(String turtleSP)
Returns the de-serialized profile
|
Resource[] |
getEffects()
Returns the list of service effects; the main user of this method is the
service bus.
|
Iterator |
getInputs()
Returns the list of service input parameters; the main user of this
method is the service bus.
|
int |
getNumberOfInputs() |
int |
getNumberOfMandatoryInputs() |
Resource[] |
getOutputBindings()
Returns the list of declarations how the service output parameters are
bound; the main user of this method is the service bus.
|
Iterator |
getOutputs()
Returns the list of service output parameters; the main user of this
method is the service bus.
|
String |
getProcessURI()
Returns the URI that serves as the internal ID of the service on the side
of the provider; the main user of this method is the service bus.
|
String |
getServiceDescription()
Returns the textual description of the service; the main user of this
method is the service bus.
|
String |
getServiceName()
Returns the name of the service; the main user of this method is the
service bus.
|
Service |
getTheService()
Returns the individual from the service ontology that represents the
provided service; the main user of this method is the service bus.
|
boolean |
isEmpty()
Checks if input, output and result is empty.
|
boolean |
matches(Matchable other) |
String |
serializeProfile()
Returns the serialized profile as String
|
boolean |
setProperty(String propURI,
Object value)
Adds a statement with this resource as the subject, the given
propURI as the predicate and the given value as the object. |
addType, getLocalName, getNamespace, getProperty, getPropertyURIs, getType, getTypes, getURI, hasQualifiedName, isAnon, numberOfProperties
addMultiLangProp, asList, asList, asRDFList, changeProperty, copy, deepCopy, equals, generateAnonURI, getDefaultLang, getFilename, getMultiLangProp, getOrConstructLabel, getOrConstructLabel, getPropSerializationType, getResource, getResourceComment, getResourceLabel, getResourceLabel, getStaticFieldValue, hashCode, hasProperty, isAnon, isBlockingAddingTypes, isClosedCollection, isQualifiedName, isWellFormed, literal, representsQualifiedURI, serializesAsXMLLiteral, setPropertyPath, setPropertyPath, setPropertyPathFromOffset, setResourceComment, setResourceLabel, toString, toStringRecursive, toStringRecursive, unliteral
public static final String OWLS_PROFILE_NAMESPACE
public static final String MY_URI
public static final String PROP_OWLS_PROFILE_SERVICE_NAME
public static final String PROP_OWLS_PROFILE_TEXT_DESCRIPTION
public static final String PROP_OWLS_PROFILE_HAS_PROCESS
public static final String PROP_OWLS_PROFILE_HAS_INPUT
public static final String PROP_OWLS_PROFILE_HAS_OUTPUT
public static final String PROP_OWLS_PROFILE_HAS_RESULT
public static final String PROP_OWLS_PROFILE_SERVICE_PARAMETER
public static final String PROP_OWLS_PROFILE_HAS_PARAMETER
public static final String PROP_AVERAGE_QOS_RATING
QoSRating
.public static final String PROP_AVERAGE_RESPONSE_TIME
ResponseTimeInMilliseconds
.public static final String PROP_HOST_LOCATION
SingleLocationParameter
.public static final String PROP_MAX_QOS_RATING
QoSRating
.public static final String PROP_MAX_RESPONSE_TIME
ResponseTimeInMilliseconds
.public static final String PROP_MIN_QOS_RATING
QoSRating
.public static final String PROP_MIN_RESPONSE_TIME
ResponseTimeInMilliseconds
.public static final String PROP_NUMBER_OF_QOS_RATINGS
NumberOfSamples
.public static final String PROP_NUMBER_OF_RESPONSE_TIME_MEASUREMENTS
NumberOfSamples
.public static final String PROP_RESPONSE_TIMEOUT
ResponseTimeInMilliseconds
.public static final String PROP_SPATIAL_COVERAGE
MultiLocationParameter
; the union of the given locations will be interpreted as the area
covered by the service.public ServiceProfile()
public ServiceProfile(String uri)
public ServiceProfile(Service s, String processURI)
ServiceCallee
s. Effects,
inputs, outputs and output bindings must be added to the profile using
methods whose names starts with "add*". The rdfs:label and rdfs:comment
provided by the class of the given service will be used as
profile:serviceName and profile:textDescription respectively.s
- The individual service whose profile is being constructedprocessURI
- The URI that is used by the
ServiceCallee
registering this profile as an internal ID for identifying the
operation calledpublic static void addNonFunctionalParameter(String subPropertyOfServiceParameter, Class subclassOfProfileParameter)
subPropertyOfServiceParameter
- The URI of the sub-propertysubclassOfProfileParameter
- A subclass of ProfileParameter
from which the values
of the new property stempublic void addAddEffect(String[] ppath, Object value)
value
to the property reachable by the given
ppath
. The property should normally be a multi-valued
property.public void addChangeEffect(String[] ppath, Object value)
ppath
to the
given value
.public void addClassConversionOutputBinding(ProcessOutput toParam, String[] sourceProp, TypeURI targetClass)
toParam
will
be an instance of the given targetClass
as a result of
converting the actual value of a property reachable by the given property
path sourceProp
.public void addInput(ProcessInput in)
public void addLangConversionOutputBinding(ProcessOutput toParam, String[] sourceProp, String targetLang)
toParam
will
be the translation of the actual value of a property reachable by the
given property path sourceProp
into the given
targetLang
.public void addOutput(ProcessOutput out)
public void addRemoveEffect(String[] ppath)
ppath
.public void addSimpleOutputBinding(ProcessOutput toParam, String[] sourceProp)
toParam
will
reflect the value of a property reachable by the given property path
sourceProp
.public void addUnitConversionOutputBinding(ProcessOutput toParam, String[] sourceProp, String targetUnit)
toParam
will
reflect the value of a property reachable by the given property path
sourceProp
in terms of the given measurement unit
targetUnit
.public Resource[] getEffects()
public Iterator getInputs()
public int getNumberOfInputs()
public int getNumberOfMandatoryInputs()
public Iterator getOutputs()
public Resource[] getOutputBindings()
public String getProcessURI()
public String getServiceName()
public String getServiceDescription()
public Service getTheService()
public boolean isEmpty()
public boolean setProperty(String propURI, Object value)
Resource
propURI
as the predicate and the given value as the object.
Subclasses must override this in order to decide if the statement to be
added fits the general class constraints. If not, the call of this method
should be ignored. For each property only one single call may be made to
this method, unless subsequent calls to this method for setting the value
of the same property are treated as an update for an update-able
property. Multi-valued properties must be set using an instance of
List
. The differentiation, if a such list should be
treated as an rdf:List, can be made with the help of
Resource.isClosedCollection(String)
. The default implementation here
accepts all property-value pairs blindly except for rdf:type which is
handled if the value is a type URI, a Resource or a java.util.List of
them.
Note: The setting of the property rdf:type is being handled by this class
via the final methods Resource.addType(String, boolean)
,
Resource.getType()
, and Resource.getTypes()
. Although these methods give
the view of handling type URIs as strings, but in reality the types are
stored as direct instances of this class. So, the subclasses should
ignore calls for setting rdf:type; if not, then the subclass must pay
attention that the value should be a List
of direct instances of
this class so that (1) the Resource.toString()
method returns just the
URI and (2) the serializers get no problems with the value. Also,
settings via subclasses may be overwritten by this class if a subsequent
call to Resource.addType(String, boolean)
is made.
setProperty
in class Resource
Resource.setProperty(java.lang.String,java.lang.Object)
public String serializeProfile()
public static ServiceProfile deserializeProfile(String turtleSP)
public boolean matches(Matchable other)
matches
in interface Matchable
Matchable.matches(Matchable)
Copyright © 2018 universAAL Consortium. All rights reserved.