001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2013-2014 ForgeRock AS.
015 */
016package org.forgerock.opendj.ldap.spi;
017
018import java.io.Closeable;
019import java.net.InetSocketAddress;
020
021/**
022 * Interface for all classes that actually implement {@code LDAPListener}.
023 * <p>
024 * An implementation class is provided by a {@code TransportProvider}.
025 * <p>
026 * The implementation can be automatically loaded using the
027 * {@code java.util.ServiceLoader} facility if its provider extending
028 * {@code TransportProvider} is declared in the provider-configuration file
029 * {@code META-INF/services/org.forgerock.opendj.ldap.spi.TransportProvider}.
030 */
031public interface LDAPListenerImpl extends Closeable {
032
033    /**
034     * Returns the address that this LDAP listener is listening on.
035     *
036     * @return The address that this LDAP listener is listening on.
037     */
038    InetSocketAddress getSocketAddress();
039
040    /**
041     * Closes this stream and releases any system resources associated
042     * with it. If the stream is already closed then invoking this
043     * method has no effect.
044     */
045    @Override
046    void close();
047
048}