mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
09.58.2013 7057e430ce059963724928296ff166e68b4e2ebb
opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/AbstractConnectionWrapper.java
File was renamed from opendj3/opendj-ldap-sdk/src/main/java/com/forgerock/opendj/util/ConnectionDecorator.java
@@ -25,21 +25,10 @@
 *      Portions copyright 2011-2013 ForgeRock AS
 */
package com.forgerock.opendj.util;
package org.forgerock.opendj.ldap;
import java.util.Collection;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.Connection;
import org.forgerock.opendj.ldap.ConnectionEventListener;
import org.forgerock.opendj.ldap.DN;
import org.forgerock.opendj.ldap.Entry;
import org.forgerock.opendj.ldap.ErrorResultException;
import org.forgerock.opendj.ldap.FutureResult;
import org.forgerock.opendj.ldap.IntermediateResponseHandler;
import org.forgerock.opendj.ldap.ResultHandler;
import org.forgerock.opendj.ldap.SearchResultHandler;
import org.forgerock.opendj.ldap.SearchScope;
import org.forgerock.opendj.ldap.requests.AbandonRequest;
import org.forgerock.opendj.ldap.requests.AddRequest;
import org.forgerock.opendj.ldap.requests.BindRequest;
@@ -60,24 +49,26 @@
import org.forgerock.opendj.ldif.ChangeRecord;
import org.forgerock.opendj.ldif.ConnectionEntryReader;
import com.forgerock.opendj.util.Validator;
/**
 * A base class from which connection decorators may be easily implemented. The
 * default implementation of each method is to delegate to the decorated
 * connection.
 * An abstract base class from which connection wrappers may be easily
 * implemented. The default implementation of each method is to delegate to the
 * wrapped connection.
 */
public abstract class ConnectionDecorator implements Connection {
public abstract class AbstractConnectionWrapper implements Connection {
    /**
     * The decorated connection.
     * The wrapped connection.
     */
    protected final Connection connection;
    /**
     * Creates a new connection decorator.
     * Creates a new connection wrapper.
     *
     * @param connection
     *            The connection to be decorated.
     *            The connection to be wrapped.
     */
    protected ConnectionDecorator(final Connection connection) {
    protected AbstractConnectionWrapper(final Connection connection) {
        Validator.ensureNotNull(connection);
        this.connection = connection;
    }
@@ -140,7 +131,17 @@
     * The default implementation is to delegate.
     */
    @Override
    public Result applyChange(ChangeRecord request) throws ErrorResultException {
    public void addConnectionEventListener(final ConnectionEventListener listener) {
        connection.addConnectionEventListener(listener);
    }
    /**
     * {@inheritDoc}
     * <p>
     * The default implementation is to delegate.
     */
    @Override
    public Result applyChange(final ChangeRecord request) throws ErrorResultException {
        return connection.applyChange(request);
    }
@@ -162,16 +163,6 @@
     * The default implementation is to delegate.
     */
    @Override
    public void addConnectionEventListener(final ConnectionEventListener listener) {
        connection.addConnectionEventListener(listener);
    }
    /**
     * {@inheritDoc}
     * <p>
     * The default implementation is to delegate.
     */
    @Override
    public BindResult bind(final BindRequest request) throws ErrorResultException {
        return connection.bind(request);
    }