public class Configuration extends Object
Configuration
provides access target-wide parameters, variables that are the same across all
sessions and connections that do not change after initialization and which play a role during text parameter
negotiation. Some of these parameters are provided or can be overridden by the content of an XML file -
jscsi-target.xml
.Modifier and Type | Field and Description |
---|---|
protected boolean |
allowSloppyNegotiation
This variable toggles the strictness with which the parameters
IFMarkInt and OFMarkInt
are processed, when provided by the initiator. |
static String |
ATTRIBUTE_SIZE |
static File |
CONFIGURATION_CONFIG_FILE
The file name, which contains all global settings.
|
static File |
CONFIGURATION_SCHEMA_FILE
The file name of the XML Schema configuration file for the global settings.
|
static String |
ELEMENT_ALLOWSLOPPYNEGOTIATION |
static String |
ELEMENT_ASYNCFILESTORAGE |
static String |
ELEMENT_CREATE |
static String |
ELEMENT_FILESTORAGE |
static String |
ELEMENT_JCLOUDSSTORAGE |
static String |
ELEMENT_PORT |
static String |
ELEMENT_SYNCFILESTORAGE |
static String |
ELEMENT_TARGET |
static String |
ELEMENT_TARGET_LIST |
protected LogicalUnitNumber |
logicalUnitNumber
The Logical Unit Number of the virtual Logical Unit.
|
protected int |
outMaxRecvDataSegmentLength
The
MaxRecvDataSegmentLength parameter for PDUs sent in the out direction (i.e. |
protected int |
port
The port used by the jSCSI Target for listening for new connections.
|
protected String |
targetAddress
The
TargetAddress parameter (the jSCSI Target's IP address). |
protected int |
targetPortalGroupTag
The
TargetPortalGroupTag parameter. |
protected List<Target> |
targets |
Constructor and Description |
---|
Configuration(String pTargetAddress) |
Modifier and Type | Method and Description |
---|---|
protected static Node |
chopWhiteSpaces(Node node) |
static Configuration |
create(File schemaLocation,
File configFile,
String pTargetAddress)
Reads the given configuration file in memory and creates a DOM representation.
|
static Configuration |
create(String pTargetAddress) |
boolean |
getAllowSloppyNegotiation() |
int |
getInMaxRecvTextPduSequenceLength() |
LogicalUnitNumber |
getLogicalUnitNumber() |
int |
getOutMaxRecvDataSegmentLength() |
int |
getPort() |
String |
getTargetAddress() |
int |
getTargetPortalGroupTag() |
List<Target> |
getTargets() |
protected static Target |
parseTargetElement(Element targetElement) |
public static final String ELEMENT_TARGET_LIST
public static final String ELEMENT_TARGET
public static final String ELEMENT_SYNCFILESTORAGE
public static final String ELEMENT_ASYNCFILESTORAGE
public static final String ELEMENT_JCLOUDSSTORAGE
public static final String ELEMENT_FILESTORAGE
public static final String ELEMENT_CREATE
public static final String ATTRIBUTE_SIZE
public static final String ELEMENT_ALLOWSLOPPYNEGOTIATION
public static final String ELEMENT_PORT
public static final File CONFIGURATION_SCHEMA_FILE
public static final File CONFIGURATION_CONFIG_FILE
protected String targetAddress
TargetAddress
parameter (the jSCSI Target's IP address).
This parameter is initialized automatically.
protected int port
The default port number is 3260. This value may be overridden by specifying a different value in the configuration file.
protected boolean allowSloppyNegotiation
IFMarkInt
and OFMarkInt
are processed, when provided by the initiator. Usually the offered values must have to following format:
smallInteger~largeInteger
, however the jSCSI Initiator sends only single integers as value
part of the key-value pairs. Since the value of these two parameters always are Irrelevant
,
this bug can be ignored without any negative consequences by setting allowSloppyNegotiation
to
true
in the configuration file. The default is false
.protected final int targetPortalGroupTag
TargetPortalGroupTag
parameter.protected final LogicalUnitNumber logicalUnitNumber
protected final int outMaxRecvDataSegmentLength
MaxRecvDataSegmentLength
parameter for PDUs sent in the out direction (i.e. initiator to
target).
Since the value of this variable is equal to the specified default value, it does not have to be declared during login.
public Configuration(String pTargetAddress) throws IOException
IOException
public int getInMaxRecvTextPduSequenceLength()
public int getOutMaxRecvDataSegmentLength()
public String getTargetAddress()
public int getPort()
public boolean getAllowSloppyNegotiation()
public int getTargetPortalGroupTag()
public LogicalUnitNumber getLogicalUnitNumber()
public static Configuration create(String pTargetAddress) throws SAXException, ParserConfigurationException, IOException
public static Configuration create(File schemaLocation, File configFile, String pTargetAddress) throws SAXException, ParserConfigurationException, IOException
SAXException
- If this operation is supported but failed for some reason.ParserConfigurationException
- If a DocumentBuilder
cannot be created which satisfies the
configuration requested.IOException
- If any IO errors occur.protected static Target parseTargetElement(Element targetElement) throws IOException
IOException
Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.