程序包 org.elastos.hive
类 ServiceEndpoint
- java.lang.Object
-
- org.elastos.hive.connection.NodeRPCConnection
-
- org.elastos.hive.ServiceEndpoint
-
- 直接已知子类:
Backup,BackupSubscription,Provider,ScriptRunner,Vault,VaultSubscription
public class ServiceEndpoint extends NodeRPCConnection
The service end-point represents the service provides some API functions. It supports:- Access token management.
- Local cache for the access token.
- The service DID of the hive node.
- The provider address.
The service end-point is just like the map of the hive node. The application can communicate with the hive node APIs by its sub-class.
-
-
构造器概要
构造器 限定符 构造器 说明 protectedServiceEndpoint(AppContext context, java.lang.String providerAddress)Create by the application context, and the address of the provider.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected AccessTokengetAccessToken()AppContextgetAppContext()Get the application context.java.lang.StringgetAppDid()Get the application DID in the current calling context.java.lang.StringgetAppInstanceDid()Get the application instance DID in the current calling context;java.util.concurrent.CompletableFuture<java.lang.String>getLatestCommitId()Get the last commit ID of the hive node.java.util.concurrent.CompletableFuture<NodeInfo>getNodeInfo()Get the information of the hive node.java.util.concurrent.CompletableFuture<NodeVersion>getNodeVersion()Get the version of the hive node.java.lang.StringgetProviderAddress()Get the end-point address of this service End-point.java.lang.StringgetServiceDid()Get the remote node service application DID.java.lang.StringgetServiceInstanceDid()Get the remote node service instance DID where is serving the storage service.DataStoragegetStorage()Get the instance of the data storage.java.lang.StringgetUserDid()Get the user DID string of this serviceEndpoint.voidrefreshAccessToken()Refresh the access token.-
从类继承的方法 org.elastos.hive.connection.NodeRPCConnection
createService, openConnection
-
-
-
-
构造器详细资料
-
ServiceEndpoint
protected ServiceEndpoint(AppContext context, java.lang.String providerAddress)
Create by the application context, and the address of the provider. They are not all null.- 参数:
context- The application context. Access token is not required if null.providerAddress- The address of the provider.
-
-
方法详细资料
-
getAppContext
public AppContext getAppContext()
Get the application context.- 返回:
- The application context.
-
getProviderAddress
public java.lang.String getProviderAddress()
Get the end-point address of this service End-point.- 指定者:
getProviderAddress在类中NodeRPCConnection- 返回:
- provider address
-
getUserDid
public java.lang.String getUserDid()
Get the user DID string of this serviceEndpoint.- 返回:
- user did
-
getAppDid
public java.lang.String getAppDid()
Get the application DID in the current calling context.- 返回:
- application did
-
getAppInstanceDid
public java.lang.String getAppInstanceDid()
Get the application instance DID in the current calling context;- 返回:
- application instance did
-
getServiceDid
public java.lang.String getServiceDid()
Get the remote node service application DID.- 返回:
- node service did
-
getServiceInstanceDid
public java.lang.String getServiceInstanceDid()
Get the remote node service instance DID where is serving the storage service.- 返回:
- node service instance did
-
getStorage
public DataStorage getStorage()
Get the instance of the data storage.- 返回:
- The instance of the data storage.
-
refreshAccessToken
public void refreshAccessToken() throws NodeRPCExceptionRefresh the access token. This will do remote refresh if not exist.- 抛出:
NodeRPCException- SeeNodeRPCException
-
getAccessToken
protected AccessToken getAccessToken()
- 指定者:
getAccessToken在类中NodeRPCConnection
-
getNodeVersion
public java.util.concurrent.CompletableFuture<NodeVersion> getNodeVersion()
Get the version of the hive node.- 返回:
- The version of the hive node.
-
getLatestCommitId
public java.util.concurrent.CompletableFuture<java.lang.String> getLatestCommitId()
Get the last commit ID of the hive node.- 返回:
- The last commit ID.
-
getNodeInfo
public java.util.concurrent.CompletableFuture<NodeInfo> getNodeInfo()
Get the information of the hive node.- 返回:
- The information.
-
-