Interface IDataParentAdapter

All Superinterfaces:
IDataAdapter
All Known Implementing Classes:
DOIAdapter, RootSDIAdapter, SDIAdapter

public interface IDataParentAdapter extends IDataAdapter
See Also:
  • Method Details

    • getName

      String getName()
      Get name of the DOI or SDI
      Returns:
      name of the DOI or SDI
    • getSDIOrDAI

      List<TUnNaming> getSDIOrDAI()
      Get children (SDI or DAI) of this element
      Returns:
      currentElem.getSDIOrDAI()
    • toAdapter

      IDataParentAdapter toAdapter(TSDI childTSDI)
      Convert the given TSDI to a RootSDIAdapter or SDIAdapter The current instance must be the parent of the given childTSDI
      Parameters:
      childTSDI - child SDI to convert to an adapter
      Returns:
      RootSDIAdapter when current instance is a DOI or SDIAdapter otherwise
      Throws:
      IllegalArgumentException - when the current instance is not the parent of the given childTSDI
    • toAdapter

      AbstractDAIAdapter<?> toAdapter(TDAI childTDAI)
      Convert the given TDAI to a AbstractDAIAdapter The current instance must be the parent of the given childTSDI
      Parameters:
      childTDAI - child SDI to convert to an adapter
      Returns:
      AbstractDAIAdapter
      Throws:
      IllegalArgumentException - when the current instance is not the parent of the given childTSDI
    • findStructuredDataAdapterByName

      default Optional<IDataParentAdapter> findStructuredDataAdapterByName(String sdiName) throws ScdException
      Search SDI by name, directly under current this DOI or SDI
      Parameters:
      sdiName - name of SDI to find
      Returns:
      RootSDIAdapter object
      Throws:
      ScdException - throws when specified name of SDI not present in current DOI or SDI
    • getStructuredDataAdapterByName

      default IDataParentAdapter getStructuredDataAdapterByName(String sdiName) throws ScdException
      Gets SDI by name, directly under current this DOI or SDI
      Parameters:
      sdiName - name of SDI to find
      Returns:
      found SDI
      Throws:
      ScdException - throws when specified name of SDI not present in current DOI or SDI
    • getDataAdapterByName

      default AbstractDAIAdapter<?> getDataAdapterByName(String daiName) throws ScdException
      Gets DAI from current DOI
      Parameters:
      daiName - name of DAI to get
      Returns:
      found DAI
      Throws:
      ScdException - throws when specified name of DAI not present in current DOI
    • findDataAdapterByName

      default Optional<AbstractDAIAdapter<?>> findDataAdapterByName(String daiName)
      Finds DAI from current DOI
      Parameters:
      daiName - name of DAI to get
      Returns:
      found DAI
      Throws:
      ScdException - throws when specified name of DAI not present in current DOI
    • addDAI

      default AbstractDAIAdapter<?> addDAI(String name, boolean isUpdatable)
      Adds DAI to current DOI
      Parameters:
      name - name of DAI to add
      isUpdatable - updatability state of DAI
      Returns:
      DAIAdapter object as added DAI
    • addSDOI

      default IDataParentAdapter addSDOI(String sdiName)
      Adds SDOI to SDI in current DOI
      Parameters:
      sdiName - name of SDOI to add
      Returns:
      RootSDIAdapter object as added SDOI
    • findDeepestMatch

      default org.apache.commons.lang3.tuple.Pair<IDataAdapter,Integer> findDeepestMatch(List<String> sNames, int fromIndex, boolean isBdaNames)
      Search for the closest match for a list of structured data name (SDIs names = list of SDOs or BDAs names)
      Parameters:
      sNames - list of either SDO or BDA names
      fromIndex - position in the list (0 to list size minus one)
      isBdaNames - true if list of BDA names, false otherwise
      Returns:
      a pair of SCL data object Adapter and depth of the list (an index of the list)