Interface PiTranslator<T extends PiTranslatable,​E extends PiEntity>

    • Method Detail

      • translate

        E translate​(T original,
                    PiPipeconf pipeconf)
             throws PiTranslationException
        Translate the given PD entity (original) and returns a PI entity that is equivalent to he PD one for the given pipeconf.
        Parameters:
        original - PD entity
        pipeconf - pipeconf
        Returns:
        PI entity
        Throws:
        PiTranslationException - if a translation is not possible (see message for an explanation)
      • learn

        void learn​(PiHandle handle,
                   PiTranslatedEntity<T,​E> entity)
        Stores a mapping between the given translated entity and handle.
        Parameters:
        handle - PI entity handle
        entity - PI translated entity
      • lookup

        java.util.Optional<PiTranslatedEntity<T,​E>> lookup​(PiHandle handle)
        Returns a PI translated entity that was previously associated with the given handle, if present. If not present, it means a mapping between the two has not been learned by the system (via learn(PiHandle, PiTranslatedEntity)) or that it has been removed (via forget(PiHandle)). the
        Parameters:
        handle - PI entity handle
        Returns:
        optional PI translated entity
      • forget

        void forget​(PiHandle handle)
        Removes any mapping for the given PI entity handle.
        Parameters:
        handle - PI entity handle.