- java.lang.Object
-
- org.apache.syncope.core.rest.cxf.service.AbstractService
-
- org.apache.syncope.core.rest.cxf.service.AbstractSearchService
-
- org.apache.syncope.core.rest.cxf.service.AbstractAnyService<TO,CR,UR>
-
- All Implemented Interfaces:
AnyService<TO>
,JAXRSService
- Direct Known Subclasses:
AnyObjectServiceImpl
,GroupServiceImpl
,UserServiceImpl
public abstract class AbstractAnyService<TO extends AnyTO,CR extends AnyCR,UR extends AnyUR> extends AbstractSearchService implements AnyService<TO>
-
-
Field Summary
-
Fields inherited from class org.apache.syncope.core.rest.cxf.service.AbstractSearchService
searchCondVisitor
-
Fields inherited from class org.apache.syncope.core.rest.cxf.service.AbstractService
LOG, messageContext, OPTIONS_ALLOW, searchContext, uriInfo
-
Fields inherited from interface org.apache.syncope.common.rest.api.service.JAXRSService
CRLF, DOUBLE_DASH, PARAM_ANYTYPE_KIND, PARAM_ANYTYPEKEY, PARAM_CONNID_PAGED_RESULTS_COOKIE, PARAM_DETAILS, PARAM_ENTITY_KEY, PARAM_FIQL, PARAM_KEYWORD, PARAM_MAX, PARAM_NOTIFICATION, PARAM_ORDERBY, PARAM_PAGE, PARAM_REALM, PARAM_RECURSIVE, PARAM_RESOURCE, PARAM_SIZE, PARAM_USER
-
-
Constructor Summary
Constructors Constructor Description AbstractAnyService(SearchCondVisitor searchCondVisitor)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addUpdateOrReplaceAttr(String key, SchemaType schemaType, Attr attrTO, PatchOperation operation)
javax.ws.rs.core.Response
associate(ResourceAR req)
Executes resource-related operations on given entity.javax.ws.rs.core.Response
deassociate(ResourceDR req)
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(UR updateReq)
protected OffsetDateTime
findLastChange(String key)
protected abstract AnyDAO<?>
getAnyDAO()
protected abstract AbstractAnyLogic<TO,CR,UR>
getAnyLogic()
protected abstract UR
newUpdateReq(String key)
TO
read(String key)
Reads the any object matching the provided key.Set<Attr>
read(String key, SchemaType schemaType)
Reads the list of attributes owned by the given any object for the given schema type.Attr
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, Attr attrTO)
Adds or replaces the attribute, owned by the given any object, for the given schema type and schema.-
Methods inherited from class org.apache.syncope.core.rest.cxf.service.AbstractSearchService
getSearchCond
-
Methods inherited from class org.apache.syncope.core.rest.cxf.service.AbstractService
applyPreference, buildPagedResult, checkETag, createResponse, findActualKey, getOrderByClauses, getPreference, isNullPriorityAsync, modificationResponse
-
-
-
-
Constructor Detail
-
AbstractAnyService
public AbstractAnyService(SearchCondVisitor searchCondVisitor)
-
-
Method Detail
-
getAnyDAO
protected abstract AnyDAO<?> getAnyDAO()
-
getAnyLogic
protected abstract AbstractAnyLogic<TO,CR,UR> getAnyLogic()
-
read
public Set<Attr> read(String key, SchemaType schemaType)
Description copied from interface:AnyService
Reads the list of attributes owned by the given any object for the given schema type. Note that for the UserService, GroupService and AnyObjectService subclasses, if the key parameter looks like a UUID then it is interpreted as as key, otherwise as a (user)name.- Specified by:
read
in interfaceAnyService<TO extends AnyTO>
- Parameters:
key
- any object key or nameschemaType
- schema type- Returns:
- list of attributes, owned by the given any object, for the given schema type
-
read
public Attr read(String key, SchemaType schemaType, String schema)
Description copied from interface:AnyService
Reads the attribute, owned by the given any object, for the given schema type and schema. Note that for the UserService, GroupService and AnyObjectService subclasses, if the key parameter looks like a UUID then it is interpreted as as key, otherwise as a (user)name.- Specified by:
read
in interfaceAnyService<TO extends AnyTO>
- Parameters:
key
- any object key or nameschemaType
- schema typeschema
- schema- Returns:
- attribute, owned by the given any object, for the given schema type and schema
-
read
public TO read(String key)
Description copied from interface:AnyService
Reads the any object matching the provided key.- Specified by:
read
in interfaceAnyService<TO extends AnyTO>
- Parameters:
key
- if value looks like a UUID then it is interpreted as key, otherwise as a (user)name- Returns:
- any object with matching key
-
search
public PagedResult<TO> search(AnyQuery anyQuery)
Description copied from interface:AnyService
Returns a paged list of any objects matching the given query.- Specified by:
search
in interfaceAnyService<TO extends AnyTO>
- Parameters:
anyQuery
- query conditions- Returns:
- paged list of any objects matching the given query
-
findLastChange
protected OffsetDateTime findLastChange(String key)
-
doUpdate
protected javax.ws.rs.core.Response doUpdate(UR updateReq)
-
addUpdateOrReplaceAttr
protected void addUpdateOrReplaceAttr(String key, SchemaType schemaType, Attr attrTO, PatchOperation operation)
-
update
public javax.ws.rs.core.Response update(String key, SchemaType schemaType, Attr attrTO)
Description copied from interface:AnyService
Adds or replaces the attribute, owned by the given any object, for the given schema type and schema.- Specified by:
update
in interfaceAnyService<TO extends AnyTO>
- Parameters:
key
- any object key or nameschemaType
- schema typeattrTO
- attribute- Returns:
- Response object featuring the updated any object attribute - as Entity
-
delete
public void delete(String key, SchemaType schemaType, String schema)
Description copied from interface:AnyService
Deletes the attribute, owned by the given any object, for the given schema type and schema.- Specified by:
delete
in interfaceAnyService<TO extends AnyTO>
- Parameters:
key
- any object key or nameschemaType
- schema typeschema
- schema
-
delete
public javax.ws.rs.core.Response delete(String key)
Description copied from interface:AnyService
Deletes any object matching provided key.- Specified by:
delete
in interfaceAnyService<TO extends AnyTO>
- Parameters:
key
- any object key or name- Returns:
- Response object featuring the deleted any object enriched with propagation status information
-
deassociate
public javax.ws.rs.core.Response deassociate(ResourceDR req)
Description copied from interface:AnyService
Executes resource-related operations on given entity.- Specified by:
deassociate
in interfaceAnyService<TO extends AnyTO>
- Parameters:
req
- external resources to be used for propagation-related operations- Returns:
- batch results as Response entity
-
associate
public javax.ws.rs.core.Response associate(ResourceAR req)
Description copied from interface:AnyService
Executes resource-related operations on given entity.- Specified by:
associate
in interfaceAnyService<TO extends AnyTO>
- Parameters:
req
- external resources to be used for propagation-related operations- Returns:
- batch results as Response entity
-
-