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.
| Constructor and Description |
|---|
EventLogInstance(OmniledgerRPC ol,
InstanceId id)
Constructor for when the caller already knows the eventlog instance.
|
EventLogInstance(OmniledgerRPC ol,
List<Signer> signers,
DarcId darcId)
Constructor for when do you not know the eventlog instance, use this constructor when constructing for the first
time.
|
| Modifier and Type | Method and Description |
|---|---|
Event |
get(InstanceId key)
Retrieves the stored event by key.
|
InstanceId |
getInstanceId()
Gets the instance ID which can be stored to re-connect to the same eventlog instance in the future.
|
InstanceId |
log(Event event,
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,
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 EventLogInstance(OmniledgerRPC ol, List<Signer> signers, DarcId darcId) throws CothorityException
ol - the omniledger RPCsigners - a list of signers that has the "spawn:eventlog" permissiondarcId - the darc ID that has the "spawn:eventlog" permissionCothorityExceptionpublic EventLogInstance(OmniledgerRPC ol, InstanceId id) throws CothorityException
ol - the omniledger RPCid - the instance ID, it must be already initialised and stored on omniledgerCothorityExceptionpublic List<InstanceId> log(List<Event> events, 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, 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()
Copyright © 2018. All rights reserved.