|
||||||||||
| 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
public abstract class TrancheServer
This is the abstract interface for a node in the distributed file system. The get() methods are intended for public use however, the add() and delete() methods may only be invoked by a recognized authority.
| Field Summary | |
|---|---|
static java.lang.String |
BAD_NONCE
|
static java.lang.String |
BAD_SIG
|
| Constructor Summary | |
|---|---|
TrancheServer()
|
|
| Method Summary | |
|---|---|
abstract void |
close()
Closes the server and shuts down any associated resources. |
abstract PropagationReturnWrapper |
deleteData(BigHash hash,
Signature[] sigs,
byte[][] nonces,
java.lang.String[] hosts)
Delete data chunk from selected servers. |
abstract PropagationReturnWrapper |
deleteMetaData(BigHash hash,
java.lang.String uploaderName,
java.lang.Long uploadTimestamp,
java.lang.String relativePathInDataSet,
Signature[] sigs,
byte[][] nonces,
java.lang.String[] hosts)
|
abstract Activity[] |
getActivityLogEntries(long startTimestamp,
long finishTimestamp,
int limit,
byte mask)
Get all activity log entries from within a time period. |
abstract int |
getActivityLogEntriesCount(long startTimestamp,
long stopTimestamp,
byte mask)
Returns a count of all activity log entries from within a time period. |
abstract Configuration |
getConfiguration()
|
abstract Configuration |
getConfiguration(Signature sig,
byte[] nonce)
|
abstract PropagationReturnWrapper |
getData(BigHash[] hashes,
boolean propagateRequest)
|
abstract BigHash[] |
getDataHashes(java.math.BigInteger offset,
java.math.BigInteger length)
|
abstract java.lang.String |
getHost()
Returns the host name of the server. |
abstract PropagationReturnWrapper |
getMetaData(BigHash[] hashes,
boolean propagateRequest)
|
abstract BigHash[] |
getMetaDataHashes(java.math.BigInteger offset,
java.math.BigInteger length)
|
abstract StatusTable |
getNetworkStatusPortion(java.lang.String startHost,
java.lang.String endHost)
|
abstract PropagationReturnWrapper |
getNonces(java.lang.String[] hosts,
int count)
Get batch of nonces from selected server hosts. |
abstract BigHash[] |
getProjectHashes(java.math.BigInteger offset,
java.math.BigInteger length)
Returns a list of all projects that this server has. |
abstract boolean[] |
hasData(BigHash[] hashes)
|
abstract boolean[] |
hasMetaData(BigHash[] hashes)
|
abstract void |
ping()
Ping the server. |
abstract void |
registerServer(java.lang.String url)
Registers the given URL as a known server. |
abstract void |
requestShutdown(Signature sig,
byte[] nonce)
Request that a server shut down. |
abstract void |
setConfiguration(byte[] data,
Signature sig,
byte[] nonce)
Sets a new configuration for the server. |
abstract PropagationReturnWrapper |
setData(BigHash hash,
byte[] data,
Signature sig,
java.lang.String[] hosts)
Set data and replicate to specified hosts. |
abstract 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 |
| Field Detail |
|---|
public static final java.lang.String BAD_NONCE
public static final java.lang.String BAD_SIG
| Constructor Detail |
|---|
public TrancheServer()
| Method Detail |
|---|
public abstract void ping()
throws java.lang.Exception
Ping the server. Handled by Server object which wraps this object.
java.lang.Exception
public abstract StatusTable getNetworkStatusPortion(java.lang.String startHost,
java.lang.String endHost)
throws java.lang.Exception
startHost - endHost -
java.lang.Exception
public abstract PropagationReturnWrapper getNonces(java.lang.String[] hosts,
int count)
throws java.lang.Exception
Get batch of nonces from selected server hosts.
hosts - count -
java.lang.Exception
public abstract boolean[] hasData(BigHash[] hashes)
throws java.lang.Exception
hashes - the BigHash array of data chunks
java.lang.Exception - if any exception occurs
public abstract PropagationReturnWrapper getData(BigHash[] hashes,
boolean propagateRequest)
throws java.lang.Exception
hashes - propagateRequest - Whether the server should propagate the request across the network.
java.lang.Exception
public abstract PropagationReturnWrapper setData(BigHash hash,
byte[] data,
Signature sig,
java.lang.String[] hosts)
throws java.lang.Exception
Set data and replicate to specified hosts.
hash - data - sig - hosts -
java.lang.Exception
public abstract PropagationReturnWrapper deleteData(BigHash hash,
Signature[] sigs,
byte[][] nonces,
java.lang.String[] hosts)
throws java.lang.Exception
Delete data chunk from selected servers.
hash - sigs - nonces - hosts -
java.lang.Exception
public abstract boolean[] hasMetaData(BigHash[] hashes)
throws java.lang.Exception
hashes - the BigHash array of meta data chunks
java.lang.Exception - if any exception occurs
public abstract PropagationReturnWrapper getMetaData(BigHash[] hashes,
boolean propagateRequest)
throws java.lang.Exception
hashes - propagateRequest -
java.lang.Exception
public abstract PropagationReturnWrapper setMetaData(boolean merge,
BigHash hash,
byte[] data,
Signature sig,
java.lang.String[] hosts)
throws java.lang.Exception
Set meta data and replicate to specified hosts.
merge - hash - data - sig - hosts -
java.lang.Exception
public abstract 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
hash - sigs - nonces - hosts -
java.lang.Exception
public abstract BigHash[] getDataHashes(java.math.BigInteger offset,
java.math.BigInteger length)
throws java.lang.Exception
offset - the offsetlength - the length
java.lang.Exception - if any exception occurs
public abstract BigHash[] getMetaDataHashes(java.math.BigInteger offset,
java.math.BigInteger length)
throws java.lang.Exception
offset - the offsetlength - the length
java.lang.Exception - if any exception occurs
public abstract BigHash[] getProjectHashes(java.math.BigInteger offset,
java.math.BigInteger length)
throws java.lang.Exception
offset - the offsetlength - the length
java.lang.Exception - if any exception occurs
public abstract Configuration getConfiguration()
throws java.lang.Exception
java.lang.Exception
public abstract Configuration getConfiguration(Signature sig,
byte[] nonce)
throws java.lang.Exception
sig - the signaturenonce - the nonce bytes
java.lang.Exception - if any exception occurs
public abstract void setConfiguration(byte[] data,
Signature sig,
byte[] nonce)
throws java.lang.Exception
data - 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 abstract void registerServer(java.lang.String url)
throws java.lang.Exception
url - the URL to register (e.g. tranche://proteomecommons.org:443 )
java.lang.Exception - if any exception occurs
public abstract void requestShutdown(Signature sig,
byte[] nonce)
throws java.lang.Exception
Request that a server shut down. Intended for remote administration of servers.
sig - nonce -
java.lang.Exception
public abstract Activity[] getActivityLogEntries(long startTimestamp,
long finishTimestamp,
int limit,
byte mask)
throws java.lang.Exception
Get all activity log entries from within a time period.
startTimestamp - 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 abstract 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.
startTimestamp - 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 abstract void close()
Closes the server and shuts down any associated resources.
public abstract java.lang.String getHost()
Returns the host name of the server.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||