Class DeviceDescriptionLoader


  • public class DeviceDescriptionLoader
    extends java.lang.Object
    • 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 the properties 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 the properties 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 the properties parameter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DeviceDescriptionLoader

        public DeviceDescriptionLoader()
    • 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 the properties 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 property value
        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 the properties 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 property value
        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 the properties 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 property value
        Returns:
        An instance of the device description for the given EI-XML.