Class ResourceServiceImpl
- java.lang.Object
-
- org.apache.syncope.core.rest.cxf.service.AbstractService
-
- org.apache.syncope.core.rest.cxf.service.ResourceServiceImpl
-
- All Implemented Interfaces:
JAXRSService
,ResourceService
@Service public class ResourceServiceImpl extends AbstractService implements ResourceService
-
-
Field Summary
Fields Modifier and Type Field Description protected ResourceLogic
logic
-
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 ResourceServiceImpl(ResourceLogic logic)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
check(ResourceTO resourceTO)
Checks whether the connection to resource could be established.javax.ws.rs.core.Response
create(ResourceTO resourceTO)
Creates a new resource.void
delete(String key)
Deletes the resource matching the given name.javax.ws.rs.core.Response
getConnObjectKeyValue(String key, String anyTypeKey, String anyKey)
Returns the calculated connObjectKey value for the given type and key.List<ResourceTO>
list()
Returns a list of all resources.ResourceTO
read(String key)
Returns the resource with matching name.ConnObject
readConnObject(String key, String anyTypeKey, String value)
Returns connector object from the external resource, for the given type and key.void
removeSyncToken(String key, String anyTypeKey)
Removes the sync token value associated to the given any type from the given resource.PagedConnObjectResult
searchConnObjects(String key, String anyTypeKey, ConnObjectTOQuery query)
Returns a paged list of connector objects from external resource, for the given type, matching page/size conditions.void
setLatestSyncToken(String key, String anyTypeKey)
Queries the connector underlying the given resource for the latest sync token value associated to the given any type and stores the value internally, for later usage.void
update(ResourceTO resourceTO)
Updates the resource matching the given name.-
Methods inherited from class org.apache.syncope.core.rest.cxf.service.AbstractService
applyPreference, buildPagedResult, checkETag, createResponse, findActualKey, getOrderByClauses, getPreference, isNullPriorityAsync, modificationResponse
-
-
-
-
Field Detail
-
logic
protected final ResourceLogic logic
-
-
Constructor Detail
-
ResourceServiceImpl
public ResourceServiceImpl(ResourceLogic logic)
-
-
Method Detail
-
create
public javax.ws.rs.core.Response create(ResourceTO resourceTO)
Description copied from interface:ResourceService
Creates a new resource.- Specified by:
create
in interfaceResourceService
- Parameters:
resourceTO
- Resource to be created- Returns:
- Response object featuring Location header of created resource
-
update
public void update(ResourceTO resourceTO)
Description copied from interface:ResourceService
Updates the resource matching the given name.- Specified by:
update
in interfaceResourceService
- Parameters:
resourceTO
- resource to be stored
-
setLatestSyncToken
public void setLatestSyncToken(String key, String anyTypeKey)
Description copied from interface:ResourceService
Queries the connector underlying the given resource for the latest sync token value associated to the given any type and stores the value internally, for later usage.- Specified by:
setLatestSyncToken
in interfaceResourceService
- Parameters:
key
- resourceanyTypeKey
- any type
-
removeSyncToken
public void removeSyncToken(String key, String anyTypeKey)
Description copied from interface:ResourceService
Removes the sync token value associated to the given any type from the given resource.- Specified by:
removeSyncToken
in interfaceResourceService
- Parameters:
key
- resourceanyTypeKey
- any type
-
delete
public void delete(String key)
Description copied from interface:ResourceService
Deletes the resource matching the given name.- Specified by:
delete
in interfaceResourceService
- Parameters:
key
- name of resource to be deleted
-
read
public ResourceTO read(String key)
Description copied from interface:ResourceService
Returns the resource with matching name.- Specified by:
read
in interfaceResourceService
- Parameters:
key
- Name of resource to be read- Returns:
- resource with matching name
-
list
public List<ResourceTO> list()
Description copied from interface:ResourceService
Returns a list of all resources.- Specified by:
list
in interfaceResourceService
- Returns:
- list of all resources
-
getConnObjectKeyValue
public javax.ws.rs.core.Response getConnObjectKeyValue(String key, String anyTypeKey, String anyKey)
Description copied from interface:ResourceService
Returns the calculated connObjectKey value for the given type and key.- Specified by:
getConnObjectKeyValue
in interfaceResourceService
- Parameters:
key
- name of resource to read connector object fromanyTypeKey
- any object typeanyKey
- user, group or any object key- Returns:
- connObjectKey value for the external resource, for the given type and key
-
readConnObject
public ConnObject readConnObject(String key, String anyTypeKey, String value)
Description copied from interface:ResourceService
Returns connector object from the external resource, for the given type and key.- Specified by:
readConnObject
in interfaceResourceService
- Parameters:
key
- name of resource to read connector object fromanyTypeKey
- any object typevalue
- if value looks like a UUID then it is interpreted as user, group or any object key, otherwise as key value on the resource- Returns:
- connector object from the external resource, for the given type and key
-
searchConnObjects
public PagedConnObjectResult searchConnObjects(String key, String anyTypeKey, ConnObjectTOQuery query)
Description copied from interface:ResourceService
Returns a paged list of connector objects from external resource, for the given type, matching page/size conditions.- Specified by:
searchConnObjects
in interfaceResourceService
- Parameters:
key
- name of resource to read connector object fromanyTypeKey
- any object typequery
- query conditions- Returns:
- connector objects from the external resource, for the given type
-
check
public void check(ResourceTO resourceTO)
Description copied from interface:ResourceService
Checks whether the connection to resource could be established.- Specified by:
check
in interfaceResourceService
- Parameters:
resourceTO
- resource to be checked
-
-