Class SclRootAdapter


public class SclRootAdapter extends SclElementAdapter<SclRootAdapter,SCL>
  • Field Details

  • Constructor Details

    • SclRootAdapter

      public SclRootAdapter(String hId, String hVersion, String hRevision) throws ScdException
      Constructor
      Parameters:
      hId - SCL Header ID
      hVersion - SCL Header Version
      hRevision - SCL Header Revision
      Throws:
      ScdException - throws when inconsistenc in SCL file
    • SclRootAdapter

      public SclRootAdapter(SCL scd)
      Constructor
      Parameters:
      scd - SCL for which adapter is created
  • Method Details

    • amChildElementRef

      protected boolean amChildElementRef()
      Check if node is child of the reference node
      Specified by:
      amChildElementRef in class SclElementAdapter<SclRootAdapter,SCL>
      Returns:
      true
    • elementXPath

      protected String elementXPath()
      Returns XPath path to current element
      Specified by:
      elementXPath in class SclElementAdapter<SclRootAdapter,SCL>
      Returns:
      "SCL>
    • getSclRelease

      public Short getSclRelease()
      Gets SCL Release value
      Returns:
      Release value
    • getSclRevision

      public String getSclRevision()
      Gets SCL Revision value
      Returns:
      Revision value
    • getSclVersion

      public String getSclVersion()
      Gets SCL Version value
      Returns:
      Version value
    • getSubstationAdapter

      public SubstationAdapter getSubstationAdapter(String ssName) throws ScdException
      Gets Substation from SCL root node by Substation name
      Parameters:
      ssName - name of wanted Substation
      Returns:
      SubstationAdapter object
      Throws:
      ScdException - throws when unknown Substation
    • getSubstationAdapter

      public SubstationAdapter getSubstationAdapter() throws ScdException
      Gets the first Substation from SCL root node
      Returns:
      SubstationAdapter object
      Throws:
      ScdException - throws when unknown Substation
    • addHeader

      protected void addHeader(@NonNull @NonNull String hId, @NonNull @NonNull String hVersion, @NonNull @NonNull String hRevision) throws ScdException
      Add Header to SCL root node
      Parameters:
      hId - SCL Header ID
      hVersion - SCL Header Version
      hRevision - SCL Header Revision
      Throws:
      ScdException - throws when header already exists in SCL
    • addIED

      public IEDAdapter addIED(SCL icd, String iedName) throws ScdException
      Adds IED and updates DataTypeTemplate of current SCL
      Parameters:
      icd - ICD containing IED to add and related DataTypeTemplate
      iedName - name of IED to add in SCL
      Returns:
      IEDAdapter as added IED
      Throws:
      ScdException - throws when inconsistency between IED to add and SCL file content
    • getHeaderAdapter

      public HeaderAdapter getHeaderAdapter()
      Gets Header from current SCL
      Returns:
      HeaderAdapter object as Header of SCL
    • getDataTypeTemplateAdapter

      public DataTypeTemplateAdapter getDataTypeTemplateAdapter()
      Gets DataTypeTemplates from current SCL
      Returns:
      DataTypeTemplateAdapter object as DataTypeTemplates of SCL
    • getIEDAdapterByName

      public IEDAdapter getIEDAdapterByName(String iedName) throws ScdException
      Gets IED by name from SCL
      Parameters:
      iedName - name of IED to find in SCL
      Returns:
      IEDAdapter object as IED of SCL
      Throws:
      ScdException - throws when unknown IED
    • findIedAdapterByName

      public Optional<IEDAdapter> findIedAdapterByName(String iedName) throws ScdException
      Find an IED by name from SCL
      Parameters:
      iedName - name of IED to find in SCL
      Returns:
      Optional of the first IED with a matching name
      Throws:
      ScdException
    • getCommunicationAdapter

      public CommunicationAdapter getCommunicationAdapter(boolean createIfNotExists) throws ScdException
      Gets Communication from SCL
      Parameters:
      createIfNotExists - true create Communication node if not exist, false do not create communication
      Returns:
      CommunicationAdapter object as IED of SCL
      Throws:
      ScdException - throws when no Communication in SCL and createIfNotExists == false
    • streamIEDAdapters

      public Stream<IEDAdapter> streamIEDAdapters()
      Gets all IEDs from SCL
      Returns:
      Stream of IEDAdapter object as IEDs of SCL
    • checkObjRef

      public IEDAdapter checkObjRef(String val) throws ScdException
      Checks if given reference matches with at least one IED of SCL
      Parameters:
      val - reference to check
      Returns:
      IEDAdapter object as IED of SCL
      Throws:
      ScdException - throws when no IED matches
    • findConnectedApAdapter

      public Optional<ConnectedAPAdapter> findConnectedApAdapter(String iedName, String apName)
      Find a ConnectedAp element withe given iedName and apName
      Parameters:
      iedName - iedName
      apName - apName
      Returns:
      the first ConnectedAp which match the given iedName and apName, or empty Optional if none found