Class ExecutableLdapDestinationService

java.lang.Object
org.lsc.plugins.connectors.executable.AbstractExecutableLdifService
org.lsc.plugins.connectors.executable.ExecutableLdapDestinationService
All Implemented Interfaces:
Closeable, AutoCloseable, org.lsc.service.IService, org.lsc.service.IWritableService

public class ExecutableLdapDestinationService extends AbstractExecutableLdifService implements org.lsc.service.IWritableService, Closeable
This class is a generic but configurable implementation to provision data to any referential which can be scripted. This is based on ExecutableLdifService for updating executables and SimpleJndiDstService to retrieve data It just requires 4 scripts to :
  • add a new
  • update a existing data
  • rename - or change the identifier
  • delete or archive an unused data
The 4 scripts which change data are responsible for consistency. No explicit check neither rollback is achieved by the LSC engine, so a successful result for any of these 4 operations must be fully checked. At this time, no time out is managed. So please consider handling provisioned referential availability and/or time limit handling directly in the executable.
Author:
Sebastien Bahloul <seb@lsc-project.org>
  • Constructor Details

    • ExecutableLdapDestinationService

      public ExecutableLdapDestinationService(org.lsc.configuration.TaskType task) throws org.lsc.exception.LscServiceConfigurationException
      Throws:
      org.lsc.exception.LscServiceConfigurationException
  • Method Details

    • getBean

      public org.lsc.beans.IBean getBean(String pivotName, org.lsc.LscDatasets pivotAttributes, boolean fromSameService) throws org.lsc.exception.LscServiceException
      The simple object getter according to its identifier.
      Specified by:
      getBean in interface org.lsc.service.IService
      Overrides:
      getBean in class AbstractExecutableLdifService
      Parameters:
      pivotName - Name of the entry to be returned, which is the name returned by getListPivots() (used for display only)
      pivotAttributes - Map of attribute names and values, which is the data identifier in the source such as returned by getListPivots(). It must identify a unique entry in the source.
      fromSameService - are the pivot attributes provided by the same service
      Returns:
      The bean, or null if not found
      Throws:
      org.lsc.exception.LscServiceException - May throw a NamingException if the object is not found in the directory, or if more than one object would be returned.
    • getListPivots

      public Map<String,org.lsc.LscDatasets> getListPivots() throws org.lsc.exception.LscServiceException
      Returns a list of all the objects' identifiers.
      Specified by:
      getListPivots in interface org.lsc.service.IService
      Overrides:
      getListPivots in class AbstractExecutableLdifService
      Returns:
      Map of all entries names that are returned by the directory with an associated map of attribute names and values (never null)
      Throws:
      org.lsc.exception.LscServiceException
    • getWriteDatasetIds

      public List<String> getWriteDatasetIds()
      Specified by:
      getWriteDatasetIds in interface org.lsc.service.IWritableService
    • apply

      public boolean apply(org.lsc.LscModifications lm)
      Apply directory modifications.
      Specified by:
      apply in interface org.lsc.service.IWritableService
      Parameters:
      lm - Modifications to apply in a JndiModifications object.
      Returns:
      Operation status
      Throws:
      CommunicationException - If the connection to the service is lost, and all other attempts to use this service should fail.
    • getSupportedConnectionType

      public Collection<Class<? extends org.lsc.configuration.ConnectionType>> getSupportedConnectionType()
      Specified by:
      getSupportedConnectionType in interface org.lsc.service.IService
      Overrides:
      getSupportedConnectionType in class AbstractExecutableLdifService
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException