@Override public Binder onUpdated(MutableEnvironment me) { updateSubscriptions(me); return Binder.fromKeysValues("status", "ok"); }
@Override public @Nullable Binder onCreated(MutableEnvironment me) { updateSubscriptions(me); return Binder.fromKeysValues("status", "ok"); }
@Override public void onContractSubscriptionEvent(ContractSubscription.Event event) { if(event instanceof ContractSubscription.ApprovedEvent) { MutableEnvironment me = event.getEnvironment(); // recreate subscription: Contract newStoredItem = ((ContractSubscription.ApprovedEvent)event).getNewRevision(); putTrackingContract(newStoredItem); saveTrackingContractsToState(); // and save new updateSubscriptions(me); } else if(event instanceof ContractSubscription.RevokedEvent) { } }