public class LDAPConnection extends Object
Modifier and Type | Field and 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 and 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
|
Modifier and Type | Method and Description |
---|---|
int |
add(String dn,
String[] attributes,
String[] values,
String multValuedSeparator,
boolean checkEntry) |
void |
addSortingAttributes(String value) |
void |
close()
Close the LDAP connection
|
void |
connect()
Connect to LDAP server
|
void |
connect(String username,
String password)
Connect to LDAP server
|
int |
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 DN
|
void |
rename(String oldDn,
String newDn,
boolean deleteRDN)
Rename an entry
|
void |
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
|
public static final int SEARCH_SCOPE_OBJECT_SCOPE
public static final int SEARCH_SCOPE_ONELEVEL_SCOPE
public static final int SEARCH_SCOPE_SUBTREE_SCOPE
public static final int DEFAULT_PORT
public static final String DEFAUL_FILTER_STRING
public static final int STATUS_SKIPPED
public static final int STATUS_INSERTED
public static final int STATUS_UPDATED
public static final int STATUS_DELETED
public static final int STATUS_ADDED
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
org.pentaho.di.core.exception.KettleException
public void connect() throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException
public void connect(String username, String password) throws org.pentaho.di.core.exception.KettleException
username
- : usernamepassword
- : passwordorg.pentaho.di.core.exception.KettleException
public void setSortingAttributesKeys(String[] value)
public void addSortingAttributes(String value)
public void setTimeLimit(int timeLimit)
public int getTimeLimit()
public void SetPagingSize(int value)
public void search(String searchBase, String filter, int limitRows, String[] attributeReturned, int searchScope) throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException
public int delete(String dn, boolean checkEntry) throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException
public int update(String dn, String[] attributes, String[] values, boolean checkEntry) throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException
public int add(String dn, String[] attributes, String[] values, String multValuedSeparator, boolean checkEntry) throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException
public void insert(String dn, String[] attributes, String[] values, String multValuedSeparator) throws org.pentaho.di.core.exception.KettleException
dn
- : Distinguished Name (Key for lookup)attributes
- : contains all the attributes to set for insertvalues
- : contains all the values for attributesmultValuedSeparator
- : multi-valued attributes separatororg.pentaho.di.core.exception.KettleException
public int upsert(String dn, String[] attributes, String[] values, String[] attributesToUpdate, String[] valuesToUpdate, String multValuedSeparator) throws org.pentaho.di.core.exception.KettleException
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 separatororg.pentaho.di.core.exception.KettleException
public void rename(String oldDn, String newDn, boolean deleteRDN) throws org.pentaho.di.core.exception.KettleException
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 attributeorg.pentaho.di.core.exception.KettleException
public void close() throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException
public Attributes getAttributes() throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException
public static String extractBytesAndConvertToString(Attribute attr, boolean isSID) throws Exception
Exception
public org.pentaho.di.core.row.RowMeta getFields(String searchBase) throws org.pentaho.di.core.exception.KettleException
org.pentaho.di.core.exception.KettleException