Package org.jgroups.protocols.relay
Class SiteStatus
- java.lang.Object
-
- org.jgroups.protocols.relay.SiteStatus
-
public class SiteStatus extends java.lang.Object
Maintains the status of sites (up, down, undefined). This weeds out duplicate up or down notifications- Since:
- 5.2.17
- Author:
- Bela Ban
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SiteStatus.Status
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,SiteStatus.Status>
sites
-
Constructor Summary
Constructors Constructor Description SiteStatus()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.lang.String>
add(java.util.Set<java.lang.String> sites, SiteStatus.Status status)
Adds a set of sites to the cache.SiteStatus
clear()
SiteStatus.Status
get(java.lang.String site)
java.lang.String
toString()
-
-
-
Field Detail
-
sites
protected final java.util.Map<java.lang.String,SiteStatus.Status> sites
-
-
Method Detail
-
add
public java.util.Set<java.lang.String> add(java.util.Set<java.lang.String> sites, SiteStatus.Status status)
Adds a set of sites to the cache. Returns a set of sites for which notifications should be emitted. For each site S, the following happens:- S is not present: add a new entry with the given status for S and add S to the return value - S is present: if S != status: change the status and add S to the return value, else no-op
- Parameters:
sites
-status
-- Returns:
-
get
public SiteStatus.Status get(java.lang.String site)
-
clear
public SiteStatus clear()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-