Installing Multiple Connectors on a .NET Connector Server

17-2 Oracle Fusion Middleware Developers Guide for Oracle Identity Manager To develop a flat file connector: 1. Implement the configuration class for the Flat File Connector by extending the org.identityconnectors.framework.spi.AbstractConfiguration base class. Example 17–1 is a sample of this. See Section 16.3.1.2, org.identityconnectors.framework.spi.Configuration for more information. Example 17–1 Implementation of AbstractConfiguration package org.identityconnectors.flatfile; import java.io.File; import org.identityconnectors.flatfile.io.FlatFileIOFactory; import org.identityconnectors.framework.common.exceptions.ConfigurationException; import org.identityconnectors.framework.spi.AbstractConfiguration; import org.identityconnectors.framework.spi.ConfigurationProperty; Class for storing the flat file configuration public class FlatFileConfiguration extends AbstractConfiguration { Storage file name private File storeFile; Delimeter used private String textFieldDelimeter; Unique attribute field name private String uniqueAttributeName = ; Change attribute field name. Should be numeric private String changeLogAttributeName = ; public File getStoreFile { return storeFile; } public String getTextFieldDelimeter { return textFieldDelimeter; } public String getUniqueAttributeName { return uniqueAttributeName; } public String getChangeLogAttributeName { return changeLogAttributeName; } Set the store file param storeFile ConfigurationPropertyorder = 1, helpMessageKey = USER_ACCOUNT_STORE_HELP, displayMessageKey = USER_ACCOUNT_STORE_DISPLAY public void setStoreFileFile storeFile { this.storeFile = storeFile; Developing Identity Connectors 17-3 } Set the text field delimeter param textFieldDelimeter ConfigurationPropertyorder = 2, helpMessageKey = USER_STORE_TEXT_DELIM_HELP, displayMessageKey = USER_STORE_TEXT_DELIM_DISPLAY public void setTextFieldDelimeterString textFieldDelimeter { this.textFieldDelimeter = textFieldDelimeter; } Set the field whose values will be considered as unique attributes param uniqueAttributeName ConfigurationPropertyorder = 3, helpMessageKey = UNIQUE_ATTR_HELP, displayMessageKey = UNIQUE_ATTR_DISPLAY public void setUniqueAttributeNameString uniqueAttributeName { this.uniqueAttributeName = uniqueAttributeName; } Set the field name where change number should be stored param changeLogAttributeName ConfigurationPropertyorder = 3, helpMessageKey = CHANGELOG_ATTR_HELP, displayMessageKey = CHANGELOG_ATTR_DISPLAY public void setChangeLogAttributeNameString changeLogAttributeName { this.changeLogAttributeName = changeLogAttributeName; } Override public void validate { Validate if file exists and is usable boolean validFile = this.storeFile.exists this.storeFile.canRead this.storeFile.canWrite this.storeFile.isFile; if validFile throw new ConfigurationExceptionUser store file not valid; Validate if there is a field on name of unique attribute field name Validate if there is a field on name of change attribute field name FlatFileIOFactory.getInstancethis; Initialization does the validation } } 2. Create connector class for the Flat File Connector by implementing the org.identityconnectors.framework.spi.Connector interface. Example 17–2 implements the CreateOp, DeleteOp, SearchOp and UpdateOp interfaces and thus supports all four operations. The FlatFileMetadata, FlatFileParser and FlatFileWriter classes are supporting classes. Their implementation is not shown as they do not belong to the ICF. 17-4 Oracle Fusion Middleware Developers Guide for Oracle Identity Manager Example 17–2 Implementation of PoolableConnector package org.identityconnectors.flatfile; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import org.identityconnectors.flatfile.io.FlatFileIOFactory; import org.identityconnectors.flatfile.io.FlatFileMetadata; import org.identityconnectors.flatfile.io.FlatFileParser; import org.identityconnectors.flatfile.io.FlatFileWriter; import org.identityconnectors.framework.api.operations.GetApiOp; import org.identityconnectors.framework.common.exceptions.AlreadyExistsException; import org.identityconnectors.framework.common.exceptions.ConnectorException; import org.identityconnectors.framework.common.objects.Attribute; import org.identityconnectors.framework.common.objects.AttributeInfo; import org.identityconnectors.framework.common.objects.AttributeInfoBuilder; import org.identityconnectors.framework.common.objects.ConnectorObject; import org.identityconnectors.framework.common.objects.ConnectorObjectBuilder; import org.identityconnectors.framework.common.objects.ObjectClass; import org.identityconnectors.framework.common.objects.OperationOptions; import org.identityconnectors.framework.common.objects.ResultsHandler; import org.identityconnectors.framework.common.objects.Schema; import org.identityconnectors.framework.common.objects.SchemaBuilder; import org.identityconnectors.framework.common.objects.Uid; import org.identityconnectors.framework.common.objects.filter.AbstractFilterTranslator; import org.identityconnectors.framework.common.objects.filter.FilterTranslator; import org.identityconnectors.framework.spi.Configuration; import org.identityconnectors.framework.spi.ConnectorClass; import org.identityconnectors.framework.spi.PoolableConnector; import org.identityconnectors.framework.spi.operations.CreateOp; import org.identityconnectors.framework.spi.operations.DeleteOp; import org.identityconnectors.framework.spi.operations.SchemaOp; import org.identityconnectors.framework.spi.operations.SearchOp; import org.identityconnectors.framework.spi.operations.UpdateOp; The main connector class ConnectorClassconfigurationClass = FlatFileConfiguration.class, displayNameKey = FlatFile public class FlatFileConnector implements SchemaOp, CreateOp, DeleteOp, UpdateOp, SearchOpMapString, String, GetApiOp, PoolableConnector { private FlatFileConfiguration flatFileConfig; private FlatFileMetadata flatFileMetadata; private FlatFileParser flatFileParser; private FlatFileWriter flatFileWriter; private boolean alive = false; Override public Configuration getConfiguration { return this.flatFileConfig; } Override public void initConfiguration config {