public class ScopedResource extends FinalizedResource
ScopedResource
is a Resource that may have been generated at, or be
sent to, another Space. Thus it can be annotated with one or more Scopes
(a.k.a tenant ID, origin Space ID).Modifier and Type | Field and Description |
---|---|
static String |
ONLY_LOCAL_SCOPE
A special scope indicating the Resource may not be serialized to other
Spaces.
|
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, 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 |
---|
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.
|
String |
getOriginScope()
Get the Scope of the original Space sender of this
ScopedResource . |
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)
Deny if the destinations are not empty and do not contain the
candidate destination
Allow if the destinations are empty (non-tenant-aware application has
generated the message)
Allow if the destinations are not empty and contains the candidate
destination. |
void |
setOriginScope(String scope)
Set the Origin Scope of an incoming
ScopedResource . |
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()
ONLY_LOCAL_SCOPE
.public final List getScopes()
public final boolean addScope(String newScope)
newScope
- the new scope to be addedpublic final boolean clearScopes()
public final boolean setScope(ScopedResource src)
ScopedResource
.src
- the source from which to copy the scope.public final 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)
destinationCandidateScope
- The destination to be checked, If null returns false.public final String getOriginScope()
ScopedResource
. To be used only by Gateways!setOriginScope(String)
.public final void setOriginScope(String scope)
ScopedResource
. To be used by
Gateways! To reset, use with scope = null.scope
- The Scope ID.Copyright © 2018 universAAL Consortium. All rights reserved.