001/**
002 *
003 * Copyright the original author or authors
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * 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 */
017package org.jivesoftware.smackx.bytestreams;
018
019import org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamListener;
020import org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamManager;
021import org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamListener;
022import org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamManager;
023
024/**
025 * BytestreamListener are notified if a remote user wants to initiate a bytestream. Implement this
026 * interface to handle incoming bytestream requests.
027 * <p>
028 * BytestreamListener can be registered at the {@link Socks5BytestreamManager} or the
029 * {@link InBandBytestreamManager}.
030 * <p>
031 * There are two ways to add this listener. See
032 * {@link BytestreamManager#addIncomingBytestreamListener(BytestreamListener)} and
033 * {@link BytestreamManager#addIncomingBytestreamListener(BytestreamListener, org.jxmpp.jid.Jid)} for further
034 * details.
035 * <p>
036 * {@link Socks5BytestreamListener} or {@link InBandBytestreamListener} provide a more specific
037 * interface of the BytestreamListener.
038 *
039 * @author Henning Staib
040 */
041public interface BytestreamListener {
042
043    /**
044     * This listener is notified if a bytestream request from another user has been received.
045     *
046     * @param request the incoming bytestream request
047     */
048    void incomingBytestreamRequest(BytestreamRequest request);
049
050}