@Service public class ConnectorServiceImpl extends Object implements ConnectorService
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 |
---|
ConnectorServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected javax.ws.rs.core.Response.ResponseBuilder |
applyPreference(ProvisioningResult<?> provisioningResult,
javax.ws.rs.core.Response.ResponseBuilder builder) |
List<ConnIdObjectClassTO> |
buildObjectClassInfo(ConnInstanceTO connInstanceTO,
boolean includeSpecial)
Builds the list of ConnId object classes information for the connector bundle matching the given connector
instance key, with the provided configuration.
|
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.
|
void |
check(ConnInstanceTO connInstanceTO)
Checks whether the connection to resource could be established.
|
protected void |
checkETag(String etag) |
javax.ws.rs.core.Response |
create(ConnInstanceTO connInstanceTO)
Creates a new connector instance.
|
protected javax.ws.rs.core.Response |
createResponse(ProvisioningResult<?> provisioningResult)
Builds response to successful
create request, taking into account any Prefer header. |
void |
delete(String key)
Deletes the connector instance matching the provided key.
|
protected String |
getActualKey(AnyDAO<?> dao,
String pretendingKey) |
List<ConnBundleTO> |
getBundles(String lang)
Returns available connector bundles with property keys in selected language.
|
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() |
List<ConnInstanceTO> |
list(String lang)
Returns a list of all connector instances with property keys in the matching language.
|
protected javax.ws.rs.core.Response |
modificationResponse(Object entity)
Builds response to successful modification request, taking into account any
Prefer header. |
ConnInstanceTO |
read(String key,
String lang)
Returns connector instance with matching key.
|
ConnInstanceTO |
readByResource(String resourceName,
String lang)
Returns connector instance for matching resource.
|
void |
reload()
Reload all connector bundles and instances.
|
void |
update(ConnInstanceTO connInstanceTO)
Updates the connector instance matching the provided key.
|
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
public javax.ws.rs.core.Response create(ConnInstanceTO connInstanceTO)
ConnectorService
create
in interface ConnectorService
connInstanceTO
- connector instance to be createdpublic void delete(String key)
ConnectorService
delete
in interface ConnectorService
key
- connector instance key to be deletedpublic List<ConnBundleTO> getBundles(String lang)
ConnectorService
getBundles
in interface ConnectorService
lang
- language to select property keys; default language is Englishpublic List<ConnIdObjectClassTO> buildObjectClassInfo(ConnInstanceTO connInstanceTO, boolean includeSpecial)
ConnectorService
buildObjectClassInfo
in interface ConnectorService
connInstanceTO
- connector instance object providing configuration propertiesincludeSpecial
- if set to true, special schema names (like '__PASSWORD__') will be included;
default is falsepublic List<ConnInstanceTO> list(String lang)
ConnectorService
list
in interface ConnectorService
lang
- language to select property keys, null for default (English).
An ISO 639 alpha-2 or alpha-3 language code, or a language subtag up to 8 characters in length.public ConnInstanceTO read(String key, String lang)
ConnectorService
read
in interface ConnectorService
key
- connector instance key to be readlang
- language to select property keys, null for default (English).
An ISO 639 alpha-2 or alpha-3 language code, or a language subtag up to 8 characters in length.public ConnInstanceTO readByResource(String resourceName, String lang)
ConnectorService
readByResource
in interface ConnectorService
resourceName
- resource name to be used for connector lookuplang
- language to select property keys, null for default (English).
An ISO 639 alpha-2 or alpha-3 language code, or a language subtag up to 8 characters in length.public void update(ConnInstanceTO connInstanceTO)
ConnectorService
update
in interface ConnectorService
connInstanceTO
- connector instance to be storedpublic void check(ConnInstanceTO connInstanceTO)
ConnectorService
check
in interface ConnectorService
connInstanceTO
- connector instance to be used for connection checkpublic void reload()
ConnectorService
reload
in interface ConnectorService
protected 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.