Package io.meeds.deeds.service
Class TenantService
java.lang.Object
io.meeds.deeds.service.TenantService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildDeedTenantFromBlockchain(long nftId) Retrieve Deed Tenant information from blockchainlonggetDeedTenant(long nftId) Retrieves theDeedTenantinformationgetDeedTenant(String address, long nftId) Retrieves theDeedTenantinformationgetDeedTenantOrImport(String managerAddress, Long nftId) getDeedTenantOrImport(String managerAddress, Long nftId, boolean refreshFromBlockchain) getDeedTenants(String ownerAddress) Retrieve list ofDeedTenantof NFT ownerbooleanisBlockchainNetworkValid(long networkId) booleanisDeedManager(String address, long nftId) Checks if address is the provisioning manager of the DEEDbooleanisDeedOwner(String address, long nftId) Checks if address is the DEED ownerbooleanisTenantCommandStop(long nftId) Check if Deed Tenant is started or commanded to be startedvoidmarkDeedAsAcquired(long nftId, String newManager) Changes the DeedTenant Manager when an offer was acquired.saveDeedTenant(DeedTenant deedTenant) Stores Tenant informationvoidStores User Email to allow support Team Contact him and notify him about Tenant StatusvoidstartTenant(String managerAddress, String transactionHash, long nftId, String email) Stores User Email to allow support Team Contact him and notify him about Tenant Status.voidstopTenant(String managerAddress, String transactionHash, long nftId) Collects information about DEED Nft and transaction hash to command Tenant shutdown.
-
Constructor Details
-
TenantService
public TenantService()
-
-
Method Details
-
getDeedTenant
Retrieves theDeedTenantinformation- Parameters:
nftId- DEED NFT id in the blockchainaddress- wallet address- Returns:
DeedTenant- Throws:
UnauthorizedOperationException- when the wallet isn't the DEED manager nor the owner
-
getDeedTenant
Retrieves theDeedTenantinformation- Parameters:
nftId- DEED NFT id in the blockchain- Returns:
DeedTenant
-
getDeedTenants
Retrieve list ofDeedTenantof NFT owner- Parameters:
ownerAddress- Deed Owner Address- Returns:
Listof associated Deed provisioning information
-
saveEmail
public void saveEmail(String managerAddress, long nftId, String email) throws UnauthorizedOperationException, ObjectNotFoundException Stores User Email to allow support Team Contact him and notify him about Tenant Status- Parameters:
nftId- DEED NFT id in the blockchainmanagerAddress- DEED Provisioning Manager wallet addressemail- Email of the manager- Throws:
UnauthorizedOperationException- when the wallet isn't the DEED managerObjectNotFoundException- when NFT with selected identifier doesn't exists
-
getDeedTenantOrImport
public DeedTenant getDeedTenantOrImport(String managerAddress, Long nftId, boolean refreshFromBlockchain) throws ObjectNotFoundException, UnauthorizedOperationException -
getDeedTenantOrImport
public DeedTenant getDeedTenantOrImport(String managerAddress, Long nftId) throws ObjectNotFoundException, UnauthorizedOperationException -
markDeedAsAcquired
public void markDeedAsAcquired(long nftId, String newManager) throws ObjectNotFoundException, UnauthorizedOperationException Changes the DeedTenant Manager when an offer was acquired.- Parameters:
nftId- Deed NFT blockchain identifiernewManager- New Manager Address- Throws:
ObjectNotFoundException- when Deed doesn't existUnauthorizedOperationException- when the address isn't the manager on blockchain
-
startTenant
public void startTenant(String managerAddress, String transactionHash, long nftId, String email) throws UnauthorizedOperationException, ObjectNotFoundException Stores User Email to allow support Team Contact him and notify him about Tenant Status. In addition, this will collect information about DEED Nft and transaction hash to command Tenant startup.- Parameters:
nftId- DEED NFT id in the blockchainmanagerAddress- DEED Provisioning Manager wallet addresstransactionHash- Ethereum Blockchain Deed Start command Transaction Hashemail- Email of the manager- Throws:
UnauthorizedOperationException- when the wallet isn't the DEED managerObjectNotFoundException- when NFT with selected identifier doesn't exists
-
stopTenant
public void stopTenant(String managerAddress, String transactionHash, long nftId) throws UnauthorizedOperationException, ObjectNotFoundException Collects information about DEED Nft and transaction hash to command Tenant shutdown.- Parameters:
nftId- DEED NFT id in the blockchainmanagerAddress- DEED Provisioning Manager wallet addresstransactionHash- Ethereum Blockchain Deed Start command Transaction Hash- Throws:
UnauthorizedOperationException- when the wallet isn't the DEED managerObjectNotFoundException- when NFT with selected identifier doesn't exists
-
buildDeedTenantFromBlockchain
Retrieve Deed Tenant information from blockchain- Parameters:
nftId- DEED NFT id in the blockchain- Returns:
DeedTenant- Throws:
ObjectNotFoundException- when Deed NFT id is not recognized on blockchain
-
isDeedManager
Checks if address is the provisioning manager of the DEED- Parameters:
nftId- DEED NFT identifieraddress- Wallet or Contract Ethereum address- Returns:
- true if address is the provisioning manager of the DEED Tenant
-
isDeedOwner
Checks if address is the DEED owner- Parameters:
nftId- DEED NFT identifieraddress- Wallet or Contract Ethereum address- Returns:
- true if address is the owner of the DEED Tenant
-
isTenantCommandStop
public boolean isTenantCommandStop(long nftId) Check if Deed Tenant is started or commanded to be started- Parameters:
nftId- DEED NFT identifier- Returns:
- true if the Tenant Provisioning status is START_CONFIRMED or START_IN_PROGRESS
-
isBlockchainNetworkValid
public boolean isBlockchainNetworkValid(long networkId) - Parameters:
networkId- Blockchain Network identifier to check- Returns:
- true if Network is valid else return false
-
getBlockchainNetworkId
public long getBlockchainNetworkId()- Returns:
- Blockchain network identifier
-
saveDeedTenant
Stores Tenant information- Parameters:
deedTenant-DeedTenant- Returns:
DeedTenant
-