jgroup.util.log
Class ConnectionPatternEvent
java.lang.Object
jgroup.util.log.Event
jgroup.util.log.ConnectionPatternEvent
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<Event>, java.lang.Iterable<Domain>
public class ConnectionPatternEvent
- extends Event
- implements java.lang.Iterable<Domain>
A connection pattern event to be logged.
- Author:
- Hein Meling
- See Also:
- Serialized Form
Methods inherited from class jgroup.util.log.Event |
commonToString, compareTo, getDescription, getHost, getHostname, getTime, getType, isLastEvent, isType, setRelativeTo, setTime |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ConnectionPatternEvent
public ConnectionPatternEvent()
ConnectionPatternEvent
public ConnectionPatternEvent(java.lang.String description,
java.lang.String pattern,
java.util.List<jgroup.util.log.ConnectionPatternEvent.ConnectionEvent> events)
addEvent
public void addEvent(ConnectionPatternEvent.Type type,
Domain fromDomain,
Domain toDomain)
getConnectionEvents
public java.util.List<jgroup.util.log.ConnectionPatternEvent.ConnectionEvent> getConnectionEvents()
- Returns:
- Returns the list of connection events.
containsPartition
public boolean containsPartition()
- Returns:
- True if at least one of the events is a partition event.
partitionCount
public int partitionCount()
- Returns:
- The number of partitions that will result from this connection pattern.
getPartition
public DomainSet getPartition(java.net.InetAddress inetAdr)
- Returns the domain set (the partition) of the given host.
- Parameters:
inetAdr
- the host for which to obtain the domain set
- Returns:
- Returns the domain set (the partition) of the given host.
- Throws:
java.util.NoSuchElementException
- Raised if the given host is not
in any of the partitions.
getPartitions
public java.util.Set<DomainSet> getPartitions()
- Returns a set of domain sets representing the partitions of this connection
pattern event.
Implementation note: this method requires that merge events are stored first
in the events list. Currently this is accomplished by implementing the
Comparable
interface and sorting this list before constructing
the set of domain sets.
- Returns:
- Returns a set of domain sets representing the partitions of this
connection pattern event.
toString
public java.lang.String toString()
- Overrides:
toString
in class Event
iterator
public java.util.Iterator<Domain> iterator()
- Specified by:
iterator
in interface java.lang.Iterable<Domain>
Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.