Class NameplateSetup

java.lang.Object
de.iip_ecosphere.platform.support.iip_aas.NameplateSetup

public class NameplateSetup extends Object
Describes static information about a device in the style of an ZVEI Digital Nameplate for industrial equipment V1.0. This class is intentionally neither a base nor a derived class of ApplicationSetup as this class shall (somewhen) follow the spec, ApplicationSetup shall then follow the software nameplate.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • NameplateSetup

      public NameplateSetup()
      For snakeyaml.
    • NameplateSetup

      public NameplateSetup(NameplateSetup setup)
      Copy constructor.
      Parameters:
      setup - the instance to copy from
  • Method Details

    • getManufacturerName

      public String getManufacturerName()
      Returns the manufacturer name.
      Returns:
      the manufacturer name
    • setManufacturerName

      public void setManufacturerName(String manufacturerName)
      Changes the manufacturer name. [snakeyaml]
      Parameters:
      manufacturerName - the manufacturer name
    • getManufacturerArticleNumber

      public String getManufacturerArticleNumber()
      Returns the manufacturer article number.
      Returns:
      the manufacturer article number
    • setManufacturerArticleNumber

      public void setManufacturerArticleNumber(String manufacturerArticleNumber)
      Changes the manufacturer article number. [snakeyaml]
      Parameters:
      manufacturerArticleNumber - the manufacturer article number
    • getManufacturerOrderCodeNumber

      public String getManufacturerOrderCodeNumber()
      Returns the manufacturer order code.
      Returns:
      the manufacturer order code
    • setManufacturerOrderCodeNumber

      public void setManufacturerOrderCodeNumber(String manufacturerOrderCodeNumber)
      Changes the manufacturer order code. [snakeyaml]
      Parameters:
      manufacturerOrderCodeNumber - the manufacturer order code
    • getManufacturerProductDesignation

      public String getManufacturerProductDesignation()
      Returns the manufacturer product designation.
      Returns:
      the designation (may be null for none)
    • getService

      public NameplateSetup.Service getService(String key)
      Returns the (first specified) service with the given key.
      Parameters:
      key - the key
      Returns:
      the service, may be null for none
    • getServices

      public List<NameplateSetup.Service> getServices()
      Returns the services.
      Returns:
      the services
    • getServicesAsMap

      public static Map<String,NameplateSetup.Service> getServicesAsMap(List<NameplateSetup.Service> services)
      Returns the given services as map.
      Parameters:
      services - the services (may be null)
      Returns:
      the services as map, indexed by their keys
    • setServices

      public void setServices(List<NameplateSetup.Service> services)
      Changes the services. [snakeyaml]
      Parameters:
      services - the services
    • setManufacturerProductDesignation

      public void setManufacturerProductDesignation(String manufacturerProductDesignation)
      Changes the manufacturer product designation. [snakeyaml]
      Parameters:
      manufacturerProductDesignation - the designation
    • getAddress

      public ApplicationSetup.Address getAddress()
      Returns the address.
      Returns:
      the address
    • setAddress

      public void setAddress(ApplicationSetup.Address address)
      Changes the address. [snakeyaml]
      Parameters:
      address - the address
    • getProductImage

      public String getProductImage()
      Returns the optional product image.
      Returns:
      the image (local resolvable name or URI to image)
    • setProductImage

      public void setProductImage(String productImage)
      Changes the optional product image. [snakeyaml]
      Parameters:
      productImage - the image (local resolvable name or URI to image)
    • getManufacturerLogo

      public String getManufacturerLogo()
      Returns the optional manufacturer logo.
      Returns:
      the logo (local resolvable name or URI to image)
    • setManufacturerLogo

      public void setManufacturerLogo(String manufacturerLogo)
      Defines the optional manufacturer logo. [snakeyaml]
      Parameters:
      manufacturerLogo - the logo (local resolvable name or URI to image)
    • expandUrn

      public static String expandUrn(String urn, String expansion)
      Expands the last part of an URN by the given expansion.
      Parameters:
      urn - the URN to expand
      expansion - the expansion
      Returns:
      the expanded URN
    • createAas

      public de.iip_ecosphere.platform.support.aas.Aas createAas(String urn, String id, Consumer<de.iip_ecosphere.platform.support.aas.Aas.AasBuilder> further)
      Creates an AAS for this nameplate setup.
      Parameters:
      urn - the URN of the AAS to create
      id - the id short to create
      further - further build steps on the AAS, may be null
      Returns:
      the AAS
      See Also:
    • createTechnicalDataNameplate

      private void createTechnicalDataNameplate(de.iip_ecosphere.platform.support.aas.Aas.AasBuilder aasBuilder, String urn)
      Creates the technical data nameplate. [legacy]
      Parameters:
      aasBuilder - the parent AAS builder
      urn - the URN of the platform AAS
    • resolveNameplateSetup

      public static InputStream resolveNameplateSetup()
      Basic way of resolving a nameplate setup.
      Returns:
      the input stream containing the setup, may be null for none
    • obtainNameplateSetup

      public static NameplateSetup obtainNameplateSetup() throws IOException
      Preliminary way to find the nameplate YML.
      Returns:
      the setup representing the nameplate YML
      Throws:
      IOException - if the setup file cannot be read
      See Also:
    • readFromAas

      public static NameplateSetup readFromAas(de.iip_ecosphere.platform.support.aas.Aas aas)
      Reads the AAS back as nameplate setup. Currently, we read only the services back.
      Parameters:
      aas - the AAS to read out (may be null)
      Returns:
      the nameplate setup
    • readServices

      private static List<NameplateSetup.Service> readServices(de.iip_ecosphere.platform.support.aas.Submodel sub)
      Reads services from the given submodel.
      Parameters:
      sub - the submodel
      Returns:
      the services
    • getStringProperty

      private static String getStringProperty(de.iip_ecosphere.platform.support.aas.SubmodelElementCollection coll, String idShort)
      Returns the value of a string property.
      Parameters:
      coll - the collection to take the property from
      idShort - the short id of the property
      Returns:
      the value or null
    • resolveFromAas

      public static NameplateSetup resolveFromAas() throws IOException
      Resolves the nameplate setup from the IIP-Ecosphere platform AAS via the device id.
      Returns:
      the nameplate setup, may be null if there is none
      Throws:
      IOException - if resolving the AASs fails for some reason
    • resolveServiceFromAas

      public static NameplateSetup.Service resolveServiceFromAas(String key)
      Resolves the service with the given key from the IIP-Ecosphere platform AAS.
      Parameters:
      key - the key of the service to resolve, may be null and leads to null
      Returns:
      the service, may be null for none
    • resolve

      public static de.iip_ecosphere.platform.support.aas.Aas resolve(String identifier) throws IOException
      Resolves an identifier to the respective AAS.
      Parameters:
      identifier - the identifier, URN, URL to resolve
      Returns:
      the resolved AAS or null for none
      Throws:
      IOException - if the resolution failed