Package org.jivesoftware.smackx.bytestreams.ibb

Examples of org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamListener


        rand.nextBytes(data);
        final SynchronousQueue<byte[]> queue = new SynchronousQueue<byte[]>();

        InBandBytestreamManager targetByteStreamManager = InBandBytestreamManager.getByteStreamManager(targetConnection);

        InBandBytestreamListener incomingByteStreamListener = new InBandBytestreamListener() {

            public void incomingBytestreamRequest(InBandBytestreamRequest request) {
                InputStream inputStream;
                try {
                    inputStream = request.accept().getInputStream();
View Full Code Here


        rand.nextBytes(data);
        final SynchronousQueue<byte[]> queue = new SynchronousQueue<byte[]>();

        InBandBytestreamManager targetByteStreamManager = InBandBytestreamManager.getByteStreamManager(targetConnection);

        InBandBytestreamListener incomingByteStreamListener = new InBandBytestreamListener() {

            public void incomingBytestreamRequest(InBandBytestreamRequest request) {
                InputStream inputStream;
                try {
                    inputStream = request.accept().getInputStream();
View Full Code Here

        final SynchronousQueue<byte[]> queue = new SynchronousQueue<byte[]>();

        InBandBytestreamManager targetByteStreamManager = InBandBytestreamManager.getByteStreamManager(targetConnection);

        InBandBytestreamListener incomingByteStreamListener = new InBandBytestreamListener() {

            public void incomingBytestreamRequest(InBandBytestreamRequest request) {
                try {
                    InBandBytestreamSession session = request.accept();
                    OutputStream outputStream = session.getOutputStream();
View Full Code Here

     */
    @Test
    public void shouldInvokeListenerForAllRequests() throws Exception {

        // add listener
        InBandBytestreamListener listener = mock(InBandBytestreamListener.class);
        byteStreamManager.addIncomingBytestreamListener(listener);

        // run the listener with the initiation packet
        initiationListener.processPacket(initBytestream);

View Full Code Here

     */
    @Test
    public void shouldInvokeListenerForUser() throws Exception {

        // add listener
        InBandBytestreamListener listener = mock(InBandBytestreamListener.class);
        byteStreamManager.addIncomingBytestreamListener(listener, initiatorJID);

        // run the listener with the initiation packet
        initiationListener.processPacket(initBytestream);

View Full Code Here

     */
    @Test
    public void shouldNotInvokeListenerForUser() throws Exception {

        // add listener for request of user "other_initiator"
        InBandBytestreamListener listener = mock(InBandBytestreamListener.class);
        byteStreamManager.addIncomingBytestreamListener(listener, "other_" + initiatorJID);

        // run the listener with the initiation packet
        initiationListener.processPacket(initBytestream);

View Full Code Here

     */
    @Test
    public void shouldNotInvokeAllRequestsListenerIfUserListenerExists() throws Exception {

        // add listener for all request
        InBandBytestreamListener allRequestsListener = mock(InBandBytestreamListener.class);
        byteStreamManager.addIncomingBytestreamListener(allRequestsListener);

        // add listener for request of user "initiator"
        InBandBytestreamListener userRequestsListener = mock(InBandBytestreamListener.class);
        byteStreamManager.addIncomingBytestreamListener(userRequestsListener, initiatorJID);

        // run the listener with the initiation packet
        initiationListener.processPacket(initBytestream);

View Full Code Here

     */
    @Test
    public void shouldInvokeAllRequestsListenerIfUserListenerExists() throws Exception {

        // add listener for all request
        InBandBytestreamListener allRequestsListener = mock(InBandBytestreamListener.class);
        byteStreamManager.addIncomingBytestreamListener(allRequestsListener);

        // add listener for request of user "other_initiator"
        InBandBytestreamListener userRequestsListener = mock(InBandBytestreamListener.class);
        byteStreamManager.addIncomingBytestreamListener(userRequestsListener, "other_"
                        + initiatorJID);

        // run the listener with the initiation packet
        initiationListener.processPacket(initBytestream);
View Full Code Here

     */
    @Test
    public void shouldIgnoreInBandBytestreamRequestOnce() throws Exception {

        // add listener for all request
        InBandBytestreamListener allRequestsListener = mock(InBandBytestreamListener.class);
        byteStreamManager.addIncomingBytestreamListener(allRequestsListener);

        // add listener for request of user "initiator"
        InBandBytestreamListener userRequestsListener = mock(InBandBytestreamListener.class);
        byteStreamManager.addIncomingBytestreamListener(userRequestsListener, initiatorJID);

        // ignore session ID
        byteStreamManager.ignoreBytestreamRequestOnce(sessionID);

View Full Code Here

TOP

Related Classes of org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.