public class VaultSubscription extends ServiceEndpoint implements SubscriptionService<VaultInfo>, PaymentService
Subscribe the vault is the first step to use the service in the vault.
| Constructor and Description |
|---|
VaultSubscription(AppContext context)
Create by the application context, and the address of the provider.
|
VaultSubscription(AppContext context,
java.lang.String providerAddress)
Create by the application context, and the address of the provider.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletableFuture<VaultInfo> |
checkSubscription()
Let the user to get the basic information of the subscription.
|
java.util.concurrent.CompletableFuture<java.util.List<AppInfo>> |
getAppStats()
Get all application stats of the vault service
|
java.util.concurrent.CompletableFuture<Order> |
getOrder(java.lang.String orderId)
Obtain the order detail according to the given order id.
|
java.util.concurrent.CompletableFuture<java.util.List<Order>> |
getOrderList()
Obtain all the list of order detail.
|
java.util.concurrent.CompletableFuture<PricingPlan> |
getPricingPlan(java.lang.String planName)
Let users to get the specific pricing plan information.
|
java.util.concurrent.CompletableFuture<java.util.List<PricingPlan>> |
getPricingPlanList()
Let users to get the all the pricing plan list in order to subscribe
to a new vault or backup service on the user's requirement.
|
java.util.concurrent.CompletableFuture<Receipt> |
getReceipt(java.lang.String orderId)
Obtain the receipt detail according to the order id.
|
java.util.concurrent.CompletableFuture<java.lang.String> |
getVersion()
Obtain the version of the payment module.
|
java.util.concurrent.CompletableFuture<Receipt> |
payOrder(java.lang.String orderId,
java.lang.String transactionId)
Pay for the order with a given id.
|
java.util.concurrent.CompletableFuture<Order> |
placeOrder(java.lang.String planName)
Place an order for new subscription or extending the existing subscription
service.
|
java.util.concurrent.CompletableFuture<VaultInfo> |
subscribe()
Let a new user subscribe to the entity service on the specified back-end
node, where the entity service would be vault or backup service.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
unsubscribe()
Let user to unsubscribe to an existing but useless vault or backup service.
|
getAccessToken, getAppContext, getAppDid, getAppInstanceDid, getLatestCommitId, getNodeInfo, getNodeVersion, getProviderAddress, getServiceDid, getServiceInstanceDid, getStorage, getUserDid, refreshAccessTokencreateService, openConnectionpublic VaultSubscription(AppContext context, java.lang.String providerAddress) throws HiveException
context - The application context.providerAddress - The address of the provider.HiveException - See HiveExceptionpublic VaultSubscription(AppContext context) throws HiveException
context - The application context.HiveException - See HiveExceptionpublic java.util.concurrent.CompletableFuture<java.util.List<PricingPlan>> getPricingPlanList()
SubscriptionServicegetPricingPlanList in interface SubscriptionService<VaultInfo>public java.util.concurrent.CompletableFuture<PricingPlan> getPricingPlan(java.lang.String planName)
SubscriptionServicegetPricingPlan in interface SubscriptionService<VaultInfo>planName - the name of the pricing planpublic java.util.concurrent.CompletableFuture<VaultInfo> subscribe()
SubscriptionServicesubscribe in interface SubscriptionService<VaultInfo>public java.util.concurrent.CompletableFuture<java.lang.Void> unsubscribe()
SubscriptionServiceunsubscribe in interface SubscriptionService<VaultInfo>public java.util.concurrent.CompletableFuture<VaultInfo> checkSubscription()
SubscriptionServicecheckSubscription in interface SubscriptionService<VaultInfo>public java.util.concurrent.CompletableFuture<java.util.List<AppInfo>> getAppStats()
SubscriptionServicegetAppStats in interface SubscriptionService<VaultInfo>public java.util.concurrent.CompletableFuture<Order> placeOrder(java.lang.String planName)
PaymentServiceplaceOrder in interface PaymentServiceplanName - the name of the pricing planpublic java.util.concurrent.CompletableFuture<Order> getOrder(java.lang.String orderId)
PaymentServicegetOrder in interface PaymentServiceorderId - order idpublic java.util.concurrent.CompletableFuture<Receipt> payOrder(java.lang.String orderId, java.lang.String transactionId)
PaymentServicepayOrder in interface PaymentServiceorderId - order idtransactionId - the transaction id on the block-chain.public java.util.concurrent.CompletableFuture<java.util.List<Order>> getOrderList()
PaymentServicegetOrderList in interface PaymentServicepublic java.util.concurrent.CompletableFuture<Receipt> getReceipt(java.lang.String orderId)
PaymentServicegetReceipt in interface PaymentServiceorderId - order id.public java.util.concurrent.CompletableFuture<java.lang.String> getVersion()
PaymentServicegetVersion in interface PaymentService