org.universAAL.middleware.service
Class ServiceCall

Package class diagram package ServiceCall
java.lang.Object
  extended by org.universAAL.middleware.rdf.Resource
      extended by org.universAAL.middleware.rdf.FinalizedResource
          extended by org.universAAL.middleware.service.ServiceCall
All Implemented Interfaces:
UtilityCall

public class ServiceCall
extends FinalizedResource
implements UtilityCall

Operations of ServiceCallees will be called by passing an instance of this class. The ServiceCallee must then identify the operation called using the the return value of getProcessURI(). In a next step, if the operation called needs input values, they can be collected by several calls to getInputValue(String). In case of optional input parameters, the operation should be "executed" with the default value of the optional parameters only if getInputValue(String) returns null; otherwise the passed value must be used.

Author:
mtazari - Saied Tazari

Field Summary
static String MY_URI
          A resource URI that specifies the resource as a service call.
static String PROP_OWLS_BINDING_VALUE_DATA
          A property key for the actual input value within an input resource.
static String PROP_OWLS_PERFORM_HAS_DATA_FROM
          A property key that points to the List containing all of the input resources.
static String PROP_OWLS_PERFORM_PROCESS
          A property key that corresponds to the URI of the OWL-S perform process.
static ServiceCall THIS_SERVICE_CALL
          A ServiceCall that is a realization of the OWL-S process:ThisPerform.
static String TYPE_OWLS_INPUT_BINDING
          A type that identifies a resource as an input resource of a call.
 
Fields inherited from class org.universAAL.middleware.rdf.Resource
ANON_URI_PREFIX, blockAddingTypes, isXMLLiteral, ns_delim_index, 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, PROP_uAAL_INVOLVED_HUMAN_USER, props, RDF_EMPTY_LIST, RDF_NAMESPACE, RDFS_NAMESPACE, TYPE_RDF_LIST, TYPE_RDFS_CLASS, uAAL_NAMESPACE_PREFIX, uAAL_SERVICE_NAMESPACE, uAAL_VOCABULARY_NAMESPACE, uri
 
Constructor Summary
ServiceCall()
          Default constructor of the class.
ServiceCall(Object dummy, String uri)
           
ServiceCall(String processURI)
          A constructor that besides the resource identification URI MY_URI, sets the the URI of the OWL-S perform process.
 
Method Summary
 boolean addInput(String inputURI, Object value)
          Adds an input parameter to the call.
 void addNonSemanticInput(Hashtable nonSemanticInput)
           
 Object getInputValue(String inputURI)
          Retrieves the actual value of an input parameter.
 Resource getInvolvedUser()
          Retrieves the user involved in the call, if there is such.
 Object getNonSemanticInput(String uri)
           
 String getProcessURI()
          Retrieves the URI of the OWL-S perform process.
 int getPropSerializationType(String propURI)
          Answers if the given property has to be considered when serializing this individual in a minimized way, and if not ignore-able, whether its value should be presented in its full form or can be reduced.
 boolean isWellFormed()
          Checks whether the URI of the OWL-S perform process is properly set.
 void setInvolvedUser(Resource user)
          Sets the human user involved in the call.
 void setProcessURI(String processURI)
          Sets the URI of the OWL-S perform process.
 boolean setProperty(String propURI, Object o)
          This method inherits the superclass behavior, but performs some additional checks for correctness of the property values, specific for the ServiceCall.
 
Methods inherited from class org.universAAL.middleware.rdf.FinalizedResource
addType, getLocalName, getNamespace, getProperty, getPropertyURIs, getType, getTypes, getURI, hasQualifiedName, isAnon, numberOfProperties
 
Methods inherited from class org.universAAL.middleware.rdf.Resource
addMultiLangProp, asList, asList, asRDFList, changeProperty, copy, deepCopy, equals, generateAnonURI, getDefaultLang, getFilename, getMultiLangProp, getOrConstructLabel, getResource, getResourceComment, getResourceLabel, getStaticFieldValue, hashCode, hasProperty, isAnon, isBlockingAddingTypes, isClosedCollection, isQualifiedName, literal, representsQualifiedURI, serializesAsXMLLiteral, setPropertyPath, setPropertyPath, setPropertyPathFromOffset, setResourceComment, setResourceLabel, toString, toStringRecursive, toStringRecursive, unliteral
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MY_URI

public static final String MY_URI
A resource URI that specifies the resource as a service call.

See Also:
Constant Field Values

