public class EventLogInstance extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ContractId |
| Constructor and Description |
|---|
EventLogInstance(ByzCoinRPC bc,
DarcId darcId,
List<Signer> signers)
Constructor for when do you not know the eventlog contract, use this constructor when constructing for the first
time.
|
| Modifier and Type | Method and Description |
|---|---|
static EventLogInstance |
fromByzcoin(ByzCoinRPC bc,
InstanceId id)
Constructor for when the caller already knows the eventlog contract.
|
Event |
get(InstanceId key)
Retrieves the stored event by key.
|
InstanceId |
getInstanceId()
Gets the contract ID which can be stored to re-connect to the same eventlog instance in the future.
|
InstanceId |
log(Event event,
DarcId darcId,
List<Signer> signers)
Logs an event, the returned value is the ID of the event which can be retrieved later.
|
List<InstanceId> |
log(List<Event> events,
DarcId darcId,
List<Signer> signers)
Logs a list of events, the returned value is a list of ID for every event which can be used to retrieve events
later.
|
SearchResponse |
search(String topic,
long from,
long to)
Searches for events based on topic and a time range.
|
public static String ContractId
public EventLogInstance(ByzCoinRPC bc, DarcId darcId, List<Signer> signers) throws CothorityException
bc - the byzcoin RPCdarcId - the darc ID that has the "spawn:eventlog" permissionsigners - a list of signers that has the "spawn:eventlog" permissionCothorityException - if something goes wrongpublic List<InstanceId> log(List<Event> events, DarcId darcId, List<Signer> signers) throws CothorityException
events - a list of events to logdarcId - the darc IDsigners - a list of signers with the permission "invoke:eventlog"CothorityException - if something goes wrongpublic InstanceId log(Event event, DarcId darcId, List<Signer> signers) throws CothorityException
event - the event to logdarcId - the darc IDsigners - a list of signers that has the "invoke:eventlog" permissionCothorityException - if something goes wrongpublic Event get(InstanceId key) throws CothorityException
key - the key for which the event is storedCothorityException - if something goes wrongpublic SearchResponse search(String topic, long from, long to) throws CothorityException
topic - the topic to search, if it is an empty string, all topics are included, we do not support regexfrom - the start of the search range (exclusive).to - the end of the search range (inclusive).CothorityException - if something goes wrongpublic InstanceId getInstanceId()
public static EventLogInstance fromByzcoin(ByzCoinRPC bc, InstanceId id) throws CothorityException
bc - the byzcoin RPCid - the contract ID, it must be already initialised and stored on byzcoinCothorityException - if something goes wrongCopyright © 2018. All rights reserved.