org.openorb.notify
Class Util

java.lang.Object
  extended by org.openorb.notify.Util

public final class Util
extends java.lang.Object

The Util class provides some useful methods like wildcard support to check if an EventType is part of an EventType collection.

Author:
Olivier Modica

Method Summary
static EventTypeInfo[] addRemoveEventTypes(EventTypeInfo[] collection, EventType[] toAdd, EventType[] toRemove)
          Check if an EventType ( domain name, event name ) is a part of an EventType collection checking wildcards.
static int getMatchingEventTypeIndex(EventType eventType, EventType[] collection)
          Check if an EventType ( domain name, event name ) is a part of an EventType collection checking wildcards.
static EventTypeInfo getMatchingEventTypeInfo(EventType eventType, EventTypeInfo[] collection)
          Check if an EventType ( domain name, event name ) is a part of an EventTypeInfo collection checking wildcards.
static boolean isMatchingEventType(EventType eventType, EventType[] collection)
          Check if an EventType ( domain name, event name ) is a part of an EventType collection checking wildcards.
static void sleep(long time, org.apache.avalon.framework.logger.Logger logger)
          Common sleep method for the Notification Service.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMatchingEventTypeIndex

public static int getMatchingEventTypeIndex(EventType eventType,
                                            EventType[] collection)
Check if an EventType ( domain name, event name ) is a part of an EventType collection checking wildcards.

Returns:
the matching EventType index in the collection or -1 if not found.

getMatchingEventTypeInfo

public static EventTypeInfo getMatchingEventTypeInfo(EventType eventType,
                                                     EventTypeInfo[] collection)
Check if an EventType ( domain name, event name ) is a part of an EventTypeInfo collection checking wildcards.

Returns:
the matching EventTypeInfo in the collection or null if not found.

isMatchingEventType

public static boolean isMatchingEventType(EventType eventType,
                                          EventType[] collection)
Check if an EventType ( domain name, event name ) is a part of an EventType collection checking wildcards.

Returns:
true if the EventType could be found in the collection.

addRemoveEventTypes

public static EventTypeInfo[] addRemoveEventTypes(EventTypeInfo[] collection,
                                                  EventType[] toAdd,
                                                  EventType[] toRemove)
Check if an EventType ( domain name, event name ) is a part of an EventType collection checking wildcards.

Returns:
true if the EventType could be found in the collection.

sleep

public static void sleep(long time,
                         org.apache.avalon.framework.logger.Logger logger)
Common sleep method for the Notification Service. Allows single point of debugging.