Skip navigation links


org.identityconnectors.framework.common.objects
Class SchemaBuilder

java.lang.Object
  extended by org.identityconnectors.framework.common.objects.SchemaBuilder


public final class SchemaBuilder
extends java.lang.Object

Simple builder class to help facilitate creating a Schema object.

Since:
1.0
Version:
$Revision $
Author:
Will Droste

Constructor Summary
SchemaBuilder(java.lang.Class<? extends Connector> connectorClass)
          Creates a SchemaBuilder for the given connector class

 

Method Summary
 void addSupportedObjectClass(java.lang.Class<? extends SPIOperation> op, ObjectClassInfo def)
          Adds the given ObjectClassInfo as a supported ObjectClass for the given operation.
 void addSupportedOperationOption(java.lang.Class<? extends SPIOperation> op, OperationOptionInfo def)
          Adds the given OperationOptionInfo as a supported option for the given operation.
 Schema build()
          Builds the Schema object based on the ObjectClassInfos added so far.
 void clearSupportedObjectClassesByOperation()
          Clears the operation-specific supported classes.
 void clearSupportedOptionsByOperation()
          Clears the operation-specific supported options.
 void defineObjectClass(ObjectClassInfo info)
          Adds another ObjectClassInfo to the schema.
 void defineObjectClass(java.lang.String type, java.util.Set<AttributeInfo> attrInfo)
          Adds another ObjectClassInfo to the schema.
 void defineOperationOption(OperationOptionInfo info)
          Adds another OperationOptionInfo to the schema.
 void defineOperationOption(java.lang.String optionName, java.lang.Class<?> type)
          Adds another OperationOptionInfo to the schema.
 void removeSupportedObjectClass(java.lang.Class<? extends SPIOperation> op, ObjectClassInfo def)
          Removes the given ObjectClassInfo as a supported ObjectClass for the given operation.
 void removeSupportedOperationOption(java.lang.Class<? extends SPIOperation> op, OperationOptionInfo def)
          Removes the given OperationOptionInfo as a supported option for the given operation.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

SchemaBuilder

public SchemaBuilder(java.lang.Class<? extends Connector> connectorClass)
Creates a SchemaBuilder for the given connector class
Parameters:
connectorClass - The connector for which we are building the schema.

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:
java.lang.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.

defineObjectClass

public void defineObjectClass(java.lang.String type,
                              java.util.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:
java.lang.IllegalStateException - If already defined

defineOperationOption

public void defineOperationOption(java.lang.String optionName,
                                  java.lang.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:
java.lang.IllegalStateException - If already defined

addSupportedObjectClass

public void addSupportedObjectClass(java.lang.Class<? extends SPIOperation> op,
                                    ObjectClassInfo def)
Adds the given ObjectClassInfo as a supported ObjectClass for the given operation.
Parameters:
op - The SPI operation
def - The ObjectClassInfo
Throws:
java.lang.IllegalArgumentException - If the given ObjectClassInfo was not already defined using defineObjectClass(ObjectClassInfo).

removeSupportedObjectClass

public void removeSupportedObjectClass(java.lang.Class<? extends SPIOperation> op,
                                       ObjectClassInfo def)
Removes the given ObjectClassInfo as a supported ObjectClass for the given operation.
Parameters:
op - The SPI operation
def - The ObjectClassInfo
Throws:
java.lang.IllegalArgumentException - If the given ObjectClassInfo was not already defined using defineObjectClass(ObjectClassInfo).

addSupportedOperationOption

public void addSupportedOperationOption(java.lang.Class<? extends SPIOperation> op,
                                        OperationOptionInfo def)
Adds the given OperationOptionInfo as a supported option for the given operation.
Parameters:
op - The SPI operation
def - The OperationOptionInfo
Throws:
java.lang.IllegalArgumentException - If the given OperationOptionInfo was not already defined using defineOperationOption(OperationOptionInfo).

removeSupportedOperationOption

public void removeSupportedOperationOption(java.lang.Class<? extends SPIOperation> op,
                                           OperationOptionInfo def)
Removes the given OperationOptionInfo as a supported option for the given operation.
Parameters:
op - The SPI operation
def - The OperationOptionInfo
Throws:
java.lang.IllegalArgumentException - If the given OperationOptionInfo was not already defined using defineOperationOption(OperationOptionInfo).

clearSupportedObjectClassesByOperation

public void clearSupportedObjectClassesByOperation()
Clears the operation-specific supported classes. Normally, when you add an ObjectClass, using defineObjectClass(ObjectClassInfo), it is added to all operations. You may then remove those that you need using removeSupportedObjectClass(Class, ObjectClassInfo). You may wish, as an alternative to clear everything out and instead add using addSupportedObjectClass(Class, ObjectClassInfo).

clearSupportedOptionsByOperation

public void clearSupportedOptionsByOperation()
Clears the operation-specific supported options. Normally, when you add an OperationOptionInfo using defineOperationOption(OperationOptionInfo), this adds the option to all operations. You may then remove the option from any operation that does not support the option using removeSupportedOperationOption(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 using addSupportedOperationOption(Class, OperationOptionInfo).

build

public Schema build()
Builds the Schema object based on the ObjectClassInfos added so far.
Returns:
new Schema object based on the info provided.

Skip navigation links


Copyright © 2011, Oracle and/or its affiliates. All rights reserved.