public class SiteInfo
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
Attribute[] |
attributes |
int |
dataFormatVersion |
static byte |
HASH_TYPE_BY_ALL |
static byte |
HASH_TYPE_BY_PREFIX |
static byte |
HASH_TYPE_BY_SUFFIX |
byte[] |
hashFilter |
byte |
hashOption |
boolean |
isPrimary |
boolean |
isRoot |
byte |
majorProtocolVersion |
byte |
minorProtocolVersion |
static short |
MULTI_PRIMARY |
boolean |
multiPrimary |
static short |
PRIMARY_SITE |
long |
responseTime |
int |
serialNumber |
ServerInfo[] |
servers |
| Constructor and Description |
|---|
SiteInfo()
Default constructor: object uninitialized except as above.
|
SiteInfo(int siteVersion,
boolean isPrimary,
boolean isMultiPrimary,
byte hashingOption,
java.lang.String siteDescription,
java.net.InetAddress listenAddr,
java.net.InetAddress altAddr,
int port,
int httpPort,
java.io.File pubKeyFile,
boolean disableUDP) |
SiteInfo(int siteVersion,
boolean isPrimary,
boolean isMultiPrimary,
byte hashingOption,
java.lang.String siteDescription,
java.net.InetAddress listenAddr,
int port,
int httpPort,
java.io.File pubKeyFile,
boolean disableUDP)
Constructor used by configuration routines.
|
SiteInfo(SiteInfo site) |
| Modifier and Type | Method and Description |
|---|---|
ServerInfo |
determineServer(byte[] handle)
Return the ServerInfo that this handle hashes to
|
int |
determineServerNum(byte[] handle)
Shortcut to determineServerNum(handle, hashOption, numServers) using
this.hashOption
|
static int |
determineServerNum(byte[] handle,
int hashOption,
int numServers)
Return the index of the server that this handle hashes to
|
boolean |
equals(java.lang.Object obj) |
byte[] |
getAttribute(byte[] attribute)
Get the value of the specified attribute for this site (if any).
|
static int |
getHandleHash(byte[] handle,
int hashOption)
Return the positive integer generated by hashing the part of this handle
indicated by hashOption.
|
java.util.HashMap |
getId2ServerMap() |
int |
hashCode() |
static void |
main(java.lang.String[] argv)
Hash the given arguments as handles and display the results.
|
java.lang.String |
toString()
Return a string of labeled members of this object.
|
public static final byte HASH_TYPE_BY_PREFIX
public static final byte HASH_TYPE_BY_SUFFIX
public static final byte HASH_TYPE_BY_ALL
public static final short PRIMARY_SITE
public static final short MULTI_PRIMARY
public int dataFormatVersion
public int serialNumber
public byte majorProtocolVersion
public byte minorProtocolVersion
public boolean isPrimary
public boolean multiPrimary
public boolean isRoot
public long responseTime
public byte hashOption
public byte[] hashFilter
public ServerInfo[] servers
public Attribute[] attributes
public SiteInfo()
public SiteInfo(int siteVersion,
boolean isPrimary,
boolean isMultiPrimary,
byte hashingOption,
java.lang.String siteDescription,
java.net.InetAddress listenAddr,
int port,
int httpPort,
java.io.File pubKeyFile,
boolean disableUDP)
throws java.io.IOException
java.io.IOExceptionpublic SiteInfo(int siteVersion,
boolean isPrimary,
boolean isMultiPrimary,
byte hashingOption,
java.lang.String siteDescription,
java.net.InetAddress listenAddr,
java.net.InetAddress altAddr,
int port,
int httpPort,
java.io.File pubKeyFile,
boolean disableUDP)
throws java.io.IOException
java.io.IOExceptionpublic SiteInfo(SiteInfo site)
public byte[] getAttribute(byte[] attribute)
public static final int getHandleHash(byte[] handle,
int hashOption)
throws HandleException
HandleExceptionpublic final int determineServerNum(byte[] handle)
throws HandleException
HandleExceptionpublic static final int determineServerNum(byte[] handle,
int hashOption,
int numServers)
throws HandleException
HandleExceptionpublic ServerInfo determineServer(byte[] handle) throws HandleException
HandleExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.HashMap getId2ServerMap()
public static final void main(java.lang.String[] argv)
throws java.lang.Exception
java.lang.Exceptionpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object