|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Site
A site that provides Entities for the Entityhub. Sites are read-only and
do support dereferencing of entities.
They optionally can support search.
ManagedSites do also support create/update/delete on
managed entities. They are also required to support the query.
NOTE: this interface replaces ReferencedSite in versions
later than 0.10.0-incubating.
| Field Summary | |
|---|---|
static Set<String> |
PROHIBITED_SITE_IDS
List of ids that are not allowed to be used (case
insensitive) for referenced sites. |
| Method Summary | |
|---|---|
QueryResultList<Representation> |
find(FieldQuery query)
Searches for entities based on the parsed FieldQuery and returns
representations as defined by the selected fields of the query. |
QueryResultList<Entity> |
findEntities(FieldQuery query)
Searches for Entities based on the parsed FieldQuery and returns
the selected Entities including the whole representation. |
QueryResultList<String> |
findReferences(FieldQuery query)
Searches for entities based on the parsed FieldQuery and returns
the references (ids). |
SiteConfiguration |
getConfiguration()
Getter for the configuration of this referenced site |
InputStream |
getContent(String id,
String contentType)
Getter for the Content of the Entity |
Entity |
getEntity(String id)
Getter for the Entity by the id |
FieldMapper |
getFieldMapper()
Getter for the FieldMappings configured for this Site |
String |
getId()
The Id of this site. |
FieldQueryFactory |
getQueryFactory()
Getter for the QueryFactory implementation preferable used with this Site. |
boolean |
supportsLocalMode()
Returns if this referenced site supports local mode - meaning, that it can be used to search and retrieve entities in offline mode. |
boolean |
supportsSearch()
Returns if this referenced site supports queries. |
| Field Detail |
|---|
static final Set<String> PROHIBITED_SITE_IDS
ids that are not allowed to be used (case
insensitive) for referenced sites.
| Method Detail |
|---|
String getId()
getConfiguration().getId().
The configured ID MUST NOT be null, empty or one of the
PROHIBITED_SITE_IDS.
QueryResultList<String> findReferences(FieldQuery query)
throws SiteException
FieldQuery and returns
the references (ids). Note that selected fields of the query are ignored.
query - the query
SiteException - If the request can not be executed both on
the Cache and by using the EntityDereferencer/
EntitySearcher accessing the remote site. For errors with the
remote site the cause will always be a Yard Exceptions. Errors for remote
Sites are usually IOExceptions.
QueryResultList<Representation> find(FieldQuery query)
throws SiteException
FieldQuery and returns
representations as defined by the selected fields of the query. Note that
if the query defines also Constraints for selected fields, that
the returned representation will only contain values selected by such
constraints.
query - the query
SiteException - If the request can not be executed both on
the Cache and by using the EntityDereferencer/
EntitySearcher accessing the remote site. For errors with the
remote site the cause will always be a Yard Exceptions. Errors for remote
Sites are usually IOExceptions.
QueryResultList<Entity> findEntities(FieldQuery query)
throws SiteException
FieldQuery and returns
the selected Entities including the whole representation. Note that selected
fields of the query are ignored.
query - the query
SiteException - If the request can not be executed both on
the Cache and by using the EntityDereferencer/
EntitySearcher accessing the remote site. For errors with the
remote site the cause will always be a Yard Exceptions. Errors for remote
Sites are usually IOExceptions.
Entity getEntity(String id)
throws SiteException
id - the id of the entity
null if not found
SiteException - If the request can not be executed both on
the Cache and by using the EntityDereferencer/
EntitySearcher accessing the remote site. For errors with the
remote site the cause will always be a Yard Exceptions. Errors for remote
Sites are usually IOExceptions.
InputStream getContent(String id,
String contentType)
throws SiteException
id - the id of the EntitycontentType - the requested contentType
null if no entity with the parsed id
was found or the parsed ContentType is not supported for this Entity
SiteException - If the request can not be executed both on
the Cache and by using the EntityDereferencer/
EntitySearcher accessing the remote site. For errors with the
remote site the cause will always be a Yard Exceptions. Errors for remote
Sites are usually IOExceptions.FieldMapper getFieldMapper()
FieldMapping present for this Site.FieldQueryFactory getQueryFactory()
SiteConfiguration getConfiguration()
boolean supportsLocalMode()
The result MUST reflect the current situation and not be based on the
configuration. Meaning, that if the configuration defines a local cache
but the cache is currently not available this method needs to return
false.
boolean supportsSearch()
The result MUST refelct the current situation and not be based on the
configuration. E.g. if the remote site does not support querys and the
local cache is temporary not available this method would need to support
false even that based on the configuration the site would
theoretically support queries.
TODO: This need to be extended as soon as support for multiple query languages is added.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||