public class DefaultContentManager extends Object implements ContentManager
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultContentManager.FHeader |
static class |
DefaultContentManager.FHeaderId |
| Modifier and Type | Field and Description |
|---|---|
protected io.nessus.core.ipfs.impl.DefaultContentManager.BCData |
bcdata |
protected io.nessus.Blockchain |
blockchain |
static int |
DEFAULT_IPFS_ATTEMPTS |
static int |
DEFAULT_IPFS_THREADS |
static long |
DEFAULT_IPFS_TIMEOUT |
protected DefaultContentManager.FHeaderId |
fhid |
protected IPFSClient |
ipfs |
protected io.nessus.Network |
network |
protected Path |
rootPath |
protected io.nessus.Wallet |
wallet |
| Constructor and Description |
|---|
DefaultContentManager(IPFSClient ipfs,
io.nessus.Blockchain blockchain) |
DefaultContentManager(IPFSClient ipfs,
io.nessus.Blockchain blockchain,
Long timeout,
Integer attepts,
Integer threads) |
| Modifier and Type | Method and Description |
|---|---|
FHandle |
add(io.nessus.Wallet.Address owner,
InputStream input,
Path path)
Add content to IPFS.
|
protected void |
clearFileCache() |
protected FHandle |
decrypt(FHandle fhandle,
io.nessus.Wallet.Address owner,
Path destPath,
boolean storePlain) |
PublicKey |
findAddressRegistation(io.nessus.Wallet.Address addr)
Find the registered key for a given address.
|
List<FHandle> |
findIPFSContent(io.nessus.Wallet.Address owner,
Long timeout)
Find registered IPFS content for a given address.
|
List<FHandle> |
findLocalContent(io.nessus.Wallet.Address owner)
Find local content for a given address.
|
FHandle |
findLocalContent(io.nessus.Wallet.Address owner,
Path path)
Find local content for a given address and path.
|
FHandle |
get(io.nessus.Wallet.Address owner,
String cid,
Path path,
Long timeout)
Get content from IPFS.
|
io.nessus.Blockchain |
getBlockchain()
Get the Blockchain
|
protected FHandle |
getFHandleFromTx(io.nessus.UTXO utxo,
io.nessus.Wallet.Address owner) |
protected DefaultContentManager.FHeaderId |
getFHeaderId() |
int |
getIPFSAttempts() |
IPFSClient |
getIPFSClient()
Get the IPFS client
|
int |
getIPFSThreads() |
long |
getIPFSTimeout() |
InputStream |
getLocalContent(io.nessus.Wallet.Address owner,
Path path)
Show content of a plain file from local storage.
|
protected PublicKey |
getPubKeyFromTx(io.nessus.UTXO utxo,
io.nessus.Wallet.Address owner) |
Path |
getRootPath() |
protected wf.bitcoin.javabitcoindrpcclient.BitcoindRpcClient |
getRpcClient() |
protected DefaultContentManager.FHeader |
readFHeader(Reader rd) |
PublicKey |
registerAddress(io.nessus.Wallet.Address addr)
Register a public address.
|
List<String> |
removeIPFSContent(io.nessus.Wallet.Address owner,
List<String> cids)
Unregister a IPFS content.
|
boolean |
removeLocalContent(io.nessus.Wallet.Address owner,
Path path)
Remove a plain file content from local storage.
|
FHandle |
send(io.nessus.Wallet.Address owner,
String cid,
io.nessus.Wallet.Address target,
Long timeout)
Send content to a target address via IPFS.
|
PublicKey |
unregisterAddress(io.nessus.Wallet.Address addr)
Unregister a public address.
|
DefaultContentManager.FHeader |
writeHeader(FHandle fhandle,
Writer pw) |
public static final long DEFAULT_IPFS_TIMEOUT
public static final int DEFAULT_IPFS_ATTEMPTS
public static final int DEFAULT_IPFS_THREADS
protected final io.nessus.Blockchain blockchain
protected final io.nessus.Network network
protected final io.nessus.Wallet wallet
protected final DefaultContentManager.FHeaderId fhid
protected final IPFSClient ipfs
protected final io.nessus.core.ipfs.impl.DefaultContentManager.BCData bcdata
protected final Path rootPath
public DefaultContentManager(IPFSClient ipfs, io.nessus.Blockchain blockchain)
public DefaultContentManager(IPFSClient ipfs, io.nessus.Blockchain blockchain, Long timeout, Integer attepts, Integer threads)
public long getIPFSTimeout()
public int getIPFSAttempts()
public int getIPFSThreads()
public Path getRootPath()
public io.nessus.Blockchain getBlockchain()
ContentManagergetBlockchain in interface ContentManagerpublic IPFSClient getIPFSClient()
ContentManagergetIPFSClient in interface ContentManagerpublic PublicKey registerAddress(io.nessus.Wallet.Address addr) throws GeneralSecurityException
ContentManagerregisterAddress in interface ContentManagerGeneralSecurityExceptionpublic PublicKey unregisterAddress(io.nessus.Wallet.Address addr)
ContentManagerunregisterAddress in interface ContentManagerpublic List<String> removeIPFSContent(io.nessus.Wallet.Address owner, List<String> cids) throws IOException
ContentManagerremoveIPFSContent in interface ContentManagerIOExceptionprotected void clearFileCache()
public FHandle add(io.nessus.Wallet.Address owner, InputStream input, Path path) throws IOException, GeneralSecurityException
ContentManageradd in interface ContentManagerIOExceptionGeneralSecurityExceptionpublic FHandle get(io.nessus.Wallet.Address owner, String cid, Path path, Long timeout) throws IOException, GeneralSecurityException
ContentManagerget in interface ContentManagerIOExceptionGeneralSecurityExceptionpublic FHandle send(io.nessus.Wallet.Address owner, String cid, io.nessus.Wallet.Address target, Long timeout) throws IOException, GeneralSecurityException
ContentManagersend in interface ContentManagerIOExceptionGeneralSecurityExceptionpublic PublicKey findAddressRegistation(io.nessus.Wallet.Address addr)
ContentManagerfindAddressRegistation in interface ContentManagerpublic List<FHandle> findIPFSContent(io.nessus.Wallet.Address owner, Long timeout) throws IOException
ContentManagerfindIPFSContent in interface ContentManagerIOExceptionpublic List<FHandle> findLocalContent(io.nessus.Wallet.Address owner) throws IOException
ContentManagerfindLocalContent in interface ContentManagerIOExceptionpublic FHandle findLocalContent(io.nessus.Wallet.Address owner, Path path) throws IOException
ContentManagerfindLocalContent in interface ContentManagerIOExceptionpublic InputStream getLocalContent(io.nessus.Wallet.Address owner, Path path) throws IOException
ContentManagergetLocalContent in interface ContentManagerIOExceptionpublic boolean removeLocalContent(io.nessus.Wallet.Address owner,
Path path)
throws IOException
ContentManagerremoveLocalContent in interface ContentManagerIOExceptionprotected wf.bitcoin.javabitcoindrpcclient.BitcoindRpcClient getRpcClient()
protected DefaultContentManager.FHeaderId getFHeaderId()
protected FHandle decrypt(FHandle fhandle, io.nessus.Wallet.Address owner, Path destPath, boolean storePlain) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionprotected PublicKey getPubKeyFromTx(io.nessus.UTXO utxo, io.nessus.Wallet.Address owner)
protected FHandle getFHandleFromTx(io.nessus.UTXO utxo, io.nessus.Wallet.Address owner)
protected DefaultContentManager.FHeader readFHeader(Reader rd) throws IOException
IOExceptionpublic DefaultContentManager.FHeader writeHeader(FHandle fhandle, Writer pw) throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionCopyright © 2018. All rights reserved.