Class ConnectionWithControls
- java.lang.Object
-
- org.opends.guitools.controlpanel.browser.ConnectionWithControls
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class ConnectionWithControls extends Object implements Closeable
Associates aConnectionWrapperwith the LDAPControls it should use when performing operation.The relevant controls are automatically added to the request when calling
add(AddRequest),delete(DeleteRequest),modify(ModifyRequest),modifyDN(ModifyDNRequest),search(SearchRequest)orsearchSingleEntry(SearchRequest).
-
-
Constructor Summary
Constructors Constructor Description ConnectionWithControls(ConnectionWrapper conn, ServerSideSortRequestControl sortControl, ManageDsaITRequestControl followReferralsControl)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(AddRequest request)Adds with the provided request.voidclose()voiddelete(DeleteRequest request)Deletes with the provided request.ConnectionWrappergetConnectionWrapper()Returns the connection wrapper.voidmodify(ModifyRequest request)Modifies with the provided request.voidmodifyDN(ModifyDNRequest request)modifies a DN with the provided request.ConnectionEntryReadersearch(SearchRequest request)Searches using the provided request.SearchResultEntrysearchSingleEntry(SearchRequest request)Searches a single entry.voidsetRequestControls(ServerSideSortRequestControl sortControl, ManageDsaITRequestControl followReferralsControl)Sets the sort and manage dsa it controls to use when making LDAP operations.
-
-
-
Constructor Detail
-
ConnectionWithControls
public ConnectionWithControls(ConnectionWrapper conn, ServerSideSortRequestControl sortControl, ManageDsaITRequestControl followReferralsControl)
Constructor.- Parameters:
conn- the connection wrappersortControl- the sort control, may benullfollowReferralsControl- the manage dsa IT control, may benull
-
-
Method Detail
-
getConnectionWrapper
public ConnectionWrapper getConnectionWrapper()
Returns the connection wrapper.DO NOT USE TO PERFORM LDAP OPERATIONS!
This getter is only used to allow to query its state.
- Returns:
- the read-only connection wrapper.
-
setRequestControls
public void setRequestControls(ServerSideSortRequestControl sortControl, ManageDsaITRequestControl followReferralsControl)
Sets the sort and manage dsa it controls to use when making LDAP operations.- Parameters:
sortControl- the sort control, may benullfollowReferralsControl- the manage dsa IT control, may benull
-
searchSingleEntry
public SearchResultEntry searchSingleEntry(SearchRequest request) throws LdapException
Searches a single entry.- Parameters:
request- the request- Returns:
- the non-
nullsingle SearchResultEntry - Throws:
LdapException- if an error occurred.- See Also:
Connection.searchSingleEntry(SearchRequest)
-
search
public ConnectionEntryReader search(SearchRequest request)
Searches using the provided request.- Parameters:
request- the request- Returns:
- a non-
nullConnectionEntryReader - See Also:
Connection.search(SearchRequest)
-
add
public void add(AddRequest request) throws LdapException
Adds with the provided request.- Parameters:
request- the request- Throws:
LdapException- if an error occurred.- See Also:
Connection.add(AddRequest)
-
delete
public void delete(DeleteRequest request) throws LdapException
Deletes with the provided request.- Parameters:
request- the request- Throws:
LdapException- if an error occurred.- See Also:
Connection.delete(DeleteRequest)
-
modify
public void modify(ModifyRequest request) throws LdapException
Modifies with the provided request.- Parameters:
request- the request- Throws:
LdapException- if an error occurred.- See Also:
Connection.modify(ModifyRequest)
-
modifyDN
public void modifyDN(ModifyDNRequest request) throws LdapException
modifies a DN with the provided request.- Parameters:
request- the request- Throws:
LdapException- if an error occurred.- See Also:
Connection.modifyDN(ModifyDNRequest)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-