Package org.jscsi.parser.datasegment

Examples of org.jscsi.parser.datasegment.SettingsMap


         * @return the value of the given parameter of the connection.
         * @throws OperationalTextKeyException If the given parameter cannot be found.
         */
        final String getSetting (final int connectionID, final OperationalTextKey textKey) throws OperationalTextKeyException {

            final SettingsMap sm = connectionConfiguration.get(connectionID);
            if (sm != null) {
                final String value = sm.get(textKey);
                if (value != null) { return value; }
            }

            final String value = sessionConfiguration.get(textKey);
            if (value != null) { return value; }
View Full Code Here


         * @param connectionID The ID of the connection.
         * @return All session-wide and connection-specific settings of the connection.
         */
        final SettingsMap getSettings (final int connectionID) {

            final SettingsMap sm = new SettingsMap();

            // set all session settings
            for (Map.Entry<OperationalTextKey , String> e : sessionConfiguration.entrySet()) {
                sm.add(e.getKey(), e.getValue());
            }

            // set all connection settings (if any)
            final SettingsMap connectionSettings = connectionConfiguration.get(connectionID);
            if (connectionSettings != null) {

                for (Map.Entry<OperationalTextKey , String> e : connectionSettings.entrySet()) {
                    sm.add(e.getKey(), e.getValue());
                }
            }
            return sm;
        }
View Full Code Here

     * @throws InternetSCSIException This exception should be never thrown.
     */
    @Test
    public void testDeserialize1 () throws IOException , InternetSCSIException , DigestException {

        SettingsMap expectedKeyValuePair = new SettingsMap();
        expectedKeyValuePair.add(OperationalTextKey.INITIATOR_NAME, "iqn.com.ibm.k-machine");
        expectedKeyValuePair.add(OperationalTextKey.TARGET_NAME, "iqn.1987-05.com.cisco.00.58031e1d068ac226d385847592c0b670.IBM-Disk");
        expectedKeyValuePair.add(OperationalTextKey.AUTH_METHOD, "none");
        expectedKeyValuePair.add(OperationalTextKey.SESSION_TYPE, "normal");

        super.setUp(TEST_CASE_1);
        super.testDeserialize(true, false, OperationCode.LOGIN_REQUEST, 0x00000000, 0x00000095, 0xC8D04B81);
        super.testDataSegment(expectedKeyValuePair);

View Full Code Here

     * @throws InternetSCSIException This exception should be never thrown.
     */
    @Test
    public void testDeserialize2 () throws IOException , InternetSCSIException , DigestException {

        SettingsMap expectedKeyValuePair = new SettingsMap();
        expectedKeyValuePair.add(OperationalTextKey.INITIATOR_NAME, "iqn.1987-05.com.cisco:01.ac24953f3f9");
        expectedKeyValuePair.add(OperationalTextKey.INITIATOR_ALIAS, "Initiator");
        expectedKeyValuePair.add(OperationalTextKey.TARGET_NAME, "disk1");
        expectedKeyValuePair.add(OperationalTextKey.SESSION_TYPE, "Normal");
        expectedKeyValuePair.add(OperationalTextKey.HEADER_DIGEST, "None,CRC32CDigest");
        expectedKeyValuePair.add(OperationalTextKey.DATA_DIGEST, "None");
        expectedKeyValuePair.add(OperationalTextKey.DEFAULT_TIME_2_WAIT, "0");
        expectedKeyValuePair.add(OperationalTextKey.DEFAULT_TIME_2_RETAIN, "0");
        expectedKeyValuePair.add(OperationalTextKey.ERROR_RECOVERY_LEVEL, "0");
        expectedKeyValuePair.add(OperationalTextKey.INITIAL_R2T, "No");
        expectedKeyValuePair.add(OperationalTextKey.IMMEDIATE_DATA, "Yes");
        expectedKeyValuePair.add(OperationalTextKey.MAX_BURST_LENGTH, "16776192");
        expectedKeyValuePair.add(OperationalTextKey.FIRST_BURST_LENGTH, "262144");
        expectedKeyValuePair.add(OperationalTextKey.MAX_OUTSTANDING_R2T, "1");
        expectedKeyValuePair.add(OperationalTextKey.MAX_CONNECTIONS, "1");
        expectedKeyValuePair.add(OperationalTextKey.DATA_PDU_IN_ORDER, "Yes");
        expectedKeyValuePair.add(OperationalTextKey.DATA_SEQUENCE_IN_ORDER, "Yes");
        expectedKeyValuePair.add(OperationalTextKey.MAX_RECV_DATA_SEGMENT_LENGTH, "131072");
        expectedKeyValuePair.add(OperationalTextKey.IF_MARKER, "No");
        expectedKeyValuePair.add(OperationalTextKey.OF_MARKER, "No");

        super.setUp(TEST_CASE_2);
        super.testDeserialize(true, true, OperationCode.LOGIN_REQUEST, 0x00000000, 0x000001AE, 0x000A0000);
        super.testDataSegment(expectedKeyValuePair);

View Full Code Here

TOP

Related Classes of org.jscsi.parser.datasegment.SettingsMap

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.