public abstract class AbstractConnector extends java.lang.Object implements Connector
Extending this class is not required to use the connector with IdentityIQ, but it is required if you want to test and maintain the connector using XModule.
Connector.Feature| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
_state
Stores connector state modifications in memory
|
protected ConnectorConfig |
config
An object containing configuration parameters such as the host,
port, and credentials for communicating with the managed system.
|
static java.lang.String |
CONFIG_RETRYABLE_ERRORS
The name of the configuration attribute that is used when shouldRetry method is called
by the connector implementation to Check if the error message is configured to be retried.
|
protected Log |
log
A log abstraction for sending diagnostic messages.
|
protected java.lang.String |
objectType
The currently configured object type.
|
protected Schema |
schema
The Schema that matches the object type, found within the
ConnectorCnfig.
|
StatisticsCollector |
statisticsCollector
The StatisticsCollector object is require for passing statistics of
connectors during Aggregation process.
|
ARG_CURRENT, ARG_EXPIRATION, ARG_PARTITION, ATT_DELETED, ATT_DISABLED, ATT_LOCKED, ATT_PASSWORD, ATT_PERMISSIONS, OBJECT_TYPE_ACCOUNT, OBJECT_TYPE_GROUP, OBJECT_TYPE_TICKET| Constructor and Description |
|---|
AbstractConnector()
Default constructor - required for reflective instantiation.
|
AbstractConnector(ConnectorConfig config,
Log log)
Constructor for an account connector that uses the given config.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
authenticate(java.lang.String accountId,
java.util.Map<java.lang.String,java.lang.Object> options)
Perform pass-through authentication with additional options.
|
java.util.Map<java.lang.String,java.lang.Object> |
authenticate(java.lang.String identity,
java.lang.String password)
Perform pass-through authentication.
|
java.util.Map<java.lang.String,java.lang.Object> |
buildOptions(Request request)
Build up the options that will be passed down to each of
the operations that have options.
|
Result |
checkStatus(java.lang.String id)
Default implementation of check status that does nothing.
|
void |
close()
Release resource held by this connector.
|
void |
configure(ConnectorConfig config,
Log log)
Save the configuration object and log interface in local fields
for later use.
|
Result |
create(java.lang.String id,
java.util.List<Item> items)
Create an object of the currently configured type on the resource.
|
Result |
delete(java.lang.String id,
java.util.Map<java.lang.String,java.lang.Object> options)
Delete the object of the configured object type that has the given
native identifier.
|
void |
destroy(java.util.Map<java.lang.String,java.lang.Object> optionsMap)
Called by aggregator at the end of aggregation
|
Result |
disable(java.lang.String id,
java.util.Map<java.lang.String,java.lang.Object> options)
Disable the object of the configured object type that has the given
native identifier.
|
Schema |
discoverSchema()
Discover the Schema for the currently configured object type.
|
java.util.Map |
doHealthCheck(java.util.Map<java.lang.String,java.lang.Object> options)
Light Weight Test Connection
|
protected Result |
doSystemItems(Request req,
java.util.List<Item> items,
java.lang.String id)
Helper for provision, process the list of system items.
|
Result |
enable(java.lang.String id,
java.util.Map<java.lang.String,java.lang.Object> options)
Enable the object of the configured object type that has the given native
identifier.
|
protected static java.util.List<java.lang.Object> |
getAsList(java.lang.Object val) |
protected static java.util.List<java.lang.String> |
getAsStringList(java.lang.Object val) |
protected boolean |
getBoolean(java.lang.String attrName) |
java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> |
getChangeLogExtract(java.util.Map<java.lang.String,java.lang.Object> requestParams)
Default implementation of the getChangeLogExtract method, which throws a
UnsupportedOperationException exception.
|
ConnectorConfig |
getConfig() |
java.util.Map<java.lang.String,java.lang.Object> |
getConfigOptions(java.lang.String configOptionsKey)
Default implementation of getConfigOptions method that does nothing.
|
ConnectorServices |
getConnectorServices() |
java.util.Map<java.lang.String,java.lang.Object> |
getDeltaAggregationState()
Convenience method to get the delta aggregation state.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
getExtractPartitions(java.util.Map<java.lang.String,java.lang.Object> requestParams,
java.lang.String extractType)
This method will be called to get extract Partition for ARM extract
requests
|
java.lang.Boolean |
getFeatureFlagValue(java.lang.String name,
boolean defaultValue)
This method will return value of featureFlag name provided.
|
protected java.lang.String |
getIdentityAttribute()
Convenience method to return the identityAttribute from the Schema
for the currently configured object type.
|
protected int |
getInt(java.lang.String attrName,
int defaultValue) |
java.util.List<Partition> |
getIteratorPartitions(int suggestedPartitionCount,
Filter filter,
java.util.Map<java.lang.String,java.lang.Object> ops)
Default implementation of the getIteratorPartitions method, which
returns null by default.
|
Log |
getLog() |
protected java.lang.String |
getNativeIdentifier(java.util.Map<java.lang.String,java.lang.Object> obj) |
java.lang.String |
getObjectType() |
boolean |
getProductFlagValue(java.lang.String name,
boolean defaultValue)
Returns requested Product Flag set by CCG, if not set then return default value.
|
protected java.lang.String |
getRequiredString(java.lang.String attrName) |
Schema |
getSchema() |
java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> |
getSecurityExtract(java.util.Map<java.lang.String,java.lang.Object> requestParams)
Default implementation of the getSecurityExtract method, which throws a
UnsupportedOperationException exception.
|
protected java.lang.String |
getString(java.lang.String attrName) |
java.util.List<Connector.Feature> |
getSupportedFeatures(java.lang.String objectType)
The default is GET and ITERATE.
|
java.util.List<java.lang.String> |
getSupportedObjectTypes()
Return a list of the object types supported by this connector.
|
java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> |
getUtilizationExtract(java.util.Map<java.lang.String,java.lang.Object> requestParams)
Default implementation of the getUtilizationExtract method, which throws
a UnsupportedOperationException exception.
|
boolean |
isExceptionRetryable(java.lang.Exception e)
Check weather the exception is eligible for retry.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
itemsToMap(java.util.List<Item> items)
Given a list of Items, convert them into a Map.
|
java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> |
iterate(Partition partition)
Default implementation of the iterate(Partition) method, which throws
UnsupportedOperationException by default.
|
void |
notifyListeners()
Notify listener when connector config changes
|
void |
provision(Plan plan)
Default implementation of the plan evaluation method that parses the
plan and calls down to a simpler set of methods that can be
implemented by the subclass.
|
void |
registerListener(ConnectorStateChangeListener listener)
Register listener interested in connector config changes
|
void |
saveConnectorState()
Finally save the new connector state values into the app config
|
void |
setConnectorServices(ConnectorServices connServices)
Sets the ConnectorServices object, provided by OpenConnectorAdapter.
|
void |
setConnectorState(java.lang.String attribute,
java.lang.Object val)
Interface to set connector state values
|
void |
setDeltaAggregationState(java.util.Map<java.lang.String,java.lang.Object> state)
Convenience method to set the delta aggregation state.
|
void |
setLog(Log log)
Change the log used by this connector.
|
void |
setObjectType(java.lang.String type)
Set the target object type.
|
Result |
setPassword(java.lang.String id,
java.lang.String newPassword,
java.lang.String currentPassword,
java.util.Date expiration,
java.util.Map<java.lang.String,java.lang.Object> options)
Set the password for the given object to the newPassword.
|
void |
setRetryStatus(Result result)
Helper for setting retry status -
Iterate through all the messages from the result and call shoudRetry for each one
If it can be retried, check if the retry threshold is configured, set that in the result
|
void |
setStatisticsCollector(StatisticsCollector statisticsCollector)
Set the StatisticsCollector object require for underlying connector to
push the aggreagtion statistics.
|
boolean |
shouldRetry(java.lang.Exception e,
java.lang.String error)
Helper for checking if the provisioning error can be retried -
1.
|
boolean |
supportsPartitionedDeltaAggregation()
Gets if the connector supports partitioned delta aggregation
|
void |
testConnection()
Test the connection to the managed system.
|
protected void |
throwUnsupported(java.lang.String method) |
Result |
unlock(java.lang.String id,
java.util.Map<java.lang.String,java.lang.Object> options)
Unlock the object of the configured object type that has the given native
identifier.
|
Result |
update(java.lang.String id,
java.util.List<Item> items)
Update the object of the given type using the given item list.
|
protected ConnectorConfig config
protected Log log
protected java.lang.String objectType
protected Schema schema
protected java.util.Map<java.lang.String,java.lang.Object> _state
public static final java.lang.String CONFIG_RETRYABLE_ERRORS
public StatisticsCollector statisticsCollector
public AbstractConnector()
public AbstractConnector(ConnectorConfig config, Log log)
public void configure(ConnectorConfig config, Log log)
configure in interface Connectorconfig - The ConnectorConfig that specifies connection
parameters and schemas.log - An implementation of Log that the connector can
use for logging.Connector.configure(ConnectorConfig, Log)public ConnectorConfig getConfig()
getConfig in interface ConnectorConnector.getConfig()public void setDeltaAggregationState(java.util.Map<java.lang.String,java.lang.Object> state)
public java.util.Map<java.lang.String,java.lang.Object> getDeltaAggregationState()
public void setConnectorState(java.lang.String attribute,
java.lang.Object val)
setConnectorState in interface Connectorattribute - The attribute that needs to be set a new valueval - The value to set against the attributepublic void saveConnectorState()
saveConnectorState in interface Connectorpublic Log getLog()
public void setLog(Log log)
public void setObjectType(java.lang.String type)
setObjectType in interface Connectortype - The target object type for future method calls.
This can be one of the OBJECT_TYPE_* constants or
any supported object type.public java.lang.String getObjectType()
getObjectType in interface Connectorpublic Schema getSchema()
public void setConnectorServices(ConnectorServices connServices)
setConnectorServices in interface Connectorpublic ConnectorServices getConnectorServices()
getConnectorServices in interface Connectorpublic void close()
close in interface ConnectorConnector.close()public void testConnection()
throws ConnectorException
testConnection in interface ConnectorConnectorExceptionConnector.testConnection()public java.util.Map doHealthCheck(java.util.Map<java.lang.String,java.lang.Object> options)
throws ConnectorException,
java.lang.UnsupportedOperationException
doHealthCheck in interface Connectoroptions - : kept null as of now as testConnection() is void Returning , can be used for future extensionConnectorExceptionjava.lang.UnsupportedOperationExceptionpublic java.util.List<java.lang.String> getSupportedObjectTypes()
ConnectorgetSupportedObjectTypes in interface Connectorpublic java.util.List<Connector.Feature> getSupportedFeatures(java.lang.String objectType)
getSupportedFeatures in interface Connectorpublic java.lang.Boolean getFeatureFlagValue(java.lang.String name,
boolean defaultValue)
name - defaultValue - public boolean getProductFlagValue(java.lang.String name,
boolean defaultValue)
name - defaultValue - public java.util.Map<java.lang.String,java.lang.Object> authenticate(java.lang.String identity,
java.lang.String password)
throws ConnectorException,
AuthenticationFailedException,
ExpiredPasswordException,
ObjectNotFoundException,
java.lang.UnsupportedOperationException
authenticate in interface Connectoridentity - A value for an identifying attribute of the account to
authenticate with.password - The password to use to authenticate.ConnectorException - If the operation fails.AuthenticationFailedException - If authentication failed.ExpiredPasswordException - If authentication failed because of an
expired password.ObjectNotFoundException - If an object that matches the given
identity could not be found.java.lang.UnsupportedOperationException - If the AUTHENTICATE feature is not
supported.AbstractConnector.authenticate(String, String)public java.util.Map<java.lang.String,java.lang.Object> authenticate(java.lang.String accountId,
java.util.Map<java.lang.String,java.lang.Object> options)
throws ConnectorException,
AuthenticationFailedException,
ExpiredPasswordException,
ObjectNotFoundException,
java.lang.UnsupportedOperationException
authenticate in interface ConnectoraccountId - A value for an identifying attribute of the account to authenticate with.options - Additional options to consider during authentication including the password.ConnectorException - If the operation fails.AuthenticationFailedException - If authentication failed.ExpiredPasswordException - If authentication failed because of an
expired password.ObjectNotFoundException - If an object that matches the given
identity could not be found.java.lang.UnsupportedOperationException - If the AUTHENTICATE feature is not
supported.Connector.authenticate(String, Map)public Schema discoverSchema() throws ConnectorException, java.lang.UnsupportedOperationException
ConnectordiscoverSchema in interface ConnectorConnectorException - If the operation fails.java.lang.UnsupportedOperationException - If the DISCOVER_SCHEMA feature is
not supported.protected void throwUnsupported(java.lang.String method)
protected java.lang.String getIdentityAttribute()
protected java.lang.String getNativeIdentifier(java.util.Map<java.lang.String,java.lang.Object> obj)
throws java.lang.IllegalArgumentException
obj - The object from which to retrieve the nativeIdentifier.java.lang.IllegalArgumentException - If the given object does not have a
value for the configured identity attribute.protected java.lang.String getString(java.lang.String attrName)
attrName - The name of the configuration attribute.protected java.lang.String getRequiredString(java.lang.String attrName)
attrName - The name of the configuration attribute.ConnectorExceptionprotected int getInt(java.lang.String attrName,
int defaultValue)
attrName - The name of the configuration attribute.defaultValue - The value to return if not configured.ConnectorException - If the configured value is not an integer.protected boolean getBoolean(java.lang.String attrName)
attrName - The name of the configuration attribute.protected static java.util.List<java.lang.Object> getAsList(java.lang.Object val)
protected static java.util.List<java.lang.String> getAsStringList(java.lang.Object val)
protected java.util.Map<java.lang.String,java.lang.Object> itemsToMap(java.util.List<Item> items)
Note that this will lose any extended arguments that might be passed with each Item.
items - list of Items to convertpublic void provision(Plan plan) throws ConnectorException, java.lang.UnsupportedOperationException
We will treat each Request in the plan as an independent transaction that will have its own Result.
provision in interface Connectorplan - The plan to evaluate.ConnectorException - If the operation fails.ObjectAlreadyExistsException - If an object already exists on
the resource.java.lang.UnsupportedOperationException - If the an operation in the plan
is not supported.public void setRetryStatus(Result result)
public boolean shouldRetry(java.lang.Exception e,
java.lang.String error)
e - The exception object to testerror - string of errors to comparepublic boolean isExceptionRetryable(java.lang.Exception e)
e - The exception object.protected Result doSystemItems(Request req, java.util.List<Item> items, java.lang.String id)
The typical cases are handled adequately with these rules:
While it seems funny to not try to merge Results of multiple system items, in practice this doesn't happen.
public java.util.Map<java.lang.String,java.lang.Object> buildOptions(Request request)
In any given request there can arguments at the request level and/or item level. These arguments will be flattened into a single Map and given to each method in the options method parameter.
In some cases operation might require additional values sent over in the request in the form of other Items.
If there are additional items present in the Request they will also be merged into the options map by name of the item as the key and the value of the item as the value of the key in the options map.
The arguments from the request, the item, and then finally any additional included items are added.
There should not be any key conflict, but if they do occur the arguments and the item names the item will be skipped and an error will be sent to the log.
request - public Result create(java.lang.String id, java.util.List<Item> items) throws ConnectorException, ObjectAlreadyExistsException, java.lang.UnsupportedOperationException
id - The identifier of the object to create.items - The initial account attributes.ConnectorException - If the operation fails.ObjectAlreadyExistsException - If this object already exists on
the resource.java.lang.UnsupportedOperationException - If the CREATE feature is not
supported.
The Items in the list can all be assumed to use the operation
Item.Operation.Set though the connector should tolerate
Item.Operation.Add. It is easiest if the connector just ignores
the operation and assumes it is Set.public Result update(java.lang.String id, java.util.List<Item> items) throws ConnectorException, ObjectNotFoundException, java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException
id - The native identity of object to updateitems - A list of items to updateConnectorException - If the operation fails.ObjectNotFoundException - If the object to update cannot be found.java.lang.UnsupportedOperationException - If the UPDATE feature is not
supported or the options map contains operations that are not
supported.java.lang.IllegalArgumentExceptionpublic Result delete(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> options) throws ConnectorException, ObjectNotFoundException, java.lang.UnsupportedOperationException
If there are additional Items present as part of the Request they will be merged into the options map by name of the item. The value stored for each name (key) is the value found on the Item.
id - The value for the identity attribute.options - Options that may influence the deletion.ConnectorException - If the operation fails.java.lang.UnsupportedOperationException - If the DELETE feature is not
supported.ObjectNotFoundExceptionpublic Result enable(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> options) throws ConnectorException, ObjectNotFoundException, java.lang.UnsupportedOperationException
If there are additional Items present as part of the Request they will be merged into the options map by name of the item. The value stored for each name (key) is the value found on the Item.
id - The value for the identity attribute.options - Options that may influence the enable.ConnectorException - If the operation fails.ObjectNotFoundException - If the object to enable cannot be found.java.lang.UnsupportedOperationException - If the ENABLE feature is not
supported.public Result disable(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> options) throws ConnectorException, ObjectNotFoundException, java.lang.UnsupportedOperationException
If there are additional Items present as part of the Request they will be merged into the options map by name of the item. The value stored for each name (key) is the value found on the Item.
id - The value for the identity attribute.options - Options that may influence the disable.ConnectorException - If the operation fails.ObjectNotFoundException - If the object to disable cannot be found.java.lang.UnsupportedOperationException - If the DISABLE feature is not
supported.public Result unlock(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> options) throws ConnectorException, ObjectNotFoundException, java.lang.UnsupportedOperationException
If there are additional Items present as part of the Request they will be merged into the options map by name of the item. The value stored for each name (key) is the value found on the Item.
id - The value for the identity attribute.options - Options that may influence the unlock.ConnectorException - If the operation fails.ObjectNotFoundException - If the object to unlock cannot be found.java.lang.UnsupportedOperationException - If the UNLOCK feature is not
supported.public Result setPassword(java.lang.String id, java.lang.String newPassword, java.lang.String currentPassword, java.util.Date expiration, java.util.Map<java.lang.String,java.lang.Object> options) throws ConnectorException, ObjectNotFoundException, java.lang.UnsupportedOperationException
If there are additional Items present as part of the Request they will be merged into the options map by name of the item. The value stored for each name (key) is the value found on the Item.
id - The value for the identity attribute.newPassword - The password to set for the account.currentPassword - The current password of the account. This
should be provided if available, but is not
always required.expiration - The expiration date for the password.options - An optional map of options that can provide
additional information about the password
change.ConnectorException - If the operation fails.ObjectNotFoundException - If the object to set the password on
cannot be found.java.lang.UnsupportedOperationException - If the SET_PASSWORD feature is not
supported.public Result checkStatus(java.lang.String id) throws ConnectorException, java.lang.UnsupportedOperationException
See Connector.checkStatus(String) for further details
checkStatus in interface Connectorid - The value that was returned as a resultToken in
the result by the provision method.java.lang.UnsupportedOperationException - If the check status is not
implemented by a subclass.ConnectorExceptionpublic java.util.Map<java.lang.String,java.lang.Object> getConfigOptions(java.lang.String configOptionsKey)
throws ConnectorException,
java.lang.UnsupportedOperationException
See Connector.getConfigOptions(String) for further details
getConfigOptions in interface ConnectorconfigOptionsKey - java.lang.UnsupportedOperationException - If the check status is not
implemented by a subclass.ConnectorExceptionObjectNotFoundExceptionpublic java.util.List<Partition> getIteratorPartitions(int suggestedPartitionCount, Filter filter, java.util.Map<java.lang.String,java.lang.Object> ops) throws ConnectorException
getIteratorPartitions in interface ConnectorsuggestedPartitionCount - The caller will calculate the optimal
number of partitions and pass it into the connector.filter - The possibly null filter to help constrain
which options are returned.ops - The possibly null map will provides additional options
for future expansion.ConnectorExceptionPartitionpublic java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> iterate(Partition partition) throws ConnectorException, java.lang.UnsupportedOperationException
iterate in interface Connectorpartition - One of the objects built in getIteratorPartitions that
will drive which objects get returned by the iterator.ConnectorExceptionjava.lang.UnsupportedOperationExceptionPartitionpublic void registerListener(ConnectorStateChangeListener listener)
registerListener in interface Connectorlistener - The listener that is interested in listening
to connector config changespublic void notifyListeners()
notifyListeners in interface Connectorpublic boolean supportsPartitionedDeltaAggregation()
supportsPartitionedDeltaAggregation in interface Connectorpublic void destroy(java.util.Map<java.lang.String,java.lang.Object> optionsMap)
throws ConnectorException
destroy in interface ConnectoroptionsMap - Map of options sent by connectorConnectorExceptionpublic void setStatisticsCollector(StatisticsCollector statisticsCollector)
setStatisticsCollector in interface Connectorpublic java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> getUtilizationExtract(java.util.Map<java.lang.String,java.lang.Object> requestParams)
throws ConnectorException,
java.lang.UnsupportedOperationException
getUtilizationExtract in interface ConnectorrequestParams - params which will contain information to fetch data from ERP
systems.sailpoint.connector.ConnectorException - instance of ConnectorException in case of failurejava.lang.UnsupportedOperationException - instance of UnsupportedOperationException in case method is
not implemented by connectors.ConnectorException - instance of ConnectorException in case of failurepublic java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> getSecurityExtract(java.util.Map<java.lang.String,java.lang.Object> requestParams)
throws ConnectorException,
java.lang.UnsupportedOperationException
getSecurityExtract in interface ConnectorrequestParams - params which will contain information to fetch data from ERP
systems.sailpoint.connector.ConnectorException - instance of ConnectorException in case of failurejava.lang.UnsupportedOperationException - instance of UnsupportedOperationException in case method is
not implemented by connectors.ConnectorExceptionpublic java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> getChangeLogExtract(java.util.Map<java.lang.String,java.lang.Object> requestParams)
throws ConnectorException,
java.lang.UnsupportedOperationException
getChangeLogExtract in interface ConnectorrequestParams - params which will contain information to fetch data from ERP
systems.sailpoint.connector.ConnectorException - instance of ConnectorException in case of failurejava.lang.UnsupportedOperationException - instance of UnsupportedOperationException in case method is
not implemented by connectors.ConnectorExceptionpublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getExtractPartitions(java.util.Map<java.lang.String,java.lang.Object> requestParams,
java.lang.String extractType)
throws ConnectorException,
java.lang.UnsupportedOperationException,
InsufficientPermissionException
getExtractPartitions in interface ConnectorrequestParams - has required details to fetch extract Partition dataextractType - this contains extract typeConnectorException - instance of ConnectorException in case of failurejava.lang.UnsupportedOperationException - instance of UnsupportedOperationException in case method is
not implemented by connectors.InsufficientPermissionException - instance of ConnectorException in case of insufficient
permissions