|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.ldap.sdk.LDAPRequest
com.unboundid.ldap.sdk.ExtendedRequest
com.unboundid.ldap.sdk.unboundidds.extensions.MultiUpdateExtendedRequest
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class MultiUpdateExtendedRequest
NOTE: This class is part of the Commercial Edition of the UnboundID LDAP SDK for Java. It is not available for use in applications that include only the Standard Edition of the LDAP SDK, and is not supported for use in conjunction with non-UnboundID products.This class provides an implementation of an extended request that can be used to send multiple update requests to the server in a single packet, optionally processing them as a single atomic unit. The OID for this request is 1.3.6.1.4.1.30221.2.6.17, and the value must have the following encoding:
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. }
MultiUpdateErrorBehavior
,
MultiUpdateExtendedResult
,
Serialized FormField Summary | |
---|---|
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. |
Fields inherited from class com.unboundid.ldap.sdk.ExtendedRequest |
---|
TYPE_EXTENDED_REQUEST_OID, TYPE_EXTENDED_REQUEST_VALUE |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class com.unboundid.ldap.sdk.ExtendedRequest |
---|
encodeProtocolOp, getLastMessageID, getOID, getOperationType, getProtocolOpType, getValue, hasValue, responseReceived, writeTo |
Methods inherited from class com.unboundid.ldap.sdk.LDAPRequest |
---|
followReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setResponseTimeoutMillis, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MULTI_UPDATE_REQUEST_OID
Constructor Detail |
---|
public MultiUpdateExtendedRequest(MultiUpdateErrorBehavior errorBehavior, 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(MultiUpdateErrorBehavior errorBehavior, LDAPRequest[] requests, 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(MultiUpdateErrorBehavior errorBehavior, java.util.List<LDAPRequest> requests, 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(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.Method Detail |
---|
public MultiUpdateExtendedResult process(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.public MultiUpdateErrorBehavior getErrorBehavior()
public java.util.List<LDAPRequest> getRequests()
public MultiUpdateExtendedRequest duplicate()
duplicate
in interface ReadOnlyLDAPRequest
duplicate
in class ExtendedRequest
public MultiUpdateExtendedRequest duplicate(Control[] controls)
duplicate
in interface ReadOnlyLDAPRequest
duplicate
in class ExtendedRequest
controls
- The set of controls to include in the duplicate request.
public java.lang.String getExtendedRequestName()
getExtendedRequestName
in class ExtendedRequest
public void toString(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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |