Package io.meeds.deeds.common.service
Class TenantService
java.lang.Object
io.meeds.deeds.common.service.TenantService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildDeedTenantFromBlockchain(long nftId) Retrieve Deed Tenant information from blockchainlongshortgetCardType(long nftId) getDeedTenant(long nftId) Retrieves theDeedTenantinformationgetDeedTenant(String address, long nftId) Retrieves theDeedTenantinformationgetDeedTenantOrImport(Long nftId) getDeedTenantOrImport(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:
address- wallet addressnftId- DEED NFT id in the blockchain- Returns:
DeedTenant- Throws:
UnauthorizedOperationException- when the wallet isn't the DEED manager nor the owner
-
getCardType
public short getCardType(long nftId) throws io.meeds.wom.api.constant.ObjectNotFoundException - Parameters:
nftId- DEED NFT id in the blockchain- Returns:
- Deed Card Type
- Throws:
io.meeds.wom.api.constant.ObjectNotFoundException- when NFT with selected identifier doesn't exists
-
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, io.meeds.wom.api.constant.ObjectNotFoundException Stores User Email to allow support Team Contact him and notify him about Tenant Status- Parameters:
managerAddress- DEED Provisioning Manager wallet addressnftId- DEED NFT id in the blockchainemail- Email of the manager- Throws:
UnauthorizedOperationException- when the wallet isn't the DEED managerio.meeds.wom.api.constant.ObjectNotFoundException- when NFT with selected identifier doesn't exists
-
getDeedTenantOrImport
public DeedTenant getDeedTenantOrImport(String managerAddress, Long nftId, boolean refreshFromBlockchain) throws io.meeds.wom.api.constant.ObjectNotFoundException - Throws:
io.meeds.wom.api.constant.ObjectNotFoundException
-
getDeedTenantOrImport
public DeedTenant getDeedTenantOrImport(String managerAddress, Long nftId) throws io.meeds.wom.api.constant.ObjectNotFoundException - Throws:
io.meeds.wom.api.constant.ObjectNotFoundException
-
getDeedTenantOrImport
public DeedTenant getDeedTenantOrImport(Long nftId) throws io.meeds.wom.api.constant.ObjectNotFoundException - Throws:
io.meeds.wom.api.constant.ObjectNotFoundException
-
markDeedAsAcquired
public void markDeedAsAcquired(long nftId, String newManager) throws io.meeds.wom.api.constant.ObjectNotFoundException, UnauthorizedOperationException Changes the DeedTenant Manager when an offer was acquired.- Parameters:
nftId- Deed NFT blockchain identifiernewManager- New Manager Address- Throws:
io.meeds.wom.api.constant.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, io.meeds.wom.api.constant.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:
managerAddress- DEED Provisioning Manager wallet addresstransactionHash- Ethereum Blockchain Deed Start command Transaction HashnftId- DEED NFT id in the blockchainemail- Email of the manager- Throws:
UnauthorizedOperationException- when the wallet isn't the DEED managerio.meeds.wom.api.constant.ObjectNotFoundException- when NFT with selected identifier doesn't exists
-
stopTenant
public void stopTenant(String managerAddress, String transactionHash, long nftId) throws UnauthorizedOperationException, io.meeds.wom.api.constant.ObjectNotFoundException Collects information about DEED Nft and transaction hash to command Tenant shutdown.- Parameters:
managerAddress- DEED Provisioning Manager wallet addresstransactionHash- Ethereum Blockchain Deed Start command Transaction HashnftId- DEED NFT id in the blockchain- Throws:
UnauthorizedOperationException- when the wallet isn't the DEED managerio.meeds.wom.api.constant.ObjectNotFoundException- when NFT with selected identifier doesn't exists
-
buildDeedTenantFromBlockchain
public DeedTenant buildDeedTenantFromBlockchain(long nftId) throws io.meeds.wom.api.constant.ObjectNotFoundException Retrieve Deed Tenant information from blockchain- Parameters:
nftId- DEED NFT id in the blockchain- Returns:
DeedTenant- Throws:
io.meeds.wom.api.constant.ObjectNotFoundException- when Deed NFT id is not recognized on blockchain
-
isDeedManager
Checks if address is the provisioning manager of the DEED- Parameters:
address- Wallet or Contract Ethereum addressnftId- DEED NFT identifier- Returns:
- true if address is the provisioning manager of the DEED Tenant
-
isDeedOwner
Checks if address is the DEED owner- Parameters:
address- Wallet or Contract Ethereum addressnftId- DEED NFT identifier- 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
-