Class DeviceDescriptionLoader
- java.lang.Object
-
- com.smartgridready.communicator.common.helper.DeviceDescriptionLoader
-
public class DeviceDescriptionLoader extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description DeviceDescriptionLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.smartgridready.ns.v0.DeviceFrame
load(java.lang.String deviceDescXml)
Load an external device description from its EI-XML content.com.smartgridready.ns.v0.DeviceFrame
load(java.lang.String aDescriptionFile, java.io.InputStream aDescriptionStream)
Load an external device description from an EI-XML input stream.com.smartgridready.ns.v0.DeviceFrame
load(java.lang.String aDescriptionFile, java.io.InputStream aDescriptionStream, java.util.Properties properties)
Load an external device description from an EI-XML input stream and replace placeholder tags with the values given by theproperties
parameter.com.smartgridready.ns.v0.DeviceFrame
load(java.lang.String aBaseDir, java.lang.String aDescriptionFile)
Load an external device description from its EI-XML file.com.smartgridready.ns.v0.DeviceFrame
load(java.lang.String aBaseDir, java.lang.String aDescriptionFile, java.util.Properties properties)
Load an external device description from its EI-XML file and replace placeholder tags with the values given by theproperties
parameter.com.smartgridready.ns.v0.DeviceFrame
load(java.lang.String deviceDescXml, java.util.Properties properties)
Load an external device description from its EI-XML file and replace placeholder tags with the values given by theproperties
parameter.
-
-
-
Method Detail
-
load
public com.smartgridready.ns.v0.DeviceFrame load(java.lang.String aDescriptionFile, java.io.InputStream aDescriptionStream)
Load an external device description from an EI-XML input stream.- Parameters:
aDescriptionFile
- The external interface file name.aDescriptionStream
- The external interface EI-XML input stream.- Returns:
- An instance of the device description for the given EI-XML
-
load
public com.smartgridready.ns.v0.DeviceFrame load(java.lang.String aBaseDir, java.lang.String aDescriptionFile)
Load an external device description from its EI-XML file.- Parameters:
aBaseDir
- The path to the folder where the external interface file resides.aDescriptionFile
- The external interface file name.- Returns:
- An instance of the device description for the given EI-XML
-
load
public com.smartgridready.ns.v0.DeviceFrame load(java.lang.String deviceDescXml)
Load an external device description from its EI-XML content.- Parameters:
deviceDescXml
- The external interface file XML content.- Returns:
- An instance of the device description for the given EI-XML
-
load
public com.smartgridready.ns.v0.DeviceFrame load(java.lang.String aBaseDir, java.lang.String aDescriptionFile, java.util.Properties properties)
Load an external device description from its EI-XML file and replace placeholder tags with the values given by theproperties
parameter.Example properties:
Properties properties = new Properties(); properties.put("ipAddress", "127.0.0.1"); deviceDescriptionLoader.load("./EI-XML", "MySGr-Device.xml", properties);
will replace{{ipAddress}}
within the EI-XML with the value 127.0.0.1- Parameters:
aBaseDir
- The path to the folder where the external interface file resides.aDescriptionFile
- The external interface file name.properties
- Key value pairs that replaces tags like{{keyName}}
with the propertyvalue
- Returns:
- An instance of the device description for the given EI-XML.
-
load
public com.smartgridready.ns.v0.DeviceFrame load(java.lang.String aDescriptionFile, java.io.InputStream aDescriptionStream, java.util.Properties properties)
Load an external device description from an EI-XML input stream and replace placeholder tags with the values given by theproperties
parameter.Example properties:
Properties properties = new Properties(); properties.put("ipAddress", "127.0.0.1"); InputStream input = FileUtils.openInputStream(new File("MySGr-Device.xml")); deviceDescriptionLoader.load("MySGr-Device.xml", input, properties);
will replace{{ipAddress}}
within the EI-XML with the value 127.0.0.1- Parameters:
aDescriptionFile
- The external interface file name.aDescriptionStream
- The external interface EI-XML input stream.properties
- Key value pairs that replaces tags like{{keyName}}
with the propertyvalue
- Returns:
- An instance of the device description for the given EI-XML.
-
load
public com.smartgridready.ns.v0.DeviceFrame load(java.lang.String deviceDescXml, java.util.Properties properties)
Load an external device description from its EI-XML file and replace placeholder tags with the values given by theproperties
parameter.Example properties:
Properties properties = new Properties(); properties.put("ipAddress", "127.0.0.1"); String xml = "<xml>...</xml>"; deviceDescriptionLoader.load(xml, properties);
will replace{{ipAddress}}
within the EI-XML with the value 127.0.0.1- Parameters:
deviceDescXml
- The EI-XML file content.properties
- Key value pairs that replaces tags like{{keyName}}
with the propertyvalue
- Returns:
- An instance of the device description for the given EI-XML.
-
-