org.jgroups.protocols.relay
Class SiteUUID

java.lang.Object
  extended by org.jgroups.util.UUID
      extended by org.jgroups.protocols.relay.SiteUUID
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Comparable<Address>, Address, SiteAddress, Streamable
Direct Known Subclasses:
SiteMaster

public class SiteUUID
extends UUID
implements SiteAddress

Implementation of SiteAddress

Since:
3.2
Author:
Bela Ban
See Also:
Serialized Form

Field Summary
protected  java.lang.String name
           
protected  short site
           
protected static java.util.concurrent.ConcurrentMap<java.lang.Short,java.lang.String> site_cache
           
 
Fields inherited from class org.jgroups.util.UUID
cache, leastSigBits, mostSigBits, numberGenerator, print_function, print_uuids, SIZE
 
Fields inherited from interface org.jgroups.Address
IP_ADDR, NULL, SITE_MASTER, SITE_UUID, UUID_ADDR
 
Constructor Summary
SiteUUID()
           
SiteUUID(long mostSigBits, long leastSigBits, java.lang.String name, short site)
           
SiteUUID(UUID uuid, java.lang.String name, short site)
           
 
Method Summary
static void addToCache(short site, java.lang.String name)
           
static java.util.Collection<java.lang.String> cacheValues()
           
static void clearCache()
           
 UUID copy()
           
 java.lang.String getName()
           
 short getSite()
          Returns the ID of the site (all sites need to have a unique site ID)
protected static short getSite(java.lang.String site_name)
           
static java.lang.String getSiteName(short site)
           
static boolean hasCacheValues()
           
 void readExternal(java.io.ObjectInput in)
           
 void readFrom(java.io.DataInput in)
          Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed
static void replaceInCache(short site, java.lang.String name)
           
 int size()
          Returns serialized size of this address
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput out)
           
 void writeTo(java.io.DataOutput out)
          Write the entire state of the current object (including superclasses) to outstream.
 
Methods inherited from class org.jgroups.util.UUID
add, add, compareTo, digits, equals, get, getContents, getLeastSignificantBits, getMostSignificantBits, hashCode, printCache, randomUUID, remove, removeAll, retainAll, toStringLong
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

name

protected java.lang.String name

site

protected short site

site_cache

protected static final java.util.concurrent.ConcurrentMap<java.lang.Short,java.lang.String> site_cache
Constructor Detail

SiteUUID

public SiteUUID()

SiteUUID

public SiteUUID(long mostSigBits,
                long leastSigBits,
                java.lang.String name,
                short site)

SiteUUID

public SiteUUID(UUID uuid,
                java.lang.String name,
                short site)
Method Detail

getName

public java.lang.String getName()

addToCache

public static void addToCache(short site,
                              java.lang.String name)

replaceInCache

public static void replaceInCache(short site,
                                  java.lang.String name)

cacheValues

public static java.util.Collection<java.lang.String> cacheValues()

hasCacheValues

public static boolean hasCacheValues()

getSiteName

public static java.lang.String getSiteName(short site)

clearCache

public static void clearCache()

getSite

public short getSite()
Description copied from interface: SiteAddress
Returns the ID of the site (all sites need to have a unique site ID)

Specified by:
getSite in interface SiteAddress

copy

public UUID copy()
Overrides:
copy in class UUID

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class UUID
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class UUID
Throws:
java.io.IOException

readFrom

public void readFrom(java.io.DataInput in)
              throws java.lang.Exception
Description copied from interface: Streamable
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed

Specified by:
readFrom in interface Streamable
Overrides:
readFrom in class UUID
Throws:
java.lang.Exception

writeTo

public void writeTo(java.io.DataOutput out)
             throws java.lang.Exception
Description copied from interface: Streamable
Write the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed

Specified by:
writeTo in interface Streamable
Overrides:
writeTo in class UUID
Throws:
java.lang.Exception

size

public int size()
Description copied from interface: Address
Returns serialized size of this address

Specified by:
size in interface Address
Overrides:
size in class UUID

toString

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

getSite

protected static short getSite(java.lang.String site_name)


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.