Class DOIAdapter

java.lang.Object
org.lfenergy.compas.sct.commons.scl.SclElementAdapter<AbstractLNAdapter<? extends TAnyLN>,TDOI>
org.lfenergy.compas.sct.commons.scl.ied.DOIAdapter
All Implemented Interfaces:
IDataAdapter, IDataParentAdapter

public class DOIAdapter extends SclElementAdapter<AbstractLNAdapter<? extends TAnyLN>,TDOI> implements IDataParentAdapter
See Also:
  • Field Details

  • Constructor Details

    • DOIAdapter

      protected DOIAdapter(AbstractLNAdapter<? extends TAnyLN> parentAdapter, TDOI currentElem)
      Constructor
      Parameters:
      parentAdapter - Parent container reference
      currentElem - Current reference
  • Method Details

    • amChildElementRef

      protected boolean amChildElementRef()
      Check if node is child of the reference node
      Specified by:
      amChildElementRef in class SclElementAdapter<AbstractLNAdapter<? extends TAnyLN>,TDOI>
      Returns:
      link parent child existence
    • elementXPath

      protected String elementXPath()
      Description copied from class: SclElementAdapter
      Returns XPath path to current element
      Specified by:
      elementXPath in class SclElementAdapter<AbstractLNAdapter<? extends TAnyLN>,TDOI>
      Returns:
      message as undefined
    • getName

      public String getName()
      Description copied from interface: IDataParentAdapter
      Get name of the DOI or SDI
      Specified by:
      getName in interface IDataParentAdapter
      Returns:
      name of the DOI or SDI
    • getSDIOrDAI

      public List<TUnNaming> getSDIOrDAI()
      Description copied from interface: IDataParentAdapter
      Get children (SDI or DAI) of this element
      Specified by:
      getSDIOrDAI in interface IDataParentAdapter
      Returns:
      currentElem.getSDIOrDAI()
    • toAdapter

      public IDataParentAdapter toAdapter(TSDI childTSDI)
      Description copied from interface: IDataParentAdapter
      Convert the given TSDI to a RootSDIAdapter or SDIAdapter The current instance must be the parent of the given childTSDI
      Specified by:
      toAdapter in interface IDataParentAdapter
      Parameters:
      childTSDI - child SDI to convert to an adapter
      Returns:
      RootSDIAdapter when current instance is a DOI or SDIAdapter otherwise
    • toAdapter

      public AbstractDAIAdapter<?> toAdapter(TDAI childTDAI)
      Description copied from interface: IDataParentAdapter
      Convert the given TDAI to a AbstractDAIAdapter The current instance must be the parent of the given childTSDI
      Specified by:
      toAdapter in interface IDataParentAdapter
      Parameters:
      childTDAI - child SDI to convert to an adapter
      Returns:
      AbstractDAIAdapter
    • updateDaiFromExtRef

      public List<SclReportItem> updateDaiFromExtRef(List<TExtRef> tExtRefs)
      Update the DAI/Val according to the ExtRef attributes. If the ExtRef.desc start with DAI[name='purpose']/Val and end with "_1" (nominal case): - DAI[name='setSrcRef']/Val is updated with ExtRef attributes concatenation - DAI[name='setSrcCB']/Val is updated with ExtRef attributes concatenation if ExtRef.srcCBName is present If the ExtRef.desc start with DAI[name='purpose']/Val and end with "_2" or greater (test case): - DAI[name='setTstRef']/Val is updated with ExtRef attributes concatenation - DAI[name='setTstCB']/Val is updated with ExtRef attributes concatenation if ExtRef.srcCBName is present
      Parameters:
      tExtRefs - all the ExtRefs contained in the current LDevice/LLN0
      Returns:
      a filled SclReportItem if an error occurs, empty SclReportItem otherwise
    • updateDAI

      public Optional<SclReportItem> updateDAI(String daName, String value)
      Check and update DAI identified by name with given value
      Parameters:
      daName - name of DAI to update
      value - new value
      Returns:
      warning message when DAI not updatable, otherwise return empty and update DAI with value