程序包 org.elastos.hive
类 VaultSubscription
- java.lang.Object
-
- org.elastos.hive.connection.NodeRPCConnection
-
- org.elastos.hive.ServiceEndpoint
-
- org.elastos.hive.VaultSubscription
-
- 所有已实现的接口:
PaymentService,SubscriptionService<VaultInfo>
public class VaultSubscription extends ServiceEndpoint implements SubscriptionService<VaultInfo>, PaymentService
The vault subscription is used for the vault management.Subscribe the vault is the first step to use the service in the vault.
-
-
构造器概要
构造器 构造器 说明 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.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 java.util.concurrent.CompletableFuture<java.lang.Void>activate()Activate the vault service.java.util.concurrent.CompletableFuture<VaultInfo>checkSubscription()Let the user to get the basic information of the subscription.java.util.concurrent.CompletableFuture<java.lang.Void>deactivate()Deactivate the vault service.java.util.concurrent.CompletableFuture<java.util.List<AppInfo>>getAppStats()Get all application stats of the vault servicejava.util.concurrent.CompletableFuture<Order>getOrder(int 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(int orderId)Obtain the receipt detail according to the order id.java.util.concurrent.CompletableFuture<java.util.List<Receipt>>getReceipts()Obtain the receipt of the vault.java.util.concurrent.CompletableFuture<java.lang.String>getVersion()Obtain the version of the payment module.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<Receipt>settleOrder(int orderId)Pay for the order with a given id.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()java.util.concurrent.CompletableFuture<java.lang.Void>unsubscribe(boolean force)Let user to unsubscribe to an existing but useless vault or backup service.-
从类继承的方法 org.elastos.hive.ServiceEndpoint
getAccessToken, getAppContext, getAppDid, getAppInstanceDid, getLatestCommitId, getNodeInfo, getNodeVersion, getProviderAddress, getServiceDid, getServiceInstanceDid, getStorage, getUserDid, refreshAccessToken
-
从类继承的方法 org.elastos.hive.connection.NodeRPCConnection
createService, openConnection
-
-
-
-
构造器详细资料
-
VaultSubscription
public VaultSubscription(AppContext context, java.lang.String providerAddress) throws HiveException
Create by the application context, and the address of the provider.- 参数:
context- The application context.providerAddress- The address of the provider.- 抛出:
HiveException- SeeHiveException
-
VaultSubscription
public VaultSubscription(AppContext context) throws HiveException
Create by the application context, and the address of the provider.- 参数:
context- The application context.- 抛出:
HiveException- SeeHiveException
-
-
方法详细资料
-
getPricingPlanList
public java.util.concurrent.CompletableFuture<java.util.List<PricingPlan>> getPricingPlanList()
从接口复制的说明:SubscriptionServiceLet 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.- 指定者:
getPricingPlanList在接口中SubscriptionService<VaultInfo>- 返回:
- Return a list of all pricing plan with specific type on success. Otherwise, the specific exception would be returned.
-
getPricingPlan
public java.util.concurrent.CompletableFuture<PricingPlan> getPricingPlan(java.lang.String planName)
从接口复制的说明:SubscriptionServiceLet users to get the specific pricing plan information.- 指定者:
getPricingPlan在接口中SubscriptionService<VaultInfo>- 参数:
planName- the name of the pricing plan- 返回:
- Return the specific pricing plan information on success. Otherwise, the specific exception would be returned.
-
subscribe
public java.util.concurrent.CompletableFuture<VaultInfo> subscribe()
从接口复制的说明:SubscriptionServiceLet a new user subscribe to the entity service on the specified back-end node, where the entity service would be vault or backup service. Currently this method would only support for subscription to a entity service with free pricing plan. When there is already a corresponding service existed, no new service would be subscribed or created.- 指定者:
subscribe在接口中SubscriptionService<VaultInfo>- 返回:
- The basic information of the newly created or existing vault on success, otherwise, the specific exception would returned in the wrapper.
-
activate
public java.util.concurrent.CompletableFuture<java.lang.Void> activate()
从接口复制的说明:SubscriptionServiceActivate the vault service.- 指定者:
activate在接口中SubscriptionService<VaultInfo>- 返回:
- None would be returned on success, otherwise, the specific exception would be returned.
-
deactivate
public java.util.concurrent.CompletableFuture<java.lang.Void> deactivate()
从接口复制的说明:SubscriptionServiceDeactivate the vault service.- 指定者:
deactivate在接口中SubscriptionService<VaultInfo>- 返回:
- None would be returned on success, otherwise, the specific exception would be returned.
-
unsubscribe
public java.util.concurrent.CompletableFuture<java.lang.Void> unsubscribe(boolean force)
从接口复制的说明:SubscriptionServiceLet user to unsubscribe to an existing but useless vault or backup service.- 指定者:
unsubscribe在接口中SubscriptionService<VaultInfo>- 参数:
force- whether force to remove the data.- 返回:
- None would be returned on success, otherwise, the specific exception would be returned.
-
unsubscribe
public java.util.concurrent.CompletableFuture<java.lang.Void> unsubscribe()
- 指定者:
unsubscribe在接口中SubscriptionService<VaultInfo>
-
checkSubscription
public java.util.concurrent.CompletableFuture<VaultInfo> checkSubscription()
从接口复制的说明:SubscriptionServiceLet the user to get the basic information of the subscription.- 指定者:
checkSubscription在接口中SubscriptionService<VaultInfo>- 返回:
- The basic information of the newly created or existing vault on success, otherwise, the specific exception would returned in the wrapper.
-
getAppStats
public java.util.concurrent.CompletableFuture<java.util.List<AppInfo>> getAppStats()
从接口复制的说明:SubscriptionServiceGet all application stats of the vault service- 指定者:
getAppStats在接口中SubscriptionService<VaultInfo>- 返回:
- The application list.
-
placeOrder
public java.util.concurrent.CompletableFuture<Order> placeOrder(java.lang.String planName)
从接口复制的说明:PaymentServicePlace an order for new subscription or extending the existing subscription service.- 指定者:
placeOrder在接口中PaymentService- 参数:
planName- the name of the pricing plan- 返回:
- return the new order detail when the request successfully was received by back-end node, otherwise return the specific exception.
-
getOrder
public java.util.concurrent.CompletableFuture<Order> getOrder(int orderId)
从接口复制的说明:PaymentServiceObtain the order detail according to the given order id.- 指定者:
getOrder在接口中PaymentService- 参数:
orderId- order id- 返回:
- return the order detail in case there is a order with order id existing. otherwise, return the specific exception.
-
settleOrder
public java.util.concurrent.CompletableFuture<Receipt> settleOrder(int orderId)
从接口复制的说明:PaymentServicePay for the order with a given id.- 指定者:
settleOrder在接口中PaymentService- 参数:
orderId- order id of the payment contract- 返回:
- return the receipt detail in case the payment was accepted by hive node, otherwise return the specific exception.
-
getOrderList
public java.util.concurrent.CompletableFuture<java.util.List<Order>> getOrderList()
从接口复制的说明:PaymentServiceObtain all the list of order detail.- 指定者:
getOrderList在接口中PaymentService- 返回:
- return the list of order detail on success, otherwise, return the specific exception.
-
getReceipt
public java.util.concurrent.CompletableFuture<Receipt> getReceipt(int orderId)
从接口复制的说明:PaymentServiceObtain the receipt detail according to the order id.- 指定者:
getReceipt在接口中PaymentService- 参数:
orderId- order id.- 返回:
- return the receipt detail in case there is a receipt existing, otherwise, return the specific exception.
-
getReceipts
public java.util.concurrent.CompletableFuture<java.util.List<Receipt>> getReceipts()
从接口复制的说明:PaymentServiceObtain the receipt of the vault.- 指定者:
getReceipts在接口中PaymentService- 返回:
- return the receipt detail in case there is a receipt existing, otherwise, return the specific exception.
-
getVersion
public java.util.concurrent.CompletableFuture<java.lang.String> getVersion()
从接口复制的说明:PaymentServiceObtain the version of the payment module.- 指定者:
getVersion在接口中PaymentService- 返回:
- return the version, otherwise, return the specific exception.
-
-