public final class Configuration extends Object
This class stores all informations, which are set during an iSCSI Session, Connection or are set as the default values. Therefore, this class was implemented as a Singleton Pattern.
Constructor and Description |
---|
Configuration()
Constructor to create a new, empty
Configuration object. |
Configuration(Hashtable<org.jscsi.parser.datasegment.OperationalTextKey,org.jscsi.parser.datasegment.SettingEntry> paramGlobalConfig,
ConcurrentHashMap<String,org.jscsi.initiator.Configuration.SessionConfiguration> paramConfig)
Constructor to create a
Configuration object with existing data |
Modifier and Type | Method and Description |
---|---|
static Configuration |
create()
Creates a instance of a
Configuration object, which is initialized with the settings from the
system-wide configuration file. |
static Configuration |
create(File configSchemaFileName,
File configFileName)
Creates a instance of a
Configuration object, which is initialized with the settings from the
system-wide configuration file. |
String |
getSessionSetting(String targetName,
org.jscsi.parser.datasegment.OperationalTextKey textKey)
Returns the value of a single parameter.
|
String |
getSetting(String targetName,
int connectionID,
org.jscsi.parser.datasegment.OperationalTextKey textKey)
Returns the value of a single parameter, instead of all values.
|
org.jscsi.parser.datasegment.SettingsMap |
getSettings(String targetName,
int connectionID)
Unifies all parameters (in the right precedence) and returns one
SettingsMap . |
InetSocketAddress |
getTargetAddress(String targetName)
Returns the
InetAddress instance of the connected iSCSI Target. |
void |
update(String targetName,
int connectionID,
org.jscsi.parser.datasegment.SettingsMap response)
Updates the stored settings of a connection with these values from the response of the iSCSI Target.
|
public Configuration()
Configuration
object.public Configuration(Hashtable<org.jscsi.parser.datasegment.OperationalTextKey,org.jscsi.parser.datasegment.SettingEntry> paramGlobalConfig, ConcurrentHashMap<String,org.jscsi.initiator.Configuration.SessionConfiguration> paramConfig)
Configuration
object with existing datapublic static final Configuration create() throws org.jscsi.exception.ConfigurationException
Configuration
object, which is initialized with the settings from the
system-wide configuration file.Configuration
instance with all settings.org.jscsi.exception.ConfigurationException
- If this operation is supported but failed for some reason.public static final Configuration create(File configSchemaFileName, File configFileName) throws org.jscsi.exception.ConfigurationException
Configuration
object, which is initialized with the settings from the
system-wide configuration file.configSchemaFileName
- The file name of the schema to check the configuration file against.sconfigFileName
- The file name of the configuration file to use.Configuration
instance with all settings.org.jscsi.exception.ConfigurationException
- If this operation is supported but failed for some reason.public final String getSetting(String targetName, int connectionID, org.jscsi.parser.datasegment.OperationalTextKey textKey) throws org.jscsi.exception.OperationalTextKeyException
targetName
- Name of the iSCSI Target to connect.connectionID
- The ID of the connection to retrieve.textKey
- The name of the parameter.org.jscsi.exception.OperationalTextKeyException
- If the given parameter cannot be found.public final org.jscsi.parser.datasegment.SettingsMap getSettings(String targetName, int connectionID)
SettingsMap
. Right order means:
default, then the session-wide, and finally the connection-wide valid parameters.targetName
- Name of the iSCSI Target to connect.connectionID
- The ID of the connection to retrieve.SettingsMap
.public final String getSessionSetting(String targetName, org.jscsi.parser.datasegment.OperationalTextKey textKey) throws org.jscsi.exception.OperationalTextKeyException
targetName
- Name of the iSCSI Target to connect.textKey
- The name of the parameter.org.jscsi.exception.OperationalTextKeyException
- If the given parameter cannot be found.public final InetSocketAddress getTargetAddress(String targetName) throws org.jscsi.exception.NoSuchSessionException
InetAddress
instance of the connected iSCSI Target.targetName
- The name of the iSCSI Target.InetAddress
instance of the requested iSCSI Target.org.jscsi.exception.NoSuchSessionException
- if a session with this target name is not open.public final void update(String targetName, int connectionID, org.jscsi.parser.datasegment.SettingsMap response) throws org.jscsi.exception.NoSuchSessionException
targetName
- The name of the iSCSI Target.connectionID
- The ID of the connection within this iSCSI Target.response
- The response settings.org.jscsi.exception.NoSuchSessionException
- if a session with this target name is not open.Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.