public class ScopedResource extends FinalizedResource
ScopedResource
is a Resource that may have been generated at, or be
sent to, another AALSpace. Thus it can be annotated with one or more Scopes
(a.k.a tenant ID, origin AALSpace Id).Modifier and Type | Field and Description |
---|---|
static String |
ONLY_LOCAL_SCOPE
A special scope indicating the Resource may not be serialized to other
AALSpaces.
|
static String |
PROP_ORIG_SCOPE
The property URI for holding the Origin Scope.
|
static String |
PROP_SCOPES
The property URI for holding the Destination Scopes.
|
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 and Description |
---|
ScopedResource() |
ScopedResource(boolean isXMLLiteral) |
ScopedResource(String uri) |
ScopedResource(String uri,
boolean isXMLLiteral) |
ScopedResource(String uriPrefix,
int numProps) |
Modifier and Type | Method and Description |
---|---|
boolean |
addScope(String newScope)
Add a new scope to this resource.
|
boolean |
clearScopes()
Remove all scope annotations from this resource.
|
List |
getScopes()
List all scopes associated to this resource.
|
boolean |
isScoped()
Check if there is any scopes for this resource.
|
boolean |
isSerializableTo(String destinationCandidateScope)
Check whether if this
ScopedResource may be sent to a destination
scope Deny if the origin is the destination candidate (this will cause message loops) Deny if the destinations do contain ONLY_LOCAL_SCOPE (tenant-aware application has
decided this message is only local)
Allow if the destinations are empty (non-tenant-aware application has
generated the message)
Deny if the destinations are not empty and do not contain the
candidate destination
Allow if the destinations are not empty and contain a
ScopedResource#ALL_SCOPES scope or the candidate destination. |
boolean |
setScope(ScopedResource src)
Copy the scope from another
ScopedResource . |
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, setProperty, setPropertyPath, setPropertyPath, setPropertyPathFromOffset, setResourceComment, setResourceLabel, toString, toStringRecursive, toStringRecursive, unliteral
public static final String PROP_SCOPES
public static final String PROP_ORIG_SCOPE
Resource.getProperty(String)
and
Resource.setProperty(String, Object)
, only by the router
artifacts.public static final String ONLY_LOCAL_SCOPE
public ScopedResource()
public ScopedResource(boolean isXMLLiteral)
public ScopedResource(String uri)
public ScopedResource(String uri, boolean isXMLLiteral)
public ScopedResource(String uriPrefix, int numProps)
public boolean isScoped()
public List getScopes()
public boolean addScope(String newScope)
newScope
- the new scope to be addedpublic boolean clearScopes()
public boolean setScope(ScopedResource src)
ScopedResource
.src
- the source from which to copy the scope.public boolean isSerializableTo(String destinationCandidateScope)
ScopedResource
may be sent to a destination
scope ONLY_LOCAL_SCOPE
(tenant-aware application has
decided this message is only local)
ScopedResource#ALL_SCOPES
scope or the candidate destination.
destinationCandidateScope
- The destination to be checked, If null returns false.Copyright © 2015 universAAL Consortium. All rights reserved.