com.ca.jcs.converter.eval
Class PropertyConverters

java.lang.Object
  extended by com.ca.jcs.converter.eval.PropertyConverters

public class PropertyConverters
extends Object

Stored for each property that requires one or more conversions be applied to it.


Constructor Summary
PropertyConverters()
           
 
Method Summary
 boolean applyFlatten(Attribute unflattenedConnAttr)
           
 String applyToLiteral(String value, boolean toConnector, Converter.ConverterFlag flag)
          Apply all contained non-structural converters to the provided value, in the direction specified by toConnector.
 boolean applyUnflatten(Attribute attr)
          Undoes changes performed by any multi-valued structural converters for this property (including flatteners), but performs no other un-conversions.
 void checkSanityConnectorDependantConverters(MetaObjectClassMappings classMaps)
           
static void convertAttribute(MetaObjectClassMapping classMap, Attribute attr, boolean toConnector, boolean runStructural)
          Run all converters that apply on a single attribute in either direction
static void convertAttributes(MetaObjectClassMapping classMap, Attributes attrs, boolean toConnector)
          Handle conversion of attributes in either direction, as dictated by the toConnector - including management of ConverterValueCache.
static ModificationItem[] convertModificationItems(ObjectInfo objInfo, ModificationItem[] items, LazyConnectorAttributesProxy attrs)
          Run all relevant converters on items passed to modify operation, using attrs if need to access current state of the target object.
 List<MetaPluginConfig> getClassConverterConfigs()
           
static PropertyConverters getConvertersForAttr(MetaObjectClassMapping classMap, Attribute attr)
          Get all converters that are registered for a single attribute (attribute id in LDAP-speak)
static PropertyConverters getConvertersForLdapAttrId(MetaObjectClassMapping classMap, String attrId)
          Obtain converters for an LDAP-speak attribute ID that are registered
 boolean getHasConnectorDependantConverter()
          At least one contained converter implements ConnectorDependantAttributeConverter.
 List<PropertyConverter> getPropertyConverters()
           
 AttributeConverter getValueConverter()
           
static ModificationItem[] normalizeModificationItemOps(ObjectInfo objInfo, boolean inConnectorSpeak, ModificationItem[] items, LazyConnectorAttributesProxy attrs)
          Normalize the provided modification items, which may involve changing the modification op (and hence provided attribute's value list) for any multi-valued properties which have the MetaDataDefs.MD_FORCE_MOD_MODE metadata setting provided, as well as for single-valued properties being modified with modes other then DirContext.REPLACE_ATTRIBUTE.
 void registerConnectorWithDependantConverters(MetaConnector connector)
           
 void setClassConverterConfigs(List<MetaPluginConfig> convClasses)
           
 void setPropertyConverters(List<PropertyConverter> pvs)
           
 void setValueConverter(AttributeConverter valueConverter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyConverters

public PropertyConverters()
Method Detail

getHasConnectorDependantConverter

public boolean getHasConnectorDependantConverter()
At least one contained converter implements ConnectorDependantAttributeConverter.


getPropertyConverters

public List<PropertyConverter> getPropertyConverters()

setPropertyConverters

public void setPropertyConverters(List<PropertyConverter> pvs)

getValueConverter

public AttributeConverter getValueConverter()

setValueConverter

public void setValueConverter(AttributeConverter valueConverter)

getClassConverterConfigs

public List<MetaPluginConfig> getClassConverterConfigs()

setClassConverterConfigs

public void setClassConverterConfigs(List<MetaPluginConfig> convClasses)

applyUnflatten

public boolean applyUnflatten(Attribute attr)
                       throws NamingException
Undoes changes performed by any multi-valued structural converters for this property (including flatteners), but performs no other un-conversions.

Throws:
NamingException

applyFlatten

public boolean applyFlatten(Attribute unflattenedConnAttr)
                     throws NamingException
Throws:
NamingException

applyToLiteral

public String applyToLiteral(String value,
                             boolean toConnector,
                             Converter.ConverterFlag flag)
                      throws NamingException
Apply all contained non-structural converters to the provided value, in the direction specified by toConnector. Used to provide the partial conversion, for instance like that required when dealing with literal values provided in search filters.

Throws:
NamingException

convertAttributes

public static void convertAttributes(MetaObjectClassMapping classMap,
                                     Attributes attrs,
                                     boolean toConnector)
                              throws NamingException
Handle conversion of attributes in either direction, as dictated by the toConnector - including management of ConverterValueCache.

Throws:
NamingException

convertAttribute

public static void convertAttribute(MetaObjectClassMapping classMap,
                                    Attribute attr,
                                    boolean toConnector,
                                    boolean runStructural)
                             throws NamingException
Run all converters that apply on a single attribute in either direction

Throws:
NamingException

getConvertersForAttr

public static PropertyConverters getConvertersForAttr(MetaObjectClassMapping classMap,
                                                      Attribute attr)
Get all converters that are registered for a single attribute (attribute id in LDAP-speak)


getConvertersForLdapAttrId

public static PropertyConverters getConvertersForLdapAttrId(MetaObjectClassMapping classMap,
                                                            String attrId)
Obtain converters for an LDAP-speak attribute ID that are registered


convertModificationItems

public static ModificationItem[] convertModificationItems(ObjectInfo objInfo,
                                                          ModificationItem[] items,
                                                          LazyConnectorAttributesProxy attrs)
                                                   throws NamingException
Run all relevant converters on items passed to modify operation, using attrs if need to access current state of the target object.

Throws:
NamingException

normalizeModificationItemOps

public static ModificationItem[] normalizeModificationItemOps(ObjectInfo objInfo,
                                                              boolean inConnectorSpeak,
                                                              ModificationItem[] items,
                                                              LazyConnectorAttributesProxy attrs)
                                                       throws NamingException
Normalize the provided modification items, which may involve changing the modification op (and hence provided attribute's value list) for any multi-valued properties which have the MetaDataDefs.MD_FORCE_MOD_MODE metadata setting provided, as well as for single-valued properties being modified with modes other then DirContext.REPLACE_ATTRIBUTE.

Parameters:
objInfo - Information for target object to which modifications are to be applied.
inConnectorSpeak - True if items are already mapped to connector-speak and false otherwise.
items - Array of modification items to be applied.
attrs - Proxy which can be used to lookup current attribute values for the target object, if required.
Returns:
Possibly modified array of items.
Throws:
NamingException

checkSanityConnectorDependantConverters

public void checkSanityConnectorDependantConverters(MetaObjectClassMappings classMaps)

registerConnectorWithDependantConverters

public void registerConnectorWithDependantConverters(MetaConnector connector)


Created 2009-10-09 16:43 EST