Examples of Initiator


Examples of ca.uhn.hl7v2.app.Initiator

        // A connection object represents a socket attached to an HL7 server
        Connection connection = connectionHub
                .attach(host, port, new PipeParser(), MinLowerLayerProtocol.class);

        // The initiator is used to transmit unsolicited messages
        Initiator initiator = connection.getInitiator();
        HL7Message sampleMessage = new HL7Message();

        //send
        Message response = null;
        try {
            response = initiator.sendAndReceive(sampleMessage.getHL7Message());
            PipeParser parser = new PipeParser();
            String responseString = parser.encode(response);
            System.out.println("Received response:\n" + responseString);
        } catch (LLPException e) {
            System.out.println("Error : " + e);
View Full Code Here

Examples of ca.uhn.hl7v2.app.Initiator

        try {
            Message message = parser.parse(xmlFormat);
            ConnectionHub connectionHub = ConnectionHub.getInstance();
            Connection connection = getConnection(targetEPR, connectionHub);
            Initiator initiator = connection.getInitiator();
            String timeout = params.get(HL7Constants.TIMEOUT_PARAM);
            if (timeout != null) {
                initiator.setTimeoutMillis(Integer.parseInt(timeout));
            } else {
                initiator.setTimeoutMillis(HL7Constants.DEFAULT_TIMEOUT);
            }

            returnMsg = initiator.sendAndReceive(message);
            connectionHub.detach(connection);

            if (log.isDebugEnabled()) {
                log.debug("HL7 message successfully dispatched to URL " + targetEPR);
                log.debug("Response message received from target EP : " + returnMsg.toString());
View Full Code Here

Examples of ca.uhn.hl7v2.app.Initiator

        // A connection object represents a socket attached to an HL7 server
        Connection connection = connectionHub
                .attach("localhost", port, new PipeParser(), MinLowerLayerProtocol.class);

        // The initiator is used to transmit unsolicited messages
        Initiator initiator = connection.getInitiator();
        Message response = initiator.sendAndReceive(adt);

        String responseString = parser.encode(response);
        System.out.println("Received response:\n" + responseString);

        /*
 
View Full Code Here

Examples of ca.uhn.hl7v2.app.Initiator

        // A connection object represents a socket attached to an HL7 server
        Connection connection = connectionHub
                .attach("localhost", port, new PipeParser(), MinLowerLayerProtocol.class);

        // The initiator is used to transmit unsolicited messages
        Initiator initiator = connection.getInitiator();
        Message response = initiator.sendAndReceive(adt);

        String responseString = parser.encode(response);
        System.out.println("Received response:\n" + responseString);

        /*
 
View Full Code Here

Examples of org.jscsi.initiator.Initiator

     * @throws Exception
     *             if any error occurs
     */
    public JSCSIDevice(final String targetName) throws Exception {

        initiator = new Initiator(Configuration.create());
        target = targetName;
    }
View Full Code Here

Examples of org.jscsi.initiator.Initiator

        random.nextBytes(writeData2.array());

        // init of initiator and the session
        String target1 = "testing-xen2-disk1";
        String target2 = "testing-xen2-disk2";
        Initiator initiator = new Initiator(Configuration.create());
        initiator.createSession(target1);
        initiator.createSession(target2);

        // writing the first target multithreaded
        final Future<Void> write1 = initiator.multiThreadedWrite(target1, writeData1, address, writeData1.capacity());
        // writing the second target multithreaded
        final Future<Void> write2 = initiator.multiThreadedWrite(target2, writeData2, address, writeData2.capacity());

        // Blocking until writes are concluded
        write1.get();
        write2.get();

        // Getting the data from the first target multithreaded
        final Future<Void> read1 = initiator.multiThreadedRead(target1, readData1, address, readData1.capacity());
        // Getting the data from the second target multithreaded
        final Future<Void> read2 = initiator.multiThreadedRead(target2, readData2, address, readData2.capacity());

        // Blocking until reads are concluded
        read1.get();
        read2.get();

        // closing the targets
        initiator.closeSession(target1);
        initiator.closeSession(target2);

        // correctness check
        if (!Arrays.equals(writeData1.array(), readData1.array()) || !Arrays.equals(writeData2.array(), readData2.array())) { throw new IllegalStateException("Data read must be equal to the data written"); }
    }
View Full Code Here

Examples of org.jscsi.initiator.Initiator

        Random random = new Random(System.currentTimeMillis());
        random.nextBytes(writeData.array());

        // init of initiator and the session
        String target = "testing-xen2-disk1";
        Initiator initiator = new Initiator(Configuration.create());
        initiator.createSession(target);

        // writing the data single threaded
        initiator.write(target, writeData, address, writeData.capacity());

        // reading the data single threaded
        initiator.read(target, readData, address, readData.capacity());

        // closing the session
        initiator.closeSession(target);

        // correctness check
        if (!Arrays.equals(writeData.array(), readData.array())) { throw new IllegalStateException("Data read must be equal to the data written"); }
    }
View Full Code Here

Examples of org.jscsi.initiator.Initiator

public class SimpleLoginLogout {

    public static void main (final String[] args) throws NoSuchSessionException , TaskExecutionException , ConfigurationException {
        // init of the target
        String target = "testing-xen2-disk1";
        Initiator initiator = new Initiator(Configuration.create());
        // creating session, performing login on target
        initiator.createSession(target);
        // closing the session
        initiator.closeSession(target);
    }
View Full Code Here

Examples of org.jscsi.initiator.Initiator

    public static final void initialize () throws Exception {
        CallableStart.start();

        configuration = Configuration.create(new File(CONFIG_DIR, "jscsi.xsd"), new File(CONFIG_DIR, "jscsi.xml"));

        initiator = new Initiator(configuration);

        readBuffer = ByteBuffer.allocate(BUFFER_SIZE);
        writeBuffer = ByteBuffer.allocate(BUFFER_SIZE);

        randomGenerator = new Random(System.currentTimeMillis());
View Full Code Here

Examples of org.voltdb.iv2.Initiator

                                                List<Integer> m_partitionsToSitesAtStartupForExportInit)
    {
        List<Initiator> initiators = new ArrayList<Initiator>();
        for (Integer partition : partitions)
        {
            Initiator initiator = new SpInitiator(m_messenger, partition, getStatsAgent(),
                    m_snapshotCompletionMonitor, startAction);
            initiators.add(initiator);
            m_partitionsToSitesAtStartupForExportInit.add(partition);
        }
        return initiators;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.