public abstract class AbstractAnyService<TO extends AnyTO,P extends AnyPatch> extends Object implements AnyService<TO>
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOG |
protected org.apache.cxf.jaxrs.ext.MessageContext |
messageContext |
protected static String |
OPTIONS_ALLOW |
protected SearchCondVisitor |
searchCondVisitor |
protected org.apache.cxf.jaxrs.ext.search.SearchContext |
searchContext |
protected javax.ws.rs.core.UriInfo |
uriInfo |
CRLF, DOUBLE_DASH, PARAM_ANYTYPE_KIND, PARAM_ANYTYPEKEY, PARAM_CONNID_PAGED_RESULTS_COOKIE, PARAM_DETAILS, PARAM_ENTITY_KEY, PARAM_FIQL, PARAM_MAX, PARAM_NOTIFICATION, PARAM_ORDERBY, PARAM_PAGE, PARAM_REALM, PARAM_RESOURCE, PARAM_SIZE, PARAM_USER
Constructor and Description |
---|
AbstractAnyService() |
Modifier and Type | Method and Description |
---|---|
protected javax.ws.rs.core.Response.ResponseBuilder |
applyPreference(ProvisioningResult<?> provisioningResult,
javax.ws.rs.core.Response.ResponseBuilder builder) |
javax.ws.rs.core.Response |
associate(AssociationPatch patch)
Executes resource-related operations on given entity.
|
protected <T extends BaseBean> |
buildPagedResult(List<T> list,
int page,
int size,
int totalCount)
Builds a paged result out of a list of items and additional information.
|
protected void |
checkETag(String etag) |
protected javax.ws.rs.core.Response |
createResponse(ProvisioningResult<?> provisioningResult)
Builds response to successful
create request, taking into account any Prefer header. |
javax.ws.rs.core.Response |
deassociate(DeassociationPatch patch)
Executes resource-related operations on given entity.
|
javax.ws.rs.core.Response |
delete(String key)
Deletes any object matching provided key.
|
void |
delete(String key,
SchemaType schemaType,
String schema)
Deletes the attribute, owned by the given any object, for the given schema type and schema.
|
protected javax.ws.rs.core.Response |
doUpdate(P anyPatch) |
protected Date |
findLastChange(String key) |
protected String |
getActualKey(AnyDAO<?> dao,
String pretendingKey) |
protected abstract AnyDAO<?> |
getAnyDAO() |
protected abstract AbstractAnyLogic<TO,P> |
getAnyLogic() |
protected List<OrderByClause> |
getOrderByClauses(String orderBy) |
protected Preference |
getPreference()
Reads
Prefer header from request and parses into a Preference instance. |
protected SearchCond |
getSearchCond(String fiql,
String realm) |
protected boolean |
isNullPriorityAsync() |
protected javax.ws.rs.core.Response |
modificationResponse(Object entity)
Builds response to successful modification request, taking into account any
Prefer header. |
protected abstract P |
newPatch(String key) |
TO |
read(String key)
Reads the any object matching the provided key.
|
Set<AttrTO> |
read(String key,
SchemaType schemaType)
Reads the list of attributes owned by the given any object for the given schema type.
|
AttrTO |
read(String key,
SchemaType schemaType,
String schema)
Reads the attribute, owned by the given any object, for the given schema type and schema.
|
PagedResult<TO> |
search(AnyQuery anyQuery)
Returns a paged list of any objects matching the given query.
|
javax.ws.rs.core.Response |
update(String key,
SchemaType schemaType,
AttrTO attrTO)
Adds or replaces the attribute, owned by the given any object, for the given schema type and schema.
|
protected static final org.slf4j.Logger LOG
protected static final String OPTIONS_ALLOW
@Context protected javax.ws.rs.core.UriInfo uriInfo
@Context protected org.apache.cxf.jaxrs.ext.MessageContext messageContext
@Context protected org.apache.cxf.jaxrs.ext.search.SearchContext searchContext
@Autowired protected SearchCondVisitor searchCondVisitor
protected abstract AnyDAO<?> getAnyDAO()
protected abstract AbstractAnyLogic<TO,P> getAnyLogic()
public Set<AttrTO> read(String key, SchemaType schemaType)
AnyService
read
in interface AnyService<TO extends AnyTO>
key
- any object key or nameschemaType
- schema typepublic AttrTO read(String key, SchemaType schemaType, String schema)
AnyService
read
in interface AnyService<TO extends AnyTO>
key
- any object key or nameschemaType
- schema typeschema
- schemapublic TO read(String key)
AnyService
read
in interface AnyService<TO extends AnyTO>
key
- if value looks like a UUID then it is interpreted as key, otherwise as a (user)namepublic PagedResult<TO> search(AnyQuery anyQuery)
AnyService
search
in interface AnyService<TO extends AnyTO>
anyQuery
- query conditionsprotected javax.ws.rs.core.Response doUpdate(P anyPatch)
public javax.ws.rs.core.Response update(String key, SchemaType schemaType, AttrTO attrTO)
AnyService
update
in interface AnyService<TO extends AnyTO>
key
- any object key or nameschemaType
- schema typeattrTO
- attributepublic void delete(String key, SchemaType schemaType, String schema)
AnyService
delete
in interface AnyService<TO extends AnyTO>
key
- any object key or nameschemaType
- schema typeschema
- schemapublic javax.ws.rs.core.Response delete(String key)
AnyService
delete
in interface AnyService<TO extends AnyTO>
key
- any object key or namepublic javax.ws.rs.core.Response deassociate(DeassociationPatch patch)
AnyService
deassociate
in interface AnyService<TO extends AnyTO>
patch
- external resources to be used for propagation-related operationspublic javax.ws.rs.core.Response associate(AssociationPatch patch)
AnyService
associate
in interface AnyService<TO extends AnyTO>
patch
- external resources to be used for propagation-related operationsprotected boolean isNullPriorityAsync()
protected Preference getPreference()
Prefer
header from request and parses into a Preference
instance.Preference
instance matching the passed Prefer
header,
or Preference.NONE
if missing.protected javax.ws.rs.core.Response.ResponseBuilder applyPreference(ProvisioningResult<?> provisioningResult, javax.ws.rs.core.Response.ResponseBuilder builder)
protected javax.ws.rs.core.Response createResponse(ProvisioningResult<?> provisioningResult)
create
request, taking into account any Prefer
header.provisioningResult
- the entity just createdcreate
requestprotected javax.ws.rs.core.Response modificationResponse(Object entity)
Prefer
header.entity
- the entity just modifiedprotected void checkETag(String etag)
protected SearchCond getSearchCond(String fiql, String realm)
protected List<OrderByClause> getOrderByClauses(String orderBy)
protected <T extends BaseBean> PagedResult<T> buildPagedResult(List<T> list, int page, int size, int totalCount)
T
- result typelist
- bare list of items to be returnedpage
- current pagesize
- requested sizetotalCount
- total result size (not considering pagination)Copyright © 2010–2023 The Apache Software Foundation. All rights reserved.