Class AsteriskHandler.EventItem

  • Enclosing class:
    AsteriskHandler

    public static class AsteriskHandler.EventItem
    extends java.lang.Object
    Keep track of an event listener entry. [I'm not sure what this should do yet.] Each time an event arrives, we traverse the list checking for each regexp match. When a match is found, we send the event to all the listening Q's.
    • Constructor Summary

      Constructors 
      Constructor Description
      EventItem​(java.lang.String queue, java.lang.String key, java.lang.String exp, java.lang.String context, java.lang.String serverName)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean addQ2Event​(java.lang.String queue, java.lang.String key, java.lang.String exp, java.lang.String context, java.lang.String serverName)
      Add a new queue to an existing event.
      boolean remQEvent​(java.lang.String queue, java.lang.String key, java.lang.String exp)
      Remove an exp/Q pair.
      boolean send2Q​(java.util.Dictionary event)
      Send an event to the q's if there is a match.
      int size()  
      java.lang.String toString()  
      java.lang.String toString​(java.lang.String delim, java.lang.String delim2)
      Machine readable version
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • EventItem

        public EventItem​(java.lang.String queue,
                         java.lang.String key,
                         java.lang.String exp,
                         java.lang.String context,
                         java.lang.String serverName)
    • Method Detail

      • addQ2Event

        public boolean addQ2Event​(java.lang.String queue,
                                  java.lang.String key,
                                  java.lang.String exp,
                                  java.lang.String context,
                                  java.lang.String serverName)
        Add a new queue to an existing event.
        Parameters:
        queue - The destination Q
        exp - The regular expression
        Returns:
        true if there is now an event/q match
      • remQEvent

        public boolean remQEvent​(java.lang.String queue,
                                 java.lang.String key,
                                 java.lang.String exp)
        Remove an exp/Q pair. Return true if removed.
        Parameters:
        queue - The destination Q to remove (or all if null)
        key - The event key to match on (null for all keys)
        exp - The event re (or null for all re's)
        Returns:
        true if something was removed
      • size

        public int size()
      • send2Q

        public boolean send2Q​(java.util.Dictionary event)
        Send an event to the q's if there is a match. XXX need to think about event format. XXX if key contains '*' or '?' do globbing
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toString

        public java.lang.String toString​(java.lang.String delim,
                                         java.lang.String delim2)
        Machine readable version