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 StringDEFAUL_FILTER_STRINGstatic intDEFAULT_PORTstatic intSEARCH_SCOPE_OBJECT_SCOPEstatic intSEARCH_SCOPE_ONELEVEL_SCOPEstatic intSEARCH_SCOPE_SUBTREE_SCOPEstatic intSTATUS_ADDEDstatic intSTATUS_DELETEDstatic intSTATUS_INSERTEDstatic intSTATUS_SKIPPEDstatic intSTATUS_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 intadd(String dn, String[] attributes, String[] values, String multValuedSeparator, boolean checkEntry)voidaddSortingAttributes(String value)voidclose()Close the LDAP connectionvoidconnect()Connect to LDAP servervoidconnect(String username, String password)Connect to LDAP serverintdelete(String dn, boolean checkEntry)static StringextractBytesAndConvertToString(Attribute attr, boolean isSID)AttributesgetAttributes()org.pentaho.di.core.row.RowMetagetFields(String searchBase)List<String>getSortingAttributes()intgetTimeLimit()voidinsert(String dn, String[] attributes, String[] values, String multValuedSeparator)Insert record in LDAP based on DNvoidrename(String oldDn, String newDn, boolean deleteRDN)Rename an entryvoidsearch(String searchBase, String filter, int limitRows, String[] attributeReturned, int searchScope)voidSetPagingSize(int value)voidsetSortingAttributesKeys(String[] value)voidsetTimeLimit(int timeLimit)intupdate(String dn, String[] attributes, String[] values, boolean checkEntry)intupsert(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.KettleExceptionConstruct a new LDAP Connection- Throws:
org.pentaho.di.core.exception.KettleException
-
-
Method Detail
-
connect
public void connect() throws org.pentaho.di.core.exception.KettleExceptionConnect 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.KettleExceptionClose 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
-
-