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 |
static String |
LogCmd |
| Constructor and Description |
|---|
EventLogInstance(ByzCoinRPC bc,
DarcId darcBaseID,
List<Signer> signers,
List<Long> signerCtrs)
Constructor for when do you not know the eventlog contract, use this constructor when constructing for the first
time.
|
EventLogInstance(ByzCoinRPC bc,
InstanceId id)
Constructor for when the caller already knows the eventlog contract.
|
| 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,
List<Signer> signers,
List<Long> signerCtrs)
Logs an event, the returned value is the ID of the event which can be retrieved later.
|
List<InstanceId> |
log(List<Event> events,
List<Signer> signers,
List<Long> signerCtrs)
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 EventLogInstance(ByzCoinRPC bc, DarcId darcBaseID, List<Signer> signers, List<Long> signerCtrs) throws CothorityException
bc - the byzcoin RPCdarcBaseID - the darc ID that has the "spawn:eventlog" permissionsigners - a list of signers that has the "spawn:eventlog" permissionsignerCtrs - a list of monotonically increasing counter for every signerCothorityException - if something goes wrongpublic EventLogInstance(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 wrongpublic List<InstanceId> log(List<Event> events, List<Signer> signers, List<Long> signerCtrs) throws CothorityException
events - a list of events to logsigners - a list of signers with the permission "invoke:eventlog.log"signerCtrs - a list of monotonically increasing counter for every signerCothorityException - if something goes wrongpublic InstanceId log(Event event, List<Signer> signers, List<Long> signerCtrs) throws CothorityException
event - the event to logsigners - a list of signers that has the "invoke:eventlog.log" permissionsignerCtrs - a list of monotonically increasing counter for every signerCothorityException - 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 © 2019. All rights reserved.