Package net.handle.hdllib
Class SiteInfo
java.lang.Object
net.handle.hdllib.SiteInfo
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSiteInfo()
Default constructor: object uninitialized except as above.SiteInfo
(int siteVersion, boolean isPrimary, boolean isMultiPrimary, byte hashingOption, String siteDescription, InetAddress listenAddr, int port, int httpPort, File pubKeyFile, boolean disableUDP) Constructor used by configuration routines.SiteInfo
(int siteVersion, boolean isPrimary, boolean isMultiPrimary, byte hashingOption, String siteDescription, InetAddress listenAddr, InetAddress altAddr, int port, int httpPort, File pubKeyFile, boolean disableUDP) -
Method Summary
Modifier and TypeMethodDescriptiondetermineServer
(byte[] handle) Return the ServerInfo that this handle hashes tofinal int
determineServerNum
(byte[] handle) Shortcut to determineServerNum(handle, hashOption, numServers) using this.hashOptionstatic final int
determineServerNum
(byte[] handle, int hashOption, int numServers) Return the index of the server that this handle hashes toboolean
byte[]
getAttribute
(byte[] attribute) Get the value of the specified attribute for this site (if any).getAttributeForServer
(String attribute, int which) getDomainForServer
(int which) static final int
getHandleHash
(byte[] handle, int hashOption) Return the positive integer generated by hashing the part of this handle indicated by hashOption.int
hashCode()
boolean
static final void
Hash the given arguments as handles and display the results.toString()
Return a string of labeled members of this object.
-
Field Details
-
DOMAIN
- See Also:
-
PATH
- See Also:
-
HASH_TYPE_BY_PREFIX
public static final byte HASH_TYPE_BY_PREFIX- See Also:
-
HASH_TYPE_BY_SUFFIX
public static final byte HASH_TYPE_BY_SUFFIX- See Also:
-
HASH_TYPE_BY_ALL
public static final byte HASH_TYPE_BY_ALL- See Also:
-
PRIMARY_SITE
public static final short PRIMARY_SITE- See Also:
-
MULTI_PRIMARY
public static final short MULTI_PRIMARY- See Also:
-
dataFormatVersion
public int dataFormatVersion -
serialNumber
public int serialNumber -
majorProtocolVersion
public byte majorProtocolVersion -
minorProtocolVersion
public byte minorProtocolVersion -
isPrimary
public boolean isPrimary -
multiPrimary
public boolean multiPrimary -
isRoot
public boolean isRoot -
responseTime
public long responseTime -
hashOption
public byte hashOption -
hashFilter
public byte[] hashFilter -
servers
-
attributes
-
-
Constructor Details
-
SiteInfo
public SiteInfo()Default constructor: object uninitialized except as above. -
SiteInfo
public SiteInfo(int siteVersion, boolean isPrimary, boolean isMultiPrimary, byte hashingOption, String siteDescription, InetAddress listenAddr, int port, int httpPort, File pubKeyFile, boolean disableUDP) throws IOException Constructor used by configuration routines.- Throws:
IOException
-
SiteInfo
public SiteInfo(int siteVersion, boolean isPrimary, boolean isMultiPrimary, byte hashingOption, String siteDescription, InetAddress listenAddr, InetAddress altAddr, int port, int httpPort, File pubKeyFile, boolean disableUDP) throws IOException - Throws:
IOException
-
SiteInfo
-
-
Method Details
-
getAttribute
public byte[] getAttribute(byte[] attribute) Get the value of the specified attribute for this site (if any). -
getHandleHash
Return the positive integer generated by hashing the part of this handle indicated by hashOption.- Throws:
HandleException
-
determineServerNum
Shortcut to determineServerNum(handle, hashOption, numServers) using this.hashOption- Throws:
HandleException
-
determineServerNum
public static final int determineServerNum(byte[] handle, int hashOption, int numServers) throws HandleException Return the index of the server that this handle hashes to- Throws:
HandleException
-
determineServer
Return the ServerInfo that this handle hashes to- Throws:
HandleException
-
toString
Return a string of labeled members of this object. -
getId2ServerMap
-
main
Hash the given arguments as handles and display the results.- Throws:
Exception
-
hashCode
public int hashCode() -
equals
-
getAttributeForServer
-
getDomainForServer
-
hasZeroAddressServersAndDomain
public boolean hasZeroAddressServersAndDomain()
-