Class LDAPConnection
- java.lang.Object
-
- org.pentaho.di.trans.steps.ldapinput.LDAPConnection
-
public class LDAPConnection extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAUL_FILTER_STRING
static int
DEFAULT_PORT
static int
SEARCH_SCOPE_OBJECT_SCOPE
static int
SEARCH_SCOPE_ONELEVEL_SCOPE
static int
SEARCH_SCOPE_SUBTREE_SCOPE
static int
STATUS_ADDED
static int
STATUS_DELETED
static int
STATUS_INSERTED
static int
STATUS_SKIPPED
static int
STATUS_UPDATED
-
Constructor Summary
Constructors Constructor Description LDAPConnection(org.pentaho.di.core.logging.LogChannelInterface logInterface, org.pentaho.di.core.variables.VariableSpace variableSpace, LdapMeta meta, Collection<String> binaryAttributes)
Construct a new LDAP Connection
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
add(String dn, String[] attributes, String[] values, String multValuedSeparator, boolean checkEntry)
void
addSortingAttributes(String value)
void
close()
Close the LDAP connectionvoid
connect()
Connect to LDAP servervoid
connect(String username, String password)
Connect to LDAP serverint
delete(String dn, boolean checkEntry)
static String
extractBytesAndConvertToString(Attribute attr, boolean isSID)
Attributes
getAttributes()
org.pentaho.di.core.row.RowMeta
getFields(String searchBase)
List<String>
getSortingAttributes()
int
getTimeLimit()
void
insert(String dn, String[] attributes, String[] values, String multValuedSeparator)
Insert record in LDAP based on DNvoid
rename(String oldDn, String newDn, boolean deleteRDN)
Rename an entryvoid
search(String searchBase, String filter, int limitRows, String[] attributeReturned, int searchScope)
void
SetPagingSize(int value)
void
setSortingAttributesKeys(String[] value)
void
setTimeLimit(int timeLimit)
int
update(String dn, String[] attributes, String[] values, boolean checkEntry)
int
upsert(String dn, String[] attributes, String[] values, String[] attributesToUpdate, String[] valuesToUpdate, String multValuedSeparator)
Upsert record in LDAP First we will check if the entry exist based on DN If we can not find it, we will create it otherwise, we will perform an update
-
-
-
Field Detail
-
SEARCH_SCOPE_OBJECT_SCOPE
public static final int SEARCH_SCOPE_OBJECT_SCOPE
- See Also:
- Constant Field Values
-
SEARCH_SCOPE_ONELEVEL_SCOPE
public static final int SEARCH_SCOPE_ONELEVEL_SCOPE
- See Also:
- Constant Field Values
-
SEARCH_SCOPE_SUBTREE_SCOPE
public static final int SEARCH_SCOPE_SUBTREE_SCOPE
- See Also:
- Constant Field Values
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
DEFAUL_FILTER_STRING
public static final String DEFAUL_FILTER_STRING
- See Also:
- Constant Field Values
-
STATUS_SKIPPED
public static final int STATUS_SKIPPED
- See Also:
- Constant Field Values
-
STATUS_INSERTED
public static final int STATUS_INSERTED
- See Also:
- Constant Field Values
-
STATUS_UPDATED
public static final int STATUS_UPDATED
- See Also:
- Constant Field Values
-
STATUS_DELETED
public static final int STATUS_DELETED
- See Also:
- Constant Field Values
-
STATUS_ADDED
public static final int STATUS_ADDED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LDAPConnection
public LDAPConnection(org.pentaho.di.core.logging.LogChannelInterface logInterface, org.pentaho.di.core.variables.VariableSpace variableSpace, LdapMeta meta, Collection<String> binaryAttributes) throws org.pentaho.di.core.exception.KettleException
Construct a new LDAP Connection- Throws:
org.pentaho.di.core.exception.KettleException
-
-
Method Detail
-
connect
public void connect() throws org.pentaho.di.core.exception.KettleException
Connect to LDAP server- Throws:
org.pentaho.di.core.exception.KettleException
-
connect
public void connect(String username, String password) throws org.pentaho.di.core.exception.KettleException
Connect to LDAP server- Parameters:
username
- : usernamepassword
- : password- Throws:
org.pentaho.di.core.exception.KettleException
-
setSortingAttributesKeys
public void setSortingAttributesKeys(String[] value)
-
addSortingAttributes
public void addSortingAttributes(String value)
-
setTimeLimit
public void setTimeLimit(int timeLimit)
-
getTimeLimit
public int getTimeLimit()
-
SetPagingSize
public void SetPagingSize(int value)
-
search
public void search(String searchBase, String filter, int limitRows, String[] attributeReturned, int searchScope) throws org.pentaho.di.core.exception.KettleException
- Throws:
org.pentaho.di.core.exception.KettleException
-
delete
public int delete(String dn, boolean checkEntry) throws org.pentaho.di.core.exception.KettleException
- Throws:
org.pentaho.di.core.exception.KettleException
-
update
public int update(String dn, String[] attributes, String[] values, boolean checkEntry) throws org.pentaho.di.core.exception.KettleException
- Throws:
org.pentaho.di.core.exception.KettleException
-
add
public int add(String dn, String[] attributes, String[] values, String multValuedSeparator, boolean checkEntry) throws org.pentaho.di.core.exception.KettleException
- Throws:
org.pentaho.di.core.exception.KettleException
-
insert
public void insert(String dn, String[] attributes, String[] values, String multValuedSeparator) throws org.pentaho.di.core.exception.KettleException
Insert record in LDAP based on DN- Parameters:
dn
- : Distinguished Name (Key for lookup)attributes
- : contains all the attributes to set for insertvalues
- : contains all the values for attributesmultValuedSeparator
- : multi-valued attributes separator- Throws:
org.pentaho.di.core.exception.KettleException
-
upsert
public int upsert(String dn, String[] attributes, String[] values, String[] attributesToUpdate, String[] valuesToUpdate, String multValuedSeparator) throws org.pentaho.di.core.exception.KettleException
Upsert record in LDAP First we will check if the entry exist based on DN If we can not find it, we will create it otherwise, we will perform an update- Parameters:
dn
- : Distinguished Name (Key for lookup)attributes
- : contains all the attributes to set for insertvalues
- : contains all the values for attributesattributesToUpdate
- : contains attributes to updatevaluesToUpdate
- : contains values for attributes to updatemultValuedSeparator
- : multi-valued attributes separator- Returns:
- status : STATUS_INSERTED, STATUS_UPDATED or STATUS_SKIPPED
- Throws:
org.pentaho.di.core.exception.KettleException
-
rename
public void rename(String oldDn, String newDn, boolean deleteRDN) throws org.pentaho.di.core.exception.KettleException
Rename an entry- Parameters:
oldDn
- Distinguished name of the entry to renamenewDn
- target Distinguished name (new)deleteRDN
- To specify whether you want to keep the old name attribute when you use rename entry true : do not keep the old value (defaut) false : keep the old value as an attribute- Throws:
org.pentaho.di.core.exception.KettleException
-
close
public void close() throws org.pentaho.di.core.exception.KettleException
Close the LDAP connection- Throws:
org.pentaho.di.core.exception.KettleException
-
getAttributes
public Attributes getAttributes() throws org.pentaho.di.core.exception.KettleException
- Throws:
org.pentaho.di.core.exception.KettleException
-
extractBytesAndConvertToString
public static String extractBytesAndConvertToString(Attribute attr, boolean isSID) throws Exception
- Throws:
Exception
-
getFields
public org.pentaho.di.core.row.RowMeta getFields(String searchBase) throws org.pentaho.di.core.exception.KettleException
- Throws:
org.pentaho.di.core.exception.KettleException
-
-