Class SlidingTimeWindow

    • Field Detail

      • size

        protected long size
      • nodeId

        protected int nodeId
    • Constructor Detail

      • SlidingTimeWindow

        public SlidingTimeWindow()
      • SlidingTimeWindow

        public SlidingTimeWindow​(long size)
    • Method Detail

      • setWindowNode

        public void setWindowNode​(WindowNode windowNode)
      • getSize

        public long getSize()
        Returns:
        the size
      • setSize

        public void setSize​(long size)
        Parameters:
        size - the size to set
      • createContext

        public Behavior.Context createContext()
        Description copied from interface: Behavior
        Creates the context object associated with this behavior. The object is given as a parameter in all behavior call backs.
        Specified by:
        createContext in interface Behavior
      • assertFact

        public boolean assertFact​(Object context,
                                  InternalFactHandle fact,
                                  PropagationContext pctx,
                                  ReteEvaluator reteEvaluator)
        Description copied from interface: Behavior
        Makes the behavior aware of the new fact entering behavior's scope
        Specified by:
        assertFact in interface Behavior
        Parameters:
        context - The behavior context object
        fact - The new fact entering behavior's scope
        reteEvaluator - The working memory session reference
        Returns:
        true if the propagation should continue, false otherwise. I.e., the behaviour has veto power over the fact propagation, and prevents the propagation to continue if returns false on this method.
      • retractFact

        public void retractFact​(Object context,
                                InternalFactHandle fact,
                                PropagationContext pctx,
                                ReteEvaluator reteEvaluator)
        Description copied from interface: Behavior
        Removes a right tuple from the behavior's scope
        Specified by:
        retractFact in interface Behavior
        Parameters:
        context - The behavior context object
        fact - The fact leaving the behavior's scope
        reteEvaluator - The working memory session reference
      • isExpired

        protected boolean isExpired​(long currentTime,
                                    EventFactHandle handle)
      • getExpirationOffset

        public long getExpirationOffset()
        Description copied from interface: Behavior
        Some behaviors might change the expiration offset for the associated fact type. Example: time sliding windows. For these behaviors, this method must return the expiration offset associated to them.
        Specified by:
        getExpirationOffset in interface Behavior
        Returns:
        the expiration offset for this behavior or -1 if they don't have a time based expiration offset.