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(LogChannelInterface logInterface,
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() |
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(LogChannelInterface logInterface, VariableSpace variableSpace, LdapMeta meta, Collection<String> binaryAttributes) throws KettleException
KettleExceptionpublic void connect()
throws KettleException
KettleExceptionpublic void connect(String username, String password) throws KettleException
username - : usernamepassword - : passwordKettleExceptionpublic 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 KettleException
KettleExceptionpublic int delete(String dn, boolean checkEntry) throws KettleException
KettleExceptionpublic int update(String dn, String[] attributes, String[] values, boolean checkEntry) throws KettleException
KettleExceptionpublic int add(String dn, String[] attributes, String[] values, String multValuedSeparator, boolean checkEntry) throws KettleException
KettleExceptionpublic void insert(String dn, String[] attributes, String[] values, String multValuedSeparator) throws 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 separatorKettleExceptionpublic int upsert(String dn, String[] attributes, String[] values, String[] attributesToUpdate, String[] valuesToUpdate, String multValuedSeparator) throws 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 separatorKettleExceptionpublic void rename(String oldDn, String newDn, boolean deleteRDN) throws 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 attributeKettleExceptionpublic void close()
throws KettleException
KettleExceptionpublic Attributes getAttributes() throws KettleException
KettleExceptionpublic static String extractBytesAndConvertToString(Attribute attr, boolean isSID) throws Exception
Exceptionpublic RowMeta getFields(String searchBase) throws KettleException
KettleExceptionCopyright © 2018 Hitachi Vantara. All rights reserved.