Interface Mapper


  • public interface Mapper
    Mapper responsibility is to provide correlation between context identifier and ksession identifier to effectively keep track of what context has been mapped to given ksession.
    Mapper covers entire life cycle of the mapping which consists of:
    • storing the mapping
    • retrieving the mapping
    • removing the mapping
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object findContextId​(java.lang.Long ksessionId, java.lang.String ownerId)
      Finds context by ksession identifier
      java.lang.Long findMapping​(org.kie.api.runtime.manager.Context<?> context, java.lang.String ownerId)
      Finds ksession for given context
      void removeMapping​(org.kie.api.runtime.manager.Context<?> context, java.lang.String ownerId)
      Remove permanently context to ksession id mapping
      void saveMapping​(org.kie.api.runtime.manager.Context<?> context, java.lang.Long ksessionId, java.lang.String ownerId)
      Stores context to ksession id mapping
    • Method Detail

      • saveMapping

        void saveMapping​(org.kie.api.runtime.manager.Context<?> context,
                         java.lang.Long ksessionId,
                         java.lang.String ownerId)
        Stores context to ksession id mapping
        Parameters:
        context - instance of the context to be stored
        ksessionId - actual identifier of ksession
      • findMapping

        java.lang.Long findMapping​(org.kie.api.runtime.manager.Context<?> context,
                                   java.lang.String ownerId)
        Finds ksession for given context
        Parameters:
        context - instance of the context
        Returns:
        ksession identifier when found otherwise null
      • findContextId

        java.lang.Object findContextId​(java.lang.Long ksessionId,
                                       java.lang.String ownerId)
        Finds context by ksession identifier
        Parameters:
        ksessionId - identifier of ksession
        Returns:
        context instance when wound otherwise null
      • removeMapping

        void removeMapping​(org.kie.api.runtime.manager.Context<?> context,
                           java.lang.String ownerId)
        Remove permanently context to ksession id mapping
        Parameters:
        context - context instance that mapping shall be removed for