Skip to content

Commit

Permalink
Add interface methods for delegated subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-ap committed Jan 11, 2023
1 parent f41f782 commit c21c3e3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>blockchains.iaas.uni.stuttgart.de</groupId>
<artifactId>blockchain-access-layer-api</artifactId>
<version>2.0.3</version>
<version>2.0.4</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/********************************************************************************
* Copyright (c) 2018-2022 Institute for the Architecture of Application System -
* Copyright (c) 2018-2023 Institute for the Architecture of Application System -
* University of Stuttgart
* Author: Ghareeb Falazi
* Co-author: Akshay Patel
*
* This program and the accompanying materials are made available under the
* terms the Apache Software License 2.0
Expand All @@ -16,6 +17,8 @@
import blockchains.iaas.uni.stuttgart.de.api.exceptions.InvalidTransactionException;
import blockchains.iaas.uni.stuttgart.de.api.exceptions.NotSupportedException;
import blockchains.iaas.uni.stuttgart.de.api.model.*;
import com.github.arteam.simplejsonrpc.core.annotation.JsonRpcOptional;
import com.github.arteam.simplejsonrpc.core.annotation.JsonRpcParam;
import io.reactivex.Observable;

import java.math.BigDecimal;
Expand Down Expand Up @@ -147,4 +150,33 @@ CompletableFuture<Transaction> tryReplaceInvocation(String correlationId, String

boolean tryCancelInvocation(String correlationId);

/*
* This method should be implemented by the plugin to indicate whether the plugin is capable of handling subscription
* and the callbacks both.
* */
boolean canHandleDelegatedSubscription();

/*
* This method is an alternative to initial gateway implementation where the gateway acts as a centralized entity
* and handles subscriptions and callbacks. Using this method, a plugin can must invoke callbacks on its own rather
* than gateway managing the callbacks.
* */
boolean delegatedSubscribe(String functionIdentifier,
String eventIdentifier,
List<Parameter> outputParameters,
double degreeOfConfidence,
String filter,
String callbackUrl,
String correlationId);

/*
* This method is an alternative to initial gateway implementation where the gateway acts as a centralized entity
* and handles subscriptions, callbacks and cancelling subscriptions.
* */
boolean delegatedUnsubscribe(String functionIdentifier,
String eventIdentifier,
List<String> typeArguments,
List<Parameter> parameters,
String correlationId);

}

0 comments on commit c21c3e3

Please sign in to comment.