|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tranche.commons.Debuggable
org.tranche.TrancheServer
org.tranche.routing.RoutingTrancheServer
public class RoutingTrancheServer
Used to connect to one or more Tranche Servers ("data servers"). Redirects requests to appropriate servers.
| Field Summary |
|---|
| Fields inherited from class org.tranche.TrancheServer |
|---|
BAD_NONCE, BAD_SIG |
| Constructor Summary | |
|---|---|
RoutingTrancheServer()
|
|
RoutingTrancheServer(java.security.cert.X509Certificate cert,
java.security.PrivateKey key)
|
|
| Method Summary | |
|---|---|
boolean |
addListener(RoutingTrancheServerListener l)
|
void |
clearListeners()
|
void |
close()
Closes the server and shuts down any associated resources. |
PropagationReturnWrapper |
deleteData(BigHash hash,
Signature[] sigs,
byte[][] nonces,
java.lang.String[] hosts)
Delete data chunk from selected servers. |
PropagationReturnWrapper |
deleteMetaData(BigHash hash,
java.lang.String uploaderName,
java.lang.Long uploadTimestamp,
java.lang.String relativePathInDataSet,
Signature[] sigs,
byte[][] nonces,
java.lang.String[] hosts)
p>Delete meta data chunk from selected servers. |
void |
fireDataServersAdded(java.lang.String[] hosts)
|
void |
fireDataServersRemoved(java.lang.String[] hosts)
Fired when a RoutingTrancheServer instance removes one or more data server. |
Activity[] |
getActivityLogEntries(long startTimestamp,
long finishTimestamp,
int limit,
byte mask)
Get all activity log entries from within a time period. |
int |
getActivityLogEntriesCount(long startTimestamp,
long stopTimestamp,
byte mask)
Returns a count of all activity log entries from within a time period. |
java.security.cert.X509Certificate |
getAuthCert()
By setting a certificate and private key to the routing Tranche server that can perform deletes, will be able to delete from managed data servers. |
java.security.PrivateKey |
getAuthPrivateKey()
By setting a certificate and private key to the routing Tranche server that can perform deletes, will be able to delete from managed data servers. |
Configuration |
getConfiguration()
|
Configuration |
getConfiguration(Signature sig,
byte[] nonce)
|
PropagationReturnWrapper |
getData(BigHash[] hashes,
boolean propagateRequest)
|
BigHash[] |
getDataHashes(java.math.BigInteger offset,
java.math.BigInteger length)
|
java.lang.String |
getHost()
Returns the host name of the server. |
java.util.Set<java.lang.String> |
getManagedServers()
Just returns a deep copy of servers to use. |
PropagationReturnWrapper |
getMetaData(BigHash[] hashes,
boolean propagateRequest)
|
BigHash[] |
getMetaDataHashes(java.math.BigInteger offset,
java.math.BigInteger length)
|
StatusTable |
getNetworkStatusPortion(java.lang.String startHost,
java.lang.String endHost)
Returns the rows in the local network status that have host names that are between the startHost (inclusive) and the endHost (exclusive.) |
PropagationReturnWrapper |
getNonces(java.lang.String[] hosts,
int count)
Get batch of nonces from selected server hosts. |
BigHash[] |
getProjectHashes(java.math.BigInteger offset,
java.math.BigInteger length)
Returns a list of all projects that this server has. |
boolean[] |
hasData(BigHash[] hashes)
|
boolean[] |
hasMetaData(BigHash[] hashes)
|
boolean |
isClosed()
Returns true if and only if the server has been closed. |
boolean |
isManagedServer(java.lang.String host)
Returns true if server host is among managed host list; false otherwise. |
void |
ping()
Ping the server. |
void |
registerServer(java.lang.String url)
Registers the given URL as a known server. |
boolean |
removeListener(RoutingTrancheServerListener l)
|
void |
requestShutdown(Signature sig,
byte[] nonce)
Request that a server shut down. |
void |
saveConfiguration()
Serialize the Configurtation data and save to disk. |
void |
setAuthCert(java.security.cert.X509Certificate authCert)
By setting a certificate and private key to the routing Tranche server that can perform deletes, will be able to delete from managed data servers. |
void |
setAuthPrivateKey(java.security.PrivateKey authPrivateKey)
By setting a certificate and private key to the routing Tranche server that can perform deletes, will be able to delete from managed data servers. |
void |
setConfiguration(byte[] data,
Signature sig,
byte[] nonce)
Sets a new configuration for the server. |
void |
setConfiguration(Configuration newConfig)
|
PropagationReturnWrapper |
setData(BigHash hash,
byte[] data,
Signature sig,
java.lang.String[] hosts)
Set data and replicate to specified hosts. |
PropagationReturnWrapper |
setMetaData(boolean merge,
BigHash hash,
byte[] data,
Signature sig,
java.lang.String[] hosts)
Set meta data and replicate to specified hosts. |
| Methods inherited from class org.tranche.commons.Debuggable |
|---|
debugErr, debugErr, debugOut, isDebug, setDebug |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RoutingTrancheServer(java.security.cert.X509Certificate cert,
java.security.PrivateKey key)
public RoutingTrancheServer()
| Method Detail |
|---|
public void setConfiguration(byte[] data,
Signature sig,
byte[] nonce)
throws java.lang.Exception
setConfiguration in class TrancheServerdata - The configuration saved as an array of bytes. Use ConfigurationUtil to generate
the appropriate bytes.sig - A signature for the data.nonce - The nonce used from the server.
java.lang.Exception - If invalid configuration format exceptions or security exceptions occur.
public void setConfiguration(Configuration newConfig)
throws java.lang.Exception
java.lang.Exceptionpublic void saveConfiguration()
Serialize the Configurtation data and save to disk.
public Configuration getConfiguration(Signature sig,
byte[] nonce)
throws java.lang.Exception
getConfiguration in class TrancheServersig - the signaturenonce - the nonce bytes
java.lang.Exception - if any exception occurs
public Configuration getConfiguration()
throws java.lang.Exception
getConfiguration in class TrancheServerjava.lang.Exception
public void ping()
throws java.lang.Exception
Ping the server. Handled by Server object which wraps this object.
ping in class TrancheServerjava.lang.Exception
public StatusTable getNetworkStatusPortion(java.lang.String startHost,
java.lang.String endHost)
throws java.lang.Exception
Returns the rows in the local network status that have host names that are between the startHost (inclusive) and the endHost (exclusive.)
getNetworkStatusPortion in class TrancheServerstartHost - endHost -
java.lang.Exceptionpublic java.util.Set<java.lang.String> getManagedServers()
Just returns a deep copy of servers to use. Synchronized.
public boolean isManagedServer(java.lang.String host)
Returns true if server host is among managed host list; false otherwise.
host -
public boolean[] hasData(BigHash[] hashes)
throws java.lang.Exception
hasData in class TrancheServerhashes - the BigHash array of data chunks
java.lang.Exception - if any exception occurs
public boolean[] hasMetaData(BigHash[] hashes)
throws java.lang.Exception
hasMetaData in class TrancheServerhashes - the BigHash array of meta data chunks
java.lang.Exception - if any exception occurs
public PropagationReturnWrapper getMetaData(BigHash[] hashes,
boolean propagateRequest)
throws java.lang.Exception
getMetaData in class TrancheServerhashes - propagateRequest -
java.lang.Exception
public PropagationReturnWrapper getData(BigHash[] hashes,
boolean propagateRequest)
throws java.lang.Exception
getData in class TrancheServerhashes - propagateRequest -
java.lang.Exceptionpublic java.lang.String getHost()
TrancheServerReturns the host name of the server.
getHost in class TrancheServer
public BigHash[] getDataHashes(java.math.BigInteger offset,
java.math.BigInteger length)
throws java.lang.Exception
getDataHashes in class TrancheServeroffset - the offsetlength - the length
java.lang.Exception - if any exception occurs
public BigHash[] getMetaDataHashes(java.math.BigInteger offset,
java.math.BigInteger length)
throws java.lang.Exception
getMetaDataHashes in class TrancheServeroffset - the offsetlength - the length
java.lang.Exception - if any exception occurs
public void registerServer(java.lang.String url)
throws java.lang.Exception
registerServer in class TrancheServerurl - the URL to register (e.g. tranche://proteomecommons.org:443 )
java.lang.Exception - if any exception occurs
public BigHash[] getProjectHashes(java.math.BigInteger offset,
java.math.BigInteger length)
throws java.lang.Exception
getProjectHashes in class TrancheServeroffset - the offsetlength - the length
java.lang.Exception - if any exception occurspublic void close()
close in class TrancheServer
public void requestShutdown(Signature sig,
byte[] nonce)
throws java.lang.Exception
Request that a server shut down. Intended for remote administration of servers.
requestShutdown in class TrancheServersig - nonce -
java.lang.Exception
public Activity[] getActivityLogEntries(long startTimestamp,
long finishTimestamp,
int limit,
byte mask)
throws java.lang.Exception
Get all activity log entries from within a time period.
getActivityLogEntries in class TrancheServerstartTimestamp - Timestamp from which to include activities (inclusive)finishTimestamp - Timestamp to which to include activities (inclusive)limit - Limit number of activity entries to returnmask - Used to match activity bytes. If all the bits in the mask are included in the activity byte, then the activity will be included. For example, if the mask is Activity.ACTION_TYPE_SET, then all logs that have this bit set (set data and set meta data) will be included. However, if Activity.SET_DATA is the mask, then only set data actions will match (since there are two bits set in the mask, making it more restrictive). 0 is least restrictive (restricts nothing) and 0xFF is most restrictive (restricts everything but itself).
java.lang.Exception
public int getActivityLogEntriesCount(long startTimestamp,
long stopTimestamp,
byte mask)
throws java.lang.Exception
Returns a count of all activity log entries from within a time period.
getActivityLogEntriesCount in class TrancheServerstartTimestamp - Timestamp from which to include activities (inclusive)stopTimestamp - Timestamp to which to include activities (inclusive)mask - Used to match activity bytes. If all the bits in the mask are included in the activity byte, then the activity will be included. For example, if the mask is Activity.ACTION_TYPE_SET, then all logs that have this bit set (set data and set meta data) will be included. However, if Activity.SET_DATA is the mask, then only set data actions will match (since there are two bits set in the mask, making it more restrictive). 0 is least restrictive (restricts nothing) and 0xFF is most restrictive (restricts everything but itself).
java.lang.Exceptionpublic boolean addListener(RoutingTrancheServerListener l)
l -
public boolean removeListener(RoutingTrancheServerListener l)
l -
public void clearListeners()
public void fireDataServersAdded(java.lang.String[] hosts)
hosts - public void fireDataServersRemoved(java.lang.String[] hosts)
Fired when a RoutingTrancheServer instance removes one or more data server.
hosts -
public PropagationReturnWrapper setData(BigHash hash,
byte[] data,
Signature sig,
java.lang.String[] hosts)
throws java.lang.Exception
Set data and replicate to specified hosts.
setData in class TrancheServerhash - data - sig - hosts -
java.lang.Exception
public PropagationReturnWrapper setMetaData(boolean merge,
BigHash hash,
byte[] data,
Signature sig,
java.lang.String[] hosts)
throws java.lang.Exception
TrancheServerSet meta data and replicate to specified hosts.
setMetaData in class TrancheServermerge - hash - data - sig - hosts -
java.lang.Exception
public PropagationReturnWrapper getNonces(java.lang.String[] hosts,
int count)
throws java.lang.Exception
Get batch of nonces from selected server hosts.
getNonces in class TrancheServerhosts - count -
java.lang.Exception
public PropagationReturnWrapper deleteData(BigHash hash,
Signature[] sigs,
byte[][] nonces,
java.lang.String[] hosts)
throws java.lang.Exception
Delete data chunk from selected servers.
deleteData in class TrancheServerhash - sigs - nonces - hosts -
java.lang.Exception
public PropagationReturnWrapper deleteMetaData(BigHash hash,
java.lang.String uploaderName,
java.lang.Long uploadTimestamp,
java.lang.String relativePathInDataSet,
Signature[] sigs,
byte[][] nonces,
java.lang.String[] hosts)
throws java.lang.Exception
deleteMetaData in class TrancheServerhash - sigs - nonces - hosts -
java.lang.Exceptionpublic java.security.cert.X509Certificate getAuthCert()
By setting a certificate and private key to the routing Tranche server that can perform deletes, will be able to delete from managed data servers.
It is the responsibility of the administrator starting the routing server to secure a signed key/certificate that can perform deletes. Please contact the Tranche network administrators for more information.
public void setAuthCert(java.security.cert.X509Certificate authCert)
By setting a certificate and private key to the routing Tranche server that can perform deletes, will be able to delete from managed data servers.
It is the responsibility of the administrator starting the routing server to secure a signed key/certificate that can perform deletes. Please contact the Tranche network administrators for more information.
authCert - public java.security.PrivateKey getAuthPrivateKey()
By setting a certificate and private key to the routing Tranche server that can perform deletes, will be able to delete from managed data servers.
It is the responsibility of the administrator starting the routing server to secure a signed key/certificate that can perform deletes. Please contact the Tranche network administrators for more information.
public void setAuthPrivateKey(java.security.PrivateKey authPrivateKey)
By setting a certificate and private key to the routing Tranche server that can perform deletes, will be able to delete from managed data servers.
It is the responsibility of the administrator starting the routing server to secure a signed key/certificate that can perform deletes. Please contact the Tranche network administrators for more information.
authPrivateKey - public boolean isClosed()
Returns true if and only if the server has been closed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||