Update from OpenDS sdk by Bo Li: Added unmodifiable and copyOf request factories. Added authrate performance utility.
4 files copied
2 files deleted
22 files added
3 files renamed
45 files modified
| New file |
| | |
| | | #!/bin/sh |
| | | # |
| | | # CDDL HEADER START |
| | | # |
| | | # The contents of this file are subject to the terms of the |
| | | # Common Development and Distribution License, Version 1.0 only |
| | | # (the "License"). You may not use this file except in compliance |
| | | # with the License. |
| | | # |
| | | # You can obtain a copy of the license at |
| | | # trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | # or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | # See the License for the specific language governing permissions |
| | | # and limitations under the License. |
| | | # |
| | | # When distributing Covered Code, include this CDDL HEADER in each |
| | | # file and include the License file at |
| | | # trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | # add the following below this CDDL HEADER, with the fields enclosed |
| | | # by brackets "[]" replaced with your own identifying information: |
| | | # Portions Copyright [yyyy] [name of copyright owner] |
| | | # |
| | | # CDDL HEADER END |
| | | # |
| | | # |
| | | # Copyright 2010 Sun Microsystems, Inc. |
| | | |
| | | |
| | | # This script may be used to measure auth performance. |
| | | OPENDS_INVOKE_CLASS="com.sun.opends.sdk.tools.AuthRate" |
| | | export OPENDS_INVOKE_CLASS |
| | | |
| | | SCRIPT_NAME="authrate" |
| | | export SCRIPT_NAME |
| | | |
| | | SCRIPT_DIR=`dirname "${0}"` |
| | | "${SCRIPT_DIR}/../lib/_client-script.sh" "${@}" |
| New file |
| | |
| | | |
| | | @echo off |
| | | rem CDDL HEADER START |
| | | rem |
| | | rem The contents of this file are subject to the terms of the |
| | | rem Common Development and Distribution License, Version 1.0 only |
| | | rem (the "License"). You may not use this file except in compliance |
| | | rem with the License. |
| | | rem |
| | | rem You can obtain a copy of the license at |
| | | rem trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | rem or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | rem See the License for the specific language governing permissions |
| | | rem and limitations under the License. |
| | | rem |
| | | rem When distributing Covered Code, include this CDDL HEADER in each |
| | | rem file and include the License file at |
| | | rem trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | rem add the following below this CDDL HEADER, with the fields enclosed |
| | | rem by brackets "[]" replaced with your own identifying information: |
| | | rem Portions Copyright [yyyy] [name of copyright owner] |
| | | rem |
| | | rem CDDL HEADER END |
| | | rem |
| | | rem |
| | | rem Copyright 2010 Sun Microsystems, Inc. |
| | | |
| | | setlocal |
| | | |
| | | set OPENDS_INVOKE_CLASS="com.sun.opends.sdk.tools.AuthRate" |
| | | set SCRIPT_NAME=authrate |
| | | for %%i in (%~sf0) do call "%%~dPsi\..\lib\_client-script.bat" %* |
| | | |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package com.sun.opends.sdk.ldap; |
| | |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | import javax.net.ssl.SSLContext; |
| | |
| | | |
| | | private final AtomicInteger nextMsgID = new AtomicInteger(1); |
| | | |
| | | private boolean bindOrStartTLSInProgress = false; |
| | | private final AtomicBoolean bindOrStartTLSInProgress = |
| | | new AtomicBoolean(false); |
| | | |
| | | private final ConcurrentHashMap<Integer, AbstractLDAPFutureResultImpl<?>> pendingRequests = |
| | | new ConcurrentHashMap<Integer, AbstractLDAPFutureResultImpl<?>>(); |
| | |
| | | return new CompletedFutureResult<Void>( |
| | | ErrorResultException.wrap(connectionInvalidReason), messageID); |
| | | } |
| | | if (bindOrStartTLSInProgress) |
| | | if (bindOrStartTLSInProgress.get()) |
| | | { |
| | | final Result errorResult = Responses.newResult( |
| | | ResultCode.OPERATIONS_ERROR).setDiagnosticMessage( |
| | |
| | | future.adaptErrorResult(connectionInvalidReason); |
| | | return future; |
| | | } |
| | | if (bindOrStartTLSInProgress) |
| | | if (bindOrStartTLSInProgress.get()) |
| | | { |
| | | future.setResultOrError(Responses |
| | | .newResult(ResultCode.OPERATIONS_ERROR).setDiagnosticMessage( |
| | |
| | | future.adaptErrorResult(connectionInvalidReason); |
| | | return future; |
| | | } |
| | | if (bindOrStartTLSInProgress) |
| | | if (!bindOrStartTLSInProgress.compareAndSet(false, true)) |
| | | { |
| | | future.setResultOrError(Responses.newBindResult( |
| | | ResultCode.OPERATIONS_ERROR).setDiagnosticMessage( |
| | |
| | | } |
| | | |
| | | pendingRequests.put(messageID, future); |
| | | bindOrStartTLSInProgress = true; |
| | | } |
| | | |
| | | try |
| | |
| | | future.adaptErrorResult(connectionInvalidReason); |
| | | return future; |
| | | } |
| | | if (bindOrStartTLSInProgress) |
| | | if (bindOrStartTLSInProgress.get()) |
| | | { |
| | | future.setResultOrError(Responses.newCompareResult( |
| | | ResultCode.OPERATIONS_ERROR).setDiagnosticMessage( |
| | |
| | | future.adaptErrorResult(connectionInvalidReason); |
| | | return future; |
| | | } |
| | | if (bindOrStartTLSInProgress) |
| | | if (bindOrStartTLSInProgress.get()) |
| | | { |
| | | future.setResultOrError(Responses |
| | | .newResult(ResultCode.OPERATIONS_ERROR).setDiagnosticMessage( |
| | |
| | | future.adaptErrorResult(connectionInvalidReason); |
| | | return future; |
| | | } |
| | | if (bindOrStartTLSInProgress) |
| | | if (!bindOrStartTLSInProgress.compareAndSet(false, true)) |
| | | { |
| | | future.setResultOrError(request.getResultDecoder() |
| | | .newExtendedErrorResult(ResultCode.OPERATIONS_ERROR, "", |
| | |
| | | .newExtendedErrorResult(ResultCode.OPERATIONS_ERROR, "", |
| | | "This connection is already TLS enabled")); |
| | | } |
| | | bindOrStartTLSInProgress = true; |
| | | } |
| | | pendingRequests.put(messageID, future); |
| | | } |
| | |
| | | future.adaptErrorResult(connectionInvalidReason); |
| | | return future; |
| | | } |
| | | if (bindOrStartTLSInProgress) |
| | | if (bindOrStartTLSInProgress.get()) |
| | | { |
| | | future.setResultOrError(Responses |
| | | .newResult(ResultCode.OPERATIONS_ERROR).setDiagnosticMessage( |
| | |
| | | future.adaptErrorResult(connectionInvalidReason); |
| | | return future; |
| | | } |
| | | if (bindOrStartTLSInProgress) |
| | | if (bindOrStartTLSInProgress.get()) |
| | | { |
| | | future.setResultOrError(Responses |
| | | .newResult(ResultCode.OPERATIONS_ERROR).setDiagnosticMessage( |
| | |
| | | future.adaptErrorResult(connectionInvalidReason); |
| | | return future; |
| | | } |
| | | if (bindOrStartTLSInProgress) |
| | | if (bindOrStartTLSInProgress.get()) |
| | | { |
| | | future.setResultOrError(Responses |
| | | .newResult(ResultCode.OPERATIONS_ERROR).setDiagnosticMessage( |
| | |
| | | |
| | | void setBindOrStartTLSInProgress(final boolean state) |
| | | { |
| | | bindOrStartTLSInProgress = state; |
| | | bindOrStartTLSInProgress.set(state); |
| | | } |
| | | |
| | | |
| | | |
| | | synchronized void startTLS(final SSLContext sslContext, |
| | | final String[] protocols, final String[] cipherSuites, |
| | | final List<String> protocols, final List<String> cipherSuites, |
| | | final CompletionHandler<SSLEngine> completionHandler) throws IOException |
| | | { |
| | | if (isTLSEnabled()) |
| | |
| | | |
| | | sslEngineConfigurator = new SSLEngineConfigurator(sslContext, true, false, |
| | | false); |
| | | sslEngineConfigurator.setEnabledProtocols(protocols); |
| | | sslEngineConfigurator.setEnabledCipherSuites(cipherSuites); |
| | | sslEngineConfigurator.setEnabledProtocols(protocols.isEmpty() ? |
| | | null : protocols.toArray(new String[protocols.size()])); |
| | | sslEngineConfigurator.setEnabledCipherSuites(cipherSuites.isEmpty() ? |
| | | null : cipherSuites.toArray(new String[cipherSuites.size()])); |
| | | sslFilter = new SSLFilter(null, sslEngineConfigurator); |
| | | installFilter(sslFilter); |
| | | sslFilter.handshake(connection, completionHandler); |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package com.sun.opends.sdk.ldap; |
| | |
| | | { |
| | | final StartTLSExtendedRequest startTLS = Requests |
| | | .newStartTLSExtendedRequest(options.getSSLContext()); |
| | | startTLS.setEnabledCipherSuites(options.getEnabledCipherSuites()); |
| | | startTLS.setEnabledProtocols(options.getEnabledProtocols()); |
| | | startTLS.addEnabledCipherSuite( |
| | | options.getEnabledCipherSuites().toArray( |
| | | new String[options.getEnabledCipherSuites().size()])); |
| | | startTLS.addEnabledProtocol( |
| | | options.getEnabledProtocols().toArray( |
| | | new String[options.getEnabledProtocols().size()])); |
| | | return connection.extendedRequest(startTLS, handler); |
| | | } |
| | | |
| | |
| | | # |
| | | # CDDL HEADER START |
| | | # |
| | | # The contents of this file are subject to the terms of the |
| | |
| | | # |
| | | # CDDL HEADER END |
| | | # |
| | | # Copyright 2009 Sun Microsystems, Inc. |
| | | # |
| | | # Copyright 2010 Sun Microsystems, Inc. |
| | | # |
| | | |
| | | |
| | | |
| | |
| | | modify throughput and response time of a directory service using \ |
| | | user-defined modifications |
| | | INFO_MODRATE_TOOL_DESCRIPTION_TARGETDN=Target entry DN format string |
| | | INFO_AUTHRATE_TOOL_DESCRIPTION=This utility can be used to measure \ |
| | | bind throughput and response time of a directory service using \ |
| | | user-defined bind or search-then-bind operations. Format strings may be \ |
| | | used in the bind DN option as well as the authid and authzid SASL bind \ |
| | | options. A search operation may be used to retrieve the bind DN by \ |
| | | specifying the base DN and a filter. The retrieved entry DN will be appended \ |
| | | as the last argument in the argument list when evaluating format strings. \ |
| | | For example, to measure simple bind performance using the retrieved user \ |
| | | DN as the bind DN: authrate -D '%2$s' -p password -b "dc=example,dc=com" \ |
| | | -g 'rand(0,10000)' '(user=user.%1$d)' |
| | | |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package com.sun.opends.sdk.tools; |
| | | |
| | | import com.sun.opends.sdk.util.RecursiveFutureResult; |
| | | import org.opends.sdk.*; |
| | | import org.opends.sdk.requests.*; |
| | | import org.opends.sdk.responses.BindResult; |
| | | import org.opends.sdk.responses.SearchResultEntry; |
| | | |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.concurrent.atomic.AtomicLong; |
| | | |
| | | import static com.sun.opends.sdk.messages.Messages.*; |
| | | import static com.sun.opends.sdk.messages.Messages.ERR_ERROR_PARSING_ARGS; |
| | | import static com.sun.opends.sdk.tools.ToolConstants.*; |
| | | import static com.sun.opends.sdk.tools.ToolConstants.OPTION_LONG_BASEDN; |
| | | import static com.sun.opends.sdk.tools.ToolConstants.OPTION_SHORT_BASEDN; |
| | | import static com.sun.opends.sdk.tools.Utils.filterExitCode; |
| | | |
| | | /** |
| | | * A load generation tool that can be used to load a Directory Server with |
| | | * Bind requests using one or more LDAP connections. |
| | | */ |
| | | public final class AuthRate extends ConsoleApplication |
| | | { |
| | | private final class BindPerformanceRunner extends PerformanceRunner |
| | | { |
| | | private final AtomicLong searchWaitRecentTime = new AtomicLong(); |
| | | private final AtomicInteger invalidCredRecentCount = new AtomicInteger(); |
| | | |
| | | private final class BindStatsThread extends StatsThread |
| | | { |
| | | private final String[] extraColumn; |
| | | |
| | | |
| | | |
| | | private BindStatsThread() |
| | | { |
| | | super(new String[] { "bind time %" }); |
| | | extraColumn = new String[1]; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | String[] getAdditionalColumns() |
| | | { |
| | | invalidCredRecentCount.set(0); |
| | | final long searchWaitTime = searchWaitRecentTime.getAndSet(0); |
| | | extraColumn[0] = String.format("%.1f", |
| | | ((float)(waitTime - searchWaitTime) / waitTime) * 100.0); |
| | | return extraColumn; |
| | | } |
| | | } |
| | | |
| | | private final class BindUpdateStatsResultHandler |
| | | extends UpdateStatsResultHandler<BindResult> |
| | | { |
| | | private BindUpdateStatsResultHandler(long eTime) { |
| | | super(eTime); |
| | | } |
| | | |
| | | @Override |
| | | public void handleErrorResult(ErrorResultException error) { |
| | | if(error.getResult().getResultCode() != ResultCode.INVALID_CREDENTIALS) |
| | | { |
| | | super.handleErrorResult(error); |
| | | } |
| | | else |
| | | { |
| | | failedRecentCount.getAndIncrement(); |
| | | invalidCredRecentCount.getAndIncrement(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private final class BindWorkerThread extends WorkerThread |
| | | { |
| | | private SearchRequest sr; |
| | | private BindRequest br; |
| | | |
| | | private Object[] data; |
| | | |
| | | |
| | | |
| | | private BindWorkerThread(final AsynchronousConnection connection, |
| | | final ConnectionFactory connectionFactory) |
| | | { |
| | | super(connection, connectionFactory); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public FutureResult<?> performOperation( |
| | | final AsynchronousConnection connection, |
| | | final DataSource[] dataSources, final long startTime) |
| | | { |
| | | if (dataSources != null) |
| | | { |
| | | data = DataSource.generateData(dataSources, data); |
| | | if(data.length == dataSources.length) |
| | | { |
| | | Object[] newData = new Object[data.length + 1]; |
| | | System.arraycopy(data, 0, newData, 0, data.length); |
| | | data = newData; |
| | | } |
| | | } |
| | | if(filter != null && baseDN != null) |
| | | { |
| | | if (sr == null) |
| | | { |
| | | if (dataSources == null) |
| | | { |
| | | sr = Requests.newSearchRequest(baseDN, scope, filter, attributes); |
| | | } |
| | | else |
| | | { |
| | | sr = Requests.newSearchRequest(String.format(baseDN, data), scope, |
| | | String.format(filter, data), attributes); |
| | | } |
| | | sr.setDereferenceAliasesPolicy(dereferencesAliasesPolicy); |
| | | } |
| | | else if (dataSources != null) |
| | | { |
| | | sr.setFilter(String.format(filter, data)); |
| | | sr.setName(String.format(baseDN, data)); |
| | | } |
| | | |
| | | RecursiveFutureResult<SearchResultEntry, BindResult> future = |
| | | new RecursiveFutureResult<SearchResultEntry, BindResult>( |
| | | new BindUpdateStatsResultHandler(startTime)) |
| | | { |
| | | @Override |
| | | protected FutureResult<? extends BindResult> chainResult( |
| | | SearchResultEntry innerResult, |
| | | ResultHandler<? super BindResult> resultHandler) |
| | | throws ErrorResultException |
| | | { |
| | | searchWaitRecentTime.getAndAdd(System.nanoTime() - startTime); |
| | | if(data == null) |
| | | { |
| | | data = new Object[1]; |
| | | } |
| | | data[data.length-1] = innerResult.getName().toString(); |
| | | return performBind(connection, data, resultHandler); |
| | | } |
| | | }; |
| | | connection.searchSingleEntry(sr, future); |
| | | return future; |
| | | } |
| | | else |
| | | { |
| | | return performBind(connection, data, |
| | | new UpdateStatsResultHandler<BindResult>(startTime)); |
| | | } |
| | | } |
| | | |
| | | private FutureResult<BindResult> performBind( |
| | | final AsynchronousConnection connection, |
| | | final Object[] data, |
| | | final ResultHandler<? super BindResult> handler) |
| | | { |
| | | if(bindRequest instanceof SimpleBindRequest) |
| | | { |
| | | SimpleBindRequest o = (SimpleBindRequest)bindRequest; |
| | | if(br == null) |
| | | { |
| | | br = Requests.copyOfSimpleBindRequest(o); |
| | | } |
| | | |
| | | SimpleBindRequest sbr = (SimpleBindRequest)br; |
| | | if (data != null && o.getName() != null) |
| | | { |
| | | sbr.setName(String.format(o.getName(), data)); |
| | | } |
| | | if(successRecentCount.get() * ((float)invalidCredPercent/100) > |
| | | invalidCredRecentCount.get()) |
| | | { |
| | | sbr.setPassword("invalid-password"); |
| | | } |
| | | else |
| | | { |
| | | sbr.setPassword(o.getPassword()); |
| | | } |
| | | } |
| | | else if(bindRequest instanceof DigestMD5SASLBindRequest) |
| | | { |
| | | DigestMD5SASLBindRequest o = (DigestMD5SASLBindRequest)bindRequest; |
| | | if(br == null) |
| | | { |
| | | br = Requests.copyOfDigestMD5SASLBindRequest(o); |
| | | } |
| | | |
| | | DigestMD5SASLBindRequest sbr = (DigestMD5SASLBindRequest)br; |
| | | if (data != null) |
| | | { |
| | | if(o.getAuthenticationID() != null) |
| | | { |
| | | sbr.setAuthenticationID( |
| | | String.format(o.getAuthenticationID(), data)); |
| | | } |
| | | if(o.getAuthorizationID() != null) |
| | | { |
| | | sbr.setAuthorizationID( |
| | | String.format(o.getAuthorizationID(), data)); |
| | | } |
| | | } |
| | | if(successRecentCount.get() * ((float)invalidCredPercent/100) > |
| | | invalidCredRecentCount.get()) |
| | | { |
| | | sbr.setPassword("invalid-password"); |
| | | } |
| | | else |
| | | { |
| | | sbr.setPassword(o.getPassword()); |
| | | } |
| | | } |
| | | else if(bindRequest instanceof CRAMMD5SASLBindRequest) |
| | | { |
| | | CRAMMD5SASLBindRequest o = (CRAMMD5SASLBindRequest)bindRequest; |
| | | if(br == null) |
| | | { |
| | | br = Requests.copyOfCRAMMD5SASLBindRequest(o); |
| | | } |
| | | |
| | | CRAMMD5SASLBindRequest sbr = (CRAMMD5SASLBindRequest)br; |
| | | if (data != null && o.getAuthenticationID() != null) |
| | | { |
| | | sbr.setAuthenticationID( |
| | | String.format(o.getAuthenticationID(), data)); |
| | | } |
| | | if(successRecentCount.get() * ((float)invalidCredPercent/100) > |
| | | invalidCredRecentCount.get()) |
| | | { |
| | | sbr.setPassword("invalid-password"); |
| | | } |
| | | else |
| | | { |
| | | sbr.setPassword(o.getPassword()); |
| | | } |
| | | } |
| | | else if(bindRequest instanceof GSSAPISASLBindRequest) |
| | | { |
| | | GSSAPISASLBindRequest o = (GSSAPISASLBindRequest)bindRequest; |
| | | if(br == null) |
| | | { |
| | | br = Requests.copyOfGSSAPISASLBindRequest(o); |
| | | } |
| | | |
| | | GSSAPISASLBindRequest sbr = (GSSAPISASLBindRequest)br; |
| | | if (data != null) |
| | | { |
| | | if(o.getAuthenticationID() != null) |
| | | { |
| | | sbr.setAuthenticationID( |
| | | String.format(o.getAuthenticationID(), data)); |
| | | } |
| | | if(o.getAuthorizationID() != null) |
| | | { |
| | | sbr.setAuthorizationID( |
| | | String.format(o.getAuthorizationID(), data)); |
| | | } |
| | | } |
| | | if(successRecentCount.get() * ((float)invalidCredPercent/100) > |
| | | invalidCredRecentCount.get()) |
| | | { |
| | | sbr.setPassword("invalid-password"); |
| | | } |
| | | else |
| | | { |
| | | sbr.setPassword(o.getPassword()); |
| | | } |
| | | } |
| | | else if(bindRequest instanceof ExternalSASLBindRequest) |
| | | { |
| | | ExternalSASLBindRequest o = (ExternalSASLBindRequest)bindRequest; |
| | | if(br == null) |
| | | { |
| | | br = Requests.copyOfExternalSASLBindRequest(o); |
| | | } |
| | | |
| | | ExternalSASLBindRequest sbr = (ExternalSASLBindRequest)br; |
| | | if (data != null && o.getAuthorizationID() != null) |
| | | { |
| | | sbr.setAuthorizationID(String.format(o.getAuthorizationID(), data)); |
| | | } |
| | | } |
| | | else if(bindRequest instanceof PlainSASLBindRequest) |
| | | { |
| | | PlainSASLBindRequest o = (PlainSASLBindRequest)bindRequest; |
| | | if(br == null) |
| | | { |
| | | br = Requests.copyOfPlainSASLBindRequest(o); |
| | | } |
| | | |
| | | PlainSASLBindRequest sbr = (PlainSASLBindRequest)br; |
| | | if (data != null) |
| | | { |
| | | if(o.getAuthenticationID() != null) |
| | | { |
| | | sbr.setAuthenticationID( |
| | | String.format(o.getAuthenticationID(), data)); |
| | | } |
| | | if(o.getAuthorizationID() != null) |
| | | { |
| | | sbr.setAuthorizationID( |
| | | String.format(o.getAuthorizationID(), data)); |
| | | } |
| | | } |
| | | if(successRecentCount.get() * ((float)invalidCredPercent/100) > |
| | | invalidCredRecentCount.get()) |
| | | { |
| | | sbr.setPassword("invalid-password"); |
| | | } |
| | | else |
| | | { |
| | | sbr.setPassword(o.getPassword()); |
| | | } |
| | | } |
| | | |
| | | return connection.bind(br, handler); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private String filter; |
| | | |
| | | private String baseDN; |
| | | |
| | | private SearchScope scope; |
| | | |
| | | private DereferenceAliasesPolicy dereferencesAliasesPolicy; |
| | | |
| | | private String[] attributes; |
| | | |
| | | private BindRequest bindRequest; |
| | | |
| | | private int invalidCredPercent; |
| | | |
| | | |
| | | |
| | | private BindPerformanceRunner(final ArgumentParser argParser, |
| | | final ConsoleApplication app) throws ArgumentException |
| | | { |
| | | super(argParser, app, true, true, true); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | StatsThread newStatsThread() |
| | | { |
| | | if(filter != null && baseDN != null) |
| | | { |
| | | return new BindStatsThread(); |
| | | } |
| | | return new StatsThread(new String[0]); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | WorkerThread newWorkerThread(final AsynchronousConnection connection, |
| | | final ConnectionFactory connectionFactory) |
| | | { |
| | | return new BindWorkerThread(connection, connectionFactory); |
| | | } |
| | | } |
| | | /** |
| | | * The main method for SearchRate tool. |
| | | * |
| | | * @param args |
| | | * The command-line arguments provided to this program. |
| | | */ |
| | | |
| | | public static void main(final String[] args) |
| | | { |
| | | final int retCode = mainSearchRate(args, System.in, System.out, System.err); |
| | | System.exit(filterExitCode(retCode)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Parses the provided command-line arguments and uses that information to run |
| | | * the ldapsearch tool. |
| | | * |
| | | * @param args |
| | | * The command-line arguments provided to this program. |
| | | * @return The error code. |
| | | */ |
| | | |
| | | static int mainSearchRate(final String[] args) |
| | | { |
| | | return mainSearchRate(args, System.in, System.out, System.err); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Parses the provided command-line arguments and uses that information to run |
| | | * the ldapsearch tool. |
| | | * |
| | | * @param args |
| | | * The command-line arguments provided to this program. |
| | | * @param inStream |
| | | * The input stream to use for standard input, or <CODE>null</CODE> |
| | | * if standard input is not needed. |
| | | * @param outStream |
| | | * The output stream to use for standard output, or <CODE>null</CODE> |
| | | * if standard output is not needed. |
| | | * @param errStream |
| | | * The output stream to use for standard error, or <CODE>null</CODE> |
| | | * if standard error is not needed. |
| | | * @return The error code. |
| | | */ |
| | | |
| | | static int mainSearchRate(final String[] args, final InputStream inStream, |
| | | final OutputStream outStream, final OutputStream errStream) |
| | | |
| | | { |
| | | return new AuthRate(inStream, outStream, errStream).run(args); |
| | | } |
| | | |
| | | |
| | | |
| | | private BooleanArgument verbose; |
| | | |
| | | |
| | | |
| | | |
| | | private AuthRate(final InputStream in, final OutputStream out, |
| | | final OutputStream err) |
| | | { |
| | | super(in, out, err); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether or not the user has requested advanced mode. |
| | | * |
| | | * @return Returns <code>true</code> if the user has requested advanced mode. |
| | | */ |
| | | @Override |
| | | public boolean isAdvancedMode() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether or not the user has requested interactive behavior. |
| | | * |
| | | * @return Returns <code>true</code> if the user has requested interactive |
| | | * behavior. |
| | | */ |
| | | @Override |
| | | public boolean isInteractive() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether or not this console application is running in its |
| | | * menu-driven mode. This can be used to dictate whether output should go to |
| | | * the error stream or not. In addition, it may also dictate whether or not |
| | | * sub-menus should display a cancel option as well as a quit option. |
| | | * |
| | | * @return Returns <code>true</code> if this console application is running in |
| | | * its menu-driven mode. |
| | | */ |
| | | @Override |
| | | public boolean isMenuDrivenMode() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether or not the user has requested quiet output. |
| | | * |
| | | * @return Returns <code>true</code> if the user has requested quiet output. |
| | | */ |
| | | @Override |
| | | public boolean isQuiet() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether or not the user has requested script-friendly output. |
| | | * |
| | | * @return Returns <code>true</code> if the user has requested script-friendly |
| | | * output. |
| | | */ |
| | | @Override |
| | | public boolean isScriptFriendly() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether or not the user has requested verbose output. |
| | | * |
| | | * @return Returns <code>true</code> if the user has requested verbose output. |
| | | */ |
| | | @Override |
| | | public boolean isVerbose() |
| | | { |
| | | return verbose.isPresent(); |
| | | } |
| | | |
| | | |
| | | |
| | | private int run(final String[] args) |
| | | { |
| | | // Create the command-line argument parser for use with this |
| | | // program. |
| | | final LocalizableMessage toolDescription = |
| | | INFO_AUTHRATE_TOOL_DESCRIPTION.get(); |
| | | final ArgumentParser argParser = new ArgumentParser(AuthRate.class |
| | | .getName(), toolDescription, false, true, 0, 0, |
| | | "[filter format string] [attributes ...]"); |
| | | |
| | | ConnectionFactoryProvider connectionFactoryProvider; |
| | | ConnectionFactory connectionFactory; |
| | | BindPerformanceRunner runner; |
| | | |
| | | StringArgument baseDN; |
| | | MultiChoiceArgument<SearchScope> searchScope; |
| | | MultiChoiceArgument<DereferenceAliasesPolicy> dereferencePolicy; |
| | | BooleanArgument showUsage; |
| | | StringArgument propertiesFileArgument; |
| | | BooleanArgument noPropertiesFileArgument; |
| | | IntegerArgument invalidCredPercent; |
| | | |
| | | try |
| | | { |
| | | if(System.getProperty("org.opends.sdk.ldap.transport.linger") == null) |
| | | { |
| | | System.setProperty("org.opends.sdk.ldap.transport.linger", "0"); |
| | | } |
| | | connectionFactoryProvider = |
| | | new ConnectionFactoryProvider(argParser, this); |
| | | runner = new BindPerformanceRunner(argParser, this); |
| | | |
| | | propertiesFileArgument = new StringArgument("propertiesFilePath", null, |
| | | OPTION_LONG_PROP_FILE_PATH, false, false, true, |
| | | INFO_PROP_FILE_PATH_PLACEHOLDER.get(), null, null, |
| | | INFO_DESCRIPTION_PROP_FILE_PATH.get()); |
| | | argParser.addArgument(propertiesFileArgument); |
| | | argParser.setFilePropertiesArgument(propertiesFileArgument); |
| | | |
| | | noPropertiesFileArgument = new BooleanArgument( |
| | | "noPropertiesFileArgument", null, OPTION_LONG_NO_PROP_FILE, |
| | | INFO_DESCRIPTION_NO_PROP_FILE.get()); |
| | | argParser.addArgument(noPropertiesFileArgument); |
| | | argParser.setNoPropertiesFileArgument(noPropertiesFileArgument); |
| | | |
| | | showUsage = new BooleanArgument("showUsage", OPTION_SHORT_HELP, |
| | | OPTION_LONG_HELP, INFO_DESCRIPTION_SHOWUSAGE.get()); |
| | | argParser.addArgument(showUsage); |
| | | argParser.setUsageArgument(showUsage, getOutputStream()); |
| | | |
| | | baseDN = new StringArgument("baseDN", OPTION_SHORT_BASEDN, |
| | | OPTION_LONG_BASEDN, false, false, true, INFO_BASEDN_PLACEHOLDER.get(), |
| | | null, null, INFO_SEARCHRATE_TOOL_DESCRIPTION_BASEDN.get()); |
| | | baseDN.setPropertyName(OPTION_LONG_BASEDN); |
| | | argParser.addArgument(baseDN); |
| | | |
| | | searchScope = new MultiChoiceArgument<SearchScope>("searchScope", 's', |
| | | "searchScope", false, true, INFO_SEARCH_SCOPE_PLACEHOLDER.get(), |
| | | SearchScope.values(), false, INFO_SEARCH_DESCRIPTION_SEARCH_SCOPE |
| | | .get()); |
| | | searchScope.setPropertyName("searchScope"); |
| | | searchScope.setDefaultValue(SearchScope.WHOLE_SUBTREE); |
| | | argParser.addArgument(searchScope); |
| | | |
| | | dereferencePolicy = new MultiChoiceArgument<DereferenceAliasesPolicy>( |
| | | "derefpolicy", 'a', "dereferencePolicy", false, true, |
| | | INFO_DEREFERENCE_POLICE_PLACEHOLDER.get(), DereferenceAliasesPolicy |
| | | .values(), false, INFO_SEARCH_DESCRIPTION_DEREFERENCE_POLICY |
| | | .get()); |
| | | dereferencePolicy.setPropertyName("dereferencePolicy"); |
| | | dereferencePolicy.setDefaultValue(DereferenceAliasesPolicy.NEVER); |
| | | argParser.addArgument(dereferencePolicy); |
| | | |
| | | invalidCredPercent = new IntegerArgument("invalidPassword", 'I', |
| | | "invalidPassword", false, false, true, LocalizableMessage |
| | | .raw("{invalidPassword}"), 0, null, true, 0, true, 100, |
| | | LocalizableMessage |
| | | .raw("Percent of bind operations with simulated " + |
| | | "invalid password")); |
| | | invalidCredPercent.setPropertyName("invalidPassword"); |
| | | argParser.addArgument(invalidCredPercent); |
| | | |
| | | verbose = new BooleanArgument("verbose", 'v', "verbose", |
| | | INFO_DESCRIPTION_VERBOSE.get()); |
| | | verbose.setPropertyName("verbose"); |
| | | argParser.addArgument(verbose); |
| | | } |
| | | catch (final ArgumentException ae) |
| | | { |
| | | final LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae |
| | | .getMessage()); |
| | | println(message); |
| | | return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue(); |
| | | } |
| | | |
| | | // Parse the command-line arguments provided to this program. |
| | | try |
| | | { |
| | | argParser.parseArguments(args); |
| | | connectionFactory = |
| | | connectionFactoryProvider.getConnectionFactory(); |
| | | runner.validate(); |
| | | |
| | | runner.bindRequest = connectionFactoryProvider.getBindRequest(); |
| | | if(runner.bindRequest == null) |
| | | { |
| | | throw new ArgumentException(LocalizableMessage.raw( |
| | | "Authentication information must be provided to use this tool")); |
| | | } |
| | | } |
| | | catch (final ArgumentException ae) |
| | | { |
| | | final LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae |
| | | .getMessage()); |
| | | println(message); |
| | | println(argParser.getUsageMessage()); |
| | | return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue(); |
| | | } |
| | | |
| | | // If we should just display usage or version information, |
| | | // then print it and exit. |
| | | if (argParser.usageOrVersionDisplayed()) |
| | | { |
| | | return 0; |
| | | } |
| | | |
| | | final List<String> attributes = new LinkedList<String>(); |
| | | final ArrayList<String> filterAndAttributeStrings = argParser |
| | | .getTrailingArguments(); |
| | | if (filterAndAttributeStrings.size() > 0) |
| | | { |
| | | // the list of trailing arguments should be structured as follow: |
| | | // the first trailing argument is |
| | | // considered the filter, the other as attributes. |
| | | runner.filter = filterAndAttributeStrings.remove(0); |
| | | // The rest are attributes |
| | | for (final String s : filterAndAttributeStrings) |
| | | { |
| | | attributes.add(s); |
| | | } |
| | | } |
| | | runner.attributes = attributes.toArray(new String[attributes.size()]); |
| | | runner.baseDN = baseDN.getValue(); |
| | | try |
| | | { |
| | | runner.scope = searchScope.getTypedValue(); |
| | | runner.dereferencesAliasesPolicy = dereferencePolicy.getTypedValue(); |
| | | runner.invalidCredPercent = invalidCredPercent.getIntValue(); |
| | | } |
| | | catch (final ArgumentException ex1) |
| | | { |
| | | println(ex1.getMessageObject()); |
| | | return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue(); |
| | | } |
| | | |
| | | // Try it out to make sure the format string and data sources |
| | | // match. |
| | | final Object[] data = DataSource.generateData(runner.getDataSources(), |
| | | null); |
| | | try |
| | | { |
| | | if(runner.baseDN != null && runner.filter != null) |
| | | { |
| | | String.format(runner.filter, data); |
| | | String.format(runner.baseDN, data); |
| | | } |
| | | } |
| | | catch (final Exception ex1) |
| | | { |
| | | println(LocalizableMessage.raw("Error formatting filter or base DN: " |
| | | + ex1.toString())); |
| | | return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue(); |
| | | } |
| | | |
| | | return runner.run(connectionFactory); |
| | | } |
| | | } |
| | | |
| File was renamed from opendj-sdk/sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package com.sun.opends.sdk.tools; |
| | |
| | | /** |
| | | * A connection factory designed for use with command line tools. |
| | | */ |
| | | final class ArgumentParserConnectionFactory extends AbstractConnectionFactory |
| | | implements ConnectionFactory |
| | | final class ConnectionFactoryProvider |
| | | { |
| | | /** |
| | | * End Of Line. |
| | |
| | | * The Logger. |
| | | */ |
| | | static final Logger LOG = Logger |
| | | .getLogger(ArgumentParserConnectionFactory.class.getName()); |
| | | .getLogger(ConnectionFactoryProvider.class.getName()); |
| | | |
| | | /** |
| | | * The 'hostName' global argument. |
| | |
| | | |
| | | private ConnectionFactory connFactory; |
| | | |
| | | private ConnectionFactory authenticatedConnFactory; |
| | | |
| | | private BindRequest bindRequest = null; |
| | | |
| | | private final ConsoleApplication app; |
| | | |
| | | |
| | | |
| | | public ArgumentParserConnectionFactory(final ArgumentParser argumentParser, |
| | | public ConnectionFactoryProvider(final ArgumentParser argumentParser, |
| | | final ConsoleApplication app) throws ArgumentException |
| | | { |
| | | this(argumentParser, app, "cn=Directory Manager", 389, false); |
| | |
| | | |
| | | |
| | | |
| | | public ArgumentParserConnectionFactory(final ArgumentParser argumentParser, |
| | | public ConnectionFactoryProvider(final ArgumentParser argumentParser, |
| | | final ConsoleApplication app, final String defaultBindDN, |
| | | final int defaultPort, final boolean alwaysSSL) throws ArgumentException |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public FutureResult<AsynchronousConnection> getAsynchronousConnection( |
| | | final ResultHandler<? super AsynchronousConnection> handler) |
| | | public ConnectionFactory getConnectionFactory() throws ArgumentException |
| | | { |
| | | return connFactory.getAsynchronousConnection(handler); |
| | | } |
| | | |
| | | |
| | | |
| | | public void validate() throws ArgumentException |
| | | { |
| | | port = portArg.getIntValue(); |
| | | |
| | | // Couldn't have at the same time bindPassword and bindPasswordFile |
| | | if (bindPasswordArg.isPresent() && bindPasswordFileArg.isPresent()) |
| | | if(connFactory == null) |
| | | { |
| | | final LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get( |
| | | bindPasswordArg.getLongIdentifier(), bindPasswordFileArg |
| | | .getLongIdentifier()); |
| | | throw new ArgumentException(message); |
| | | } |
| | | port = portArg.getIntValue(); |
| | | |
| | | // Couldn't have at the same time trustAll and |
| | | // trustStore related arg |
| | | if (trustAllArg.isPresent() && trustStorePathArg.isPresent()) |
| | | { |
| | | final LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get( |
| | | trustAllArg.getLongIdentifier(), trustStorePathArg |
| | | .getLongIdentifier()); |
| | | throw new ArgumentException(message); |
| | | } |
| | | if (trustAllArg.isPresent() && trustStorePasswordArg.isPresent()) |
| | | { |
| | | final LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get( |
| | | trustAllArg.getLongIdentifier(), trustStorePasswordArg |
| | | .getLongIdentifier()); |
| | | throw new ArgumentException(message); |
| | | } |
| | | if (trustAllArg.isPresent() && trustStorePasswordFileArg.isPresent()) |
| | | { |
| | | final LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get( |
| | | trustAllArg.getLongIdentifier(), trustStorePasswordFileArg |
| | | .getLongIdentifier()); |
| | | throw new ArgumentException(message); |
| | | } |
| | | |
| | | // Couldn't have at the same time trustStorePasswordArg and |
| | | // trustStorePasswordFileArg |
| | | if (trustStorePasswordArg.isPresent() |
| | | && trustStorePasswordFileArg.isPresent()) |
| | | { |
| | | final LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get( |
| | | trustStorePasswordArg.getLongIdentifier(), trustStorePasswordFileArg |
| | | .getLongIdentifier()); |
| | | throw new ArgumentException(message); |
| | | } |
| | | |
| | | if (trustStorePathArg.isPresent()) |
| | | { |
| | | // Check that the path exists and is readable |
| | | final String value = trustStorePathArg.getValue(); |
| | | if (!canRead(trustStorePathArg.getValue())) |
| | | // Couldn't have at the same time bindPassword and bindPasswordFile |
| | | if (bindPasswordArg.isPresent() && bindPasswordFileArg.isPresent()) |
| | | { |
| | | final LocalizableMessage message = ERR_CANNOT_READ_TRUSTSTORE |
| | | .get(value); |
| | | final LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get( |
| | | bindPasswordArg.getLongIdentifier(), bindPasswordFileArg |
| | | .getLongIdentifier()); |
| | | throw new ArgumentException(message); |
| | | } |
| | | } |
| | | |
| | | if (keyStorePathArg.isPresent()) |
| | | { |
| | | // Check that the path exists and is readable |
| | | final String value = keyStorePathArg.getValue(); |
| | | if (!canRead(trustStorePathArg.getValue())) |
| | | // Couldn't have at the same time trustAll and |
| | | // trustStore related arg |
| | | if (trustAllArg.isPresent() && trustStorePathArg.isPresent()) |
| | | { |
| | | final LocalizableMessage message = ERR_CANNOT_READ_KEYSTORE.get(value); |
| | | final LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get( |
| | | trustAllArg.getLongIdentifier(), trustStorePathArg |
| | | .getLongIdentifier()); |
| | | throw new ArgumentException(message); |
| | | } |
| | | } |
| | | |
| | | // Couldn't have at the same time startTLSArg and |
| | | // useSSLArg |
| | | if (useStartTLSArg.isPresent() && useSSLArg.isPresent()) |
| | | { |
| | | final LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get( |
| | | useStartTLSArg.getLongIdentifier(), useSSLArg.getLongIdentifier()); |
| | | throw new ArgumentException(message); |
| | | } |
| | | |
| | | try |
| | | { |
| | | if (useSSLArg.isPresent() || useStartTLSArg.isPresent()) |
| | | if (trustAllArg.isPresent() && trustStorePasswordArg.isPresent()) |
| | | { |
| | | String clientAlias; |
| | | if (certNicknameArg.isPresent()) |
| | | final LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get( |
| | | trustAllArg.getLongIdentifier(), trustStorePasswordArg |
| | | .getLongIdentifier()); |
| | | throw new ArgumentException(message); |
| | | } |
| | | if (trustAllArg.isPresent() && trustStorePasswordFileArg.isPresent()) |
| | | { |
| | | final LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get( |
| | | trustAllArg.getLongIdentifier(), trustStorePasswordFileArg |
| | | .getLongIdentifier()); |
| | | throw new ArgumentException(message); |
| | | } |
| | | |
| | | // Couldn't have at the same time trustStorePasswordArg and |
| | | // trustStorePasswordFileArg |
| | | if (trustStorePasswordArg.isPresent() |
| | | && trustStorePasswordFileArg.isPresent()) |
| | | { |
| | | final LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get( |
| | | trustStorePasswordArg.getLongIdentifier(), trustStorePasswordFileArg |
| | | .getLongIdentifier()); |
| | | throw new ArgumentException(message); |
| | | } |
| | | |
| | | if (trustStorePathArg.isPresent()) |
| | | { |
| | | // Check that the path exists and is readable |
| | | final String value = trustStorePathArg.getValue(); |
| | | if (!canRead(trustStorePathArg.getValue())) |
| | | { |
| | | clientAlias = certNicknameArg.getValue(); |
| | | final LocalizableMessage message = ERR_CANNOT_READ_TRUSTSTORE |
| | | .get(value); |
| | | throw new ArgumentException(message); |
| | | } |
| | | else |
| | | } |
| | | |
| | | if (keyStorePathArg.isPresent()) |
| | | { |
| | | // Check that the path exists and is readable |
| | | final String value = keyStorePathArg.getValue(); |
| | | if (!canRead(trustStorePathArg.getValue())) |
| | | { |
| | | clientAlias = null; |
| | | final LocalizableMessage message = |
| | | ERR_CANNOT_READ_KEYSTORE.get(value); |
| | | throw new ArgumentException(message); |
| | | } |
| | | } |
| | | |
| | | if (sslContext == null) |
| | | // Couldn't have at the same time startTLSArg and |
| | | // useSSLArg |
| | | if (useStartTLSArg.isPresent() && useSSLArg.isPresent()) |
| | | { |
| | | final LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get( |
| | | useStartTLSArg.getLongIdentifier(), useSSLArg.getLongIdentifier()); |
| | | throw new ArgumentException(message); |
| | | } |
| | | |
| | | try |
| | | { |
| | | if (useSSLArg.isPresent() || useStartTLSArg.isPresent()) |
| | | { |
| | | final TrustManager trustManager = getTrustManager(); |
| | | |
| | | X509KeyManager keyManager = null; |
| | | final X509KeyManager akm = getKeyManager(keyStorePathArg.getValue()); |
| | | |
| | | if (akm != null && clientAlias != null) |
| | | String clientAlias; |
| | | if (certNicknameArg.isPresent()) |
| | | { |
| | | keyManager = KeyManagers.useSingleCertificate(clientAlias, akm); |
| | | clientAlias = certNicknameArg.getValue(); |
| | | } |
| | | else |
| | | { |
| | | clientAlias = null; |
| | | } |
| | | |
| | | sslContext = new SSLContextBuilder().setTrustManager(trustManager) |
| | | .setKeyManager(keyManager).getSSLContext(); |
| | | if (sslContext == null) |
| | | { |
| | | final TrustManager trustManager = getTrustManager(); |
| | | |
| | | X509KeyManager keyManager = null; |
| | | final X509KeyManager akm = |
| | | getKeyManager(keyStorePathArg.getValue()); |
| | | |
| | | if (akm != null && clientAlias != null) |
| | | { |
| | | keyManager = KeyManagers.useSingleCertificate(clientAlias, akm); |
| | | } |
| | | |
| | | sslContext = new SSLContextBuilder().setTrustManager(trustManager) |
| | | .setKeyManager(keyManager).getSSLContext(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (final Exception e) |
| | | { |
| | | throw new ArgumentException(ERR_LDAP_CONN_CANNOT_INITIALIZE_SSL.get(e |
| | | .toString()), e); |
| | | } |
| | | catch (final Exception e) |
| | | { |
| | | throw new ArgumentException(ERR_LDAP_CONN_CANNOT_INITIALIZE_SSL.get(e |
| | | .toString()), e); |
| | | } |
| | | |
| | | if (sslContext != null) |
| | | { |
| | | final LDAPOptions options = new LDAPOptions().setSSLContext(sslContext) |
| | | .setUseStartTLS(useStartTLSArg.isPresent()); |
| | | connFactory = new LDAPConnectionFactory(hostNameArg.getValue(), port, |
| | | options); |
| | | if (sslContext != null) |
| | | { |
| | | final LDAPOptions options = new LDAPOptions().setSSLContext(sslContext) |
| | | .setUseStartTLS(useStartTLSArg.isPresent()); |
| | | connFactory = new LDAPConnectionFactory(hostNameArg.getValue(), port, |
| | | options); |
| | | } |
| | | else |
| | | { |
| | | connFactory = new LDAPConnectionFactory(hostNameArg.getValue(), port); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | connFactory = new LDAPConnectionFactory(hostNameArg.getValue(), port); |
| | | } |
| | | |
| | | try |
| | | { |
| | | bindRequest = getBindRequest(); |
| | | } |
| | | catch (final CLIException e) |
| | | { |
| | | throw new ArgumentException(LocalizableMessage |
| | | .raw("Error reading input: " + e.toString())); |
| | | } |
| | | if (bindRequest != null) |
| | | { |
| | | connFactory = new AuthenticatedConnectionFactory(connFactory, bindRequest) |
| | | .setRebindAllowed(true); |
| | | } |
| | | return connFactory; |
| | | } |
| | | |
| | | |
| | | public ConnectionFactory getAuthenticatedConnectionFactory() |
| | | throws ArgumentException |
| | | { |
| | | if(authenticatedConnFactory == null) |
| | | { |
| | | authenticatedConnFactory = getConnectionFactory(); |
| | | BindRequest bindRequest = getBindRequest(); |
| | | if(bindRequest != null) |
| | | { |
| | | authenticatedConnFactory = |
| | | Connections.newAuthenticatedConnectionFactory( |
| | | authenticatedConnFactory, bindRequest); |
| | | } |
| | | } |
| | | return authenticatedConnFactory; |
| | | } |
| | | |
| | | /** |
| | | * Returns <CODE>true</CODE> if we can read on the provided path and |
| | |
| | | |
| | | |
| | | |
| | | private String getAuthID(final String mech) throws CLIException, |
| | | ArgumentException |
| | | private String getAuthID(final String mech) throws ArgumentException |
| | | { |
| | | String value = null; |
| | | for (final String s : saslOptionArg.getValues()) |
| | |
| | | } |
| | | if (value == null && app.isInteractive()) |
| | | { |
| | | value = app.readInput(LocalizableMessage.raw("Authentication ID:"), |
| | | bindNameArg.getDefaultValue() == null ? null : "dn: " |
| | | + bindNameArg.getDefaultValue()); |
| | | try { |
| | | value = app.readInput(LocalizableMessage.raw("Authentication ID:"), |
| | | bindNameArg.getDefaultValue() == null ? null : "dn: " |
| | | + bindNameArg.getDefaultValue()); |
| | | } catch (CLIException e) { |
| | | throw new ArgumentException( |
| | | LocalizableMessage.raw("Unable to read authentication ID"), e); |
| | | } |
| | | } |
| | | if (value == null) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | private String getAuthzID() throws CLIException, ArgumentException |
| | | private String getAuthzID() throws ArgumentException |
| | | { |
| | | String value = null; |
| | | for (final String s : saslOptionArg.getValues()) |
| | |
| | | |
| | | |
| | | |
| | | private String getBindName() throws CLIException |
| | | private String getBindName() throws ArgumentException |
| | | { |
| | | String value = ""; |
| | | if (bindNameArg.isPresent()) |
| | |
| | | } |
| | | else if (app.isInteractive()) |
| | | { |
| | | value = app.readInput(LocalizableMessage.raw("Bind name:"), bindNameArg |
| | | .getDefaultValue() == null ? value : bindNameArg.getDefaultValue()); |
| | | try { |
| | | value = app.readInput(LocalizableMessage.raw("Bind name:"), bindNameArg |
| | | .getDefaultValue() == null ? value : bindNameArg.getDefaultValue()); |
| | | } catch (CLIException e) { |
| | | throw new ArgumentException( |
| | | LocalizableMessage.raw("Unable to read bind name"), e); |
| | | } |
| | | } |
| | | |
| | | return value; |
| | |
| | | |
| | | |
| | | |
| | | private BindRequest getBindRequest() throws CLIException, ArgumentException |
| | | public BindRequest getBindRequest() throws ArgumentException |
| | | { |
| | | String mech = null; |
| | | for (final String s : saslOptionArg.getValues()) |
| | | if(bindRequest == null) |
| | | { |
| | | if (s.startsWith(SASL_PROPERTY_MECH)) |
| | | String mech = null; |
| | | for (final String s : saslOptionArg.getValues()) |
| | | { |
| | | mech = parseSASLOptionValue(s); |
| | | break; |
| | | if (s.startsWith(SASL_PROPERTY_MECH)) |
| | | { |
| | | mech = parseSASLOptionValue(s); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (mech == null) |
| | | { |
| | | if (bindNameArg.isPresent() || bindPasswordFileArg.isPresent() |
| | | || bindPasswordArg.isPresent()) |
| | | if (mech == null) |
| | | { |
| | | return Requests.newSimpleBindRequest(getBindName(), getPassword()); |
| | | if (bindNameArg.isPresent() || bindPasswordFileArg.isPresent() |
| | | || bindPasswordArg.isPresent()) |
| | | { |
| | | bindRequest = |
| | | Requests.newSimpleBindRequest(getBindName(), getPassword()); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | if (mech.equals(DigestMD5SASLBindRequest.SASL_MECHANISM_NAME)) |
| | | { |
| | | return Requests.newDigestMD5SASLBindRequest( |
| | | getAuthID(DigestMD5SASLBindRequest.SASL_MECHANISM_NAME), |
| | | ByteString.valueOf(getPassword())).setAuthorizationID(getAuthzID()) |
| | | .setRealm(getRealm()); |
| | | } |
| | | if (mech.equals(CRAMMD5SASLBindRequest.SASL_MECHANISM_NAME)) |
| | | { |
| | | return Requests.newCRAMMD5SASLBindRequest( |
| | | getAuthID(CRAMMD5SASLBindRequest.SASL_MECHANISM_NAME), ByteString |
| | | .valueOf(getPassword())); |
| | | } |
| | | if (mech.equals(GSSAPISASLBindRequest.SASL_MECHANISM_NAME)) |
| | | { |
| | | return Requests.newGSSAPISASLBindRequest( |
| | | getAuthID(GSSAPISASLBindRequest.SASL_MECHANISM_NAME), |
| | | ByteString.valueOf(getPassword())).setKDCAddress(getKDC()).setRealm( |
| | | getRealm()).setAuthorizationID(getAuthzID()); |
| | | } |
| | | if (mech.equals(ExternalSASLBindRequest.SASL_MECHANISM_NAME)) |
| | | { |
| | | if (sslContext == null) |
| | | else if (mech.equals(DigestMD5SASLBindRequest.SASL_MECHANISM_NAME)) |
| | | { |
| | | final LocalizableMessage message = ERR_TOOL_SASLEXTERNAL_NEEDS_SSL_OR_TLS |
| | | .get(); |
| | | throw new ArgumentException(message); |
| | | bindRequest = Requests.newDigestMD5SASLBindRequest( |
| | | getAuthID(DigestMD5SASLBindRequest.SASL_MECHANISM_NAME), |
| | | ByteString.valueOf(getPassword())).setAuthorizationID(getAuthzID()) |
| | | .setRealm(getRealm()); |
| | | } |
| | | if (!keyStorePathArg.isPresent() && getKeyStore() == null) |
| | | else if (mech.equals(CRAMMD5SASLBindRequest.SASL_MECHANISM_NAME)) |
| | | { |
| | | final LocalizableMessage message = ERR_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE |
| | | .get(); |
| | | throw new ArgumentException(message); |
| | | bindRequest = Requests.newCRAMMD5SASLBindRequest( |
| | | getAuthID(CRAMMD5SASLBindRequest.SASL_MECHANISM_NAME), ByteString |
| | | .valueOf(getPassword())); |
| | | } |
| | | return Requests.newExternalSASLBindRequest().setAuthorizationID( |
| | | getAuthzID()); |
| | | else if (mech.equals(GSSAPISASLBindRequest.SASL_MECHANISM_NAME)) |
| | | { |
| | | bindRequest = Requests.newGSSAPISASLBindRequest( |
| | | getAuthID(GSSAPISASLBindRequest.SASL_MECHANISM_NAME), |
| | | ByteString.valueOf(getPassword())).setKDCAddress(getKDC()).setRealm( |
| | | getRealm()).setAuthorizationID(getAuthzID()); |
| | | } |
| | | else if (mech.equals(ExternalSASLBindRequest.SASL_MECHANISM_NAME)) |
| | | { |
| | | if (sslContext == null) |
| | | { |
| | | final LocalizableMessage message = |
| | | ERR_TOOL_SASLEXTERNAL_NEEDS_SSL_OR_TLS.get(); |
| | | throw new ArgumentException(message); |
| | | } |
| | | if (!keyStorePathArg.isPresent() && getKeyStore() == null) |
| | | { |
| | | final LocalizableMessage message = |
| | | ERR_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE.get(); |
| | | throw new ArgumentException(message); |
| | | } |
| | | bindRequest = Requests.newExternalSASLBindRequest().setAuthorizationID( |
| | | getAuthzID()); |
| | | } |
| | | else if (mech.equals(PlainSASLBindRequest.SASL_MECHANISM_NAME)) |
| | | { |
| | | bindRequest = Requests.newPlainSASLBindRequest( |
| | | getAuthID(PlainSASLBindRequest.SASL_MECHANISM_NAME), |
| | | ByteString.valueOf(getPassword())).setAuthorizationID(getAuthzID()); |
| | | } |
| | | else |
| | | { |
| | | throw new ArgumentException(ERR_LDAPAUTH_UNSUPPORTED_SASL_MECHANISM |
| | | .get(mech)); |
| | | } |
| | | } |
| | | if (mech.equals(PlainSASLBindRequest.SASL_MECHANISM_NAME)) |
| | | { |
| | | return Requests.newPlainSASLBindRequest( |
| | | getAuthID(PlainSASLBindRequest.SASL_MECHANISM_NAME), |
| | | ByteString.valueOf(getPassword())).setAuthorizationID(getAuthzID()); |
| | | } |
| | | |
| | | throw new ArgumentException(ERR_LDAPAUTH_UNSUPPORTED_SASL_MECHANISM |
| | | .get(mech)); |
| | | return bindRequest; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | private String getKDC() throws ArgumentException, CLIException |
| | | private String getKDC() throws ArgumentException |
| | | { |
| | | String value = null; |
| | | for (final String s : saslOptionArg.getValues()) |
| | |
| | | * @return The password stored into the specified file on by the command line |
| | | * argument, or null it if not specified. |
| | | */ |
| | | private String getPassword() throws CLIException |
| | | private String getPassword() throws ArgumentException |
| | | { |
| | | String value = ""; |
| | | if (bindPasswordArg.isPresent()) |
| | |
| | | } |
| | | if (value.length() == 0 && app.isInteractive()) |
| | | { |
| | | value = app.readLineOfInput(LocalizableMessage.raw("Bind Password:")); |
| | | try |
| | | { |
| | | value = app.readLineOfInput(LocalizableMessage.raw("Bind Password:")); |
| | | } |
| | | catch(CLIException e) |
| | | { |
| | | throw new ArgumentException( |
| | | LocalizableMessage.raw("Unable to read password"), e); |
| | | } |
| | | } |
| | | |
| | | return value; |
| | |
| | | |
| | | |
| | | |
| | | private String getRealm() throws ArgumentException, CLIException |
| | | private String getRealm() throws ArgumentException |
| | | { |
| | | String value = null; |
| | | for (final String s : saslOptionArg.getValues()) |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package com.sun.opends.sdk.tools; |
| | |
| | | final ArgumentParser argParser = new ArgumentParser(LDAPCompare.class |
| | | .getName(), toolDescription, false, true, 1, 0, |
| | | "attribute:value [DN ...]"); |
| | | ArgumentParserConnectionFactory connectionFactory; |
| | | ConnectionFactoryProvider connectionFactoryProvider; |
| | | ConnectionFactory connectionFactory; |
| | | |
| | | BooleanArgument continueOnError; |
| | | BooleanArgument noop; |
| | |
| | | |
| | | try |
| | | { |
| | | connectionFactory = new ArgumentParserConnectionFactory(argParser, this); |
| | | connectionFactoryProvider = |
| | | new ConnectionFactoryProvider(argParser, this); |
| | | propertiesFileArgument = new StringArgument("propertiesFilePath", null, |
| | | OPTION_LONG_PROP_FILE_PATH, false, false, true, |
| | | INFO_PROP_FILE_PATH_PLACEHOLDER.get(), null, null, |
| | |
| | | try |
| | | { |
| | | argParser.parseArguments(args); |
| | | connectionFactory.validate(); |
| | | connectionFactory = |
| | | connectionFactoryProvider.getAuthenticatedConnectionFactory(); |
| | | } |
| | | catch (final ArgumentException ae) |
| | | { |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package com.sun.opends.sdk.tools; |
| | |
| | | .get(); |
| | | final ArgumentParser argParser = new ArgumentParser(LDAPModify.class |
| | | .getName(), toolDescription, false); |
| | | ArgumentParserConnectionFactory connectionFactory; |
| | | ConnectionFactoryProvider connectionFactoryProvider; |
| | | ConnectionFactory connectionFactory; |
| | | |
| | | BooleanArgument continueOnError; |
| | | // TODO: Remove this due to new LDIF reader api? |
| | |
| | | |
| | | try |
| | | { |
| | | connectionFactory = new ArgumentParserConnectionFactory(argParser, this); |
| | | connectionFactoryProvider = |
| | | new ConnectionFactoryProvider(argParser, this); |
| | | propertiesFileArgument = new StringArgument("propertiesFilePath", null, |
| | | OPTION_LONG_PROP_FILE_PATH, false, false, true, |
| | | INFO_PROP_FILE_PATH_PLACEHOLDER.get(), null, null, |
| | |
| | | try |
| | | { |
| | | argParser.parseArguments(args); |
| | | connectionFactory.validate(); |
| | | connectionFactory = |
| | | connectionFactoryProvider.getAuthenticatedConnectionFactory(); |
| | | } |
| | | catch (final ArgumentException ae) |
| | | { |
| | |
| | | .get(); |
| | | final ArgumentParser argParser = new ArgumentParser( |
| | | LDAPPasswordModify.class.getName(), toolDescription, false); |
| | | ArgumentParserConnectionFactory connectionFactory; |
| | | ConnectionFactoryProvider connectionFactoryProvider; |
| | | ConnectionFactory connectionFactory; |
| | | |
| | | FileBasedArgument currentPWFile; |
| | | FileBasedArgument newPWFile; |
| | |
| | | |
| | | try |
| | | { |
| | | connectionFactory = new ArgumentParserConnectionFactory(argParser, this); |
| | | connectionFactoryProvider = |
| | | new ConnectionFactoryProvider(argParser, this); |
| | | propertiesFileArgument = new StringArgument("propertiesFilePath", null, |
| | | OPTION_LONG_PROP_FILE_PATH, false, false, true, |
| | | INFO_PROP_FILE_PATH_PLACEHOLDER.get(), null, null, |
| | |
| | | try |
| | | { |
| | | argParser.parseArguments(args); |
| | | connectionFactory.validate(); |
| | | connectionFactory = |
| | | connectionFactoryProvider.getAuthenticatedConnectionFactory(); |
| | | } |
| | | catch (final ArgumentException ae) |
| | | { |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package com.sun.opends.sdk.tools; |
| | |
| | | final ArgumentParser argParser = new ArgumentParser(LDAPSearch.class |
| | | .getName(), toolDescription, false, true, 0, 0, |
| | | "[filter] [attributes ...]"); |
| | | ArgumentParserConnectionFactory connectionFactory; |
| | | ConnectionFactoryProvider connectionFactoryProvider; |
| | | ConnectionFactory connectionFactory; |
| | | |
| | | BooleanArgument countEntries; |
| | | BooleanArgument dontWrap; |
| | |
| | | IntegerArgument sizeLimit; |
| | | try |
| | | { |
| | | connectionFactory = new ArgumentParserConnectionFactory(argParser, this); |
| | | connectionFactoryProvider = |
| | | new ConnectionFactoryProvider(argParser, this); |
| | | final StringArgument propertiesFileArgument = new StringArgument( |
| | | "propertiesFilePath", null, OPTION_LONG_PROP_FILE_PATH, false, false, |
| | | true, INFO_PROP_FILE_PATH_PLACEHOLDER.get(), null, null, |
| | |
| | | try |
| | | { |
| | | argParser.parseArguments(args); |
| | | connectionFactory.validate(); |
| | | connectionFactory = |
| | | connectionFactoryProvider.getAuthenticatedConnectionFactory(); |
| | | } |
| | | catch (final ArgumentException ae) |
| | | { |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package com.sun.opends.sdk.tools; |
| | |
| | | { |
| | | private static final class ModifyPerformanceRunner extends PerformanceRunner |
| | | { |
| | | private final class ModifyWorkerThread extends |
| | | WorkerThread<ResultHandler<Result>> |
| | | private final class ModifyWorkerThread extends WorkerThread |
| | | { |
| | | private ModifyRequest mr; |
| | | private Object[] data; |
| | |
| | | |
| | | |
| | | @Override |
| | | public ResultHandler<Result> getHandler(final long startTime) |
| | | { |
| | | return new UpdateStatsResultHandler<Result>(startTime); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public FutureResult<?> performOperation( |
| | | final AsynchronousConnection connection, |
| | | final ResultHandler<Result> handler, final DataSource[] dataSources) |
| | | final DataSource[] dataSources, long startTime) |
| | | { |
| | | if (dataSources != null) |
| | | { |
| | | data = DataSource.generateData(dataSources, data); |
| | | } |
| | | mr = newModifyRequest(data); |
| | | return connection.modify(mr, handler); |
| | | return connection.modify(mr, |
| | | new UpdateStatsResultHandler<Result>(startTime)); |
| | | } |
| | | |
| | | |
| | |
| | | private ModifyPerformanceRunner(final ArgumentParser argParser, |
| | | final ConsoleApplication app) throws ArgumentException |
| | | { |
| | | super(argParser, app); |
| | | super(argParser, app, false, false, false); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | WorkerThread<?> newWorkerThread(final AsynchronousConnection connection, |
| | | WorkerThread newWorkerThread(final AsynchronousConnection connection, |
| | | final ConnectionFactory connectionFactory) |
| | | { |
| | | return new ModifyWorkerThread(connection, connectionFactory); |
| | |
| | | final ArgumentParser argParser = new ArgumentParser( |
| | | ModRate.class.getName(), toolDescription, false, true, 1, 0, |
| | | "[(attribute:value format string) ...]"); |
| | | ArgumentParserConnectionFactory connectionFactory; |
| | | ConnectionFactoryProvider connectionFactoryProvider; |
| | | ConnectionFactory connectionFactory; |
| | | ModifyPerformanceRunner runner; |
| | | |
| | | BooleanArgument showUsage; |
| | |
| | | { |
| | | System.setProperty("org.opends.sdk.ldap.transport.linger", "0"); |
| | | } |
| | | connectionFactory = new ArgumentParserConnectionFactory(argParser, this); |
| | | connectionFactoryProvider = |
| | | new ConnectionFactoryProvider(argParser, this); |
| | | runner = new ModifyPerformanceRunner(argParser, this); |
| | | propertiesFileArgument = new StringArgument("propertiesFilePath", null, |
| | | OPTION_LONG_PROP_FILE_PATH, false, false, true, |
| | |
| | | try |
| | | { |
| | | argParser.parseArguments(args); |
| | | connectionFactory.validate(); |
| | | connectionFactory = |
| | | connectionFactoryProvider.getAuthenticatedConnectionFactory(); |
| | | runner.validate(); |
| | | } |
| | | catch (final ArgumentException ae) |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package com.sun.opends.sdk.tools; |
| | |
| | | |
| | | /** |
| | | * Worker thread base implementation. |
| | | * |
| | | * @param <R> |
| | | * Type of result handler. |
| | | */ |
| | | abstract class WorkerThread<R extends ResultHandler<?>> extends Thread |
| | | abstract class WorkerThread extends Thread |
| | | { |
| | | private int count; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | public abstract R getHandler(long startTime); |
| | | |
| | | |
| | | |
| | | public abstract FutureResult<?> performOperation( |
| | | AsynchronousConnection connection, R handler, DataSource[] dataSources); |
| | | AsynchronousConnection connection, DataSource[] dataSources, |
| | | long startTime); |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | FutureResult<?> future; |
| | | AsynchronousConnection connection; |
| | | R handler; |
| | | |
| | | final double targetTimeInMS = |
| | | (1.0 / (targetThroughput / |
| | |
| | | long start; |
| | | while (!stopRequested && !(maxIterations > 0 && count >= maxIterations)) |
| | | { |
| | | start = System.nanoTime(); |
| | | handler = getHandler(start); |
| | | |
| | | if (this.connection == null) |
| | | { |
| | | try |
| | |
| | | } |
| | | } |
| | | } |
| | | future = performOperation(connection, handler, dataSources.get()); |
| | | |
| | | start = System.nanoTime(); |
| | | future = performOperation(connection, dataSources.get(), start); |
| | | operationRecentCount.getAndIncrement(); |
| | | count++; |
| | | if (!isAsync) |
| | |
| | | |
| | | private final AtomicInteger operationRecentCount = new AtomicInteger(); |
| | | |
| | | private final AtomicInteger successRecentCount = new AtomicInteger(); |
| | | protected final AtomicInteger successRecentCount = new AtomicInteger(); |
| | | |
| | | private final AtomicInteger failedRecentCount = new AtomicInteger(); |
| | | protected final AtomicInteger failedRecentCount = new AtomicInteger(); |
| | | |
| | | private final AtomicLong waitRecentTime = new AtomicLong(); |
| | | |
| | |
| | | |
| | | |
| | | |
| | | PerformanceRunner(final ArgumentParser argParser, final ConsoleApplication app) |
| | | PerformanceRunner(final ArgumentParser argParser, |
| | | final ConsoleApplication app, |
| | | boolean neverRebind, boolean neverAsynchronous, |
| | | boolean alwaysSingleThreaded) |
| | | throws ArgumentException |
| | | { |
| | | this.app = app; |
| | |
| | | true, 1, false, 0, LocalizableMessage |
| | | .raw("Number of worker threads per connection")); |
| | | numThreadsArgument.setPropertyName("numThreads"); |
| | | argParser.addArgument(numThreadsArgument); |
| | | if(!alwaysSingleThreaded) |
| | | { |
| | | argParser.addArgument(numThreadsArgument); |
| | | } |
| | | else |
| | | { |
| | | numThreadsArgument.addValue("1"); |
| | | } |
| | | |
| | | numConnectionsArgument = new IntegerArgument("numConnections", 'c', |
| | | "numConnections", false, false, true, LocalizableMessage |
| | | .raw("{numConnections}"), 1, null, true, 1, false, 0, |
| | | LocalizableMessage.raw("Number of connections")); |
| | | numThreadsArgument.setPropertyName("numConnections"); |
| | | numConnectionsArgument.setPropertyName("numConnections"); |
| | | argParser.addArgument(numConnectionsArgument); |
| | | |
| | | maxIterationsArgument = new IntegerArgument("maxIterations", 'm', |
| | | "maxIterations", false, false, true, LocalizableMessage |
| | | .raw("{maxIterations}"), 0, null, LocalizableMessage |
| | | .raw("Max iterations, 0 for unlimited")); |
| | | numThreadsArgument.setPropertyName("maxIterations"); |
| | | maxIterationsArgument.setPropertyName("maxIterations"); |
| | | argParser.addArgument(maxIterationsArgument); |
| | | |
| | | statsIntervalArgument = new IntegerArgument("statInterval", 'i', |
| | |
| | | .raw("{statInterval}"), 5, null, true, 1, false, 0, |
| | | LocalizableMessage |
| | | .raw("Display results each specified number of seconds")); |
| | | numThreadsArgument.setPropertyName("statInterval"); |
| | | statsIntervalArgument.setPropertyName("statInterval"); |
| | | argParser.addArgument(statsIntervalArgument); |
| | | |
| | | targetThroughputArgument = new IntegerArgument("targetThroughput", 'M', |
| | |
| | | |
| | | noRebindArgument = new BooleanArgument("noRebind", 'F', "noRebind", |
| | | LocalizableMessage.raw("Keep connections open and don't rebind")); |
| | | keepConnectionsOpen.setPropertyName("noRebind"); |
| | | argParser.addArgument(noRebindArgument); |
| | | noRebindArgument.setPropertyName("noRebind"); |
| | | if(!neverRebind) |
| | | { |
| | | argParser.addArgument(noRebindArgument); |
| | | } |
| | | else |
| | | { |
| | | noRebindArgument.addValue(String.valueOf(true)); |
| | | } |
| | | |
| | | asyncArgument = new BooleanArgument("asynchronous", 'A', "asynchronous", |
| | | LocalizableMessage.raw("Use asynchronous mode and don't " + |
| | | "wait for results before sending the next request")); |
| | | keepConnectionsOpen.setPropertyName("asynchronous"); |
| | | argParser.addArgument(asyncArgument); |
| | | asyncArgument.setPropertyName("asynchronous"); |
| | | if(!neverAsynchronous) |
| | | { |
| | | argParser.addArgument(asyncArgument); |
| | | } |
| | | |
| | | arguments = new StringArgument("argument", 'g', "argument", false, true, |
| | | true, LocalizableMessage.raw("{generator function or static string}"), |
| | |
| | | |
| | | |
| | | |
| | | abstract WorkerThread<?> newWorkerThread(AsynchronousConnection connection, |
| | | abstract WorkerThread newWorkerThread(AsynchronousConnection connection, |
| | | ConnectionFactory connectionFactory); |
| | | |
| | | |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package com.sun.opends.sdk.tools; |
| | |
| | | |
| | | private final class SearchStatsThread extends StatsThread |
| | | { |
| | | private long totalEntryCount; |
| | | |
| | | private final String[] extraColumn; |
| | | |
| | | |
| | |
| | | String[] getAdditionalColumns() |
| | | { |
| | | final int entryCount = entryRecentCount.getAndSet(0); |
| | | totalEntryCount += entryCount; |
| | | if (successCount > 0) |
| | | { |
| | | extraColumn[0] = String.format("%.1f", (double) entryCount |
| | |
| | | |
| | | |
| | | |
| | | private final class SearchWorkerThread extends |
| | | WorkerThread<SearchStatsHandler> |
| | | private final class SearchWorkerThread extends WorkerThread |
| | | { |
| | | private SearchRequest sr; |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | public SearchStatsHandler getHandler(final long startTime) |
| | | { |
| | | return new SearchStatsHandler(startTime); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public FutureResult<?> performOperation( |
| | | final AsynchronousConnection connection, |
| | | final SearchStatsHandler handler, final DataSource[] dataSources) |
| | | final DataSource[] dataSources, final long startTime) |
| | | { |
| | | if (sr == null) |
| | | { |
| | |
| | | sr.setFilter(String.format(filter, data)); |
| | | sr.setName(String.format(baseDN, data)); |
| | | } |
| | | return connection.search(sr, handler); |
| | | return connection.search(sr, new SearchStatsHandler(startTime)); |
| | | } |
| | | } |
| | | |
| | |
| | | private SearchPerformanceRunner(final ArgumentParser argParser, |
| | | final ConsoleApplication app) throws ArgumentException |
| | | { |
| | | super(argParser, app); |
| | | super(argParser, app, false, false, false); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | WorkerThread<?> newWorkerThread(final AsynchronousConnection connection, |
| | | WorkerThread newWorkerThread(final AsynchronousConnection connection, |
| | | final ConnectionFactory connectionFactory) |
| | | { |
| | | return new SearchWorkerThread(connection, connectionFactory); |
| | |
| | | .getName(), toolDescription, false, true, 1, 0, |
| | | "[filter format string] [attributes ...]"); |
| | | |
| | | ArgumentParserConnectionFactory connectionFactory; |
| | | ConnectionFactoryProvider connectionFactoryProvider; |
| | | ConnectionFactory connectionFactory; |
| | | SearchPerformanceRunner runner; |
| | | |
| | | StringArgument baseDN; |
| | |
| | | { |
| | | System.setProperty("org.opends.sdk.ldap.transport.linger", "0"); |
| | | } |
| | | connectionFactory = new ArgumentParserConnectionFactory(argParser, this); |
| | | connectionFactoryProvider = |
| | | new ConnectionFactoryProvider(argParser, this); |
| | | runner = new SearchPerformanceRunner(argParser, this); |
| | | |
| | | propertiesFileArgument = new StringArgument("propertiesFilePath", null, |
| | |
| | | try |
| | | { |
| | | argParser.parseArguments(args); |
| | | connectionFactory.validate(); |
| | | connectionFactory = |
| | | connectionFactoryProvider.getAuthenticatedConnectionFactory(); |
| | | runner.validate(); |
| | | } |
| | | catch (final ArgumentException ae) |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk; |
| | | |
| | | |
| | | |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import javax.net.ssl.SSLContext; |
| | |
| | | /** |
| | | * The list of cipher suite |
| | | */ |
| | | private String[] enabledCipherSuites = null; |
| | | private List<String> enabledCipherSuites = new LinkedList<String>(); |
| | | |
| | | /** |
| | | * the list of protocols |
| | | */ |
| | | private String[] enabledProtocols = null; |
| | | private List<String> enabledProtocols = new LinkedList<String>(); |
| | | |
| | | |
| | | |
| | |
| | | this.timeoutInMillis = options.timeoutInMillis; |
| | | this.useStartTLS = options.useStartTLS; |
| | | this.decodeOptions = new DecodeOptions(options.decodeOptions); |
| | | this.enabledCipherSuites = options.enabledCipherSuites; |
| | | this.enabledProtocols = options.enabledProtocols; |
| | | this.enabledCipherSuites.addAll(options.getEnabledCipherSuites()); |
| | | this.enabledProtocols.addAll(options.getEnabledProtocols()); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * Set the protocol versions enabled for secure connections with the |
| | | * Adds the protocol versions enabled for secure connections with the |
| | | * Directory Server. |
| | | * |
| | | * The protocols must be supported by the SSLContext specified in |
| | |
| | | * this method, only the protocols listed in the protocols parameter are |
| | | * enabled for use. |
| | | * |
| | | * @param protocols Names of all the protocols to enable or {@code null} to |
| | | * use the default protocols. |
| | | * @param protocols Names of all the protocols to enable. |
| | | * @return A reference to this LDAP connection options. |
| | | */ |
| | | public final LDAPOptions setEnabledProtocols(String[] protocols) |
| | | public final LDAPOptions addEnabledProtocol(String... protocols) |
| | | { |
| | | this.enabledProtocols = protocols; |
| | | for (final String protocol : protocols) |
| | | { |
| | | this.enabledProtocols.add(Validator.ensureNotNull(protocol)); |
| | | } |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * Set the cipher suites enabled for secure connections with the |
| | | * Adds the cipher suites enabled for secure connections with the |
| | | * Directory Server. |
| | | * |
| | | * The suites must be supported by the SSLContext specified in |
| | |
| | | * this method, only the suites listed in the protocols parameter are |
| | | * enabled for use. |
| | | * |
| | | * @param suites Names of all the suites to enable or {@code null} to |
| | | * use the default cipher suites. |
| | | * @param suites Names of all the suites to enable. |
| | | * @return A reference to this LDAP connection options. |
| | | */ |
| | | public final LDAPOptions setEnabledCipherSuites(String[] suites) |
| | | public final LDAPOptions addEnabledCipherSuite(String... suites) |
| | | { |
| | | this.enabledCipherSuites = suites; |
| | | for (final String suite : suites) |
| | | { |
| | | this.enabledCipherSuites.add(Validator.ensureNotNull(suite)); |
| | | } |
| | | return this; |
| | | } |
| | | |
| | |
| | | * Returns the names of the protocol versions which are currently enabled |
| | | * for secure connections with the Directory Server. |
| | | * |
| | | * @return an array of protocols or {@code null} if the default protocols |
| | | * @return an array of protocols or empty set if the default protocols |
| | | * are to be used. |
| | | */ |
| | | public final String[] getEnabledProtocols() |
| | | public final List<String> getEnabledProtocols() |
| | | { |
| | | return this.enabledProtocols; |
| | | } |
| | |
| | | * Returns the names of the protocol versions which are currently enabled |
| | | * for secure connections with the Directory Server. |
| | | * |
| | | * @return an array of protocols or {@code null} if the default protocols |
| | | * @return an array of protocols or empty set if the default protocols |
| | | * are to be used. |
| | | */ |
| | | public final String[] getEnabledCipherSuites() |
| | | public final List<String> getEnabledCipherSuites() |
| | | { |
| | | return this.enabledCipherSuites; |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new abandon request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param abandonRequest |
| | | * The abandon request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code abandonRequest} was {@code null} . |
| | | */ |
| | | AbandonRequestImpl(final AbandonRequest abandonRequest) |
| | | { |
| | | super(abandonRequest); |
| | | this.requestID = abandonRequest.getRequestID(); |
| | | } |
| | | |
| | | |
| | | |
| | | public int getRequestID() |
| | | { |
| | | return requestID; |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new abstract bind request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param bindRequest |
| | | * The bind request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code bindRequest} was {@code null} . |
| | | */ |
| | | protected AbstractBindRequest(BindRequest bindRequest) |
| | | { |
| | | super(bindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public abstract String getName(); |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new extended request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param extendedRequest |
| | | * The extended request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code extendedRequest} was {@code null} . |
| | | */ |
| | | protected AbstractExtendedRequest(ExtendedRequest extendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(extendedRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public abstract String getOID(); |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new abstract request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param request |
| | | * The request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code request} was {@code null} . |
| | | */ |
| | | AbstractRequestImpl(Request request) throws NullPointerException |
| | | { |
| | | Validator.ensureNotNull(request); |
| | | controls.addAll(request.getControls()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public final R addControl(final Control control) throws NullPointerException |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | abstract class AbstractSASLBindRequest<R extends SASLBindRequest> extends |
| | | AbstractBindRequest<R> implements SASLBindRequest |
| | | { |
| | | |
| | | AbstractSASLBindRequest() |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | AbstractSASLBindRequest(SASLBindRequest saslBindRequest) |
| | | { |
| | | super(saslBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | public final byte getAuthenticationType() |
| | | { |
| | | return TYPE_AUTHENTICATION_SASL; |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.ByteString; |
| | | import org.opends.sdk.responses.ExtendedResult; |
| | | import org.opends.sdk.responses.ExtendedResultDecoder; |
| | | |
| | | /** |
| | | * An abstract unmodifiable Extended request which can be used as the basis for |
| | | * implementing new unmodifiable Extended operations. |
| | | * |
| | | * @param <R> |
| | | * The type of extended request. |
| | | * @param <S> |
| | | * The type of result. |
| | | */ |
| | | abstract class |
| | | AbstractUnmodifiableExtendedRequest<R extends ExtendedRequest<S>, |
| | | S extends ExtendedResult> |
| | | extends AbstractUnmodifiableRequest<R> |
| | | implements ExtendedRequest<S> |
| | | { |
| | | AbstractUnmodifiableExtendedRequest(R impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | public final String getOID() { |
| | | return impl.getOID(); |
| | | } |
| | | |
| | | public final ExtendedResultDecoder<S> getResultDecoder() { |
| | | return impl.getResultDecoder(); |
| | | } |
| | | |
| | | public final ByteString getValue() { |
| | | return impl.getValue(); |
| | | } |
| | | |
| | | public final boolean hasValue() { |
| | | return impl.hasValue(); |
| | | } |
| | | } |
| File was renamed from opendj-sdk/sdk/src/org/opends/sdk/requests/AbstractUnmodifiableRequestImpl.java |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | * @param <R> |
| | | * The type of request. |
| | | */ |
| | | abstract class AbstractUnmodifiableRequestImpl<R extends Request> implements |
| | | abstract class AbstractUnmodifiableRequest<R extends Request> implements |
| | | Request |
| | | { |
| | | |
| | | private final R impl; |
| | | protected final R impl; |
| | | |
| | | |
| | | |
| | |
| | | * @param impl |
| | | * The underlying request implementation to be made unmodifiable. |
| | | */ |
| | | AbstractUnmodifiableRequestImpl(final R impl) |
| | | AbstractUnmodifiableRequest(final R impl) |
| | | { |
| | | this.impl = impl; |
| | | } |
copy from opendj-sdk/sdk/examples/org/opends/sdk/examples/package-info.java
copy to opendj-sdk/sdk/src/org/opends/sdk/requests/AbstractUnmodifiableSASLBindRequest.java
| File was copied from opendj-sdk/sdk/examples/org/opends/sdk/examples/package-info.java |
| | |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | /** |
| | | * Examples which use the OpenDS LDAP SDK. |
| | | * An abstract unmodifiable SASL Bind request which can be used as the basis for |
| | | * implementing new unmodifiable SASL authentication methods. |
| | | * |
| | | * @param <R> |
| | | * The type of SASL Bind request. |
| | | */ |
| | | package org.opends.sdk.examples; |
| | | abstract class AbstractUnmodifiableSASLBindRequest |
| | | <R extends SASLBindRequest> extends |
| | | AbstractUnmodifiableBindRequest<R> implements SASLBindRequest |
| | | { |
| | | |
| | | AbstractUnmodifiableSASLBindRequest(R impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String getSASLMechanism() { |
| | | return impl.getSASLMechanism(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.ErrorResultException; |
| | | |
| | | /** |
| | | * An abstract unmodifiable Bind request which can be used as the basis for |
| | | * implementing new unmodifiable authentication methods. |
| | | * |
| | | * @param <R> |
| | | * The type of Bind request. |
| | | */ |
| | | abstract class AbstractUnmodifiableBindRequest<R extends BindRequest> extends |
| | | AbstractUnmodifiableRequest<R> implements BindRequest { |
| | | |
| | | AbstractUnmodifiableBindRequest(R impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | public BindClient createBindClient(String serverName) |
| | | throws ErrorResultException { |
| | | return impl.createBindClient(serverName); |
| | | } |
| | | |
| | | public byte getAuthenticationType() { |
| | | return impl.getAuthenticationType(); |
| | | } |
| | | |
| | | public String getName() { |
| | | return impl.getName(); |
| | | } |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new add request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param addRequest |
| | | * The add request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code addRequest} was {@code null} . |
| | | */ |
| | | AddRequestImpl(final AddRequest addRequest) throws NullPointerException |
| | | { |
| | | super(addRequest); |
| | | this.entry = new LinkedHashMapEntry(addRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public <R, P> R accept(final ChangeRecordVisitor<R, P> v, final P p) |
| | |
| | | |
| | | import org.opends.sdk.DecodeException; |
| | | import org.opends.sdk.DecodeOptions; |
| | | import org.opends.sdk.ErrorResultException; |
| | | import org.opends.sdk.controls.Control; |
| | | import org.opends.sdk.controls.ControlDecoder; |
| | | |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | BindClient createBindClient(String serverName); |
| | | BindClient createBindClient(String serverName) throws ErrorResultException; |
| | | |
| | | |
| | | |
| | |
| | | * The trace information, which has no semantic value, and can be |
| | | * used by administrators in order to identify the user. |
| | | * @return This bind request. |
| | | * @throws UnsupportedOperationException |
| | | * If this anonymous SASL request does not permit the trace |
| | | * information to be set. |
| | | * @throws NullPointerException |
| | | * If {@code traceString} was {@code null}. |
| | | */ |
| | | AnonymousSASLBindRequest setTraceString(String traceString) |
| | | throws NullPointerException; |
| | | throws UnsupportedOperationException, NullPointerException; |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new anonymous SASL bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param anonymousSASLBindRequest |
| | | * The anonymous SASL bind request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code anonymousSASLBindRequest} was {@code null} . |
| | | */ |
| | | AnonymousSASLBindRequestImpl( |
| | | final AnonymousSASLBindRequest anonymousSASLBindRequest) |
| | | { |
| | | super(anonymousSASLBindRequest); |
| | | this.traceString = anonymousSASLBindRequest.getTraceString(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public BindClient createBindClient(final String serverName) |
| | |
| | | * |
| | | * @param authenticationID |
| | | * The authentication ID of the user. |
| | | * @return This bind request. |
| | | * @return This bind request |
| | | * @throws UnsupportedOperationException |
| | | * If this bind request does not permit the authentication ID to be |
| | | * set.. |
| | | * @throws LocalizedIllegalArgumentException |
| | | * If {@code authenticationID} was non-empty and did not contain a |
| | | * valid authorization ID type. |
| | |
| | | * If {@code authenticationID} was {@code null}. |
| | | */ |
| | | CRAMMD5SASLBindRequest setAuthenticationID(String authenticationID) |
| | | throws LocalizedIllegalArgumentException, NullPointerException; |
| | | throws UnsupportedOperationException, LocalizedIllegalArgumentException, |
| | | NullPointerException; |
| | | |
| | | |
| | | |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new CRAM MD5 SASL bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param cramMD5SASLBindRequest |
| | | * The CRAM MD5 SASL bind request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code cramMD5SASLBindRequest} was {@code null} . |
| | | */ |
| | | CRAMMD5SASLBindRequestImpl( |
| | | final CRAMMD5SASLBindRequest cramMD5SASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(cramMD5SASLBindRequest); |
| | | this.authenticationID = cramMD5SASLBindRequest.getAuthenticationID(); |
| | | this.password = cramMD5SASLBindRequest.getPassword(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public BindClient createBindClient(final String serverName) |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new cancel extended request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param cancelExtendedRequest |
| | | * The cancel extended request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code cancelExtendedRequest} was {@code null} . |
| | | */ |
| | | CancelExtendedRequestImpl(final CancelExtendedRequest cancelExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(cancelExtendedRequest); |
| | | this.requestID = cancelExtendedRequest.getRequestID(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public int getRequestID() |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new compare request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param compareRequest |
| | | * The compare request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code compareRequest} was {@code null} . |
| | | */ |
| | | CompareRequestImpl(final CompareRequest compareRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(compareRequest); |
| | | this.name = compareRequest.getName(); |
| | | this.attributeDescription = compareRequest.getAttributeDescription(); |
| | | this.assertionValue = compareRequest.getAssertionValue(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public ByteString getAssertionValue() |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new delete request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param deleteRequest |
| | | * The add request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code addRequest} was {@code null} . |
| | | */ |
| | | DeleteRequestImpl(final DeleteRequest deleteRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(deleteRequest); |
| | | this.name = deleteRequest.getName(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public <R, P> R accept(final ChangeRecordVisitor<R, P> v, final P p) |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new digest MD5 SASL bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param digestMD5SASLBindRequest |
| | | * The digest MD5 SASL bind request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code digestMD5SASLBindRequest} was {@code null} . |
| | | */ |
| | | DigestMD5SASLBindRequestImpl( |
| | | final DigestMD5SASLBindRequest digestMD5SASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(digestMD5SASLBindRequest); |
| | | this.additionalAuthParams.putAll( |
| | | digestMD5SASLBindRequest.getAdditionalAuthParams()); |
| | | this.qopValues.addAll(digestMD5SASLBindRequest.getQOPs()); |
| | | this.cipher = digestMD5SASLBindRequest.getCipher(); |
| | | |
| | | this.serverAuth = digestMD5SASLBindRequest.isServerAuth(); |
| | | this.maxReceiveBufferSize = |
| | | digestMD5SASLBindRequest.getMaxReceiveBufferSize(); |
| | | this.maxSendBufferSize = digestMD5SASLBindRequest.getMaxSendBufferSize(); |
| | | |
| | | this.authenticationID = digestMD5SASLBindRequest.getAuthenticationID(); |
| | | this.authorizationID = digestMD5SASLBindRequest.getAuthorizationID(); |
| | | this.password = digestMD5SASLBindRequest.getPassword(); |
| | | this.realm = digestMD5SASLBindRequest.getRealm(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | |
| | | * The desired authorization ID of the user, which may be {@code |
| | | * null}. |
| | | * @return This bind request. |
| | | * @throws UnsupportedOperationException |
| | | * If this external SASL request does not permit the authorization |
| | | * ID to be set. |
| | | * @throws LocalizedIllegalArgumentException |
| | | * If {@code authorizationID} was non-empty and did not contain a |
| | | * valid authorization ID type. |
| | | */ |
| | | ExternalSASLBindRequest setAuthorizationID(String authorizationID) |
| | | throws LocalizedIllegalArgumentException; |
| | | throws UnsupportedOperationException, LocalizedIllegalArgumentException; |
| | | |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new external SASL bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param externalSASLBindRequest |
| | | * The external SASL bind request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code externalSASLBindRequest} was {@code null} . |
| | | */ |
| | | ExternalSASLBindRequestImpl( |
| | | final ExternalSASLBindRequest externalSASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(externalSASLBindRequest); |
| | | this.authorizationID = externalSASLBindRequest.getAuthorizationID(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public BindClient createBindClient(final String serverName) |
| | |
| | | * @param subject |
| | | * The Kerberos subject of the user to be authenticated. |
| | | * @return This bind request. |
| | | * @throws UnsupportedOperationException |
| | | * If this bind request does not permit the Kerberos subject to be |
| | | * set. |
| | | * @throws NullPointerException |
| | | * If {@code subject} was {@code null}. |
| | | */ |
| | | GSSAPISASLBindRequest setSubject(Subject subject) throws NullPointerException; |
| | | GSSAPISASLBindRequest setSubject(Subject subject) |
| | | throws UnsupportedOperationException, NullPointerException; |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new GSSAPI SASL bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param gssapiSASLBindRequest |
| | | * The GSSAPI SASL bind request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code gssAPISASLBindRequest} was {@code null}. |
| | | */ |
| | | GSSAPISASLBindRequestImpl( |
| | | final GSSAPISASLBindRequest gssapiSASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(gssapiSASLBindRequest); |
| | | this.subject = gssapiSASLBindRequest.getSubject(); |
| | | |
| | | this.authenticationID = gssapiSASLBindRequest.getAuthenticationID(); |
| | | this.password = gssapiSASLBindRequest.getPassword(); |
| | | this.realm = gssapiSASLBindRequest.getRealm(); |
| | | |
| | | this.kdcAddress = gssapiSASLBindRequest.getKDCAddress(); |
| | | |
| | | this.authorizationID = gssapiSASLBindRequest.getAuthorizationID(); |
| | | |
| | | this.additionalAuthParams.putAll( |
| | | gssapiSASLBindRequest.getAdditionalAuthParams()); |
| | | this.qopValues.addAll(gssapiSASLBindRequest.getQOPs()); |
| | | |
| | | this.serverAuth = gssapiSASLBindRequest.isServerAuth(); |
| | | this.maxReceiveBufferSize = gssapiSASLBindRequest.getMaxReceiveBufferSize(); |
| | | this.maxSendBufferSize = gssapiSASLBindRequest.getMaxSendBufferSize(); |
| | | } |
| | | |
| | | |
| | | |
| | | GSSAPISASLBindRequestImpl(final Subject subject) |
| | | { |
| | | Validator.ensureNotNull(subject); |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new generic bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param genericBindRequest |
| | | * The generic bind request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code genericBindRequest} was {@code null} . |
| | | */ |
| | | GenericBindRequestImpl( |
| | | final GenericBindRequest genericBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(genericBindRequest); |
| | | this.name = genericBindRequest.getName(); |
| | | this.authenticationType = genericBindRequest.getAuthenticationType(); |
| | | this.authenticationValue = genericBindRequest.getAuthenticationValue(); |
| | | this.bindClient = null; // Create a new bind client each time. |
| | | } |
| | | |
| | | |
| | | |
| | | public BindClient createBindClient(final String serverName) |
| | | throws ErrorResultException |
| | | { |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new generic extended request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param genericExtendedRequest |
| | | * The generic extended request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code extendedRequest} was {@code null} . |
| | | */ |
| | | protected GenericExtendedRequestImpl( |
| | | GenericExtendedRequest genericExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(genericExtendedRequest); |
| | | this.requestName = genericExtendedRequest.getOID(); |
| | | this.requestValue = genericExtendedRequest.getValue(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new modify DN request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param modifyDNRequest |
| | | * The modify DN request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code modifyDNRequest} was {@code null} . |
| | | */ |
| | | ModifyDNRequestImpl(final ModifyDNRequest modifyDNRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(modifyDNRequest); |
| | | this.name = modifyDNRequest.getName(); |
| | | this.newSuperior = modifyDNRequest.getNewSuperior(); |
| | | this.newRDN = modifyDNRequest.getNewRDN(); |
| | | this.deleteOldRDN = modifyDNRequest.isDeleteOldRDN(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public <R, P> R accept(final ChangeRecordVisitor<R, P> v, final P p) |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new modify request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param modifyRequest |
| | | * The modify request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code modifyRequest} was {@code null} . |
| | | */ |
| | | ModifyRequestImpl(final ModifyRequest modifyRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(modifyRequest); |
| | | this.name = modifyRequest.getName(); |
| | | this.changes.addAll(modifyRequest.getModifications()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public <R, P> R accept(final ChangeRecordVisitor<R, P> v, final P p) |
| | |
| | | * The desired password for the user, or {@code null} if a new |
| | | * password should be generated. |
| | | * @return This password modify request. |
| | | * @throws UnsupportedOperationException |
| | | * If this password modify extended request does not permit the new |
| | | * password to be set. |
| | | */ |
| | | PasswordModifyExtendedRequest setNewPassword(ByteString newPassword); |
| | | PasswordModifyExtendedRequest setNewPassword(ByteString newPassword) |
| | | throws UnsupportedOperationException; |
| | | |
| | | |
| | | |
| | |
| | | * The desired password for the user, or {@code null} if a new |
| | | * password should be generated. |
| | | * @return This password modify request. |
| | | * @throws UnsupportedOperationException |
| | | * If this password modify extended request does not permit the new |
| | | * password to be set. |
| | | */ |
| | | PasswordModifyExtendedRequest setNewPassword(String newPassword); |
| | | PasswordModifyExtendedRequest setNewPassword(String newPassword) |
| | | throws UnsupportedOperationException; |
| | | |
| | | |
| | | |
| | |
| | | * The current password for the user, or {@code null} if the password |
| | | * is not known. |
| | | * @return This password modify request. |
| | | * @throws UnsupportedOperationException |
| | | * If this password modify extended request does not permit the old |
| | | * password to be set. |
| | | */ |
| | | PasswordModifyExtendedRequest setOldPassword(ByteString oldPassword); |
| | | PasswordModifyExtendedRequest setOldPassword(ByteString oldPassword) |
| | | throws UnsupportedOperationException; |
| | | |
| | | |
| | | |
| | |
| | | * The current password for the user, or {@code null} if the password |
| | | * is not known. |
| | | * @return This password modify request. |
| | | * @throws UnsupportedOperationException |
| | | * If this password modify extended request does not permit the old |
| | | * password to be set. |
| | | */ |
| | | PasswordModifyExtendedRequest setOldPassword(String oldPassword); |
| | | PasswordModifyExtendedRequest setOldPassword(String oldPassword) |
| | | throws UnsupportedOperationException; |
| | | |
| | | |
| | | |
| | |
| | | * {@code null} if the request should be applied to the user |
| | | * currently associated with the session. |
| | | * @return This password modify request. |
| | | * @throws UnsupportedOperationException |
| | | * If this password modify extended request does not permit the user |
| | | * identity to be set. |
| | | */ |
| | | PasswordModifyExtendedRequest setUserIdentity(ByteString userIdentity); |
| | | PasswordModifyExtendedRequest setUserIdentity(ByteString userIdentity) |
| | | throws UnsupportedOperationException; |
| | | |
| | | |
| | | |
| | |
| | | * {@code null} if the request should be applied to the user |
| | | * currently associated with the session. |
| | | * @return This password modify request. |
| | | * @throws UnsupportedOperationException |
| | | * If this password modify extended request does not permit the user |
| | | * identity to be set. |
| | | */ |
| | | PasswordModifyExtendedRequest setUserIdentity(String userIdentity); |
| | | PasswordModifyExtendedRequest setUserIdentity(String userIdentity) |
| | | throws UnsupportedOperationException; |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new password modify extended request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param passwordModifyExtendedRequest |
| | | * The password modify extended request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code passwordModifyExtendedRequest} was {@code null} . |
| | | */ |
| | | PasswordModifyExtendedRequestImpl( |
| | | final PasswordModifyExtendedRequest passwordModifyExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(passwordModifyExtendedRequest); |
| | | this.userIdentity = passwordModifyExtendedRequest.getUserIdentity(); |
| | | this.oldPassword = passwordModifyExtendedRequest.getOldPassword(); |
| | | this.newPassword = passwordModifyExtendedRequest.getNewPassword(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public ByteString getNewPassword() |
| | |
| | | * @param authenticationID |
| | | * The authentication ID of the user. |
| | | * @return This bind request. |
| | | * @throws UnsupportedOperationException |
| | | * If this bind request does not permit the authentication ID to be |
| | | * set. |
| | | * @throws LocalizedIllegalArgumentException |
| | | * If {@code authenticationID} was non-empty and did not contain a |
| | | * valid authorization ID type. |
| | |
| | | * If {@code authenticationID} was {@code null}. |
| | | */ |
| | | PlainSASLBindRequest setAuthenticationID(String authenticationID) |
| | | throws LocalizedIllegalArgumentException, NullPointerException; |
| | | throws UnsupportedOperationException, LocalizedIllegalArgumentException, |
| | | NullPointerException; |
| | | |
| | | |
| | | |
| | |
| | | * @param authorizationID |
| | | * The authorization ID of the user, which may be {@code null}. |
| | | * @return This bind request. |
| | | * @throws UnsupportedOperationException |
| | | * If this bind request does not permit the authorization ID to be |
| | | * set. |
| | | * @throws LocalizedIllegalArgumentException |
| | | * If {@code authorizationID} was non-empty and did not contain a |
| | | * valid authorization ID type. |
| | | */ |
| | | PlainSASLBindRequest setAuthorizationID(String authorizationID) |
| | | throws LocalizedIllegalArgumentException; |
| | | throws UnsupportedOperationException, LocalizedIllegalArgumentException; |
| | | |
| | | |
| | | |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new plain SASL bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param plainSASLBindRequest |
| | | * The plain SASL bind request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code plainSASLBindRequest} was {@code null} . |
| | | */ |
| | | PlainSASLBindRequestImpl( |
| | | final PlainSASLBindRequest plainSASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(plainSASLBindRequest); |
| | | this.authenticationID = plainSASLBindRequest.getAuthenticationID(); |
| | | this.authorizationID = plainSASLBindRequest.getAuthorizationID(); |
| | | this.password = plainSASLBindRequest.getPassword(); |
| | | } |
| | | |
| | | |
| | | |
| | | public BindClient createBindClient(final String serverName) |
| | | throws ErrorResultException |
| | | { |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | * TODO: update request from persistent search result. |
| | | * <p> |
| | | * TODO: synchronized requests? |
| | | * <p> |
| | | * TODO: copy constructors. |
| | | */ |
| | | public final class Requests |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable abandon request of the provided request. |
| | | * |
| | | * @param abandonRequest |
| | | * The abandon request to be copied. |
| | | * @return The new abandon request. |
| | | * @throws NullPointerException |
| | | * If {@code abandonRequest} was {@code null} |
| | | */ |
| | | public static AbandonRequest unmodifiableAbandonRequest( |
| | | final AbandonRequest abandonRequest) throws NullPointerException |
| | | { |
| | | return new UnmodifiableAbandonRequestImpl(abandonRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable add request of the provided request. |
| | | * |
| | | * @param addRequest |
| | | * The add request to be copied. |
| | | * @return The new add request. |
| | | * @throws NullPointerException |
| | | * If {@code addRequest} was {@code null} . |
| | | */ |
| | | public static AddRequest unmodifiableAddRequest(final AddRequest addRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableAddRequestImpl(addRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable anonymous SASL bind request of the provided request. |
| | | * |
| | | * @param anonymousSASLBindRequest |
| | | * The anonymous SASL bind request to be copied. |
| | | * @return The new anonymous SASL bind request. |
| | | * @throws NullPointerException |
| | | * If {@code anonymousSASLBindRequest} was {@code null} . |
| | | */ |
| | | public static AnonymousSASLBindRequest unmodifiableAnonymousSASLBindRequest( |
| | | final AnonymousSASLBindRequest anonymousSASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableAnonymousSASLBindRequestImpl( |
| | | anonymousSASLBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable cancel extended request of the provided request. |
| | | * |
| | | * @param cancelExtendedRequest |
| | | * The cancel extended request to be copied. |
| | | * @return The new cancel extended request. |
| | | * @throws NullPointerException |
| | | * If {@code cancelExtendedRequest} was {@code null} . |
| | | */ |
| | | public static CancelExtendedRequest unmodifiableCancelExtendedRequest( |
| | | final CancelExtendedRequest cancelExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableCancelExtendedRequestImpl(cancelExtendedRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable compare request of the provided request. |
| | | * |
| | | * @param compareRequest |
| | | * The compare request to be copied. |
| | | * @return The new compare request. |
| | | * @throws NullPointerException |
| | | * If {@code compareRequest} was {@code null} . |
| | | */ |
| | | public static CompareRequest unmodifiableCompareRequest( |
| | | final CompareRequest compareRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableCompareRequestImpl(compareRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable CRAM MD5 SASL bind request of the provided request. |
| | | * |
| | | * @param cramMD5SASLBindRequest |
| | | * The CRAM MD5 SASL bind request to be copied. |
| | | * @return The new CRAM-MD5 SASL bind request. |
| | | * @throws NullPointerException |
| | | * If {@code authenticationID} or {@code password} was {@code null}. |
| | | */ |
| | | public static CRAMMD5SASLBindRequest unmodifiableCRAMMD5SASLBindRequest( |
| | | final CRAMMD5SASLBindRequest cramMD5SASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableCRAMMD5SASLBindRequestImpl(cramMD5SASLBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable delete request of the provided request. |
| | | * |
| | | * @param deleteRequest |
| | | * The add request to be copied. |
| | | * @return The new delete request. |
| | | * @throws NullPointerException |
| | | * If {@code name} was {@code null}. |
| | | */ |
| | | public static DeleteRequest unmodifiableDeleteRequest( |
| | | final DeleteRequest deleteRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableDeleteRequestImpl(deleteRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable digest MD5 SASL bind request of the provided |
| | | * request. |
| | | * |
| | | * @param digestMD5SASLBindRequest |
| | | * The digest MD5 SASL bind request to be copied. |
| | | * @return The new DIGEST-MD5 SASL bind request. |
| | | * @throws NullPointerException |
| | | * If {@code authenticationID} or {@code password} was {@code null}. |
| | | */ |
| | | public static DigestMD5SASLBindRequest unmodifiableDigestMD5SASLBindRequest( |
| | | final DigestMD5SASLBindRequest digestMD5SASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableDigestMD5SASLBindRequestImpl( |
| | | digestMD5SASLBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable external SASL bind request of the provided request. |
| | | * |
| | | * @param externalSASLBindRequest |
| | | * The external SASL bind request to be copied. |
| | | * @return The new External SASL bind request. |
| | | * @throws NullPointerException |
| | | * If {@code externalSASLBindRequest} was {@code null} . |
| | | */ |
| | | public static ExternalSASLBindRequest unmodifiableExternalSASLBindRequest( |
| | | final ExternalSASLBindRequest externalSASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableExternalSASLBindRequestImpl(externalSASLBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable generic bind request of the provided request. |
| | | * |
| | | * @param genericBindRequest |
| | | * The generic bind request to be copied. |
| | | * @return The new generic bind request. |
| | | * @throws NullPointerException |
| | | * If {@code genericBindRequest} was {@code null} . |
| | | */ |
| | | public static GenericBindRequest unmodifiableGenericBindRequest( |
| | | final GenericBindRequest genericBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableGenericBindRequestImpl(genericBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable generic extended request of the provided request. |
| | | * |
| | | * @param genericExtendedRequest |
| | | * The generic extended request to be copied. |
| | | * @return The new generic extended request. |
| | | * @throws NullPointerException |
| | | * If {@code extendedRequest} was {@code null} . |
| | | */ |
| | | public static GenericExtendedRequest unmodifiableGenericExtendedRequest( |
| | | GenericExtendedRequest genericExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableGenericExtendedRequestImpl(genericExtendedRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable GSSAPI SASL bind request of the provided request. |
| | | * |
| | | * @param gssapiSASLBindRequest |
| | | * The GSSAPI SASL bind request to be copied. |
| | | * @return The new GSSAPI SASL bind request. |
| | | * @throws NullPointerException |
| | | * If {@code gssAPISASLBindRequest} was {@code null}. |
| | | */ |
| | | public static GSSAPISASLBindRequest unmodifiableGSSAPISASLBindRequest( |
| | | final GSSAPISASLBindRequest gssapiSASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableGSSAPISASLBindRequestImpl(gssapiSASLBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable modify DN request of the provided request. |
| | | * |
| | | * @param modifyDNRequest |
| | | * The modify DN request to be copied. |
| | | * @return The new modify DN request. |
| | | * @throws NullPointerException |
| | | * If {@code modifyDNRequest} was {@code null} . |
| | | */ |
| | | public static ModifyDNRequest unmodifiableModifyDNRequest( |
| | | final ModifyDNRequest modifyDNRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableModifyDNRequestImpl(modifyDNRequest); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable modify request of the provided request. |
| | | * |
| | | * @param modifyRequest |
| | | * The modify request to be copied. |
| | | * @return The new modify request. |
| | | * @throws NullPointerException |
| | | * If {@code modifyRequest} was {@code null} . |
| | | */ |
| | | public static ModifyRequest unmodifiableModifyRequest( |
| | | final ModifyRequest modifyRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableModifyRequestImpl(modifyRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable password modify extended request of the provided |
| | | * request. |
| | | * |
| | | * @param passwordModifyExtendedRequest |
| | | * The password modify extended request to be copied. |
| | | * @return The new password modify extended request. |
| | | * @throws NullPointerException |
| | | * If {@code passwordModifyExtendedRequest} was {@code null} . |
| | | */ |
| | | public static PasswordModifyExtendedRequest |
| | | unmodifiablePasswordModifyExtendedRequest( |
| | | final PasswordModifyExtendedRequest passwordModifyExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiablePasswordModifyExtendedRequestImpl( |
| | | passwordModifyExtendedRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable plain SASL bind request of the provided request. |
| | | * |
| | | * @param plainSASLBindRequest |
| | | * The plain SASL bind request to be copied. |
| | | * @return The new Plain SASL bind request. |
| | | * @throws NullPointerException |
| | | * If {@code plainSASLBindRequest} was {@code null} . |
| | | */ |
| | | public static PlainSASLBindRequest unmodifiablePlainSASLBindRequest( |
| | | final PlainSASLBindRequest plainSASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiablePlainSASLBindRequestImpl(plainSASLBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable search request of the provided request. |
| | | * |
| | | * @param searchRequest |
| | | * The search request to be copied. |
| | | * @return The new search request. |
| | | * @throws NullPointerException |
| | | * If {@code searchRequest} was {@code null} . |
| | | */ |
| | | public static SearchRequest unmodifiableSearchRequest( |
| | | final SearchRequest searchRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableSearchRequestImpl(searchRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable simple bind request of the provided request. |
| | | * |
| | | * @param simpleBindRequest |
| | | * The simple bind request to be copied. |
| | | * @return The new simple bind request. |
| | | * @throws NullPointerException |
| | | * If {@code simpleBindRequest} was {@code null} . |
| | | */ |
| | | public static SimpleBindRequest unmodifiableSimpleBindRequest( |
| | | final SimpleBindRequest simpleBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableSimpleBindRequestImpl(simpleBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable startTLS extended request of the provided request. |
| | | * |
| | | * @param startTLSExtendedRequest |
| | | * The startTLS extended request to be copied. |
| | | * @return The new start TLS extended request. |
| | | * @throws NullPointerException |
| | | * If {@code startTLSExtendedRequest} was {@code null} . |
| | | */ |
| | | public static StartTLSExtendedRequest unmodifiableStartTLSExtendedRequest( |
| | | final StartTLSExtendedRequest startTLSExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableStartTLSExtendedRequestImpl(startTLSExtendedRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable unbind request of the provided request. |
| | | * |
| | | * @param unbindRequest |
| | | * The unbind request to be copied. |
| | | * @return The new unbind request. |
| | | * @throws NullPointerException |
| | | * If {@code unbindRequest} was {@code null} . |
| | | */ |
| | | public static UnbindRequest unmodifiableUnbindRequest( |
| | | final UnbindRequest unbindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableUnbindRequestImpl(unbindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an unmodifiable new Who Am I extended request of the provided |
| | | * request. |
| | | * |
| | | * @param whoAmIExtendedRequest |
| | | * The who Am I extended request to be copied. |
| | | * @return The new Who Am I extended request. |
| | | * @throws NullPointerException |
| | | * If {@code whoAmIExtendedRequest} was {@code null} . |
| | | */ |
| | | public static WhoAmIExtendedRequest unmodifiableWhoAmIExtendedRequest( |
| | | final WhoAmIExtendedRequest whoAmIExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnmodifiableWhoAmIExtendedRequestImpl(whoAmIExtendedRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new abandon request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param abandonRequest |
| | | * The abandon request to be copied. |
| | | * @return The new abandon request. |
| | | * @throws NullPointerException |
| | | * If {@code abandonRequest} was {@code null} |
| | | */ |
| | | public static AbandonRequest copyOfAbandonRequest( |
| | | final AbandonRequest abandonRequest) throws NullPointerException |
| | | { |
| | | return new AbandonRequestImpl(abandonRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new add request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param addRequest |
| | | * The add request to be copied. |
| | | * @return The new add request. |
| | | * @throws NullPointerException |
| | | * If {@code addRequest} was {@code null} . |
| | | */ |
| | | public static AddRequest copyOfAddRequest(final AddRequest addRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new AddRequestImpl(addRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new anonymous SASL bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param anonymousSASLBindRequest |
| | | * The anonymous SASL bind request to be copied. |
| | | * @return The new anonymous SASL bind request. |
| | | * @throws NullPointerException |
| | | * If {@code anonymousSASLBindRequest} was {@code null} . |
| | | */ |
| | | public static AnonymousSASLBindRequest copyOfAnonymousSASLBindRequest( |
| | | final AnonymousSASLBindRequest anonymousSASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new AnonymousSASLBindRequestImpl(anonymousSASLBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new cancel extended request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param cancelExtendedRequest |
| | | * The cancel extended request to be copied. |
| | | * @return The new cancel extended request. |
| | | * @throws NullPointerException |
| | | * If {@code cancelExtendedRequest} was {@code null} . |
| | | */ |
| | | public static CancelExtendedRequest copyOfCancelExtendedRequest( |
| | | final CancelExtendedRequest cancelExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new CancelExtendedRequestImpl(cancelExtendedRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new compare request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param compareRequest |
| | | * The compare request to be copied. |
| | | * @return The new compare request. |
| | | * @throws NullPointerException |
| | | * If {@code compareRequest} was {@code null} . |
| | | */ |
| | | public static CompareRequest copyOfCompareRequest( |
| | | final CompareRequest compareRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new CompareRequestImpl(compareRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new CRAM MD5 SASL bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param cramMD5SASLBindRequest |
| | | * The CRAM MD5 SASL bind request to be copied. |
| | | * @return The new CRAM-MD5 SASL bind request. |
| | | * @throws NullPointerException |
| | | * If {@code authenticationID} or {@code password} was {@code null}. |
| | | */ |
| | | public static CRAMMD5SASLBindRequest copyOfCRAMMD5SASLBindRequest( |
| | | final CRAMMD5SASLBindRequest cramMD5SASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new CRAMMD5SASLBindRequestImpl(cramMD5SASLBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new delete request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param deleteRequest |
| | | * The add request to be copied. |
| | | * @return The new delete request. |
| | | * @throws NullPointerException |
| | | * If {@code name} was {@code null}. |
| | | */ |
| | | public static DeleteRequest copyOfDeleteRequest( |
| | | final DeleteRequest deleteRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new DeleteRequestImpl(deleteRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new digest MD5 SASL bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param digestMD5SASLBindRequest |
| | | * The digest MD5 SASL bind request to be copied. |
| | | * @return The new DIGEST-MD5 SASL bind request. |
| | | * @throws NullPointerException |
| | | * If {@code authenticationID} or {@code password} was {@code null}. |
| | | */ |
| | | public static DigestMD5SASLBindRequest copyOfDigestMD5SASLBindRequest( |
| | | final DigestMD5SASLBindRequest digestMD5SASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new DigestMD5SASLBindRequestImpl(digestMD5SASLBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new external SASL bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param externalSASLBindRequest |
| | | * The external SASL bind request to be copied. |
| | | * @return The new External SASL bind request. |
| | | * @throws NullPointerException |
| | | * If {@code externalSASLBindRequest} was {@code null} . |
| | | */ |
| | | public static ExternalSASLBindRequest copyOfExternalSASLBindRequest( |
| | | final ExternalSASLBindRequest externalSASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new ExternalSASLBindRequestImpl(externalSASLBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new generic bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param genericBindRequest |
| | | * The generic bind request to be copied. |
| | | * @return The new generic bind request. |
| | | * @throws NullPointerException |
| | | * If {@code genericBindRequest} was {@code null} . |
| | | */ |
| | | public static GenericBindRequest copyOfGenericBindRequest( |
| | | final GenericBindRequest genericBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new GenericBindRequestImpl(genericBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new generic extended request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param genericExtendedRequest |
| | | * The generic extended request to be copied. |
| | | * @return The new generic extended request. |
| | | * @throws NullPointerException |
| | | * If {@code extendedRequest} was {@code null} . |
| | | */ |
| | | public static GenericExtendedRequest copyOfGenericExtendedRequest( |
| | | GenericExtendedRequest genericExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new GenericExtendedRequestImpl(genericExtendedRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new GSSAPI SASL bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param gssapiSASLBindRequest |
| | | * The GSSAPI SASL bind request to be copied. |
| | | * @return The new GSSAPI SASL bind request. |
| | | * @throws NullPointerException |
| | | * If {@code gssAPISASLBindRequest} was {@code null}. |
| | | */ |
| | | public static GSSAPISASLBindRequest copyOfGSSAPISASLBindRequest( |
| | | final GSSAPISASLBindRequest gssapiSASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new GSSAPISASLBindRequestImpl(gssapiSASLBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new modify DN request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param modifyDNRequest |
| | | * The modify DN request to be copied. |
| | | * @return The new modify DN request. |
| | | * @throws NullPointerException |
| | | * If {@code modifyDNRequest} was {@code null} . |
| | | */ |
| | | public static ModifyDNRequest copyOfModifyDNRequest( |
| | | final ModifyDNRequest modifyDNRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new ModifyDNRequestImpl(modifyDNRequest); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Creates a new modify request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param modifyRequest |
| | | * The modify request to be copied. |
| | | * @return The new modify request. |
| | | * @throws NullPointerException |
| | | * If {@code modifyRequest} was {@code null} . |
| | | */ |
| | | public static ModifyRequest copyOfModifyRequest( |
| | | final ModifyRequest modifyRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new ModifyRequestImpl(modifyRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new password modify extended request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param passwordModifyExtendedRequest |
| | | * The password modify extended request to be copied. |
| | | * @return The new password modify extended request. |
| | | * @throws NullPointerException |
| | | * If {@code passwordModifyExtendedRequest} was {@code null} . |
| | | */ |
| | | public static PasswordModifyExtendedRequest |
| | | copyOfPasswordModifyExtendedRequest( |
| | | final PasswordModifyExtendedRequest passwordModifyExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new PasswordModifyExtendedRequestImpl(passwordModifyExtendedRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new plain SASL bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param plainSASLBindRequest |
| | | * The plain SASL bind request to be copied. |
| | | * @return The new Plain SASL bind request. |
| | | * @throws NullPointerException |
| | | * If {@code plainSASLBindRequest} was {@code null} . |
| | | */ |
| | | public static PlainSASLBindRequest copyOfPlainSASLBindRequest( |
| | | final PlainSASLBindRequest plainSASLBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new PlainSASLBindRequestImpl(plainSASLBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new search request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param searchRequest |
| | | * The search request to be copied. |
| | | * @return The new search request. |
| | | * @throws NullPointerException |
| | | * If {@code searchRequest} was {@code null} . |
| | | */ |
| | | public static SearchRequest copyOfSearchRequest( |
| | | final SearchRequest searchRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new SearchRequestImpl(searchRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new simple bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param simpleBindRequest |
| | | * The simple bind request to be copied. |
| | | * @return The new simple bind request. |
| | | * @throws NullPointerException |
| | | * If {@code simpleBindRequest} was {@code null} . |
| | | */ |
| | | public static SimpleBindRequest copyOfSimpleBindRequest( |
| | | final SimpleBindRequest simpleBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new SimpleBindRequestImpl(simpleBindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new startTLS extended request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param startTLSExtendedRequest |
| | | * The startTLS extended request to be copied. |
| | | * @return The new start TLS extended request. |
| | | * @throws NullPointerException |
| | | * If {@code startTLSExtendedRequest} was {@code null} . |
| | | */ |
| | | public static StartTLSExtendedRequest copyOfStartTLSExtendedRequest( |
| | | final StartTLSExtendedRequest startTLSExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new StartTLSExtendedRequestImpl(startTLSExtendedRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new unbind request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param unbindRequest |
| | | * The unbind request to be copied. |
| | | * @return The new unbind request. |
| | | * @throws NullPointerException |
| | | * If {@code unbindRequest} was {@code null} . |
| | | */ |
| | | public static UnbindRequest copyOfUnbindRequest( |
| | | final UnbindRequest unbindRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new UnbindRequestImpl(unbindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new Who Am I extended request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param whoAmIExtendedRequest |
| | | * The who Am I extended request to be copied. |
| | | * @return The new Who Am I extended request. |
| | | * @throws NullPointerException |
| | | * If {@code whoAmIExtendedRequest} was {@code null} . |
| | | */ |
| | | public static WhoAmIExtendedRequest copyOfWhoAmIExtendedRequest( |
| | | final WhoAmIExtendedRequest whoAmIExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | return new WhoAmIExtendedRequestImpl(whoAmIExtendedRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | private Requests() |
| | | { |
| | | // Prevent instantiation. |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | private DN name; |
| | | |
| | | private DereferenceAliasesPolicy dereferenceAliasesPolicy = DereferenceAliasesPolicy.NEVER; |
| | | private DereferenceAliasesPolicy dereferenceAliasesPolicy = |
| | | DereferenceAliasesPolicy.NEVER; |
| | | |
| | | private Filter filter; |
| | | |
| | |
| | | * @param filter |
| | | * The filter that defines the conditions that must be fulfilled in |
| | | * order for an entry to be returned. |
| | | * @param attributeDescriptions |
| | | * The names of the attributes to be included with each entry. |
| | | * @throws NullPointerException |
| | | * If the {@code name}, {@code scope}, or {@code filter} were |
| | | * {@code null}. |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new search request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param searchRequest |
| | | * The search request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code searchRequest} was {@code null} . |
| | | */ |
| | | SearchRequestImpl(final SearchRequest searchRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(searchRequest); |
| | | this.attributes.addAll(searchRequest.getAttributes()); |
| | | this.name = searchRequest.getName(); |
| | | this.dereferenceAliasesPolicy = searchRequest.getDereferenceAliasesPolicy(); |
| | | this.filter = searchRequest.getFilter(); |
| | | this.scope = searchRequest.getScope(); |
| | | this.sizeLimit = searchRequest.getSizeLimit(); |
| | | this.timeLimit = searchRequest.getTimeLimit(); |
| | | this.typesOnly = searchRequest.isTypesOnly(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public SearchRequest addAttribute(final String... attributeDescriptions) |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new simple bind request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param simpleBindRequest |
| | | * The simple bind request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code simpleBindRequest} was {@code null} . |
| | | */ |
| | | SimpleBindRequestImpl(final SimpleBindRequest simpleBindRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(simpleBindRequest); |
| | | this.name = simpleBindRequest.getName(); |
| | | this.password = simpleBindRequest.getPassword(); |
| | | } |
| | | |
| | | |
| | | |
| | | public BindClient createBindClient(final String serverName) |
| | | throws ErrorResultException |
| | | { |
| | |
| | | |
| | | |
| | | /** |
| | | * Set the protocol versions enabled for secure connections with the |
| | | * Adds the protocol versions enabled for secure connections with the |
| | | * Directory Server. |
| | | * |
| | | * The protocols must be supported by the SSLContext specified in |
| | |
| | | * this method, only the protocols listed in the protocols parameter are |
| | | * enabled for use. |
| | | * |
| | | * @param protocols Names of all the protocols to enable or {@code null} to |
| | | * use the default protocols. |
| | | * @param protocols Names of all the protocols to enable. |
| | | * @return A reference to this LDAP connection options. |
| | | * @throws UnsupportedOperationException |
| | | * If this start TLS extended request does not permit the enabled |
| | | * protocols to be set. |
| | | */ |
| | | StartTLSExtendedRequest setEnabledProtocols(String[] protocols); |
| | | |
| | | StartTLSExtendedRequest addEnabledProtocol(String... protocols) |
| | | throws UnsupportedOperationException; |
| | | |
| | | |
| | | /** |
| | | * Set the cipher suites enabled for secure connections with the |
| | | * Adds the cipher suites enabled for secure connections with the |
| | | * Directory Server. |
| | | * |
| | | * The suites must be supported by the SSLContext specified in |
| | |
| | | * this method, only the suites listed in the protocols parameter are |
| | | * enabled for use. |
| | | * |
| | | * @param suites Names of all the suites to enable or {@code null} to |
| | | * use the default cipher suites. |
| | | * @param suites Names of all the suites to enable. |
| | | * @return A reference to this LDAP connection options. |
| | | * @throws UnsupportedOperationException |
| | | * If this start TLS extended request does not permit the enabled |
| | | * cipher suites to be set. |
| | | */ |
| | | StartTLSExtendedRequest setEnabledCipherSuites(String[] suites); |
| | | StartTLSExtendedRequest addEnabledCipherSuite(String... suites) |
| | | throws UnsupportedOperationException; |
| | | |
| | | |
| | | |
| | |
| | | * Returns the names of the protocol versions which are currently enabled |
| | | * for secure connections with the Directory Server. |
| | | * |
| | | * @return an array of protocols or {@code null} if the default protocols |
| | | * @return an array of protocols or empty set if the default protocols |
| | | * are to be used. |
| | | */ |
| | | String[] getEnabledProtocols(); |
| | | List<String> getEnabledProtocols(); |
| | | |
| | | |
| | | |
| | |
| | | * Returns the names of the protocol versions which are currently enabled |
| | | * for secure connections with the Directory Server. |
| | | * |
| | | * @return an array of protocols or {@code null} if the default protocols |
| | | * @return an array of protocols or empty set if the default protocols |
| | | * are to be used. |
| | | */ |
| | | String[] getEnabledCipherSuites(); |
| | | List<String> getEnabledCipherSuites(); |
| | | |
| | | |
| | | |
| | |
| | | |
| | | import com.sun.opends.sdk.util.Validator; |
| | | |
| | | import java.util.*; |
| | | |
| | | |
| | | /** |
| | |
| | | throws DecodeException |
| | | { |
| | | // TODO: Check the OID and that the value is not present. |
| | | final StartTLSExtendedRequest newRequest = new StartTLSExtendedRequestImpl(); |
| | | final StartTLSExtendedRequest newRequest = |
| | | new StartTLSExtendedRequestImpl(); |
| | | for (final Control control : request.getControls()) |
| | | { |
| | | newRequest.addControl(control); |
| | |
| | | /** |
| | | * The list of cipher suite |
| | | */ |
| | | private String[] enabledCipherSuites = null; |
| | | private List<String> enabledCipherSuites = new LinkedList<String>(); |
| | | |
| | | /** |
| | | * the list of protocols |
| | | */ |
| | | private String[] enabledProtocols = null; |
| | | private List<String> enabledProtocols = new LinkedList<String>(); |
| | | |
| | | // No need to expose this. |
| | | private static final ExtendedResultDecoder<ExtendedResult> RESULT_DECODER = new ResultDecoder(); |
| | | private static final ExtendedResultDecoder<ExtendedResult> RESULT_DECODER = |
| | | new ResultDecoder(); |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new startTLS extended request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param startTLSExtendedRequest |
| | | * The startTLS extended request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code startTLSExtendedRequest} was {@code null} . |
| | | */ |
| | | StartTLSExtendedRequestImpl( |
| | | final StartTLSExtendedRequest startTLSExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(startTLSExtendedRequest); |
| | | this.sslContext = startTLSExtendedRequest.getSSLContext(); |
| | | this.enabledCipherSuites.addAll( |
| | | startTLSExtendedRequest.getEnabledCipherSuites()); |
| | | this.enabledProtocols.addAll(startTLSExtendedRequest.getEnabledProtocols()); |
| | | } |
| | | |
| | | |
| | | |
| | | // Prevent instantiation. |
| | | private StartTLSExtendedRequestImpl() |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc}} |
| | | */ |
| | | public StartTLSExtendedRequest setEnabledProtocols(String[] protocols) |
| | | public StartTLSExtendedRequest addEnabledProtocol(String... protocols) |
| | | { |
| | | this.enabledProtocols = protocols; |
| | | for (final String protocol : protocols) |
| | | { |
| | | this.enabledProtocols.add(Validator.ensureNotNull(protocol)); |
| | | } |
| | | return this; |
| | | } |
| | | |
| | |
| | | /** |
| | | * {@inheritDoc}} |
| | | */ |
| | | public StartTLSExtendedRequest setEnabledCipherSuites(String[] suites) |
| | | public StartTLSExtendedRequest addEnabledCipherSuite(String... suites) |
| | | { |
| | | this.enabledCipherSuites = suites; |
| | | for (final String suite : suites) |
| | | { |
| | | this.enabledCipherSuites.add(Validator.ensureNotNull(suite)); |
| | | } |
| | | return this; |
| | | } |
| | | |
| | |
| | | /** |
| | | * {@inheritDoc}} |
| | | */ |
| | | public String[] getEnabledProtocols() |
| | | public List<String> getEnabledProtocols() |
| | | { |
| | | return this.enabledProtocols; |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc}} |
| | | */ |
| | | public String[] getEnabledCipherSuites() |
| | | public List<String> getEnabledCipherSuites() |
| | | { |
| | | return this.enabledCipherSuites; |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new unbind request that is an exact copy of the provided |
| | | * request. |
| | | * |
| | | * @param unbindRequest |
| | | * The unbind request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code unbindRequest} was {@code null} . |
| | | */ |
| | | UnbindRequestImpl(final UnbindRequest unbindRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(unbindRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
copy from opendj-sdk/sdk/examples/org/opends/sdk/examples/package-info.java
copy to opendj-sdk/sdk/src/org/opends/sdk/requests/UnmodifiableAbandonRequestImpl.java
| File was copied from opendj-sdk/sdk/examples/org/opends/sdk/examples/package-info.java |
| | |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | /** |
| | | * Examples which use the OpenDS LDAP SDK. |
| | | * Unmodifiable abandon request implementation. |
| | | */ |
| | | package org.opends.sdk.examples; |
| | | final class UnmodifiableAbandonRequestImpl |
| | | extends AbstractUnmodifiableRequest<AbandonRequest> |
| | | implements AbandonRequest |
| | | { |
| | | UnmodifiableAbandonRequestImpl(AbandonRequest request) { |
| | | super(request); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public int getRequestID() { |
| | | return impl.getRequestID(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public AbandonRequest setRequestID(int id) |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import com.sun.opends.sdk.util.Function; |
| | | import com.sun.opends.sdk.util.Iterables; |
| | | import org.opends.sdk.*; |
| | | import org.opends.sdk.ldif.ChangeRecordVisitor; |
| | | |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * Unmodifiable add request implementation. |
| | | */ |
| | | final class UnmodifiableAddRequestImpl |
| | | extends AbstractUnmodifiableRequest<AddRequest> |
| | | implements AddRequest |
| | | { |
| | | private static final Function<Attribute, Attribute, Void> |
| | | UNMODIFIABLE_ATTRIBUTE_FUNCTION = |
| | | new Function<Attribute, Attribute, Void>() |
| | | { |
| | | |
| | | public Attribute apply(final Attribute value, final Void p) |
| | | { |
| | | return Attributes.unmodifiableAttribute(value); |
| | | } |
| | | |
| | | }; |
| | | |
| | | UnmodifiableAddRequestImpl(AddRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | public <R, P> R accept(ChangeRecordVisitor<R, P> v, P p) { |
| | | return v.visitChangeRecord(p, this); |
| | | } |
| | | |
| | | public boolean addAttribute(Attribute attribute) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public boolean addAttribute(Attribute attribute, |
| | | Collection<ByteString> duplicateValues) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public AddRequest addAttribute(String attributeDescription, |
| | | Object... values) |
| | | throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public AddRequest clearAttributes() |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public boolean containsAttribute(Attribute attribute, |
| | | Collection<ByteString> missingValues) |
| | | throws NullPointerException { |
| | | return impl.containsAttribute(attribute, missingValues); |
| | | } |
| | | |
| | | public boolean containsAttribute(String attributeDescription, |
| | | Object... values) |
| | | throws LocalizedIllegalArgumentException, |
| | | NullPointerException { |
| | | return impl.containsAttribute(attributeDescription, values); |
| | | } |
| | | |
| | | public Iterable<Attribute> getAllAttributes() { |
| | | return Iterables.unmodifiable(Iterables.transform(impl |
| | | .getAllAttributes(), UNMODIFIABLE_ATTRIBUTE_FUNCTION)); |
| | | } |
| | | |
| | | public Iterable<Attribute> getAllAttributes( |
| | | AttributeDescription attributeDescription) |
| | | throws NullPointerException { |
| | | return Iterables.unmodifiable(Iterables.transform(impl |
| | | .getAllAttributes(attributeDescription), |
| | | UNMODIFIABLE_ATTRIBUTE_FUNCTION)); |
| | | } |
| | | |
| | | public Iterable<Attribute> getAllAttributes( |
| | | String attributeDescription) |
| | | throws LocalizedIllegalArgumentException, |
| | | NullPointerException { |
| | | return Iterables.unmodifiable(Iterables.transform(impl |
| | | .getAllAttributes(attributeDescription), |
| | | UNMODIFIABLE_ATTRIBUTE_FUNCTION)); |
| | | } |
| | | |
| | | public Attribute getAttribute( |
| | | AttributeDescription attributeDescription) |
| | | throws NullPointerException { |
| | | final Attribute attribute = |
| | | impl.getAttribute(attributeDescription); |
| | | if (attribute != null) |
| | | { |
| | | return Attributes.unmodifiableAttribute(attribute); |
| | | } |
| | | else |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public Attribute getAttribute(String attributeDescription) |
| | | throws LocalizedIllegalArgumentException, |
| | | NullPointerException { |
| | | final Attribute attribute = |
| | | impl.getAttribute(attributeDescription); |
| | | if (attribute != null) |
| | | { |
| | | return Attributes.unmodifiableAttribute(attribute); |
| | | } |
| | | else |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public int getAttributeCount() { |
| | | return impl.getAttributeCount(); |
| | | } |
| | | |
| | | public DN getName() { |
| | | return impl.getName(); |
| | | } |
| | | |
| | | public boolean removeAttribute(Attribute attribute, |
| | | Collection<ByteString> missingValues) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public boolean removeAttribute( |
| | | AttributeDescription attributeDescription) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public AddRequest removeAttribute(String attributeDescription, |
| | | Object... values) |
| | | throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public boolean replaceAttribute(Attribute attribute) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public AddRequest replaceAttribute(String attributeDescription, |
| | | Object... values) |
| | | throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public AddRequest setName(DN dn) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public AddRequest setName(String dn) |
| | | throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
copy from opendj-sdk/sdk/examples/org/opends/sdk/examples/package-info.java
copy to opendj-sdk/sdk/src/org/opends/sdk/requests/UnmodifiableAnonymousSASLBindRequestImpl.java
| File was copied from opendj-sdk/sdk/examples/org/opends/sdk/examples/package-info.java |
| | |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | /** |
| | | * Examples which use the OpenDS LDAP SDK. |
| | | * Unmodifiable anonymous SASL bind request implementation. |
| | | */ |
| | | package org.opends.sdk.examples; |
| | | final class UnmodifiableAnonymousSASLBindRequestImpl extends |
| | | AbstractUnmodifiableSASLBindRequest<AnonymousSASLBindRequest> implements |
| | | AnonymousSASLBindRequest |
| | | { |
| | | UnmodifiableAnonymousSASLBindRequestImpl(AnonymousSASLBindRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | @Override |
| | | public String getTraceString() { |
| | | return impl.getTraceString(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public AnonymousSASLBindRequest setTraceString(String traceString) |
| | | throws NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.ByteString; |
| | | import org.opends.sdk.LocalizedIllegalArgumentException; |
| | | |
| | | /** |
| | | * Unmodifiable CRAM-MD5 SASL bind request implementation. |
| | | */ |
| | | public class UnmodifiableCRAMMD5SASLBindRequestImpl extends |
| | | AbstractUnmodifiableSASLBindRequest<CRAMMD5SASLBindRequest> implements |
| | | CRAMMD5SASLBindRequest |
| | | { |
| | | UnmodifiableCRAMMD5SASLBindRequestImpl(CRAMMD5SASLBindRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | @Override |
| | | public String getAuthenticationID() { |
| | | return impl.getAuthenticationID(); |
| | | } |
| | | |
| | | @Override |
| | | public ByteString getPassword() { |
| | | return impl.getPassword(); |
| | | } |
| | | |
| | | @Override |
| | | public CRAMMD5SASLBindRequest setAuthenticationID(String authenticationID) |
| | | throws LocalizedIllegalArgumentException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public CRAMMD5SASLBindRequest setPassword(ByteString password) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public CRAMMD5SASLBindRequest setPassword(String password) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.responses.ExtendedResult; |
| | | |
| | | /** |
| | | * Unmodifiable cancel extended request implementation. |
| | | */ |
| | | final class UnmodifiableCancelExtendedRequestImpl |
| | | extends AbstractUnmodifiableExtendedRequest |
| | | <CancelExtendedRequest, ExtendedResult> |
| | | implements CancelExtendedRequest |
| | | { |
| | | UnmodifiableCancelExtendedRequestImpl( |
| | | CancelExtendedRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | public int getRequestID() { |
| | | return impl.getRequestID(); |
| | | } |
| | | |
| | | public CancelExtendedRequest setRequestID(int id) |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.AttributeDescription; |
| | | import org.opends.sdk.ByteString; |
| | | import org.opends.sdk.DN; |
| | | import org.opends.sdk.LocalizedIllegalArgumentException; |
| | | |
| | | /** |
| | | * Unmodifiable compare request implementation. |
| | | */ |
| | | final class UnmodifiableCompareRequestImpl |
| | | extends AbstractUnmodifiableRequest<CompareRequest> |
| | | implements CompareRequest |
| | | { |
| | | UnmodifiableCompareRequestImpl(CompareRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | public ByteString getAssertionValue() { |
| | | return impl.getAssertionValue(); |
| | | } |
| | | |
| | | public String getAssertionValueAsString() { |
| | | return impl.getAssertionValueAsString(); |
| | | } |
| | | |
| | | public AttributeDescription getAttributeDescription() { |
| | | return impl.getAttributeDescription(); |
| | | } |
| | | |
| | | public DN getName() { |
| | | return impl.getName(); |
| | | } |
| | | |
| | | public CompareRequest setAssertionValue(ByteString value) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public CompareRequest setAssertionValue(Object value) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public CompareRequest setAttributeDescription( |
| | | AttributeDescription attributeDescription) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public CompareRequest setAttributeDescription( |
| | | String attributeDescription) |
| | | throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public CompareRequest setName(DN dn) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public CompareRequest setName(String dn) |
| | | throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.DN; |
| | | import org.opends.sdk.LocalizedIllegalArgumentException; |
| | | import org.opends.sdk.ldif.ChangeRecordVisitor; |
| | | |
| | | /** |
| | | * Unmodifiable delete request implementation. |
| | | */ |
| | | final class UnmodifiableDeleteRequestImpl |
| | | extends AbstractUnmodifiableRequest<DeleteRequest> |
| | | implements DeleteRequest |
| | | { |
| | | UnmodifiableDeleteRequestImpl(DeleteRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | public <R, P> R accept(ChangeRecordVisitor<R, P> v, P p) { |
| | | return v.visitChangeRecord(p, this); |
| | | } |
| | | |
| | | public DN getName() { |
| | | return impl.getName(); |
| | | } |
| | | |
| | | public DeleteRequest setName(DN dn) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public DeleteRequest setName(String dn) |
| | | throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.ByteString; |
| | | import org.opends.sdk.LocalizedIllegalArgumentException; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Unmodifiable digest-MD5 SASL bind request implementation. |
| | | */ |
| | | final class UnmodifiableDigestMD5SASLBindRequestImpl extends |
| | | AbstractUnmodifiableSASLBindRequest<DigestMD5SASLBindRequest> implements |
| | | DigestMD5SASLBindRequest |
| | | { |
| | | UnmodifiableDigestMD5SASLBindRequestImpl(DigestMD5SASLBindRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | @Override |
| | | public DigestMD5SASLBindRequest addAdditionalAuthParam(String name, |
| | | String value) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public DigestMD5SASLBindRequest addQOP(String... qopValues) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, String> getAdditionalAuthParams() { |
| | | return Collections.unmodifiableMap(impl.getAdditionalAuthParams()); |
| | | } |
| | | |
| | | @Override |
| | | public String getAuthenticationID() { |
| | | return impl.getAuthenticationID(); |
| | | } |
| | | |
| | | @Override |
| | | public String getAuthorizationID() { |
| | | return impl.getAuthorizationID(); |
| | | } |
| | | |
| | | @Override |
| | | public String getCipher() { |
| | | return impl.getCipher(); |
| | | } |
| | | |
| | | @Override |
| | | public int getMaxReceiveBufferSize() { |
| | | return impl.getMaxReceiveBufferSize(); |
| | | } |
| | | |
| | | @Override |
| | | public int getMaxSendBufferSize() { |
| | | return impl.getMaxSendBufferSize(); |
| | | } |
| | | |
| | | @Override |
| | | public ByteString getPassword() { |
| | | return impl.getPassword(); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getQOPs() { |
| | | return Collections.unmodifiableList(impl.getQOPs()); |
| | | } |
| | | |
| | | @Override |
| | | public String getRealm() { |
| | | return impl.getRealm(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean isServerAuth() { |
| | | return impl.isServerAuth(); |
| | | } |
| | | |
| | | @Override |
| | | public DigestMD5SASLBindRequest setAuthenticationID(String authenticationID) |
| | | throws LocalizedIllegalArgumentException, UnsupportedOperationException, |
| | | NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public DigestMD5SASLBindRequest setAuthorizationID(String authorizationID) |
| | | throws LocalizedIllegalArgumentException, UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public DigestMD5SASLBindRequest setCipher(String cipher) |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public DigestMD5SASLBindRequest setMaxReceiveBufferSize(int size) |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public DigestMD5SASLBindRequest setMaxSendBufferSize(int size) |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public DigestMD5SASLBindRequest setPassword(ByteString password) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public DigestMD5SASLBindRequest setPassword(String password) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public DigestMD5SASLBindRequest setRealm(String realm) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public DigestMD5SASLBindRequest setServerAuth(boolean serverAuth) |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.LocalizedIllegalArgumentException; |
| | | |
| | | /** |
| | | * Unmodifiable external SASL bind request implementation. |
| | | */ |
| | | final class UnmodifiableExternalSASLBindRequestImpl extends |
| | | AbstractUnmodifiableSASLBindRequest<ExternalSASLBindRequest> implements |
| | | ExternalSASLBindRequest |
| | | { |
| | | UnmodifiableExternalSASLBindRequestImpl(ExternalSASLBindRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | @Override |
| | | public String getAuthorizationID() { |
| | | return impl.getAuthorizationID(); |
| | | } |
| | | |
| | | @Override |
| | | public ExternalSASLBindRequest setAuthorizationID(String authorizationID) |
| | | throws UnsupportedOperationException, LocalizedIllegalArgumentException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.ByteString; |
| | | import org.opends.sdk.LocalizedIllegalArgumentException; |
| | | |
| | | import javax.security.auth.Subject; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Unmodifiable GSSAPI SASL bind request implementation. |
| | | */ |
| | | final class UnmodifiableGSSAPISASLBindRequestImpl extends |
| | | AbstractUnmodifiableSASLBindRequest<GSSAPISASLBindRequest> implements |
| | | GSSAPISASLBindRequest |
| | | { |
| | | UnmodifiableGSSAPISASLBindRequestImpl(GSSAPISASLBindRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | @Override |
| | | public GSSAPISASLBindRequest addAdditionalAuthParam(String name, String value) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, String> getAdditionalAuthParams() { |
| | | return Collections.unmodifiableMap(impl.getAdditionalAuthParams()); |
| | | } |
| | | |
| | | @Override |
| | | public GSSAPISASLBindRequest addQOP(String... qopValues) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public String getAuthenticationID() { |
| | | return impl.getAuthenticationID(); |
| | | } |
| | | |
| | | @Override |
| | | public String getAuthorizationID() { |
| | | return impl.getAuthorizationID(); |
| | | } |
| | | |
| | | @Override |
| | | public String getKDCAddress() { |
| | | return impl.getKDCAddress(); |
| | | } |
| | | |
| | | @Override |
| | | public int getMaxReceiveBufferSize() { |
| | | return impl.getMaxReceiveBufferSize(); |
| | | } |
| | | |
| | | @Override |
| | | public int getMaxSendBufferSize() { |
| | | return impl.getMaxSendBufferSize(); |
| | | } |
| | | |
| | | @Override |
| | | public ByteString getPassword() { |
| | | return impl.getPassword(); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getQOPs() { |
| | | return Collections.unmodifiableList(impl.getQOPs()); |
| | | } |
| | | |
| | | @Override |
| | | public String getRealm() { |
| | | return impl.getRealm(); |
| | | } |
| | | |
| | | @Override |
| | | public Subject getSubject() { |
| | | return impl.getSubject(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean isServerAuth() { |
| | | return impl.isServerAuth(); |
| | | } |
| | | |
| | | @Override |
| | | public GSSAPISASLBindRequest setAuthenticationID(String authenticationID) |
| | | throws LocalizedIllegalArgumentException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public GSSAPISASLBindRequest setAuthorizationID(String authorizationID) |
| | | throws LocalizedIllegalArgumentException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public GSSAPISASLBindRequest setKDCAddress(String address) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public GSSAPISASLBindRequest setMaxReceiveBufferSize(int size) |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public GSSAPISASLBindRequest setMaxSendBufferSize(int size) |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public GSSAPISASLBindRequest setPassword(ByteString password) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public GSSAPISASLBindRequest setPassword(String password) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public GSSAPISASLBindRequest setRealm(String realm) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public GSSAPISASLBindRequest setServerAuth(boolean serverAuth) |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public GSSAPISASLBindRequest setSubject(Subject subject) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.ByteString; |
| | | |
| | | /** |
| | | * Unmodifiable generic bind request implementation. |
| | | */ |
| | | final class UnmodifiableGenericBindRequestImpl |
| | | extends AbstractUnmodifiableBindRequest<GenericBindRequest> |
| | | implements GenericBindRequest |
| | | { |
| | | UnmodifiableGenericBindRequestImpl(GenericBindRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | public ByteString getAuthenticationValue() { |
| | | return impl.getAuthenticationValue(); |
| | | } |
| | | |
| | | public GenericBindRequest setAuthenticationType(byte type) |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public GenericBindRequest setAuthenticationValue(ByteString bytes) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public GenericBindRequest setName(String name) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.ByteString; |
| | | import org.opends.sdk.responses.GenericExtendedResult; |
| | | |
| | | /** |
| | | * Unmodifiable generic extended request implementation. |
| | | */ |
| | | final class UnmodifiableGenericExtendedRequestImpl |
| | | extends AbstractUnmodifiableExtendedRequest |
| | | <GenericExtendedRequest, GenericExtendedResult> |
| | | implements GenericExtendedRequest |
| | | { |
| | | UnmodifiableGenericExtendedRequestImpl(GenericExtendedRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | public GenericExtendedRequest setOID(String oid) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public GenericExtendedRequest setValue(ByteString bytes) |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.DN; |
| | | import org.opends.sdk.LocalizedIllegalArgumentException; |
| | | import org.opends.sdk.RDN; |
| | | import org.opends.sdk.ldif.ChangeRecordVisitor; |
| | | |
| | | /** |
| | | * Unmodifiable modify DN request implementation. |
| | | */ |
| | | final class UnmodifiableModifyDNRequestImpl |
| | | extends AbstractUnmodifiableRequest<ModifyDNRequest> |
| | | implements ModifyDNRequest |
| | | { |
| | | UnmodifiableModifyDNRequestImpl(ModifyDNRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | public <R, P> R accept(ChangeRecordVisitor<R, P> v, P p) { |
| | | return v.visitChangeRecord(p, this); |
| | | } |
| | | |
| | | public DN getName() { |
| | | return impl.getName(); |
| | | } |
| | | |
| | | public RDN getNewRDN() { |
| | | return impl.getNewRDN(); |
| | | } |
| | | |
| | | public DN getNewSuperior() { |
| | | return impl.getNewSuperior(); |
| | | } |
| | | |
| | | public boolean isDeleteOldRDN() { |
| | | return impl.isDeleteOldRDN(); |
| | | } |
| | | |
| | | public ModifyDNRequest setDeleteOldRDN(boolean deleteOldRDN) |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public ModifyDNRequest setName(DN dn) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public ModifyDNRequest setName(String dn) |
| | | throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public ModifyDNRequest setNewRDN(RDN rdn) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public ModifyDNRequest setNewRDN(String rdn) |
| | | throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public ModifyDNRequest setNewSuperior(DN dn) |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public ModifyDNRequest setNewSuperior(String dn) |
| | | throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.DN; |
| | | import org.opends.sdk.LocalizedIllegalArgumentException; |
| | | import org.opends.sdk.Modification; |
| | | import org.opends.sdk.ModificationType; |
| | | import org.opends.sdk.ldif.ChangeRecordVisitor; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Unmodifiable modify request implementation. |
| | | */ |
| | | final class UnmodifiableModifyRequestImpl |
| | | extends AbstractUnmodifiableRequest<ModifyRequest> |
| | | implements ModifyRequest |
| | | { |
| | | UnmodifiableModifyRequestImpl(ModifyRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | public <R, P> R accept(ChangeRecordVisitor<R, P> v, P p) { |
| | | return v.visitChangeRecord(p, this); |
| | | } |
| | | |
| | | public ModifyRequest addModification(Modification modification) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public ModifyRequest addModification(ModificationType type, |
| | | String attributeDescription, |
| | | Object... values) |
| | | throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public List<Modification> getModifications() { |
| | | return Collections.unmodifiableList(impl.getModifications()); |
| | | } |
| | | |
| | | public DN getName() { |
| | | return impl.getName(); |
| | | } |
| | | |
| | | public ModifyRequest setName(DN dn) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public ModifyRequest setName(String dn) |
| | | throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.ByteString; |
| | | import org.opends.sdk.responses.PasswordModifyExtendedResult; |
| | | |
| | | /** |
| | | * Unmodifiable password modify extended request implementation. |
| | | */ |
| | | final class UnmodifiablePasswordModifyExtendedRequestImpl |
| | | extends AbstractUnmodifiableExtendedRequest |
| | | <PasswordModifyExtendedRequest, PasswordModifyExtendedResult> |
| | | implements PasswordModifyExtendedRequest |
| | | { |
| | | UnmodifiablePasswordModifyExtendedRequestImpl( |
| | | PasswordModifyExtendedRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | public ByteString getNewPassword() { |
| | | return impl.getNewPassword(); |
| | | } |
| | | |
| | | public String getNewPasswordAsString() { |
| | | return impl.getNewPasswordAsString(); |
| | | } |
| | | |
| | | public ByteString getOldPassword() { |
| | | return impl.getOldPassword(); |
| | | } |
| | | |
| | | public String getOldPasswordAsString() { |
| | | return impl.getOldPasswordAsString(); |
| | | } |
| | | |
| | | public ByteString getUserIdentity() { |
| | | return impl.getUserIdentity(); |
| | | } |
| | | |
| | | public String getUserIdentityAsString() { |
| | | return impl.getUserIdentityAsString(); |
| | | } |
| | | |
| | | public PasswordModifyExtendedRequest setNewPassword(ByteString newPassword) |
| | | { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public PasswordModifyExtendedRequest setNewPassword(String newPassword) { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public PasswordModifyExtendedRequest setOldPassword(ByteString oldPassword) |
| | | { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public PasswordModifyExtendedRequest setOldPassword(String oldPassword) { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public PasswordModifyExtendedRequest setUserIdentity( |
| | | ByteString userIdentity) { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public PasswordModifyExtendedRequest setUserIdentity(String userIdentity) { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.ByteString; |
| | | import org.opends.sdk.LocalizedIllegalArgumentException; |
| | | |
| | | /** |
| | | * Unmodifiable plain SASL bind request implementation. |
| | | */ |
| | | final class UnmodifiablePlainSASLBindRequestImpl extends |
| | | AbstractUnmodifiableSASLBindRequest<PlainSASLBindRequest> implements |
| | | PlainSASLBindRequest |
| | | { |
| | | UnmodifiablePlainSASLBindRequestImpl(PlainSASLBindRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | @Override |
| | | public String getAuthenticationID() { |
| | | return impl.getAuthenticationID(); |
| | | } |
| | | |
| | | @Override |
| | | public String getAuthorizationID() { |
| | | return impl.getAuthorizationID(); |
| | | } |
| | | |
| | | @Override |
| | | public ByteString getPassword() { |
| | | return impl.getPassword(); |
| | | } |
| | | |
| | | @Override |
| | | public PlainSASLBindRequest setAuthenticationID(String authenticationID) |
| | | throws UnsupportedOperationException, LocalizedIllegalArgumentException, |
| | | NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public PlainSASLBindRequest setAuthorizationID(String authorizationID) |
| | | throws UnsupportedOperationException, LocalizedIllegalArgumentException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public PlainSASLBindRequest setPassword(ByteString password) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | @Override |
| | | public PlainSASLBindRequest setPassword(String password) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.*; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Unmodifiable search request implementation. |
| | | */ |
| | | final class UnmodifiableSearchRequestImpl |
| | | extends AbstractUnmodifiableRequest<SearchRequest> |
| | | implements SearchRequest |
| | | { |
| | | UnmodifiableSearchRequestImpl(SearchRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | public SearchRequest addAttribute(String... attributeDescriptions) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public List<String> getAttributes() { |
| | | return Collections.unmodifiableList(impl.getAttributes()); |
| | | } |
| | | |
| | | public DereferenceAliasesPolicy getDereferenceAliasesPolicy() { |
| | | return impl.getDereferenceAliasesPolicy(); |
| | | } |
| | | |
| | | public Filter getFilter() { |
| | | return impl.getFilter(); |
| | | } |
| | | |
| | | public DN getName() { |
| | | return impl.getName(); |
| | | } |
| | | |
| | | public SearchScope getScope() { |
| | | return impl.getScope(); |
| | | } |
| | | |
| | | public int getSizeLimit() { |
| | | return impl.getSizeLimit(); |
| | | } |
| | | |
| | | public int getTimeLimit() { |
| | | return impl.getTimeLimit(); |
| | | } |
| | | |
| | | public boolean isTypesOnly() { |
| | | return impl.isTypesOnly(); |
| | | } |
| | | |
| | | public SearchRequest setDereferenceAliasesPolicy( |
| | | DereferenceAliasesPolicy policy) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public SearchRequest setFilter(Filter filter) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public SearchRequest setFilter(String filter) |
| | | throws UnsupportedOperationException, |
| | | LocalizedIllegalArgumentException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public SearchRequest setName(DN dn) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public SearchRequest setName(String dn) |
| | | throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public SearchRequest setScope(SearchScope scope) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public SearchRequest setSizeLimit(int limit) |
| | | throws UnsupportedOperationException, |
| | | LocalizedIllegalArgumentException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public SearchRequest setTimeLimit(int limit) |
| | | throws UnsupportedOperationException, |
| | | LocalizedIllegalArgumentException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public SearchRequest setTypesOnly(boolean typesOnly) |
| | | throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.ByteString; |
| | | |
| | | /** |
| | | * Unmodifiable simple bind request implementation. |
| | | */ |
| | | final class UnmodifiableSimpleBindRequestImpl |
| | | extends AbstractUnmodifiableBindRequest<SimpleBindRequest> |
| | | implements SimpleBindRequest |
| | | { |
| | | UnmodifiableSimpleBindRequestImpl(SimpleBindRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | public ByteString getPassword() { |
| | | return impl.getPassword(); |
| | | } |
| | | |
| | | public String getPasswordAsString() { |
| | | return impl.getPasswordAsString(); |
| | | } |
| | | |
| | | public SimpleBindRequest setName(String name) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public SimpleBindRequest setPassword(ByteString password) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public SimpleBindRequest setPassword(String password) |
| | | throws UnsupportedOperationException, NullPointerException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.responses.ExtendedResult; |
| | | |
| | | import javax.net.ssl.SSLContext; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Unmodifiable start TLS extended request implementation. |
| | | */ |
| | | final class UnmodifiableStartTLSExtendedRequestImpl |
| | | extends AbstractUnmodifiableExtendedRequest |
| | | <StartTLSExtendedRequest, ExtendedResult> |
| | | implements StartTLSExtendedRequest |
| | | { |
| | | UnmodifiableStartTLSExtendedRequestImpl(StartTLSExtendedRequest impl) { |
| | | super(impl); |
| | | } |
| | | |
| | | public SSLContext getSSLContext() { |
| | | return impl.getSSLContext(); |
| | | } |
| | | |
| | | public StartTLSExtendedRequest addEnabledProtocol(String... protocols) { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public StartTLSExtendedRequest addEnabledCipherSuite(String... suites) { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public List<String> getEnabledProtocols() { |
| | | return Collections.unmodifiableList(impl.getEnabledProtocols()); |
| | | } |
| | | |
| | | public List<String> getEnabledCipherSuites() { |
| | | return Collections.unmodifiableList(impl.getEnabledCipherSuites()); |
| | | } |
| | | |
| | | public StartTLSExtendedRequest setSSLContext(SSLContext sslContext) { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | } |
| File was renamed from opendj-sdk/sdk/examples/org/opends/sdk/examples/package-info.java |
| | |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | /** |
| | | * Examples which use the OpenDS LDAP SDK. |
| | | * Unmodifiable unbind request implementation. |
| | | */ |
| | | package org.opends.sdk.examples; |
| | | |
| | | |
| | | |
| | | final class UnmodifiableUnbindRequestImpl |
| | | extends AbstractUnmodifiableRequest<UnbindRequest> |
| | | implements UnbindRequest |
| | | { |
| | | UnmodifiableUnbindRequestImpl(UnbindRequest impl) { |
| | | super(impl); |
| | | } |
| | | } |
copy from opendj-sdk/sdk/examples/org/opends/sdk/examples/package-info.java
copy to opendj-sdk/sdk/src/org/opends/sdk/requests/UnmodifiableWhoAmIExtendedRequestImpl.java
| File was copied from opendj-sdk/sdk/examples/org/opends/sdk/examples/package-info.java |
| | |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.sdk.requests; |
| | | |
| | | import org.opends.sdk.responses.WhoAmIExtendedResult; |
| | | |
| | | /** |
| | | * Examples which use the OpenDS LDAP SDK. |
| | | * Unmodifiable Who Am I extended request implementation. |
| | | */ |
| | | package org.opends.sdk.examples; |
| | | |
| | | |
| | | |
| | | final class UnmodifiableWhoAmIExtendedRequestImpl |
| | | extends AbstractUnmodifiableExtendedRequest |
| | | <WhoAmIExtendedRequest, WhoAmIExtendedResult> |
| | | implements WhoAmIExtendedRequest |
| | | { |
| | | UnmodifiableWhoAmIExtendedRequestImpl(WhoAmIExtendedRequest impl) { |
| | | super(impl); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new Who Am I extended request that is an exact copy of the |
| | | * provided request. |
| | | * |
| | | * @param whoAmIExtendedRequest |
| | | * The who Am I extended request to be copied. |
| | | * @throws NullPointerException |
| | | * If {@code whoAmIExtendedRequest} was {@code null} . |
| | | */ |
| | | WhoAmIExtendedRequestImpl( |
| | | final WhoAmIExtendedRequest whoAmIExtendedRequest) |
| | | throws NullPointerException |
| | | { |
| | | super(whoAmIExtendedRequest); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | |
| | | import org.opends.sdk.requests.DigestMD5SASLBindRequest; |
| | | import org.opends.sdk.requests.Requests; |
| | | import org.opends.sdk.requests.SearchRequest; |
| | | import org.testng.Assert; |
| | | import org.testng.annotations.BeforeClass; |
| | | import org.testng.annotations.Test; |
| | | import org.testng.annotations.DataProvider; |
| | |
| | | LDAPOptions options = new LDAPOptions() |
| | | .setSSLContext(sslContext) |
| | | .setUseStartTLS(true) |
| | | .setEnabledCipherSuites( |
| | | .addEnabledCipherSuite( |
| | | new String[] { "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", |
| | | "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", |
| | | "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", |