com.ibm.di.util
Class SchemaUtils

java.lang.Object
  extended by com.ibm.di.util.SchemaUtils

public class SchemaUtils
extends Object

Provides methods for working with the Connector/FC schema.

Note: This class is for internal usage only. Any dependency from the end-user will not be supported. Changes to this class will happen without a warning.

Since:
7.1

Constructor Summary
SchemaUtils()
           
 
Method Summary
static void addChildSchemaItem(Attribute attr, SchemaItemConfig sic)
          Creates a child schema item in the the schema item config for each Attribute value found in the attribute.
static SchemaItemConfig addSchemaItem(SchemaConfig config, String name, String syntax, Object attr)
          Creates a schema item in the the schema config.
static void convertEntryToSchema(Entry entry, ConnectorConfig cc, boolean input)
          Creates a schema item for each attribute in the entry.
static void convertEntryToSchemaHier(Entry entry, ConnectorConfig cc, boolean input)
          Creates a schema item for each attribute in the entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaUtils

public SchemaUtils()
Method Detail

convertEntryToSchema

public static void convertEntryToSchema(Entry entry,
                                        ConnectorConfig cc,
                                        boolean input)
                                 throws IgnorableException
Creates a schema item for each attribute in the entry. If the entry is domEnabled we call convertEntryToSchemaHier to generate a hierarchical schema representation.

Parameters:
entry - The Entry to use for creating Schema Items.
cc - The ConnectorConfig where the SchemaItem will be added
input - If true, add to Input Schema, else Output Schema.
Throws:
IgnorableException - if any of the specified schema item names has incorrect syntax this exception is thrown. It will contain the stack traces of all occurred problems (if several items had incorrect names).

convertEntryToSchemaHier

public static void convertEntryToSchemaHier(Entry entry,
                                            ConnectorConfig cc,
                                            boolean input)
                                     throws IgnorableException
Creates a schema item for each attribute in the entry. If an attribute has child nodes (e.g. Attribute in its values) they are appended to the schema item as a child node.

Parameters:
entry - The Entry to use for creating Schema Items.
cc - The ConnectorConfig where the SchemaItem will be added
input - If true, add to Input Schema, else Output Schema.
Throws:
IgnorableException - if any of the specified schema item names has incorrect syntax this exception is thrown. It will contain the stack traces of all occurred problems (if several items had incorrect names).

addChildSchemaItem

public static void addChildSchemaItem(Attribute attr,
                                      SchemaItemConfig sic)
Creates a child schema item in the the schema item config for each Attribute value found in the attribute. This method calls itself for each Attribute value found to build the hierarchical tree of schema items.

Parameters:
attr - the attribute to be added.
sic - the schema where the attribute will be added.

addSchemaItem

public static SchemaItemConfig addSchemaItem(SchemaConfig config,
                                             String name,
                                             String syntax,
                                             Object attr)
                                      throws Exception
Creates a schema item in the the schema config.

Parameters:
config - the schema config where the new item should be added.
name - the name of the new item.
syntax - the syntax for the schema items.
attr - contains data which is populated to the schema item.
Returns:
the created SchemaItemConfig, or null if it is not created.
Throws:
Exception - if the specified schema item name has incorrect syntax.