@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class MultiUpdateExtendedRequest extends ExtendedRequest
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds
package structure, are only
supported for use against Ping Identity, UnboundID, and
Nokia/Alcatel-Lucent 8661 server products. These classes provide support
for proprietary functionality or for external specifications that are not
considered stable or mature enough to be guaranteed to work in an
interoperable way with other types of LDAP servers.
MultiUpdateRequestValue ::= SEQUENCE { errorBehavior ENUMERATED { atomic (0), quitOnError (1), continueOnError (2), ... }, requests SEQUENCE OF SEQUENCE { updateOp CHOICE { modifyRequest ModifyRequest, addRequest AddRequest, delRequest DelRequest, modDNRequest ModifyDNRequest, extendedReq ExtendedRequest, ... }, controls [0] Controls OPTIONAL, ... }, ... }
MultiUpdateExtendedRequest multiUpdateRequest = new MultiUpdateExtendedRequest( MultiUpdateErrorBehavior.ABORT_ON_ERROR, new AddRequest( "dn: uid=new.user,ou=People,dc=example,dc=com", "objectClass: top", "objectClass: person", "objectClass: organizationalPerson", "objectClass: inetOrgPerson", "uid: new.user", "givenName: New", "sn: User", "cn: New User"), new ModifyRequest( "dn: cn=Test Group,ou=Groups,dc=example,dc=com", "changetype: modify", "add: member", "member: uid=new.user,ou=People,dc=example,dc=com")); MultiUpdateExtendedResult multiUpdateResult = (MultiUpdateExtendedResult) connection.processExtendedOperation(multiUpdateRequest); if (multiUpdateResult.getResultCode() == ResultCode.SUCCESS) { // The server successfully processed the multi-update request, although // this does not necessarily mean that any or all of the changes // contained in it were successful. For that, we should look at the // changes applied and/or results element of the response. switch (multiUpdateResult.getChangesApplied()) { case NONE: // There were no changes applied. Based on the configuration of the // request, this means that the attempt to create the user failed // and there was no subsequent attempt to add that user to a group. break; case ALL: // Both parts of the update succeeded. The user was created and // successfully added to a group. break; case PARTIAL: // At least one update succeeded, and at least one failed. Based on // the configuration of the request, this means that the user was // successfully created but not added to the target group. break; } } else { // The server encountered a failure while attempting to parse or process // the multi-update operation itself and did not attempt to process any // of the changes contained in the request. }
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MULTI_UPDATE_REQUEST_OID
The OID (1.3.6.1.4.1.30221.2.6.17) for the multi-update extended request.
|
TYPE_EXTENDED_REQUEST_OID, TYPE_EXTENDED_REQUEST_VALUE
Constructor and Description |
---|
MultiUpdateExtendedRequest(ExtendedRequest extendedRequest)
Creates a new multi-update extended request from the provided generic
extended request.
|
MultiUpdateExtendedRequest(MultiUpdateErrorBehavior errorBehavior,
LDAPRequest... requests)
Creates a new multi-update extended request with the provided information.
|
MultiUpdateExtendedRequest(MultiUpdateErrorBehavior errorBehavior,
LDAPRequest[] requests,
Control... controls)
Creates a new multi-update extended request with the provided information.
|
MultiUpdateExtendedRequest(MultiUpdateErrorBehavior errorBehavior,
java.util.List<LDAPRequest> requests,
Control... controls)
Creates a new multi-update extended request with the provided information.
|
Modifier and Type | Method and Description |
---|---|
MultiUpdateExtendedRequest |
duplicate()
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
MultiUpdateExtendedRequest |
duplicate(Control[] controls)
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
MultiUpdateErrorBehavior |
getErrorBehavior()
Retrieves the behavior to exhibit if errors are encountered.
|
java.lang.String |
getExtendedRequestName()
Retrieves the user-friendly name for the extended request, if available.
|
java.util.List<LDAPRequest> |
getRequests()
Retrieves the set of requests to be processed.
|
MultiUpdateExtendedResult |
process(LDAPConnection connection,
int depth)
Sends this extended request to the directory server over the provided
connection and returns the associated response.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this request to the provided buffer.
|
encodeProtocolOp, getLastMessageID, getOID, getOperationType, getProtocolOpType, getValue, hasValue, responseReceived, toCode, writeTo
followReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getReferralConnector, getReferralConnectorInternal, getReferralDepth, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setReferralConnector, setReferralDepth, setResponseTimeoutMillis, toString
@NotNull public static final java.lang.String MULTI_UPDATE_REQUEST_OID
public MultiUpdateExtendedRequest(@NotNull MultiUpdateErrorBehavior errorBehavior, @NotNull LDAPRequest... requests) throws LDAPException
errorBehavior
- The behavior to exhibit if errors are encountered.
It must not be null
.requests
- The set of requests to be processed. It must not
be null
or empty. Only add, delete, modify,
modify DN, and certain extended requests (as
determined by the server) should be included.LDAPException
- If the set of requests includes one or more invalid
request types.public MultiUpdateExtendedRequest(@NotNull MultiUpdateErrorBehavior errorBehavior, @NotNull LDAPRequest[] requests, @Nullable Control... controls) throws LDAPException
errorBehavior
- The behavior to exhibit if errors are encountered.
It must not be null
.requests
- The set of requests to be processed. It must not
be null
or empty. Only add, delete, modify,
modify DN, and certain extended requests (as
determined by the server) should be included. Each
request may include zero or more controls that
should apply only to that request.controls
- The set of controls to be included in the
multi-update extended request. It may be empty or
null
if no extended request controls are
needed in the multi-update request.LDAPException
- If the set of requests includes one or more invalid
request types.public MultiUpdateExtendedRequest(@NotNull MultiUpdateErrorBehavior errorBehavior, @NotNull java.util.List<LDAPRequest> requests, @Nullable Control... controls) throws LDAPException
errorBehavior
- The behavior to exhibit if errors are encountered.
It must not be null
.requests
- The set of requests to be processed. It must not
be null
or empty. Only add, delete, modify,
modify DN, and certain extended requests (as
determined by the server) should be included. Each
request may include zero or more controls that
should apply only to that request.controls
- The set of controls to be included in the
multi-update extended request. It may be empty or
null
if no extended request controls are
needed in the multi-update request.LDAPException
- If the set of requests includes one or more invalid
request types.public MultiUpdateExtendedRequest(@NotNull ExtendedRequest extendedRequest) throws LDAPException
extendedRequest
- The generic extended request to use to create this
multi-update extended request.LDAPException
- If a problem occurs while decoding the request.@NotNull public MultiUpdateExtendedResult process(@NotNull LDAPConnection connection, int depth) throws LDAPException
process
in class ExtendedRequest
connection
- The connection to use to communicate with the directory
server.depth
- The current referral depth for this request. It should
always be one for the initial request, and should only
be incremented when following referrals.LDAPException
- If a problem occurs while sending the request or
reading the response.@NotNull public MultiUpdateErrorBehavior getErrorBehavior()
@NotNull public java.util.List<LDAPRequest> getRequests()
@NotNull public MultiUpdateExtendedRequest duplicate()
duplicate
in interface ReadOnlyLDAPRequest
duplicate
in class ExtendedRequest
@NotNull public MultiUpdateExtendedRequest duplicate(@Nullable Control[] controls)
duplicate
in interface ReadOnlyLDAPRequest
duplicate
in class ExtendedRequest
controls
- The set of controls to include in the duplicate request.@NotNull public java.lang.String getExtendedRequestName()
getExtendedRequestName
in class ExtendedRequest
public void toString(@NotNull java.lang.StringBuilder buffer)
toString
in interface ProtocolOp
toString
in interface ReadOnlyLDAPRequest
toString
in class ExtendedRequest
buffer
- The buffer to which to append a string representation of
this request.