001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.activemq.transport;
018    
019    import java.net.InetSocketAddress;
020    import java.net.URI;
021    
022    import org.apache.activemq.Service;
023    import org.apache.activemq.command.BrokerInfo;
024    
025    /**
026     * A TransportServer asynchronously accepts {@see Transport} objects and then
027     * delivers those objects to a {@see TransportAcceptListener}.
028     *
029     *
030     */
031    public interface TransportServer extends Service {
032    
033        /**
034         * Registers an {@see TransportAcceptListener} which is notified of accepted
035         * channels.
036         *
037         * @param acceptListener
038         */
039        void setAcceptListener(TransportAcceptListener acceptListener);
040    
041        /**
042         * Associates a broker info with the transport server so that the transport
043         * can do discovery advertisements of the broker.
044         *
045         * @param brokerInfo
046         */
047        void setBrokerInfo(BrokerInfo brokerInfo);
048    
049        URI getConnectURI();
050    
051        /**
052         * @return The socket address that this transport is accepting connections
053         *         on or null if this does not or is not currently accepting
054         *         connections on a socket.
055         */
056        InetSocketAddress getSocketAddress();
057    
058        /**
059         * For TransportServers that provide SSL connections to their connected peers they should
060         * return true here if and only if they populate the ConnectionInfo command presented to
061         * the Broker with the peers certificate chain so that the broker knows it can use that
062         * information to authenticate the connected peer.
063         *
064         * @return true if this transport server provides SSL level security over its
065         *          connections.
066         */
067        boolean isSslServer();
068    }