THIS_SERVICE_CALL

public static final ServiceCall THIS_SERVICE_CALL
A ServiceCall that is a realization of the OWL-S process:ThisPerform.


PROP_OWLS_BINDING_VALUE_DATA

public static final String PROP_OWLS_BINDING_VALUE_DATA
A property key for the actual input value within an input resource.

See Also:
Constant Field Values

PROP_OWLS_PERFORM_PROCESS

public static final String PROP_OWLS_PERFORM_PROCESS
A property key that corresponds to the URI of the OWL-S perform process.

See Also:
Constant Field Values

PROP_OWLS_PERFORM_HAS_DATA_FROM

public static final String PROP_OWLS_PERFORM_HAS_DATA_FROM
A property key that points to the List containing all of the input resources.

See Also:
Constant Field Values

TYPE_OWLS_INPUT_BINDING

public static final String TYPE_OWLS_INPUT_BINDING
A type that identifies a resource as an input resource of a call.

See Also:
Constant Field Values
Constructor Detail

ServiceCall

public ServiceCall(Object dummy,
                   String uri)

ServiceCall

public ServiceCall()
Default constructor of the class. Does not set anything besides the resource identification URI MY_URI.


ServiceCall

public ServiceCall(String processURI)
A constructor that besides the resource identification URI MY_URI, sets the the URI of the OWL-S perform process.

Parameters:
processURI - the URI of the OWL-S perform process.
Method Detail

addNonSemanticInput

public void addNonSemanticInput(Hashtable nonSemanticInput)

getNonSemanticInput

public Object getNonSemanticInput(String uri)

addInput

public boolean addInput(String inputURI,
                        Object value)
Adds an input parameter to the call.

Parameters:
inputURI - the URI of the input parameter.
value - the actual value of the input parameter.
Returns:
true if the parameter was successfully set, or false otherwise, for example if null values were passed as arguments.

getInputValue

public Object getInputValue(String inputURI)
Retrieves the actual value of an input parameter.

Parameters:
inputURI - the URI of the input parameter.
Returns:
the value of the parameter.

getInvolvedUser

public Resource getInvolvedUser()
Retrieves the user involved in the call, if there is such.

Returns:
the involved user or null, if no human user is involved.

getProcessURI

public String getProcessURI()
Retrieves the URI of the OWL-S perform process.

Returns:
the process URI , or null if no process is set.

getPropSerializationType

public int getPropSerializationType(String propURI)
Description copied from class: Resource
Answers if the given property has to be considered when serializing this individual in a minimized way, and if not ignore-able, whether its value should be presented in its full form or can be reduced. The return value must be one of Resource.PROP_SERIALIZATION_OPTIONAL, Resource.PROP_SERIALIZATION_REDUCED, or Resource.PROP_SERIALIZATION_FULL. It can be assumed that the given property is one of those returned by Resource.getPropertyURIs().
Decision criterion should be if the value of this property is absolutely necessary when this resource is being sent to a remote node. If the subclass rates it as unlikely that the receiver side would need this info, the answer should be PROP_SERIALIZATION_OPTIONAL in favor of lower communication traffic and higher performance even at risk of a possible additional query on the receiver side for fetching this info. With the same rationale, if a property should be included in the process of serialization, it is preferable to include it in a reduced form; in this case the return value should be PROP_SERIALIZATION_REDUCED, otherwise PROP_SERIALIZATION_FULL can be returned. Subclasses should normally overwrite this method as this default implementation returns always PROP_SERIALIZATION_FULL.

Overrides:
getPropSerializationType in class Resource

isWellFormed

public boolean isWellFormed()
Checks whether the URI of the OWL-S perform process is properly set.

Overrides:
isWellFormed in class Resource

setInvolvedUser

public void setInvolvedUser(Resource user)
Sets the human user involved in the call. This method is usually invoked by the bus.

Parameters:
user - the new involved user.

setProcessURI

public void setProcessURI(String processURI)
Sets the URI of the OWL-S perform process. This method is usually invoked by the bus.

Parameters:
processURI - the new process URI.

setProperty

public boolean setProperty(String propURI,
                           Object o)
This method inherits the superclass behavior, but performs some additional checks for correctness of the property values, specific for the ServiceCall.

Overrides:
setProperty in class Resource
Returns:
true if the property changed as a result of the call
See Also:
Resource.setProperty(java.lang.String, java.lang.Object)


Copyright © 2014 universAAL Consortium. All Rights Reserved.