public class ConnectorHelper extends Object
Constructor and Description |
---|
ConnectorHelper() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkObject(ObjectClassInfo objectClassInfo,
ConnectorObject connectorObj,
Set<Attribute> requestedAttributes)
Checks if object has expected attributes and values.
|
static boolean |
checkObject(ObjectClassInfo objectClassInfo,
ConnectorObject connectorObj,
Set<Attribute> requestedAttributes,
boolean checkNotReturnedByDefault)
Checks if object has expected attributes and values.
|
static boolean |
checkObjectByAttrDelta(ObjectClassInfo objectClassInfo,
ConnectorObject connectorObj,
Set<AttributeDelta> requestedAttributesDelta)
Checks if object has expected attributesDelta and values.
|
static boolean |
checkObjectByAttrDelta(ObjectClassInfo objectClassInfo,
ConnectorObject connectorObj,
Set<AttributeDelta> requestedAttributesDelta,
boolean checkNotReturnedByDefault)
Checks if object has expected attributesDelta and values.
|
static void |
checkSyncDelta(ObjectClassInfo ocInfo,
SyncDelta delta,
Uid uid,
Set<Attribute> attributes,
SyncDeltaType deltaType,
boolean checkNotReturnedByDefault)
Check that passed SyncDelta has exptected values.
|
static ConnectorFacade |
createConnectorFacade(DataProvider dataProvider)
Creates connector facade, initializes connector configuration from
dataProvider and validates configuration and/or tests connection.
|
static ConnectorFacade |
createConnectorFacadeWithWrongConfiguration(DataProvider dataProvider,
Map<?,?> wrongPropertyMap)
Creates connector facade with wrong configuration.
|
static DataProvider |
createDataProvider() |
static Uid |
createObject(ConnectorFacade connectorFacade,
DataProvider dataProvider,
ObjectClassInfo objectClassInfo,
String testName,
int sequenceNumber,
OperationOptions opOptions)
gets the attributes for you
|
static Uid |
createObject(ConnectorFacade connectorFacade,
DataProvider dataProvider,
ObjectClassInfo objectClassInfo,
String testName,
String qualifier,
int sequenceNumber,
OperationOptions opOptions)
gets the attributes for you, appending the qualifier to the attribute name
|
static boolean |
deleteObject(ConnectorFacade connectorFacade,
ObjectClass objClass,
Uid uid,
boolean failOnError,
OperationOptions opOptions)
Performs deletion of object specified by uid.
|
static Object |
get(DataProvider dataProvider,
String componentName,
Class<?> dataTypeName,
String name,
String objectClassName,
int sequenceNumber,
boolean isMultivalue) |
static Object |
get(DataProvider dataProvider,
String componentName,
Class<?> dataTypeName,
String name,
String qualifier,
String objectClassName,
int sequenceNumber,
boolean isMultivalue) |
static Set<Attribute> |
getAttributes(DataProvider dataProvider,
ObjectClassInfo objectClassInfo,
String testName,
String qualifier,
int sequenceNumber,
boolean checkRequired,
boolean onlyMultiValue,
boolean onlyCreateable,
boolean onlyUpdateable)
get attribute values (concatenates the qualifier with the name)
|
static Set<AttributeDelta> |
getAttributesDelta(DataProvider dataProvider,
ObjectClassInfo objectClassInfo,
String testName,
String qualifier,
int sequenceNumber,
boolean checkRequired,
boolean isMultiValue,
boolean isAddValues,
boolean onlyCreateable,
boolean onlyUpdateable)
Get attributeDelta values (concatenates the qualifier with the name).
|
static ConfigurationProperties |
getConfigurationProperties(DataProvider dataProvider)
Gets
ConfigurationProperties for the connector |
static Set<Attribute> |
getCreateableAttributes(DataProvider dataProvider,
ObjectClassInfo objectClassInfo,
String testName,
int sequenceNumber,
boolean checkRequired,
boolean onlyMultiValue)
Get createable attributes' values.
|
static APIConfiguration |
getDefaultConfigurationProperties(DataProvider dataProvider,
ConnectorInfoManager manager) |
static ConnectorInfoManager |
getInfoManager(DataProvider dataProvider)
Tries to create remote or local manager.
|
static ObjectClass |
getObjectClassFromObjectClassInfo(ObjectClassInfo objectClassInfo)
Returns object class based on object class info.
|
static Set<String> |
getReadableAttributesNames(ObjectClassInfo ocInfo)
Returns set of attributes' names which are readable.
|
static String |
getString(DataProvider dataProvider,
String componentName,
String name,
String objectClassName)
no sequence number or qualifier, appends objectclass to name
|
static Set<Attribute> |
getUpdateableAttributes(DataProvider dataProvider,
ObjectClassInfo objectClassInfo,
String testName,
String qualifier,
int sequenceNumber,
boolean checkRequired,
boolean onlyMultiValue)
Get updateable attributes' values.
|
static Set<AttributeDelta> |
getUpdateableAttributesDelta(DataProvider dataProvider,
ObjectClassInfo objectClassInfo,
String testName,
String qualifier,
int sequenceNumber,
boolean checkRequired,
boolean isMultiValue,
boolean isAddOrRemoveValues)
Get updateable attributes' values.
|
static boolean |
isAttrSupported(ObjectClassInfo oinfo,
String attribute)
Whether is attribute supported.
|
static boolean |
isCreateable(ObjectClassInfo objectClassInfo,
Attribute attribute)
Whether is attribute Createable.
|
static boolean |
isCRU(ObjectClassInfo oinfo,
String attribute)
Whether is attribute creatable, updateable and readable.
|
static boolean |
isMultiValue(ObjectClassInfo objectClassInfo,
String attribute)
Whether is attribute multiValue.
|
static boolean |
isReadable(ObjectClassInfo objectClassInfo,
Attribute attribute)
Whether is attribute readable.
|
static boolean |
isReadable(ObjectClassInfo oinfo,
String attribute)
Whether is attribute readable.
|
static boolean |
isRequired(ObjectClassInfo objectClassInfo,
Attribute attribute)
Whether is attribute required.
|
static boolean |
isReturnedByDefault(ObjectClassInfo objectClassInfo,
Attribute attribute)
Whether is attribute returnedByDefault.
|
static boolean |
isUpdateable(ObjectClassInfo objectClassInfo,
Attribute attribute)
Whether is attribute readable.
|
static boolean |
operationsSupported(ConnectorFacade connectorFacade,
ObjectClass oClass,
Set<Class<? extends APIOperation>> operations)
check to see if a particular objectclass supports a particular operations
To succeed all the operations must be supported.
|
static boolean |
operationsSupported(ConnectorFacade connectorFacade,
Set<Class<? extends APIOperation>> operations)
check to see if ANY objectclass supports a particular operations
|
static boolean |
operationSupported(ConnectorFacade connectorFacade,
Class<? extends APIOperation> operation)
check to see if ANY objectclass supports a particular operation
|
static boolean |
operationSupported(ConnectorFacade connectorFacade,
Class<? extends APIOperation> operations1,
Class<? extends APIOperation> operations2)
check to see if ANY objectclass supports a particular operation
|
static boolean |
operationSupported(ConnectorFacade connectorFacade,
ObjectClass oClass,
Class<? extends APIOperation> operation)
check to see if a particular objectclass supports a particular operation
|
static boolean |
operationSupported(ConnectorFacade connectorFacade,
ObjectClass oClass,
Class<? extends APIOperation> operation1,
Class<? extends APIOperation> operation2)
check to see if a particular objectclass supports a particular operations
|
static List<ConnectorObject> |
search(ConnectorFacade connectorFacade,
ObjectClass objClass,
Filter filter,
OperationOptions opOptions)
Performs search on connector facade with specified object class, filter and operation options.
|
static Map<Uid,ConnectorObject> |
search2Map(ConnectorFacade connectorFacade,
ObjectClass objClass,
Filter filter,
OperationOptions opOptions)
Performs search on connector facade with specified object class, filter and operation options.
|
static List<SyncDelta> |
sync(ConnectorFacade connectorFacade,
ObjectClass objClass,
SyncToken token,
OperationOptions opOptions)
Performs sync on connector facade.
|
public static DataProvider createDataProvider()
public static ConfigurationProperties getConfigurationProperties(DataProvider dataProvider)
ConfigurationProperties
for the connectordataProvider
- public static ConnectorFacade createConnectorFacadeWithWrongConfiguration(DataProvider dataProvider, Map<?,?> wrongPropertyMap)
wrongPropertyMap
- wrong configurationpublic static ConnectorFacade createConnectorFacade(DataProvider dataProvider)
public static List<ConnectorObject> search(ConnectorFacade connectorFacade, ObjectClass objClass, Filter filter, OperationOptions opOptions)
public static Map<Uid,ConnectorObject> search2Map(ConnectorFacade connectorFacade, ObjectClass objClass, Filter filter, OperationOptions opOptions)
Uid
s to ConnectorObject
s that were found.public static List<SyncDelta> sync(ConnectorFacade connectorFacade, ObjectClass objClass, SyncToken token, OperationOptions opOptions)
public static boolean deleteObject(ConnectorFacade connectorFacade, ObjectClass objClass, Uid uid, boolean failOnError, OperationOptions opOptions)
public static boolean checkObject(ObjectClassInfo objectClassInfo, ConnectorObject connectorObj, Set<Attribute> requestedAttributes)
public static boolean checkObject(ObjectClassInfo objectClassInfo, ConnectorObject connectorObj, Set<Attribute> requestedAttributes, boolean checkNotReturnedByDefault)
checkNotReturnedByDefault
- if true then also attributes not returned by default are checkedpublic static boolean checkObjectByAttrDelta(ObjectClassInfo objectClassInfo, ConnectorObject connectorObj, Set<AttributeDelta> requestedAttributesDelta)
public static boolean checkObjectByAttrDelta(ObjectClassInfo objectClassInfo, ConnectorObject connectorObj, Set<AttributeDelta> requestedAttributesDelta, boolean checkNotReturnedByDefault)
checkNotReturnedByDefault
- if true then also attributes not returned by default are
checkedpublic static void checkSyncDelta(ObjectClassInfo ocInfo, SyncDelta delta, Uid uid, Set<Attribute> attributes, SyncDeltaType deltaType, boolean checkNotReturnedByDefault)
public static boolean isReadable(ObjectClassInfo objectClassInfo, Attribute attribute)
public static boolean isRequired(ObjectClassInfo objectClassInfo, Attribute attribute)
public static boolean isCreateable(ObjectClassInfo objectClassInfo, Attribute attribute)
public static boolean isUpdateable(ObjectClassInfo objectClassInfo, Attribute attribute)
public static boolean isReturnedByDefault(ObjectClassInfo objectClassInfo, Attribute attribute)
public static boolean isMultiValue(ObjectClassInfo objectClassInfo, String attribute)
public static boolean isCRU(ObjectClassInfo oinfo, String attribute)
public static boolean isReadable(ObjectClassInfo oinfo, String attribute)
public static boolean isAttrSupported(ObjectClassInfo oinfo, String attribute)
public static Set<Attribute> getUpdateableAttributes(DataProvider dataProvider, ObjectClassInfo objectClassInfo, String testName, String qualifier, int sequenceNumber, boolean checkRequired, boolean onlyMultiValue)
qualifier
qualifier
- the prefix for values used in update.public static Set<AttributeDelta> getUpdateableAttributesDelta(DataProvider dataProvider, ObjectClassInfo objectClassInfo, String testName, String qualifier, int sequenceNumber, boolean checkRequired, boolean isMultiValue, boolean isAddOrRemoveValues)
qualifier
qualifier
- the prefix for values used in update.public static Set<Attribute> getCreateableAttributes(DataProvider dataProvider, ObjectClassInfo objectClassInfo, String testName, int sequenceNumber, boolean checkRequired, boolean onlyMultiValue)
public static Set<String> getReadableAttributesNames(ObjectClassInfo ocInfo)
public static Set<Attribute> getAttributes(DataProvider dataProvider, ObjectClassInfo objectClassInfo, String testName, String qualifier, int sequenceNumber, boolean checkRequired, boolean onlyMultiValue, boolean onlyCreateable, boolean onlyUpdateable) throws ObjectNotFoundException
dataProvider
- objectClassInfo
- testName
- qualifier
- sequenceNumber
- checkRequired
- ObjectNotFoundException
public static Set<AttributeDelta> getAttributesDelta(DataProvider dataProvider, ObjectClassInfo objectClassInfo, String testName, String qualifier, int sequenceNumber, boolean checkRequired, boolean isMultiValue, boolean isAddValues, boolean onlyCreateable, boolean onlyUpdateable) throws ObjectNotFoundException
dataProvider
- objectClassInfo
- testName
- qualifier
- sequenceNumber
- checkRequired
- ObjectNotFoundException
public static Uid createObject(ConnectorFacade connectorFacade, DataProvider dataProvider, ObjectClassInfo objectClassInfo, String testName, String qualifier, int sequenceNumber, OperationOptions opOptions) throws ObjectNotFoundException
connectorFacade
- dataProvider
- objectClassInfo
- testName
- qualifier
- sequenceNumber
- ObjectNotFoundException
public static Uid createObject(ConnectorFacade connectorFacade, DataProvider dataProvider, ObjectClassInfo objectClassInfo, String testName, int sequenceNumber, OperationOptions opOptions) throws ObjectNotFoundException
connectorFacade
- dataProvider
- objectClassInfo
- testName
- sequenceNumber
- ObjectNotFoundException
public static boolean operationSupported(ConnectorFacade connectorFacade, ObjectClass oClass, Class<? extends APIOperation> operation)
connectorFacade
- oClass
- operation
- public static boolean operationSupported(ConnectorFacade connectorFacade, ObjectClass oClass, Class<? extends APIOperation> operation1, Class<? extends APIOperation> operation2)
connectorFacade
- oClass
- operation1
- operation2
- public static boolean operationsSupported(ConnectorFacade connectorFacade, ObjectClass oClass, Set<Class<? extends APIOperation>> operations)
connectorFacade
- oClass
- operations
- public static boolean operationSupported(ConnectorFacade connectorFacade, Class<? extends APIOperation> operation)
connectorFacade
- operation
- public static boolean operationSupported(ConnectorFacade connectorFacade, Class<? extends APIOperation> operations1, Class<? extends APIOperation> operations2)
connectorFacade
- operations1
- operations2
- public static boolean operationsSupported(ConnectorFacade connectorFacade, Set<Class<? extends APIOperation>> operations)
connectorFacade
- operations
- public static ConnectorInfoManager getInfoManager(DataProvider dataProvider)
public static APIConfiguration getDefaultConfigurationProperties(DataProvider dataProvider, ConnectorInfoManager manager) throws ObjectNotFoundException
ObjectNotFoundException
public static String getString(DataProvider dataProvider, String componentName, String name, String objectClassName) throws ObjectNotFoundException
dataProvider
- componentName
- name
- objectClassName
- ObjectNotFoundException
public static Object get(DataProvider dataProvider, String componentName, Class<?> dataTypeName, String name, String objectClassName, int sequenceNumber, boolean isMultivalue) throws ObjectNotFoundException
ObjectNotFoundException
public static Object get(DataProvider dataProvider, String componentName, Class<?> dataTypeName, String name, String qualifier, String objectClassName, int sequenceNumber, boolean isMultivalue) throws ObjectNotFoundException
ObjectNotFoundException
public static ObjectClass getObjectClassFromObjectClassInfo(ObjectClassInfo objectClassInfo)
Copyright © 2022. All rights reserved.