001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *  http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.directory.server.protocol.shared.transport;
020
021
022import org.apache.mina.core.service.IoAcceptor;
023
024
025public interface Transport
026{
027    /**
028     * Initialize the Acceptor if needed
029     */
030    void init();
031
032
033    /**
034     * @return The associated Address
035     */
036    String getAddress();
037
038
039    /**
040     * Set the InetAddress for this transport.
041     * @param address The address to set
042     */
043    void setAddress( String address );
044
045
046    /**
047     * Gets the port for this service.
048     *
049     * @return the port for this service
050     */
051    int getPort();
052
053
054    /**
055     * Sets the port for this service.
056     *
057     * @param port the port for this service
058     * @throws IllegalArgumentException if the port number is not within a valid range
059     */
060    void setPort( int port );
061
062
063    /**
064     * @return The associated IoAcceptor
065     */
066    IoAcceptor getAcceptor();
067
068
069    /**
070     * @return The number of processing threads for this acceptor
071     */
072    int getNbThreads();
073
074
075    /**
076     * Set the number of processing threads for the acceptor
077     * @param nbThreads The number of threads to create in the acceptor
078     */
079    void setNbThreads( int nbThreads );
080
081
082    /**
083     * @return The number of messages stored into the backlog when the 
084     * acceptor is being busy processing the current messages
085     */
086    int getBackLog();
087
088
089    /**
090     * Set the size of the messages queue waiting for the acceptor to
091     * be ready.
092     * @param backLog The queue size
093     */
094    void setBackLog( int backLog );
095
096
097    /**
098     * Enable or disable SSL
099     * @param sslEnabled if <code>true</code>, SSL is enabled.
100     */
101    void setEnableSSL( boolean sslEnabled );
102
103
104    /**
105     * Enable or disable SSL
106     * @param sslEnabled if <code>true</code>, SSL is enabled.
107     */
108    void enableSSL( boolean sslEnabled );
109
110
111    /**
112     * @return <code>true</code> if SSL is enabled for this transport
113     */
114    boolean isSSLEnabled();
115}