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 ResourceLogiclogic-
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 voidcheck(ResourceTO resourceTO)Checks whether the connection to resource could be established.javax.ws.rs.core.Responsecreate(ResourceTO resourceTO)Creates a new resource.voiddelete(String key)Deletes the resource matching the given name.javax.ws.rs.core.ResponsegetConnObjectKeyValue(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.ResourceTOread(String key)Returns the resource with matching name.ConnObjectreadConnObject(String key, String anyTypeKey, String value)Returns connector object from the external resource, for the given type and key.voidremoveSyncToken(String key, String anyTypeKey)Removes the sync token value associated to the given any type from the given resource.PagedConnObjectResultsearchConnObjects(String key, String anyTypeKey, ConnObjectTOQuery query)Returns a paged list of connector objects from external resource, for the given type, matching page/size conditions.voidsetLatestSyncToken(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.voidupdate(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:ResourceServiceCreates a new resource.- Specified by:
createin 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:ResourceServiceUpdates the resource matching the given name.- Specified by:
updatein interfaceResourceService- Parameters:
resourceTO- resource to be stored
-
setLatestSyncToken
public void setLatestSyncToken(String key, String anyTypeKey)
Description copied from interface:ResourceServiceQueries 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:
setLatestSyncTokenin interfaceResourceService- Parameters:
key- resourceanyTypeKey- any type
-
removeSyncToken
public void removeSyncToken(String key, String anyTypeKey)
Description copied from interface:ResourceServiceRemoves the sync token value associated to the given any type from the given resource.- Specified by:
removeSyncTokenin interfaceResourceService- Parameters:
key- resourceanyTypeKey- any type
-
delete
public void delete(String key)
Description copied from interface:ResourceServiceDeletes the resource matching the given name.- Specified by:
deletein interfaceResourceService- Parameters:
key- name of resource to be deleted
-
read
public ResourceTO read(String key)
Description copied from interface:ResourceServiceReturns the resource with matching name.- Specified by:
readin interfaceResourceService- Parameters:
key- Name of resource to be read- Returns:
- resource with matching name
-
list
public List<ResourceTO> list()
Description copied from interface:ResourceServiceReturns a list of all resources.- Specified by:
listin interfaceResourceService- Returns:
- list of all resources
-
getConnObjectKeyValue
public javax.ws.rs.core.Response getConnObjectKeyValue(String key, String anyTypeKey, String anyKey)
Description copied from interface:ResourceServiceReturns the calculated connObjectKey value for the given type and key.- Specified by:
getConnObjectKeyValuein 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:ResourceServiceReturns connector object from the external resource, for the given type and key.- Specified by:
readConnObjectin 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:ResourceServiceReturns a paged list of connector objects from external resource, for the given type, matching page/size conditions.- Specified by:
searchConnObjectsin 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:ResourceServiceChecks whether the connection to resource could be established.- Specified by:
checkin interfaceResourceService- Parameters:
resourceTO- resource to be checked
-
-