E
- the specific Accessible derived classpublic class AbstractAccessibleResource<E extends Accessible> extends AbstractResource
Modifier and Type | Class and Description |
---|---|
static interface |
AbstractAccessibleResource.Handler<E extends Accessible>
Functor used to post-process items.
|
static class |
AbstractAccessibleResource.NoOpHandler<E extends Accessible>
Implementation of a Handler that does nothing.
|
Modifier and Type | Field and Description |
---|---|
protected AclManager |
aclManager |
protected ActionManager |
actionManager |
static String |
AGGREGATION_PARAM |
protected Class<E> |
cls |
static String |
EVENT_TYPE_PARAM |
static String |
FROM_PARAM |
static String |
ITEM_ID_PARAM |
static String |
ITEM_TYPE_PARAM |
static String |
SHOW_PARAM |
static String |
TO_PARAM |
static String |
USER_PARAM |
ACCESSOR_PARAM, ALL_PARAM, AUTH_HEADER_NAME, COMMIT_PARAM, CSV_MEDIA_TYPE, DEFAULT_LIST_LIMIT, FILTER_PARAM, graph, GROUP_PARAM, ID_PARAM, INCLUDE_PROPS_PARAM, ITEM_CACHE_TIME, jsonFactory, jsonMapper, LIMIT_PARAM, LOG_MESSAGE_HEADER_NAME, LOG_PARAM, logger, manager, N3_MIMETYPE, OFFSET_PARAM, PATCH_HEADER_NAME, RANGE_HEADER_NAME, RDF_MIMETYPE_FORMATS, RDF_XML_MIMETYPE, request, requestHeaders, RESOURCE_ENDPOINT_PREFIX, SCOPE_PARAM, SORT_PARAM, STREAM_HEADER_NAME, TOLERANT_PARAM, TURTLE_MIMETYPE, uriInfo, VERSION_PARAM
Constructor and Description |
---|
AbstractAccessibleResource(org.neo4j.graphdb.GraphDatabaseService database,
Class<E> cls)
Constructor
|
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
createItem(Bundle entityBundle,
List<String> accessorIds) |
javax.ws.rs.core.Response |
createItem(Bundle entityBundle,
List<String> accessorIds,
AbstractAccessibleResource.Handler<E> handler)
Create an instance of the 'entity' in the database
|
<T extends Accessible> |
createItem(Bundle entityBundle,
List<String> accessorIds,
AbstractAccessibleResource.Handler<T> handler,
Api scopedApi,
Class<T> otherCls)
Create an instance of the 'entity' in the database
|
protected void |
deleteItem(String id)
Delete (remove) an instance of the 'entity' in the database
|
protected void |
deleteItem(String id,
AbstractAccessibleResource.Handler<E> preProcess)
Delete (remove) an instance of the 'entity' in the database,
running a handler callback beforehand.
|
protected <T extends Entity> |
exportItemsAsZip(XmlExporter<T> exporter,
Iterable<T> items,
String lang) |
protected Set<Accessor> |
getAccessors(List<String> accessorIds,
Accessor current)
Get a set of accessor frames given a list of names.
|
protected EventsApi |
getEventsApi()
Get an event query builder object.
|
javax.ws.rs.core.Response |
getItem(String id)
Retieve (get) an instance of the 'entity' in the database
|
javax.ws.rs.core.Response |
listItems()
List all instances of the 'entity' accessible to the given user.
|
javax.ws.rs.core.Response |
updateItem(Bundle entityBundle)
Update (change) an instance of the 'entity' in the database.
|
javax.ws.rs.core.Response |
updateItem(String id,
Bundle rawBundle)
Update (change) an instance of the 'entity' in the database
|
anonymousApi, api, beginTx, creationResponse, getCacheControl, getCurrentActioner, getCurrentUser, getGraph, getIntQueryParam, getItemUri, getLogMessage, getQuery, getRdfFormat, getRequesterUserProfile, getSerializer, getStringListQueryParam, isPatch, isStreaming, single, streamingList, streamingList, streamingListOfLists, streamingPage, streamingPage, streamingVertexList, streamingVertexList
public static final String ITEM_TYPE_PARAM
public static final String ITEM_ID_PARAM
public static final String EVENT_TYPE_PARAM
public static final String USER_PARAM
public static final String FROM_PARAM
public static final String TO_PARAM
public static final String SHOW_PARAM
public static final String AGGREGATION_PARAM
protected final AclManager aclManager
protected final ActionManager actionManager
protected final Class<E extends Accessible> cls
public javax.ws.rs.core.Response listItems()
public <T extends Accessible> javax.ws.rs.core.Response createItem(Bundle entityBundle, List<String> accessorIds, AbstractAccessibleResource.Handler<T> handler, Api scopedApi, Class<T> otherCls) throws PermissionDenied, ValidationError, DeserializationError
T
- the generic type of class TentityBundle
- a bundle of item data
'id' fields)accessorIds
- a list of accessors who can initially view this itemhandler
- a callback function that allows additional operations
to be run on the created object after it is initialised
but before the response is generated. This is useful for adding
relationships to the new item.scopedApi
- the Api instance to use to create the item. This allows callers
to override the scope used.otherCls
- the class of the created item.PermissionDenied
ValidationError
DeserializationError
public javax.ws.rs.core.Response createItem(Bundle entityBundle, List<String> accessorIds, AbstractAccessibleResource.Handler<E> handler) throws PermissionDenied, ValidationError, DeserializationError
entityBundle
- a bundle of item data
'id' fields)accessorIds
- a list of accessors who can initially view this itemhandler
- a callback function that allows additional operations
to be run on the created object after it is initialised
but before the response is generated. This is useful for adding
relationships to the new item.PermissionDenied
ValidationError
DeserializationError
public javax.ws.rs.core.Response createItem(Bundle entityBundle, List<String> accessorIds) throws PermissionDenied, ValidationError, DeserializationError
public javax.ws.rs.core.Response getItem(String id) throws ItemNotFound
id
- the Entities identifier stringItemNotFound
public javax.ws.rs.core.Response updateItem(Bundle entityBundle) throws PermissionDenied, ValidationError, ItemNotFound, DeserializationError
entityBundle
- the bundlePermissionDenied
ValidationError
ItemNotFound
DeserializationError
public javax.ws.rs.core.Response updateItem(String id, Bundle rawBundle) throws PermissionDenied, ValidationError, DeserializationError, ItemNotFound
If the Patch header is true top-level bundle data will be merged instead of overwritten.
id
- the item's IDrawBundle
- the bundlePermissionDenied
ValidationError
DeserializationError
ItemNotFound
protected void deleteItem(String id, AbstractAccessibleResource.Handler<E> preProcess) throws PermissionDenied, ItemNotFound, ValidationError
id
- the item's IDpreProcess
- a handler to run before deleting the itemPermissionDenied
ItemNotFound
ValidationError
protected void deleteItem(String id) throws PermissionDenied, ItemNotFound, ValidationError
id
- the item's IDPermissionDenied
ItemNotFound
ValidationError
protected <T extends Entity> javax.ws.rs.core.Response exportItemsAsZip(XmlExporter<T> exporter, Iterable<T> items, String lang) throws IOException
IOException
protected EventsApi getEventsApi()
Copyright © 2018 The European Holocaust Research Infrastructure (EHRI). All rights reserved.