public interface Connector
getSupportedObjectTypes()getSupportedFeatures(String)configure(ConnectorConfig, Log)setObjectType(String)close()testConnection()discoverSchema(String)authenticate(String, String)read(String)iterate(Filter)provision(Plan)
A Connector MUST implement all "Connector Capabilities" method, "Connector
Lifecycle" methods, and the testConnection(). All other methods are
optional. If supported, a method should be declared as supported by
returning the appropriate Feature from
getSupportedFeatures(String). Otherwise, the method should
throw and UnsupportedOperationException. Rather than
implementing the Connector interface directly, it is
recommended that the AbstractConnector be extended.
As mentioned previously, Connectors are stateful, in that they must be configured, used, and closed. The connector keeps state about how it was configured, dynamic settings such as object type, and any internal connection state to the underlying resource. Every caller must take care to close the Connector to release any resources. Here is a typical pattern for using a Connector:
Connector conn = new MyConnector();
try {
conn.configure(config, log);
Map<String,Object> account = conn.read("myaccountid");
}
finally {
conn.close();
}
A Connector declares what types of objects it can manage through
getSupportedObjectTypes. These are typically either accounts or
groups (see the OBJECT_TYPE_* constants), but a connector can claim support
for other non-standard types (for example - roles, etc...). The default object type
for a new connector is OBJECT_TYPE_ACCOUNT. You can change the object type
by calling setObjectType Once set, the object type influences
the behavior of the read and iterate methods.
Resource objects (accounts, groups, etc.) are modeled as Maps with
the map keys representing the object attribute names. Map values will
usually be String or List<String> but they
can be of any type defined by Schema.Type. When you
build a Plan, the values in the plan should match what is expected
by the connector. Though it is recommended that connectors do type
coercion this is not required.
Each connector will require different configuration information that dictates how to connect to the resource and specifics about connector behavior. This information is defined in the ConnectorConfig. The configuration should include a list of Schema objects defining the attributes of each of the objects that are managed by the connector. Schemas are optional for simple connectors in which the object schemas are fixed.
The connector methods will either throw an UnsupportedOperationException, a checked exception that indicates an expected error condition (such as ObjectNotFoundException), or a generic unchecked exception that indicates some other type of resource failure (ConnectorException).
| Modifier and Type | Interface and Description |
|---|---|
static class |
Connector.Feature
An enumeration of features that a Connector can choose to support.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ARG_CURRENT
An argument that can be passed in the Item for ATT_PASSWORD
that contains what is believed to be the current password.
|
static java.lang.String |
ARG_EXPIRATION
An argument that can be passed in the Item for the ATT_PASSWORD
attribute to indicate that the password should expire.
|
static java.lang.String |
ARG_PARTITION |
static java.lang.String |
ATT_DELETED
A reserved attribute name used to indiciate that this
object has been deleted.
|
static java.lang.String |
ATT_DISABLED
A reserved attribute name used to convey disabled status.
|
static java.lang.String |
ATT_LOCKED
A reserved attribute name used to convey lock status.
|
static java.lang.String |
ATT_PASSWORD
A reserved attribute name used to convey an account password.
|
static java.lang.String |
ATT_PERMISSIONS
A reserved attribute name used to pass a List of Permission objects.
|
static java.lang.String |
OBJECT_TYPE_ACCOUNT
Object type representing an account on a resource.
|
static java.lang.String |
OBJECT_TYPE_GROUP
Object type representing an group on a resource.
|
static java.lang.String |
OBJECT_TYPE_TICKET
Object type representing an group on a resource.
|
| 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)
Attempt to authenticate to the underlying resource using the given
accountId and password.
|
java.util.Map<java.lang.String,java.lang.Object> |
authenticate(java.lang.String identity,
java.lang.String password)
Attempt to authenticate to the underlying resource using the given
identity and password.
|
Result |
checkStatus(java.lang.String id)
Using the id passed into this method check the
request to see if has completed.
|
void |
close()
Close the underlying resources that are being held by this connector.
|
void |
configure(ConnectorConfig config,
Log log)
Configure the connector with connection parameters and optional
schemas.
|
void |
destroy(java.util.Map<java.lang.String,java.lang.Object> optionsMap)
Called by aggregator at the end of aggregation
|
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 API.Test the connection to the application ,Returns nothing on success and
throws an exception (as detailed as possible) when there is a problem
|
java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> |
getChangeLogExtract(java.util.Map<java.lang.String,java.lang.Object> requestParams)
This method will be called to fetch Change log extract from ERP Systems.
|
ConnectorConfig |
getConfig() |
java.util.Map<java.lang.String,java.lang.Object> |
getConfigOptions(java.lang.String configOptionsKey) |
ConnectorServices |
getConnectorServices() |
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 if user has no required permissions to fetch Security extract
from underlying tables it will throw InsufficientPermissionException
|
java.util.List<Partition> |
getIteratorPartitions(int suggestedPartitionCount,
Filter filter,
java.util.Map<java.lang.String,java.lang.Object> ops)
Return the list of partitions for a connector.
|
Log |
getLog() |
java.lang.String |
getObjectType() |
java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> |
getSecurityExtract(java.util.Map<java.lang.String,java.lang.Object> requestParams)
This method will be called to fetch Security extract from ERP Systems.
|
java.util.List<Connector.Feature> |
getSupportedFeatures(java.lang.String objectType)
Return the list of Features that are supported for the given object type.
|
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)
This method will be called to fetch Utilization extract from ERP Systems
requestParams has required details to fetch Utilization extract data.
|
java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> |
iterate(Filter filter)
Return an iterator over the objects of the configured object type that
match the given filter (or all objects if no filter is specified).
|
java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> |
iterate(Partition parition)
Method used to iterate over the object in chunks that can
be processed in different threads or machine pools.
|
void |
notifyListeners()
Notify listeners on application config changes
|
void |
provision(Plan plan)
Evaluate a provisioning plan that specifies operations to be performed
on one or more objects.
|
java.util.Map<java.lang.String,java.lang.Object> |
read(java.lang.String id)
Return the object of the configured object type that has the given
native identifier.
|
void |
registerListener(ConnectorStateChangeListener listener)
Register listener to listen to openconnector app config changes
|
void |
saveConnectorState()
Save new connector state values into the app config
|
void |
setConnectorServices(ConnectorServices connServices)
Sets the ConnectorServices object.
|
void |
setConnectorState(java.lang.String attribute,
java.lang.Object val)
Interface to set new connector config value
|
void |
setObjectType(java.lang.String objectType)
Change the target object type for connector methods.
|
void |
setStatisticsCollector(StatisticsCollector statisticsCollector)
Set the StatisticsCollector object require for underlying connector to
push the aggreagtion statistics.
|
boolean |
supportsPartitionedDeltaAggregation()
Gets if the connector supports partitioned delta aggregation
|
void |
testConnection()
Test the configured to see if a connection can be made.
|
static final java.lang.String OBJECT_TYPE_ACCOUNT
static final java.lang.String OBJECT_TYPE_GROUP
static final java.lang.String OBJECT_TYPE_TICKET
static final java.lang.String ATT_PASSWORD
static final java.lang.String ATT_DISABLED
static final java.lang.String ATT_LOCKED
Connectors are also expected to return this in the Map returned by the read() method to convey the current status.
static final java.lang.String ATT_PERMISSIONS
static final java.lang.String ATT_DELETED
Note that ResourceObject has a few other flags for special situations like incomplete, incremental, remove, and missing. These were only used by SMConnector and are not expected to be applicable for OpenConnectors.
static final java.lang.String ARG_EXPIRATION
static final java.lang.String ARG_CURRENT
In theory this could be used for other attributes besides passwords.
static final java.lang.String ARG_PARTITION
java.util.List<java.lang.String> getSupportedObjectTypes()
java.util.List<Connector.Feature> getSupportedFeatures(java.lang.String objectType)
void configure(ConnectorConfig config, Log log) throws java.lang.IllegalArgumentException
config - The ConnectorConfig that specifies connection
parameters and schemas.log - An implementation of Log that the connector can
use for logging.java.lang.IllegalArgumentException - If config is null.ConnectorConfig getConfig()
void registerListener(ConnectorStateChangeListener listener)
listener - The listener that is interested in listening
to connector config changesvoid notifyListeners()
void setConnectorState(java.lang.String attribute,
java.lang.Object val)
attribute - The attribute that needs to be set a new valueval - The value to set against the attributevoid saveConnectorState()
void setObjectType(java.lang.String objectType)
throws java.lang.IllegalArgumentException
objectType - The target object type for future method calls.
This can be one of the OBJECT_TYPE_* constants or
any supported object type.java.lang.IllegalArgumentException - If type is null.java.lang.String getObjectType()
Log getLog()
void setConnectorServices(ConnectorServices connServices)
ConnectorServices getConnectorServices()
void close()
void testConnection()
throws ConnectorException
ConnectorExceptionSchema discoverSchema() throws ConnectorException, java.lang.UnsupportedOperationException
ConnectorException - If the operation fails.java.lang.UnsupportedOperationException - If the DISCOVER_SCHEMA feature is
not supported.java.util.Map<java.lang.String,java.lang.Object> read(java.lang.String id)
throws ConnectorException,
ObjectNotFoundException,
java.lang.UnsupportedOperationException
id - A unique identifier for the object.ConnectorException - If the operation fails.java.lang.UnsupportedOperationException - If the GET feature is not
supported.ObjectNotFoundExceptionjava.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> iterate(Filter filter) throws ConnectorException, java.lang.UnsupportedOperationException
filter - The possibly null filter to use to constrain which
objects are returned.ConnectorException - If the operation fails.java.lang.UnsupportedOperationException - If the ITERATE feature is not
supported.java.util.List<Partition> getIteratorPartitions(int suggestedPartitionCount, Filter filter, java.util.Map<java.lang.String,java.lang.Object> ops) throws ConnectorException, java.lang.UnsupportedOperationException
The partitions returned here simple objects that hold a name, size, objectType and an attributes map for additional information.
The caller will take each partition and treat it as a single unit of work that will be distributed among the cluster of servers and or threads.
Each object in the list should contain enough about the partition so the calls to iterateObjects have information to process a single partition.
A unique name (within the list) and the objectType is required to be returned with each partition.
The caller will give hints to the suggestedPartitionCount based on processors and cores but the Application config should ultimately determine how many partitions should be returned.
suggestedPartitionCount - 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.ConnectorExceptionjava.lang.UnsupportedOperationExceptionPartitionjava.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> iterate(Partition parition) throws ConnectorException, java.lang.UnsupportedOperationException
parition - One of the objects built in getIteratorPartitions that
will drive which objects get returned by the iterator.ConnectorExceptionjava.lang.UnsupportedOperationExceptionPartitionjava.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
identity - 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.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
accountId - 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.void provision(Plan plan) throws ConnectorException, java.lang.UnsupportedOperationException
plan - 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.Result checkStatus(java.lang.String id) throws ConnectorException, ObjectNotFoundException, java.lang.UnsupportedOperationException
This method will be called one time for each ProvisioningResult returned in the ProvisioningPlan during provisioning. The provision method can store results at either the plan, account request or the attribute request level.
The new status, returned result's errors, and warnings will be merged back into the main project.
Returning a null result will have no change on the request and it will remained queued.
id - ConnectorExceptionObjectNotFoundExceptionjava.lang.UnsupportedOperationExceptionjava.util.Map<java.lang.String,java.lang.Object> getConfigOptions(java.lang.String configOptionsKey)
throws ConnectorException,
ObjectNotFoundException,
java.lang.UnsupportedOperationException
configOptionsKey - ConnectorExceptionObjectNotFoundExceptionjava.lang.UnsupportedOperationExceptionboolean supportsPartitionedDeltaAggregation()
void destroy(java.util.Map<java.lang.String,java.lang.Object> optionsMap)
throws ConnectorException
optionsMap - Map of options sent by aggregatorConnectorExceptionjava.util.Map doHealthCheck(java.util.Map<java.lang.String,java.lang.Object> options)
throws ConnectorException,
java.lang.UnsupportedOperationException
options - : kept null as of now as testConnection() is void Returning , can be used for future extensionConnectorExceptionjava.lang.UnsupportedOperationExceptionvoid setStatisticsCollector(StatisticsCollector statisticsCollector)
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
requestParams - params which will contain information to fetch data from ERP
systems.ConnectorException - instance of ConnectorException in case of failurejava.lang.UnsupportedOperationException - instance of UnsupportedOperationException in case method is
not implemented by connectors.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
requestParams - 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.ConnectorExceptionjava.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
requestParams - 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.ConnectorExceptionjava.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
requestParams - 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