|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
As defined at http://spwiki.editme.com/Context and http://spwiki.editme.com/ContextProvider, This interface holds a set of IEntity objects.
All Contexts follow the http://www.eclipse.org/higgins/ontologies/2008/6/higgins ontology as a base. As such, each Context may have the attributes:
http://www.eclipse.org/higgins/ontologies/2008/6/higgins#contextRelation
http://www.eclipse.org/higgins/ontologies/2008/6/higgins#contextCorrelation
Also, each Context has the attribute
http://www.eclipse.org/higgins/ontologies/2008/6/higgins#contextId. getContextID()
provides a shortcut to access the value of this attribute.
| Method Summary | |
|---|---|
IEntity |
addEntity(IEntity copyFrom)
Creates a new Entity for this Context by copying the data from the passed entity Note: This operation is only applied to any backing data store after applyUpdates() is called. |
IEntity |
addEntity(URI entityType,
String entityID)
Creates a new Entity for this Context. This call is typically followed by one or more calls to IHasAttributes.addAttribute(java.net.URI) on the returned IEntity
Note: This operation is only applied to any backing data
store after applyUpdates() |
void |
applyUpdates()
Applies all update operations which have been called on this Context and called on any element held by this Context (including entities, attributes, attribute meta-attributes and it's value(s), and attribute values) to a backing data store. |
IAttribute |
buildAttribute(URI attrID)
Builds an IAttribute (unassociated with any Entity). |
IFilterAttributeAssertion |
buildAttributeAssertion()
Builds an assertion for Entity Attributes (see IHasAttributes.getAttributes() and IHasAttributes.getAttribute(URI))
which can be passed to IFilter.setAssertion(IFilterAssertion) |
IAuthNAttributesMaterials |
buildAuthNAttributesMaterials()
Builds an IAuthNAttributesMaterials that may be used when calling open(Object) |
IComplexAttrValue |
buildComplexAttrValue(URI dataType)
Builds a complex attribute value to be passed to IFilterAttributeAssertion.setAssertionValue(IAttributeValue). |
IFilterEntityIDAssertion |
buildEntityIDAssertion()
Builds an assertion for Entity IDs (see IEntity.getEntityID())
which can be passed to IFilter.setAssertion(IFilterAssertion)
Note that this is simply a convenience method equivalent to creating an
IFilterAttributeAssertion for the
http://www.eclipse.org/higgins/ontologies/2008/6/higgins#entityId attribute |
IFilterEntityTypeAssertion |
buildEntityTypeAssertion()
Builds an assertion for Entity Types (see IEntity.getEntityType())
which can be passed to IFilter.setAssertion(IFilterAssertion) |
IFilter |
buildFilter()
Builds an IFilter instance that may be used when calling getEntities(IFilter) |
ISimpleAttrValue |
buildSimpleAttrValue(URI dataType,
Object value)
Builds a simple attribute value to be passed to IFilterAttributeAssertion.setAssertionValue(IAttributeValue). |
void |
cancelUpdates()
Cancels all update operations which have been called on this Context and called on any element held by this Context (including entities, attributes, attribute meta-attributes and it's value(s), and attribute values). |
void |
close()
Closes this Context and returns it to an un-open state. |
String |
exportData(String filter,
String representationFormat)
Exports this Context. |
URI |
getContextID()
Returns a reference to this Context. |
IContextModel |
getContextModel()
Returns a model of the context object as it defined in the context's schema. |
Iterator |
getEntities(IFilter filter)
|
Iterator |
getEntities(IFilter filter,
Iterator attrSelectionList)
From this context, return IEntitys that match the specified filter |
IEntity |
getEntity(String entityID)
This is the same as passing null as the attrSelectionList in getEntity(String, Iterator) |
IEntity |
getEntity(String entityID,
Iterator attrSelectionList)
Returns the Entity matching the specified entityID. |
String |
getSchema()
Returns the schema governing this context. |
void |
importData(String filter,
String representationFormat)
Imports this Context. |
boolean |
isOpen(Object identity)
Tests whether this context is open and authenticated using the specified identity |
String |
open(Object authentication)
Opens this Context using the provided authentication object. |
void |
setSchema(String schema)
Sets the schema governing this context. |
boolean |
verifyEntityAttributes(String entityID,
Iterator attributes)
Simple method for comparing a set of attribute assertions against a Entity. |
| Methods inherited from interface org.eclipse.higgins.idas.api.IHasAttributes |
|---|
addAttribute, addAttribute, equals, getAttribute, getAttributes, getSingleValuedAttribute, removeAttribute, removeAttributeValue, removeAttributeValue |
| Method Detail |
public String open(Object authentication)
throws IdASException,
ContextOpenException
Upon success (return with no exception), this Context is in an "open" state
and is available to have other methods called (such as
addEntity(URI, String),
exportData(String, String),
getEntity(String),
getEntity(String, Iterator),
getEntities(IFilter),
getEntities(IFilter, Iterator),
importData(String, String),
verifyEntityAttributes(String, Iterator)}
).
Methods requiring the context to be open throw ContextNotOpenException
when in an un-open state.
An open state specifies that the specified authentication materials have been used to successfully authenticate to this Context.
If this IContext is already in an open state, this throws ContextOpenException.
The antithesis of this method is close().
authentication - AuthN object used to open the context. This may be an instance of IAuthNAttributesMaterials or some other object used to authenticate.
IdASException
ContextOpenException, - AuthenticationException
ContextOpenExceptionclose()
public void close()
throws IdASException
Methods requiring the context to be open throw ContextNotOpenException when in an un-open state.
IdASException
public boolean isOpen(Object identity)
throws IdASException
identity - May be .
When provided, asserts that this context was opened with the specified identity.
When (@code null), no identity check is performed.
IdASException
public String getSchema()
throws IdASException
TODO (Doc): Add pointers to OWL.
TODO (Doc): Add (or point to) documentation which includes sample schema.
TODO (Arch)(Impl): Add method(s) which return the schema as a stream, DOM document, or other iterable object.
String in OWL-DL format.
IdASException
public void setSchema(String schema)
throws IdASException
TODO (Doc): Add pointers to OWL.
TODO (Doc): Add (or point to) documentation which includes sample schema.
TODO (Arch)(Impl): Add method(s) which take the schema as a stream, DOM document, or other iterable object.
schema - a String in OWL-DL format.
IdASException
public IContextModel getContextModel()
throws IdASException
IdASException
public URI getContextID()
throws IdASException
IdASException
public String exportData(String filter,
String representationFormat)
throws IdASException
TODO (Arch): filter format TBD
TODO (Arch): Does this export only Entities, or the entire Context (Attributes, Schema, Entities)?
filter - May be . Used to select a subset of this Context to be exported.representationFormat - Indicates the format of the string to be returned. TODO (Arch)(Doc): Specify format type. Give example
IdASException
public void importData(String filter,
String representationFormat)
throws IdASException
TODO (Arch): filter format TBD
TODO (Arch): Does this import only Entities, or the entire Context (Attributes, Schema, Entities)? TODO (Arch)(Doc): Discuss collisions.
filter - May be . Used to select a subset of the external data set to be imported.representationFormat - Indicates the format of the external data string being specified in external. TODO (Arch)(Doc): Specify format type. Give example
IdASException
public IAuthNAttributesMaterials buildAuthNAttributesMaterials()
throws IdASException
IAuthNAttributesMaterials that may be used when calling open(Object)
IdASException
public IAttribute buildAttribute(URI attrID)
throws IdASException
IAuthNAttributesMaterials
attrID -
IAttribute
IdASException
public IFilter buildFilter()
throws IdASException
getEntities(IFilter)
IdASException
public IFilterAttributeAssertion buildAttributeAssertion()
throws IdASException
IHasAttributes.getAttributes() and IHasAttributes.getAttribute(URI))
which can be passed to IFilter.setAssertion(IFilterAssertion)
IdASException
public IFilterEntityIDAssertion buildEntityIDAssertion()
throws IdASException
IEntity.getEntityID())
which can be passed to IFilter.setAssertion(IFilterAssertion)
Note that this is simply a convenience method equivalent to creating an
IFilterAttributeAssertion for the
http://www.eclipse.org/higgins/ontologies/2008/6/higgins#entityId attribute
IdASException
public IFilterEntityTypeAssertion buildEntityTypeAssertion()
throws IdASException
IEntity.getEntityType())
which can be passed to IFilter.setAssertion(IFilterAssertion)
IdASException
public ISimpleAttrValue buildSimpleAttrValue(URI dataType,
Object value)
throws IdASException,
InvalidTypeException
IFilterAttributeAssertion.setAssertionValue(IAttributeValue).Example:
IAttributeValue value = buildSimpleValue("http://www.w3.org/2001/XMLSchema/normalizedString", new String("Some Value"));
dataType - The type for the simple valuevalue - The value for the simple type.
IdASException
InvalidTypeException
public IComplexAttrValue buildComplexAttrValue(URI dataType)
throws IdASException,
InvalidTypeException
IFilterAttributeAssertion.setAssertionValue(IAttributeValue).Example:
TODO: do an example of building this and then adding some attributes
dataType - The type for the simple value
IdASException
InvalidTypeException
public IEntity addEntity(URI entityType,
String entityID)
throws IdASException,
InvalidTypeException,
InvalidEntityIDException,
EntityExistsException
IHasAttributes.addAttribute(java.net.URI) on the returned IEntity
Note: This operation is only applied to any backing data
store after applyUpdates()
entityType - The URI specifying the type of Entity being createdentityID - May be null. When specified, uniquely names the Entity within
this Context. When null, indicates that the caller plans to later add an
attribute or attributes which will be used to construct the unique Entity ID
applyUpdates()
InvalidTypeException - when the entityType is invalid
InvalidEntityIDException - when the entityID is invalid
EntityExistsException - when the entityID is known to already exist
IdASException
public IEntity addEntity(IEntity copyFrom)
throws IdASException,
EntityExistsException
applyUpdates() is called.
copyFrom - an IEntity from which data is copied to construct a new
Entity
applyUpdates() is called.
EntityExistsException - when copyFrom is known to already exist
IdASException
public IEntity getEntity(String entityID)
throws IdASException
getEntity(String, Iterator)
IdASExceptiongetEntity(String, Iterator)
public IEntity getEntity(String entityID,
Iterator attrSelectionList)
throws IdASException
getEntities(org.eclipse.higgins.idas.api.IFilter) with
the filter set to
entityID - Contextually unique ID of Entity to return.attrSelectionList - Iterator holding the URIs of IAttribute types
that the caller expects to access.
A indicates that the caller expects to read all attributes.
An empty set indicates that the caller expects to read no attributes.
Note that this is only an indicator of what the caller expects to read.
The caller may eventually end up reading more or less. The purpose of this
parameter is so that a context provider which gathers data across a network
connection can optimize based on the callers intended usage.
IdASException - (typically a subclass of. See below).
NoSuchEntityException - when entity specified by entityID is not found.
public Iterator getEntities(IFilter filter)
throws IdASException
IEntitys that match the filter
IdASExceptionThis is the same as passing null as the attrSelectionList in {@link #getEntities(IFilter, Iterator)}
public Iterator getEntities(IFilter filter,
Iterator attrSelectionList)
throws IdASException
IEntitys that match the specified filter
filter - Filter used to constrain the set of IEntitys returned.
A or empty filter causes all IEntitys to be returned.attrSelectionList - Iterator of URIs of IAttribute types that the caller expects to access. A indicates that all attributes will be read. An empty set indicates that no attributes will be read.
IEntitys that match the filter
IdASException
public boolean verifyEntityAttributes(String entityID,
Iterator attributes)
throws IdASException
TODO (Arch): This doesn't leave a way to verify that a Entity representing a group contains a specific member in its member value. We may want to consider allowing a filter to be passed here, or at least a partial attribute.
entityID - Contextually unique ID of Entity being verified.attributes - Iterator of IAttribute to be compared to the Entity specified by entityID.
IdASException - (typically a subclass of. See below).
NoSuchEntityException - when Entity specified by entityID is not found.
public void applyUpdates()
throws IdASException
addEntity(URI, String)addEntity(IEntity)IEntity.remove()IHasAttributes.addAttribute(IAttribute)IHasAttributes.addAttribute(URI)IHasAttributes.removeAttribute(URI)IHasAttributes.removeAttributeValue(IAttribute)IHasAttributes#rremoveAttributeValue(URI, Object)IAttribute.addComplexValue(URI)IAttribute.addSimpleValue(URI, Object)IAttribute.addValue(IAttributeValue)IAttribute.addValue(URI)IAttribute.remove()IAttributeValue.remove()ITypedValue.setData(Object)applyUpdates(). Alternately, the caller may call
cancelUpdates() in order to cancel all updates which have not yet been applied.
IdASException
public void cancelUpdates()
throws IdASException
applyUpdates()) are not canceled.
IdASExceptionapplyUpdates()
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||