Class SchemaBuilder
- java.lang.Object
-
- org.identityconnectors.framework.common.objects.SchemaBuilder
-
-
Constructor Summary
Constructors Constructor Description SchemaBuilder(Class<? extends Connector> connectorClass)
Creates a SchemaBuilder for the given connector class
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSupportedObjectClass(Class<? extends SPIOperation> op, ObjectClassInfo def)
Adds the given ObjectClassInfo as a supported ObjectClass for the given operation.void
addSupportedOperationOption(Class<? extends SPIOperation> op, OperationOptionInfo def)
Adds the given OperationOptionInfo as a supported option for the given operation.Schema
build()
Builds theSchema
object based on theObjectClassInfo
s added so far.void
clearSupportedObjectClassesByOperation()
Clears the operation-specific supported classes.void
clearSupportedOptionsByOperation()
Clears the operation-specific supported options.void
defineObjectClass(String type, Set<AttributeInfo> attrInfo)
Adds another ObjectClassInfo to the schema.void
defineObjectClass(ObjectClassInfo info)
Adds another ObjectClassInfo to the schema.void
defineObjectClass(ObjectClassInfo objectClassInfo, Class<? extends SPIOperation>... operations)
Adds another ObjectClassInfo to the schema.void
defineOperationOption(String optionName, Class<?> type)
Adds another OperationOptionInfo to the schema.void
defineOperationOption(OperationOptionInfo info)
Adds another OperationOptionInfo to the schema.void
defineOperationOption(OperationOptionInfo operationOptionInfo, Class<? extends SPIOperation>... operations)
Adds another OperationOptionInfo to the schema.void
removeSupportedObjectClass(Class<? extends SPIOperation> op, ObjectClassInfo def)
Removes the given ObjectClassInfo as a supported ObjectClass for the given operation.void
removeSupportedOperationOption(Class<? extends SPIOperation> op, OperationOptionInfo def)
Removes the given OperationOptionInfo as a supported option for the given operation.
-
-
-
Method Detail
-
defineObjectClass
public void defineObjectClass(ObjectClassInfo info)
Adds another ObjectClassInfo to the schema. Also, adds this to the set of supported classes for every operation defined by the Connector.- Parameters:
info
-- Throws:
IllegalStateException
- If already defined
-
defineObjectClass
@SafeVarargs public final void defineObjectClass(ObjectClassInfo objectClassInfo, Class<? extends SPIOperation>... operations)
Adds another ObjectClassInfo to the schema. Also, adds this to the set of supported classes for every operation defined by the Connector.- Parameters:
objectClassInfo
-operations
- The SPI operation which use supports thisobjectClassInfo
- Throws:
IllegalStateException
- If already defined
-
defineOperationOption
public void defineOperationOption(OperationOptionInfo info)
Adds another OperationOptionInfo to the schema. Also, adds this to the set of supported options for every operation defined by the Connector.
-
defineOperationOption
@SafeVarargs public final void defineOperationOption(OperationOptionInfo operationOptionInfo, Class<? extends SPIOperation>... operations)
Adds another OperationOptionInfo to the schema. Also, adds this to the set of supported options for operation defined.- Parameters:
operationOptionInfo
-operations
-- Throws:
IllegalStateException
- If already defined
-
defineObjectClass
public void defineObjectClass(String type, Set<AttributeInfo> attrInfo)
Adds another ObjectClassInfo to the schema. Also, adds this to the set of supported classes for every operation defined by the Connector.- Throws:
IllegalStateException
- If already defined
-
defineOperationOption
public void defineOperationOption(String optionName, Class<?> type)
Adds another OperationOptionInfo to the schema. Also, adds this to the set of supported options for every operation defined by the Connector.- Throws:
IllegalStateException
- If already defined
-
addSupportedObjectClass
public void addSupportedObjectClass(Class<? extends SPIOperation> op, ObjectClassInfo def)
Adds the given ObjectClassInfo as a supported ObjectClass for the given operation.- Parameters:
op
- The SPI operationdef
- The ObjectClassInfo- Throws:
IllegalArgumentException
- If the given ObjectClassInfo was not already defined usingdefineObjectClass(ObjectClassInfo)
.
-
removeSupportedObjectClass
public void removeSupportedObjectClass(Class<? extends SPIOperation> op, ObjectClassInfo def)
Removes the given ObjectClassInfo as a supported ObjectClass for the given operation.- Parameters:
op
- The SPI operationdef
- The ObjectClassInfo- Throws:
IllegalArgumentException
- If the given ObjectClassInfo was not already defined usingdefineObjectClass(ObjectClassInfo)
.
-
addSupportedOperationOption
public void addSupportedOperationOption(Class<? extends SPIOperation> op, OperationOptionInfo def)
Adds the given OperationOptionInfo as a supported option for the given operation.- Parameters:
op
- the SPI operationdef
- The OperationOptionInfo- Throws:
IllegalArgumentException
- If the given OperationOptionInfo was not already defined usingdefineOperationOption(OperationOptionInfo)
.
-
removeSupportedOperationOption
public void removeSupportedOperationOption(Class<? extends SPIOperation> op, OperationOptionInfo def)
Removes the given OperationOptionInfo as a supported option for the given operation.- Parameters:
op
- The SPI operationdef
- The OperationOptionInfo- Throws:
IllegalArgumentException
- If the given OperationOptionInfo was not already defined usingdefineOperationOption(OperationOptionInfo)
.
-
clearSupportedObjectClassesByOperation
public void clearSupportedObjectClassesByOperation()
Clears the operation-specific supported classes. Normally, when you add an ObjectClass, usingdefineObjectClass(ObjectClassInfo)
, it is added to all operations. You may then remove those that you need usingremoveSupportedObjectClass(Class, ObjectClassInfo)
. You may wish, as an alternative to clear everything out and instead add usingaddSupportedObjectClass(Class, ObjectClassInfo)
.
-
clearSupportedOptionsByOperation
public void clearSupportedOptionsByOperation()
Clears the operation-specific supported options. Normally, when you add an OperationOptionInfo usingdefineOperationOption(OperationOptionInfo)
, this adds the option to all operations. You may then remove the option from any operation that does not support the option usingremoveSupportedOperationOption(Class, OperationOptionInfo)
. An alternative approach is to clear everything out (using this method) and then add each option to every operation that supports the option usingaddSupportedOperationOption(Class, OperationOptionInfo)
.
-
build
public Schema build()
Builds theSchema
object based on theObjectClassInfo
s added so far.- Returns:
- new Schema object based on the info provided.
-
-