public abstract class ResourceHandler<T extends ResourceNode> extends Object
| Constructor and Description |
|---|
ResourceHandler()
default constructor that resolves the generic type for this class
|
| Modifier and Type | Method and Description |
|---|---|
abstract T |
createResource(T resource,
Authorization authorization)
permanently create a resource
|
abstract void |
deleteResource(String id,
Authorization authorization)
permanently deletes the resource with the given id
|
abstract T |
getResource(String id,
Authorization authorization)
extract a resource by its id
|
abstract PartialListResponse<T> |
listResources(long startIndex,
int count,
FilterNode filter,
SchemaAttribute sortBy,
SortOrder sortOrder,
List<SchemaAttribute> attributes,
List<SchemaAttribute> excludedAttributes,
Authorization authorization)
queries several resources based on the following values
|
abstract T |
updateResource(T resourceToUpdate,
Authorization authorization)
should update an existing resource with the given one.
|
public ResourceHandler()
public abstract T createResource(T resource, Authorization authorization)
resource - the resource to storeauthorization - should return the roles of an user and may contain arbitrary data needed in the
handler implementationpublic abstract T getResource(String id, Authorization authorization)
id - the id of the resource to returnauthorization - should return the roles of an user and may contain arbitrary data needed in the
handler implementationpublic abstract PartialListResponse<T> listResources(long startIndex, int count, FilterNode filter, SchemaAttribute sortBy, SortOrder sortOrder, List<SchemaAttribute> attributes, List<SchemaAttribute> excludedAttributes, Authorization authorization)
startIndex - the start index that has a minimum value of 1. So the given startIndex here will never be
lower than 1count - the number of entries that should be returned to the client. The minimum value of this value
is 0.filter - the parsed filter expression if the client has given a filtersortBy - the attribute value that should be used for sortingsortOrder - the sort orderattributes - the attributes that should be returned to the client. If the client send this parameter
the evaluation of these parameters might help to improve database performance by omitting
unnecessary table joinsexcludedAttributes - the attributes that should NOT be returned to the client. If the client send this
parameter the evaluation of these parameters might help to improve database performance by
omitting unnecessary table joinsauthorization - should return the roles of an user and may contain arbitrary data needed in the
handler implementationpublic abstract T updateResource(T resourceToUpdate, Authorization authorization)
resourceToUpdate - the resource that should override an existing oneauthorization - should return the roles of an user and may contain arbitrary data needed in the
handler implementationpublic abstract void deleteResource(String id, Authorization authorization)
id - the id of the resource to deleteauthorization - should return the roles of an user and may contain arbitrary data needed in the
handler implementationCopyright © 2019. All rights reserved.