| 1 | |
package org.jscsi.target.settings; |
| 2 | |
|
| 3 | |
|
| 4 | |
import java.util.Collection; |
| 5 | |
|
| 6 | |
import javax.naming.OperationNotSupportedException; |
| 7 | |
|
| 8 | |
import org.jscsi.target.settings.entry.Entry; |
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
|
| 20 | |
|
| 21 | |
final class SessionSettingsBuilderComponent { |
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
long settingsId; |
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
Boolean dataPduInOrder; |
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
|
| 36 | |
Boolean dataSequenceInOrder; |
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
Integer defaultTime2Retain; |
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | |
|
| 46 | |
Integer defaultTime2Wait; |
| 47 | |
|
| 48 | |
|
| 49 | |
|
| 50 | |
|
| 51 | |
Integer errorRecoveryLevel; |
| 52 | |
|
| 53 | |
|
| 54 | |
|
| 55 | |
|
| 56 | |
Integer firstBurstLength; |
| 57 | |
|
| 58 | |
|
| 59 | |
|
| 60 | |
|
| 61 | |
Boolean immediateData; |
| 62 | |
|
| 63 | |
|
| 64 | |
|
| 65 | |
|
| 66 | |
Boolean initialR2T; |
| 67 | |
|
| 68 | |
|
| 69 | |
|
| 70 | |
|
| 71 | |
String initiatorAlias; |
| 72 | |
|
| 73 | |
|
| 74 | |
|
| 75 | |
|
| 76 | |
String initiatorName; |
| 77 | |
|
| 78 | |
|
| 79 | |
|
| 80 | |
|
| 81 | |
Integer maxBurstLength; |
| 82 | |
|
| 83 | |
|
| 84 | |
|
| 85 | |
|
| 86 | |
Integer maxConnections; |
| 87 | |
|
| 88 | |
|
| 89 | |
|
| 90 | |
|
| 91 | |
Integer maxOutstandingR2T; |
| 92 | |
|
| 93 | |
|
| 94 | |
|
| 95 | |
|
| 96 | |
String sessionType; |
| 97 | |
|
| 98 | |
|
| 99 | |
|
| 100 | |
|
| 101 | |
|
| 102 | |
|
| 103 | |
|
| 104 | |
|
| 105 | 0 | SessionSettingsBuilderComponent (final long settingsId, final Collection<Entry> entries) { |
| 106 | 0 | this.settingsId = settingsId; |
| 107 | |
try { |
| 108 | 0 | dataPduInOrder = SettingsNegotiator.getEntry(TextKeyword.DATA_PDU_IN_ORDER, entries).getBooleanValue(); |
| 109 | 0 | dataSequenceInOrder = SettingsNegotiator.getEntry(TextKeyword.DATA_SEQUENCE_IN_ORDER, entries).getBooleanValue(); |
| 110 | 0 | defaultTime2Retain = SettingsNegotiator.getEntry(TextKeyword.DEFAULT_TIME_2_RETAIN, entries).getIntegerValue(); |
| 111 | 0 | defaultTime2Wait = SettingsNegotiator.getEntry(TextKeyword.DEFAULT_TIME_2_WAIT, entries).getIntegerValue(); |
| 112 | 0 | errorRecoveryLevel = SettingsNegotiator.getEntry(TextKeyword.ERROR_RECOVERY_LEVEL, entries).getIntegerValue(); |
| 113 | 0 | firstBurstLength = SettingsNegotiator.getEntry(TextKeyword.FIRST_BURST_LENGTH, entries).getIntegerValue(); |
| 114 | 0 | immediateData = SettingsNegotiator.getEntry(TextKeyword.IMMEDIATE_DATA, entries).getBooleanValue(); |
| 115 | 0 | initialR2T = SettingsNegotiator.getEntry(TextKeyword.INITIAL_R_2_T, entries).getBooleanValue(); |
| 116 | 0 | initiatorAlias = SettingsNegotiator.getEntry(TextKeyword.INITIATOR_ALIAS, entries).getStringValue(); |
| 117 | 0 | initiatorName = SettingsNegotiator.getEntry(TextKeyword.INITIATOR_NAME, entries).getStringValue(); |
| 118 | 0 | maxBurstLength = SettingsNegotiator.getEntry(TextKeyword.MAX_BURST_LENGTH, entries).getIntegerValue(); |
| 119 | 0 | maxConnections = SettingsNegotiator.getEntry(TextKeyword.MAX_CONNECTIONS, entries).getIntegerValue(); |
| 120 | 0 | maxOutstandingR2T = SettingsNegotiator.getEntry(TextKeyword.MAX_OUTSTANDING_R_2_T, entries).getIntegerValue(); |
| 121 | 0 | sessionType = SettingsNegotiator.getEntry(TextKeyword.SESSION_TYPE, entries).getStringValue(); |
| 122 | 0 | } catch (OperationNotSupportedException e) { |
| 123 | 0 | e.printStackTrace(); |
| 124 | 0 | } |
| 125 | 0 | } |
| 126 | |
} |