Package streamer

Examples of streamer.Pipeline


        InputStreamSource inputStreamSource = new InputStreamSource("source", is);
        OutputStreamSink outputStreamSink = new OutputStreamSink("mainSink", mainOS);

        Vnc33Hello hello = new Vnc33Hello("hello");

        Pipeline pipeline = new PipelineImpl("test");

        pipeline.addAndLink(inputStreamSource, hello, outputStreamSink);
        pipeline.add(new OutputStreamSink("initSink", initOS));

        pipeline.link("hello >" + OneTimeSwitch.OTOUT, "initSink");

        pipeline.runMainLoop("source", STDOUT, false, false);

        String initOut = new String(initOS.toByteArray(), RfbConstants.US_ASCII_CHARSET);
        String mainOut = new String(mainOS.toByteArray(), RfbConstants.US_ASCII_CHARSET);

        if (!"RFB 003.003\n".equals(initOut))
View Full Code Here


                // Expect encoded password
                bufs = new ByteBuffer[] {auth.encodePassword(new ByteBuffer(new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}), password)};
            }
        };

        Pipeline pipeline = new PipelineImpl("test");
        pipeline.addAndLink(source, auth, mainSink);
        pipeline.add(initSink);
        pipeline.link("auth >otout", "initSink");

        pipeline.runMainLoop("source", STDOUT, false, false);

    }
View Full Code Here

        buf.putMetadata(WIDTH, 3);
        buf.putMetadata(HEIGHT, 4);

        Element source = new MockSource("source", new ByteBuffer[] {buf});

        Pipeline pipeline = new PipelineImpl("test");

        pipeline.addAndLink(source, adapter, sink);
        pipeline.runMainLoop("source", STDOUT, false, false);

    }
View Full Code Here

                // Expect encoded password
                bufs = new ByteBuffer[] {auth.encodePassword(new ByteBuffer(new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}), password)};
            }
        };

        Pipeline pipeline = new PipelineImpl("test");
        pipeline.addAndLink(source, auth, mainSink);
        pipeline.add(initSink);
        pipeline.link("auth >otout", "initSink");

        pipeline.runMainLoop("source", STDOUT, false, false);

    }
View Full Code Here

        InputStreamSource inputStreamSource = new InputStreamSource("source", is);
        OutputStreamSink outputStreamSink = new OutputStreamSink("mainSink", mainOS);

        Vnc_3_3_Hello hello = new Vnc_3_3_Hello("hello");

        Pipeline pipeline = new PipelineImpl("test");

        pipeline.addAndLink(inputStreamSource, hello, outputStreamSink);
        pipeline.add(new OutputStreamSink("initSink", initOS));

        pipeline.link("hello >" + OneTimeSwitch.OTOUT, "initSink");

        pipeline.runMainLoop("source", STDOUT, false, false);

        String initOut = new String(initOS.toByteArray(), RfbConstants.US_ASCII_CHARSET);
        String mainOut = new String(mainOS.toByteArray(), RfbConstants.US_ASCII_CHARSET);

        if (!"RFB 003.003\n".equals(initOut))
View Full Code Here

            _worker = new Thread(new Runnable() {
                @Override
                public void run() {
                    _socket = new AprSocketWrapperImpl("socket", sslState);
                    Pipeline pipeline = new PipelineImpl("Client");
                    pipeline.add(_socket, _client);
                    pipeline.link("socket", _client.getId(), "socket");
                    pipeline.validate();

                    InetSocketAddress address = new InetSocketAddress(host, port);
                    ConsoleProxy.ensureRoute(host);

                    try {
View Full Code Here

        MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {1, 2, 3}));
        Element pcb = new ClientPreConnectionBlob("pcb", "39418F90-6D03-468E-B796-91C60DD6653A");
        Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(packet));
        Element mainSink = new MockSink("mainSink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {1, 2, 3}));

        Pipeline pipeline = new PipelineImpl("test");
        pipeline.add(source, pcb, sink, mainSink);
        pipeline.link("source", "pcb", "mainSink");
        pipeline.link("pcb >" + OTOUT, "sink");
        pipeline.runMainLoop("source", STDOUT, false, false);
    }
View Full Code Here

        ByteBuffer clipboardAdapterPacket = new ByteBuffer(0);
        clipboardAdapterPacket.putMetadata(AwtClipboardAdapter.CLIPBOARD_CONTENT, "hello world");
        Element sink = new MockSink("sink", new ByteBuffer[] {clipboardAdapterPacket});

        Pipeline pipeline = new PipelineImpl("test");
        pipeline.add(source, router, format_data_response, sink);
        pipeline.link("source", "router >format_data_response", "format_data_response >clipboard", "sink");
        pipeline.runMainLoop("source", STDOUT, false, false);

    }
View Full Code Here

                0x04, 0x00, 0x00, 0x00, // CLIPRDR_HEADER::dataLen = 4 bytes
                0x0d, 0x00, 0x00, 0x00, // CLIPRDR_FORMAT_DATA_REQUEST::requestedFormatId
                                        // = 0x0d
        }));

        Pipeline pipeline = new PipelineImpl("test");
        pipeline.add(source, router, format_list, sink);
        pipeline.link("source", "router >format_list", "format_list", "sink");
        pipeline.runMainLoop("source", STDOUT, false, false);

        // Check state
        if (!(state.serverClipboardDataFormats.containsKey(49475) && state.serverClipboardDataFormats.containsKey("Rich Text Format")))
            throw new RuntimeException("Server format list packet parsed incorrectly.");
View Full Code Here

        Element router = new ServerClipRdrChannelRouter("router");
        ClipboardState state = new ClipboardState();
        Element monitor_ready = new ServerMonitorReadyPDU("monitor_ready", state);
        Element sink = new MockSink("sink", new ByteBuffer[] {});

        Pipeline pipeline = new PipelineImpl("test");
        pipeline.add(source, router, monitor_ready, sink);
        pipeline.link("source", "router >monitor_ready", "monitor_ready", "sink");
        pipeline.runMainLoop("source", STDOUT, false, false);

        // Check state
        if (!state.serverReady)
            throw new RuntimeException("Server monitor ready packet parsed incorrectly.");
View Full Code Here

TOP

Related Classes of streamer.Pipeline

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.