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 */
019 package org.apache.directory.server.protocol.shared.transport;
020
021 import org.apache.mina.core.service.IoAcceptor;
022
023 public interface Transport
024 {
025 /**
026 * Initialize the Acceptor if needed
027 */
028 void init();
029
030 /**
031 * @return The associated Address
032 */
033 String getAddress();
034
035
036 /**
037 * Set the InetAddress for this transport.
038 * @param address The address to set
039 */
040 void setAddress( String address );
041
042
043 /**
044 * Gets the port for this service.
045 *
046 * @return the port for this service
047 */
048 int getPort();
049
050
051 /**
052 * Sets the port for this service.
053 *
054 * @param port the port for this service
055 * @throws IllegalArgumentException if the port number is not within a valid range
056 */
057 void setPort( int port );
058
059
060 /**
061 * @return The associated IoAcceptor
062 */
063 IoAcceptor getAcceptor();
064
065
066 /**
067 * Set the IoAcceptor
068 * @param acceptor The IoAcceptor to set
069 *
070 void setAcceptor ( IoAcceptor acceptor );
071
072
073 /**
074 * @return The number of processing threads for this acceptor
075 */
076 int getNbThreads();
077
078
079 /**
080 * Set the number of processing threads for the acceptor
081 * @param nbThreads The number of threads to create in the acceptor
082 */
083 void setNbThreads( int nbThreads );
084
085
086 /**
087 * @return The number of messages stored into the backlog when the
088 * acceptor is being busy processing the current messages
089 */
090 int getBackLog();
091
092
093 /**
094 * Set the size of the messages queue waiting for the acceptor to
095 * be ready.
096 * @param backLog The queue size
097 */
098 void setBackLog( int backLog );
099
100
101 /**
102 * Enable or disable SSL
103 * @param sslEnabled if <code>true</code>, SSL is enabled.
104 */
105 void setEnableSSL( boolean sslEnabled );
106
107
108 /**
109 * Enable or disable SSL
110 * @param sslEnabled if <code>true</code>, SSL is enabled.
111 */
112 void enableSSL( boolean sslEnabled );
113
114
115 /**
116 * @return <code>true</code> id SSL is enabled for this transport
117 */
118 boolean isSSLEnabled();
119 }