View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *  http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.directory.server.protocol.shared.transport;
20  
21  
22  import org.apache.mina.core.service.IoAcceptor;
23  
24  
25  public interface Transport
26  {
27      /**
28       * Initialize the Acceptor if needed
29       */
30      void init();
31  
32  
33      /**
34       * @return The associated Address
35       */
36      String getAddress();
37  
38  
39      /**
40       * Set the InetAddress for this transport.
41       * @param address The address to set
42       */
43      void setAddress( String address );
44  
45  
46      /**
47       * Gets the port for this service.
48       *
49       * @return the port for this service
50       */
51      int getPort();
52  
53  
54      /**
55       * Sets the port for this service.
56       *
57       * @param port the port for this service
58       * @throws IllegalArgumentException if the port number is not within a valid range
59       */
60      void setPort( int port );
61  
62  
63      /**
64       * @return The associated IoAcceptor
65       */
66      IoAcceptor getAcceptor();
67  
68  
69      /**
70       * @return The number of processing threads for this acceptor
71       */
72      int getNbThreads();
73  
74  
75      /**
76       * Set the number of processing threads for the acceptor
77       * @param nbThreads The number of threads to create in the acceptor
78       */
79      void setNbThreads( int nbThreads );
80  
81  
82      /**
83       * @return The number of messages stored into the backlog when the 
84       * acceptor is being busy processing the current messages
85       */
86      int getBackLog();
87  
88  
89      /**
90       * Set the size of the messages queue waiting for the acceptor to
91       * be ready.
92       * @param backLog The queue size
93       */
94      void setBackLog( int backLog );
95  
96  
97      /**
98       * Enable or disable SSL
99       * @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 }