Enum IWatcher.EventType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<IWatcher.EventType>
    Enclosing interface:
    IWatcher

    public static enum IWatcher.EventType
    extends java.lang.Enum<IWatcher.EventType>
    Constants that defines the type of event the event module can handle.

    When a watcher is registered into an event source, the source can check what kind of event are expected by calling the IWatcher.getPatternType() method. The interpretation of the watch pattern (returned by IWatcher.getWatchPattern()) depends of the type of event, as follow:

    FACT_CHECKING

    The watch pattern must be a partial statement. If, when evaluated, it returns true (ie, at least one asserted or inferred statement match the pattern), the event is fired.

    NEW_INSTANCE

    The event pattern for this type of event is first a variable and then a set of partial statement. The event is triggered when a new statement matches this set. The server return the list of instances bound to the variable.

    Example

    Registration:
     > registerEvent
     > NEW_INSTANCE
     > ON_TRUE
     > b
     > [?a desires ?b, ?a rdf:type Human]
     
    Add some facts:
     > add
     > [ramses rdf:type Human, pyramidInauguration rdf:type StaticSituation, ramses desires pyramidInauguration]
     
    This would fire the event and return:
     > event
     > [pyramidInauguration]
     

    NEW_CLASS_INSTANCE

    The event is triggered when a new instance of the class returned by the watch pattern is added. When the event is fired, the server send to the client the list of the new instances. This kind of event is a special, optimized version of NEW_INSTANCE for class instances.
    See Also:
    General description of events in oro-server
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static IWatcher.EventType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static IWatcher.EventType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • values

        public static IWatcher.EventType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (IWatcher.EventType c : IWatcher.EventType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static IWatcher.EventType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null