/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.activeblaze;

/**
 * <p/>
 * A <CODE>BlazeChannel</CODE> is a wrapper for reliable multicast communication
 */
public interface BlazeChannel extends Service {
    /**
     * @return the id
     */
    public String getId();

    /**
     * broadcast as message
     */
    public void broadcast(String destination, BlazeMessage msg) throws Exception;

    /**
     * broadcast as message
     */
    public void broadcast(Destination destination, BlazeMessage msg) throws Exception;

    /**
     * @return the configuration
     */
    public BlazeConfiguration getConfiguration();

    /**
     * Add a listener for messages
     */
    public void addBlazeTopicMessageListener(String destination, BlazeMessageListener l) throws Exception;


    /**
     * Add a listener for messages
     */
    public void addBlazeTopicMessageListener(Subscription subscription, BlazeMessageListener l) throws Exception;

    /**
     * Remove a listener for messages
     */
    public void removeBlazeTopicMessageListener(String destination, BlazeMessageListener l) throws Exception;

    /**
     * Remove the subscription
     */
    public void removeBlazeTopicMessageListener(Subscription suscription, BlazeMessageListener l) throws Exception;

    /**
     * Set an exception listener for async exceptions that can be generated
     * by a Transport thread
     */
    public void setExceptionListener(ExceptionListener l);

}