|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IContext
As defined at http://spwiki.editme.com/Context and http://spwiki.editme.com/ContextProvider, This interface holds a set of IDigitalSubject
objects.
Note that the IHasRelationships
interface takes a URI
type. This URI is a Context Referenece to the related IContext
.
TODO: Should there be a removeDigitalSubject method which takes a filter? Similar notion could apply to other update operations as they are added.
Method Summary | |
---|---|
void |
close()
Closes this Context and returns it to an un-open state. |
String |
createSubject(URI subjectType,
Iterable<IAttribute> attributes)
Creates and adds a Digital Subject to this Context. |
String |
exportData(String filter,
String representationFormat)
Exports this Context. |
URI |
getContextRef()
Returns a reference to this Context. |
String |
getSchema()
Returns the schema governing this context. |
IDigitalSubject |
getSubject(String cuid)
Returns the Digital Subject matching the specified cuid. |
Iterable<IDigitalSubject> |
getSubjects(String filter)
From this context, return IDigitalSubject s that match the specified filter |
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 |
void |
open(Object identity)
Opens this Context using the provided identity. |
void |
removeSubject(String cuid)
Removes a Digital Subject from this Context. |
void |
updateSubject(String cuid,
Iterable<IAttribute> attributes)
Add or change the attributes of a Digital Subject. |
boolean |
verifySubjectAttributes(String cuid,
Iterable<IAttribute> attributes)
Simple method for comparing a set of attribute assertions against a Digital Subject. |
Methods inherited from interface org.eclipse.higgins.idas.IHasMetadata |
---|
addMetadata, createMetadata, getMetadataSet, removeMetadata |
Methods inherited from interface org.eclipse.higgins.idas.IHasRelationships |
---|
addRelationship, createRelationship, getRelationships, removeRelationship |
Method Detail |
---|
void open(Object identity) throws IdASException, ContextOpenException
Upon success (return with no exception), this Context is in an "open" state
and is available to have other methods (such as
getSubject(String)
,
getSubjects(String)
,
createSubject(URI, Iterable)
,
removeSubject(String)
,
verifySubjectAttributes(String, Iterable)
,
updateSubject(String, Iterable)
,
exportData(String, String)
,
importData(String, String)
,
) called.
Methods requiring the context to be open throw ContextNotOpenException
when in an un-open state.
An open state specifies that the authentication materials in the identity argument 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().
identity
- AuthN identity used to open the context.
IdASException
ContextOpenException
close()
void close() throws IdASException
Methods requiring the context to be open throw ContextNotOpenException when in an un-open state.
IdASException
boolean isOpen(Object identity) throws IdASException
identity
- May be null
.
When provided, asserts that this context was opened with the specified identity.
When (@code null), no identity check is performed.
true
if this context is open as specified, false
otherwise
IdASException
String getSchema() throws IdASException
TODO: Add pointers to OWL.
TODO: Add (or point to) documentation which includes sample schema.
TODO: Add method(s) which return the schema as a stream, DOM document, or other iterable object.
String
in OWL-DL format.
IdASException
URI getContextRef() throws IdASException
IdASException
String exportData(String filter, String representationFormat) throws IdASException
TODO: filter format TBD
TODO: Does this export only Digital Subjects, or the entire Context (Metadata, Schema, DS, Relationships)?
filter
- May be null
. Used to select a subset of this Context to be exported.representationFormat
- Indicates the format of the string to be returned. TODO: Specify format type. Give example
IdASException
void importData(String filter, String representationFormat) throws IdASException
TODO: filter format TBD
TODO: Does this import only Digital Subjects, or the entire Context (Metadata, Schema, DS, Relationships)? TODO: Discuss collisions.
filter
- May be null
. 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: Specify format type. Give example
IdASException
IDigitalSubject getSubject(String cuid) throws IdASException
getSubjects(java.lang.String)
with
the filter set to <appropriate filter for cuid=name>TODO: we need a way to present a properties constraint. This is to help providers which are gathering their data from expensive sources (i.e. ldap server). We don't want to cause multiple network hits, or extra data to be gathered.
TODO: discuss whether modifications to the returned IDigitalSubject affect the stored subject.
cuid
- Contextually Unique ID of Digital Subject to return.
IdASException
- (typically a subclass of. See below).
NoSuchSubjectException
- when subject specified by cuid is not found.Iterable<IDigitalSubject> getSubjects(String filter) throws IdASException
IDigitalSubject
s that match the specified filter TODO: define filter format.
TODO: add param: Set
filter
- Filter used to constrain the set of IDigitalSubject
s returned.
A null
or empty value causes all IDigitalSubject
s to be returned.
Iterable
set of IDigitalSubject
s
IdASException
String createSubject(URI subjectType, Iterable<IAttribute> attributes) throws IdASException
subjectType
- The type of Digital Subject being created. TODO: add example URI to a higgins person.attributes
- The attributes of the Digital Subject being created. Attributes required by the definition of the subjectType must be included.
IdASException
void removeSubject(String cuid) throws IdASException
cuid
- Contextually Unique ID of the Digital Subject to be removed from this Context.
IdASException
- (typically a subclass of. See below).
NoSuchSubjectException
- when subject specified by cuid is not found.boolean verifySubjectAttributes(String cuid, Iterable<IAttribute> attributes) throws IdASException
TODO: This doesn't leave a way to verify that a DS representing a group contains a specific member in its member value.
cuid
- Contextually Unique ID of Digital Subject being verified.attributes
- Set of attributes to be compared to the Digital Subject specified by cuid.
true
if all attribute assertions in attributes are found to be equal to those attributes in the Digital Subject specified by cuid. false
otherwise.
IdASException
- (typically a subclass of. See below).
NoSuchSubjectException
- when subject specified by cuid is not found.void updateSubject(String cuid, Iterable<IAttribute> attributes) throws IdASException
TODO: This doesn't allow deletion of an attribute. TODO: This doesn't allow update operations on attribute parts (such as adding a single member of a member value) TODO: Discuss transactional semantics. Is this guaranteed to fully succeed or fully fail?
cuid
- Contextually Unique ID of Digital Subject being updated.attributes
- Iterable
set of attributes to be added or replaced.
IdASException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |