Sierra
An OpenPrivacy
Reputation Management Framework
Query
The Query package is used by the Store package to index Reputations and
Payloads. It provides a cross platform package/architecture for offloading data
query and indexing to the appropriate facility/subsystem.
The Reputation object is designed to support multiple Payload types. These
Payloads can be in any format anything the developer wants. It is expected we
will have numerous Payloads in a multitude of XML formats.
We didn't want to have a situation where developers have to rewrite their
persistence mechanism everytime a new Payload format is created. The Query
package allows developers to create new Payloads and provide indexing/query
mechanisms which can be used by StoreEngines to increase their performance
without having to rewrite the given StoreEngine.
Components:
QueryEngine:
Responsible for performing queries on StoreEngines. A StoreEngine is tied
to a QueryEngine in an one to many relationship since it has to support
multiple Payloads.
Execute the given query on this QueryEngine. The query should not run
if the supports() method returns false.
+execute (Query) : Result
-------------------------------------------------------------------------
Add a Reputation into this QueryEngine for indexing.
+putReputation (Reputation) : void
-------------------------------------------------------------------------
Return true if this QueryEngine supports all Payloads within the given
Reputation.
+supports (Reputation) : boolean
-------------------------------------------------------------------------
Return true if the given Query is supported.
+supports (Query) : boolean
-------------------------------------------------------------------------
Return true if this Payload format is supported.
+supports (Payload) : boolean
QueryManager:
Handles determining which QueryEngine to use with a given RCE or
StoreEngine. The Query object is passed so that the QueryManager can return
a QueryEngine that is best optimized to execute this query. Since an
implementation of a QueryEngine will be best optimized for a specific data
format this is necessary to figure out how to execute the query with the
best possible performance.
Execute the given Query on a QueryEngine that supports it.
+execute (Query) : Result
-------------------------------------------------------------------------
Get a QueryEngine that best supports the given Query
+getQueryEngine (Query) : QueryEngine
-------------------------------------------------------------------------
Pass on the given reputation to all QueryEngines that support indexing it.
+putReputation (Reputation) : void
Query:
Basic interface for a Query object.
Essentially the interface isn't very complex (just a tag component). Most
of the functionality is supposed to go into the implementations. It is
important that each interface define exactly the criteria for which it
should match since it is up to the QueryEngine implementation to determine
how to run the Query.
TargetedQuery:
Query which supports specifying the Payload it is 'targeting'. This can be
used along with a CompositeQuery to target multiple Payloads.
+getPayloadIdentifier () : URI
-------------------------------------------------------------------------
+setPayloadIdentifier (URI) : void
Result:
Basic interface for a Result object. A Result holds a set of Reputations
which are the 'results' of a query.
Get the Enumeration of reputations this results contains.
+getReputations () : URI[]
-------------------------------------------------------------------------
Add a Reputation to this result.
+putReputation (URI) : void
Sierra has
additional documentation for this package.
|