public class ServiceResponse extends ScopedResource implements Response, UtilityReply
ServiceCallee
-s when handling calls, and are delivered to the
ServiceCaller
-s as a result of their requests.Modifier and Type | Field and Description |
---|---|
static String |
MY_URI
A resource URI that specifies the resource as a service response.
|
static String |
PROP_SERVICE_CALL_STATUS
A property key for the property where the status of the call is stored.
|
static String |
PROP_SERVICE_HAS_OUTPUT
A property key for the property where the service outputs are stored.
|
static String |
PROP_SERVICE_SPECIFIC_ERROR
A property key for the property where any errors occurred during the
service invocation are stored.
|
static String |
PROP_UNBOUND_OUTPUT_ALLOWED
A key of property indicating that not bound output is allowed.
|
ONLY_LOCAL_SCOPE, PROP_ORIG_SCOPE, PROP_SCOPES
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 |
---|
ServiceResponse()
Default constructor for the class.
|
ServiceResponse(CallStatus status)
Constructor which besides the URI, sets the status of the call.
|
ServiceResponse(String uri)
Constructor for the class.
|
Modifier and Type | Method and Description |
---|---|
void |
addOutput(ProcessOutput output)
Adds output payload to this object.
|
void |
addOutput(String uri,
Object value)
Adds output payload to this object.
|
protected void |
allowUnboundOutput() |
protected void |
disallowUnboundOutput() |
CallStatus |
getCallStatus()
Retrieves the call status.
|
List<Object> |
getOutput(String paramURI)
Returns all value objects returned for a required output with the given
paramURI.
|
List |
getOutput(String paramURI,
boolean asMergedList)
Deprecated.
The parameter asMergedList is not used anymore since
MultiServiceResponse was introduced. Use
getOutput(String) instead. |
List<ProcessOutput> |
getOutputs()
Retrieves all of the service outputs as a raw
List without
any rearranging. |
Map<String,List<Object>> |
getOutputsMap()
Get all outputs.
|
Resource |
getProvider()
Get the provider of the requested service.
|
boolean |
isUnboundOutputAllowed() |
boolean |
isWellFormed()
Tests the object for correctness by verifying the presence of
PROP_SERVICE_CALL_STATUS property. |
boolean |
setProperty(String propURI,
Object value)
This method inherits the superclass behavior, but performs some
additional checks for correctness of the property values, specific for
the
ServiceResponse . |
addScope, clearScopes, getOriginScope, getScopes, isScoped, isSerializableTo, setOriginScope, setScope
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, literal, representsQualifiedURI, serializesAsXMLLiteral, setPropertyPath, setPropertyPath, setPropertyPathFromOffset, setResourceComment, setResourceLabel, toString, toStringRecursive, toStringRecursive, unliteral
public static final String MY_URI
public static final String PROP_SERVICE_CALL_STATUS
public static final String PROP_SERVICE_HAS_OUTPUT
ProcessOutput
s or a list of
ServiceResponse
s in case of a MultiServiceResponse
.public static final String PROP_SERVICE_SPECIFIC_ERROR
public static final String PROP_UNBOUND_OUTPUT_ALLOWED
public ServiceResponse()
Resource
to MY_URI
.public ServiceResponse(String uri)
public ServiceResponse(CallStatus status)
status
- the current status of the call.protected void allowUnboundOutput()
protected void disallowUnboundOutput()
public boolean isUnboundOutputAllowed()
public void addOutput(ProcessOutput output)
output
- the ouput that needs to be added.public void addOutput(String uri, Object value)
uri
- the URI that identifies the output.value
- the output value.public CallStatus getCallStatus()
public List<Object> getOutput(String paramURI)
paramURI
- the URI of the required output.@Deprecated public List getOutput(String paramURI, boolean asMergedList)
MultiServiceResponse
was introduced. Use
getOutput(String)
instead.paramURI
- the URI of the required output.asMergedList
- specifies if the outputs of the separate services are merged.
This parameter is not available at the moment and should be
set to truepublic Map<String,List<Object>> getOutputsMap()
getOutput(String)
but
instead of providing the output of one parameter, it provides the outputs
of all parameters. The URI of the parameter is the key of the returned
map.public List<ProcessOutput> getOutputs()
List
without
any rearranging.MultiServiceResponse
then the list can
contain more than one ProcessOutput
with the same URI;
those outputs then come from different responses.public boolean isWellFormed()
PROP_SERVICE_CALL_STATUS
property.isWellFormed
in class Resource
Resource.isWellFormed()
public Resource getProvider()
ServiceCallee
).public boolean setProperty(String propURI, Object value)
ServiceResponse
.setProperty
in class Resource
Resource.setProperty(java.lang.String,
java.lang.Object)
Copyright © 2018 universAAL Consortium. All rights reserved.