public class Session
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
CipherOpt |
cipherOpt |
Crypto |
crypto |
IData |
iData |
MData |
mData |
MDataEntries |
mDataEntries |
MDataEntryAction |
mDataEntryAction |
MDataPermission |
mDataPermission |
NFS |
nfs |
Modifier | Constructor and Description |
---|---|
protected |
Session(net.maidsafe.api.AppHandle appHandle,
net.maidsafe.api.DisconnectListener disconnectListener) |
Modifier and Type | Method and Description |
---|---|
static java.util.concurrent.CompletableFuture<Session> |
connect(byte[] bootStrapConfig)
Establish a new unregistered session using the bootstrap config from the response
|
static java.util.concurrent.CompletableFuture<Session> |
connect(java.lang.String appId,
AuthGranted authGranted)
Establish a new registered session with the network for the app
|
static java.util.concurrent.CompletableFuture<Session> |
connect(UnregisteredClientResponse response)
Establish a new unregistered session
|
static java.util.concurrent.CompletableFuture<Session> |
createTestApp(java.lang.String appId)
Creates a random app instance for testing
|
static java.util.concurrent.CompletableFuture<Session> |
createTestAppWithAccess(AuthReq authReq)
Creates a random app instance for testing
|
static java.util.concurrent.CompletableFuture<DecodeResult> |
decodeIpcMessage(java.lang.String response)
Decodes the encoded response from the Authenticator
|
static java.util.concurrent.CompletableFuture<Request> |
encodeAuthReq(AuthReq req)
Encodes an Auth request for authentication
|
java.util.concurrent.CompletableFuture<AccountInfo> |
getAccountInfo()
Get the account usage statistics (mutations done and mutations available)
|
static java.util.concurrent.CompletableFuture<java.lang.String> |
getAppContainerName(java.lang.String appId)
Get the App's container name
|
static java.util.concurrent.CompletableFuture<java.lang.String> |
getAppStem()
Returns the expected name for the app's executable without the extension
|
java.util.concurrent.CompletableFuture<MDataInfo> |
getContainerMDataInfo(java.lang.String containerName)
Get the mDataInfo for the App container
|
java.util.concurrent.CompletableFuture<java.util.List<ContainerPermissions>> |
getContainerPermissions()
Retrieve a list of container names that an app has access to.
|
static java.util.concurrent.CompletableFuture<Request> |
getContainersReq(ContainersReq containersReq)
Encode a Containers request that is to be sent to the Authenticator
|
static java.util.concurrent.CompletableFuture<java.lang.String> |
getLogOutputPath(java.lang.String logFileName)
Get the full path for the log file
|
static java.util.concurrent.CompletableFuture<Request> |
getShareMutableDataRequest(ShareMDataReq req)
Encodes a share Mutable Data request
|
static java.util.concurrent.CompletableFuture<Request> |
getUnregisteredSessionRequest(java.lang.String appId)
Encodes a request for an unregistered session
|
static java.util.concurrent.CompletableFuture |
initLogging(java.lang.String outputFileName)
Initialises logging to a file.
|
boolean |
isConnected()
Returns true if the client is connected to the network
|
static boolean |
isMock()
Returns true if libraries were compiled for mock routing
|
java.util.concurrent.CompletableFuture |
reconnect()
Attempt to restore a failed connection with the network.
|
java.util.concurrent.CompletableFuture |
refreshAccessInfo()
Fetch latest access information from the network
|
java.util.concurrent.CompletableFuture |
resetObjectCache()
Resets the object cache.
|
static java.util.concurrent.CompletableFuture |
setAdditionalSearchPath(java.lang.String path)
Sets additional search paths in `config_file_handler` to search for files
|
void |
setOnDisconnectListener(OnDisconnected disconnectedAction)
Sets the disconnected listener to perform an action when the client is disconnected
|
java.util.concurrent.CompletableFuture |
testSimulateDisconnect()
Simulates the disconnect event
|
public final CipherOpt cipherOpt
public final Crypto crypto
public final IData iData
public final MData mData
public final MDataEntries mDataEntries
public final MDataEntryAction mDataEntryAction
public final MDataPermission mDataPermission
public final NFS nfs
protected Session(net.maidsafe.api.AppHandle appHandle, net.maidsafe.api.DisconnectListener disconnectListener)
public static java.util.concurrent.CompletableFuture initLogging(java.lang.String outputFileName)
outputFileName
- File namepublic static java.util.concurrent.CompletableFuture<java.lang.String> getLogOutputPath(java.lang.String logFileName)
logFileName
- Log file namepublic static java.util.concurrent.CompletableFuture<java.lang.String> getAppContainerName(java.lang.String appId)
appId
- Application IDpublic static java.util.concurrent.CompletableFuture setAdditionalSearchPath(java.lang.String path)
path
- New path to be addedpublic static java.util.concurrent.CompletableFuture<java.lang.String> getAppStem()
public static java.util.concurrent.CompletableFuture<Request> encodeAuthReq(AuthReq req)
public static java.util.concurrent.CompletableFuture<Request> getShareMutableDataRequest(ShareMDataReq req)
req
- Share Mutable Data requestRequest
public static java.util.concurrent.CompletableFuture<Request> getUnregisteredSessionRequest(java.lang.String appId)
appId
- Application IDRequest
public static java.util.concurrent.CompletableFuture<DecodeResult> decodeIpcMessage(java.lang.String response)
response
- The encoded response from the AuthenticatorDecodeResult
public static java.util.concurrent.CompletableFuture<Session> connect(UnregisteredClientResponse response)
response
- Unregistered response from the AuthenticatorSession
instancepublic static java.util.concurrent.CompletableFuture<Request> getContainersReq(ContainersReq containersReq)
containersReq
- Containers requestpublic static java.util.concurrent.CompletableFuture<Session> connect(byte[] bootStrapConfig)
bootStrapConfig
- Bootstrap configurationSession
instancepublic static java.util.concurrent.CompletableFuture<Session> connect(java.lang.String appId, AuthGranted authGranted)
appId
- Application IDauthGranted
- Authentication reponse.Session
objectpublic static boolean isMock()
public boolean isConnected()
public void setOnDisconnectListener(OnDisconnected disconnectedAction)
disconnectedAction
- Action to be performed on disconnectionpublic java.util.concurrent.CompletableFuture<AccountInfo> getAccountInfo()
AccountInfo
public java.util.concurrent.CompletableFuture resetObjectCache()
public java.util.concurrent.CompletableFuture refreshAccessInfo()
public java.util.concurrent.CompletableFuture<MDataInfo> getContainerMDataInfo(java.lang.String containerName)
containerName
- App container namepublic java.util.concurrent.CompletableFuture<java.util.List<ContainerPermissions>> getContainerPermissions()
ContainerPermissions
>public java.util.concurrent.CompletableFuture reconnect()
public java.util.concurrent.CompletableFuture testSimulateDisconnect()
public static java.util.concurrent.CompletableFuture<Session> createTestApp(java.lang.String appId)
appId
- Application IDSession
instance