org.lsc.beans.syncoptions
Class PropertiesBasedSyncOptions

java.lang.Object
  extended by org.lsc.beans.syncoptions.PropertiesBasedSyncOptions
All Implemented Interfaces:
ISyncOptions

public class PropertiesBasedSyncOptions
extends Object
implements ISyncOptions

Synchronization options based on a properties file This class interprets properties to get detailed options for synchronization, including behavior and values for the general case or attribute by attribute.

Author:
Sebastien Bahloul <seb@lsc-project.org>, Jonathan Clarke <jon@lsc-project.org>

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.lsc.beans.syncoptions.ISyncOptions
ISyncOptions.STATUS_TYPE
 
Constructor Summary
PropertiesBasedSyncOptions()
           
 
Method Summary
 String getCondition(JndiModificationType operation)
          Returns the condition for this operation
 Set<String> getCreateAttributeNames()
          Return the names of attributes to be created.
 String getCreateCondition()
          Returns the condition for a creation
 List<String> getCreateValues(String id, String attributeName)
          Return the create value for a given attribute name.
 Set<String> getDefaultValuedAttributeNames()
          Return the default valued attributes
 List<String> getDefaultValues(String id, String attributeName)
          Return the default values for a given attribute name.
 String getDeleteCondition()
          Returns the condition for a delete
 String getDn()
          Get the setting to generate a DN
 Set<String> getForceValuedAttributeNames()
          Return the force valued attributes
 List<String> getForceValues(String id, String attributeName)
          Return the force value for a given attribute name.
 String getModrdnCondition()
          Returns the condition for a modrdn
 ISyncOptions.STATUS_TYPE getStatus(String id, String attributeName)
          Analyze the context to get the right synchronization status to apply.
 String getTaskName()
          Get the task name
 String getUpdateCondition()
          Returns the condition for an update
 List<String> getWriteAttributes()
          Get all the attributes that must be written in the destination
 void initialize(String syncName)
          When initiating a new object, needs <ul> <li>the synchronization name</li> to read properties in general configuration file <li>the general default status</li> (force if not specified) which will be used if no default status has been specified for this synchronization name <ul>
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesBasedSyncOptions

public PropertiesBasedSyncOptions()
Method Detail

initialize

public final void initialize(String syncName)
When initiating a new object, needs <ul> <li>the synchronization name</li> to read properties in general configuration file <li>the general default status</li> (force if not specified) which will be used if no default status has been specified for this synchronization name <ul>

Specified by:
initialize in interface ISyncOptions
Parameters:
syncName -

getStatus

public final ISyncOptions.STATUS_TYPE getStatus(String id,
                                                String attributeName)
Description copied from interface: ISyncOptions
Analyze the context to get the right synchronization status to apply.

Specified by:
getStatus in interface ISyncOptions
Parameters:
id - the object identifier according to the datasource
attributeName - the attribute name
Returns:
the default or create value

getDefaultValues

public final List<String> getDefaultValues(String id,
                                           String attributeName)
Description copied from interface: ISyncOptions
Return the default values for a given attribute name. The default values replace a missing value in the source datasource

Specified by:
getDefaultValues in interface ISyncOptions
Parameters:
id - the object identifier according to the datasource
attributeName - the attribute name
Returns:
the default value

getCreateValues

public final List<String> getCreateValues(String id,
                                          String attributeName)
Description copied from interface: ISyncOptions
Return the create value for a given attribute name. The create value replace a missing value in the source datasource only while creating a new entry. For coherence, implementation classes must guarantee that a default value override a create value

Specified by:
getCreateValues in interface ISyncOptions
Parameters:
id - the object identifier according to the datasource
attributeName - the attribute name
Returns:
the create value

getForceValues

public final List<String> getForceValues(String id,
                                         String attributeName)
Description copied from interface: ISyncOptions
Return the force value for a given attribute name. The force value forces a value in the desination directory

Specified by:
getForceValues in interface ISyncOptions
Parameters:
id - the object identifier according to the datasource
attributeName - the attribute name
Returns:
the force value

getCreateAttributeNames

public final Set<String> getCreateAttributeNames()
Description copied from interface: ISyncOptions
Return the names of attributes to be created.

Specified by:
getCreateAttributeNames in interface ISyncOptions
Returns:
the created attributes names

getDefaultValuedAttributeNames

public final Set<String> getDefaultValuedAttributeNames()
Description copied from interface: ISyncOptions
Return the default valued attributes

Specified by:
getDefaultValuedAttributeNames in interface ISyncOptions
Returns:
the default valued attributes names

getForceValuedAttributeNames

public final Set<String> getForceValuedAttributeNames()
Description copied from interface: ISyncOptions
Return the force valued attributes

Specified by:
getForceValuedAttributeNames in interface ISyncOptions
Returns:
the force valued attributes names

getWriteAttributes

public List<String> getWriteAttributes()
Description copied from interface: ISyncOptions
Get all the attributes that must be written in the destination

Specified by:
getWriteAttributes in interface ISyncOptions
Returns:
the attributes to write in the destination

getCreateCondition

public String getCreateCondition()
Description copied from interface: ISyncOptions
Returns the condition for a creation

Specified by:
getCreateCondition in interface ISyncOptions
Returns:
the condition or "true" if none is specified (default)

getDeleteCondition

public String getDeleteCondition()
Description copied from interface: ISyncOptions
Returns the condition for a delete

Specified by:
getDeleteCondition in interface ISyncOptions
Returns:
the condition or "true" if none is specified (default)

getUpdateCondition

public String getUpdateCondition()
Description copied from interface: ISyncOptions
Returns the condition for an update

Specified by:
getUpdateCondition in interface ISyncOptions
Returns:
the condition or "true" if none is specified (default)

getModrdnCondition

public String getModrdnCondition()
Description copied from interface: ISyncOptions
Returns the condition for a modrdn

Specified by:
getModrdnCondition in interface ISyncOptions
Returns:
the condition or "true" if none is specified (default)

getCondition

public String getCondition(JndiModificationType operation)
Description copied from interface: ISyncOptions
Returns the condition for this operation

Specified by:
getCondition in interface ISyncOptions
Parameters:
operation - The operation type
Returns:
the condition or "true" if none is specified (default)

getDn

public String getDn()
Get the setting to generate a DN

Specified by:
getDn in interface ISyncOptions
Returns:
String The script to generate a DN

getTaskName

public String getTaskName()
Get the task name

Specified by:
getTaskName in interface ISyncOptions
Returns:
String The current task name.


Copyright © 2005-2010 LSC project. All Rights Reserved.