public class EventLogInstance extends Object
Contrary to ordinary event logging services, we offer better security and auditability. Below are some of the main features that sets us apart.
| 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" permissionCothorityExceptionpublic List<InstanceId> log(List<Event> events, DarcId darcId, List<Signer> signers) throws CothorityException
events - a list of events to logsigners - a list of signers with the permission "invoke:eventlog"CothorityExceptionpublic InstanceId log(Event event, DarcId darcId, List<Signer> signers) throws CothorityException
event - the event to logsigners - a list of signers that has the "invoke:eventlog" permissionCothorityExceptionpublic Event get(InstanceId key) throws CothorityException
key - the key for which the event is storedCothorityExceptionpublic 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).CothorityExceptionpublic 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 byzcoinCothorityExceptionCopyright © 2018. All rights reserved.