public class DefaultClientServiceHandler extends java.lang.Object implements ClientServiceHandler
Constructor and Description |
---|
DefaultClientServiceHandler(AbstractLedgerClient client,
AbstractAuditorClient auditorClient)
|
Modifier and Type | Method and Description |
---|---|
com.scalar.dl.ledger.model.ContractExecutionResult |
executeContract(com.scalar.dl.rpc.ContractExecutionRequest request)
Executes the specified contract with the specified
ContractExecutionRequest . |
javax.json.JsonObject |
listContracts(com.scalar.dl.rpc.ContractsListingRequest request)
Retrieves a list of contracts with the specified
ContractsListingRequest . |
void |
registerCertificate(com.scalar.dl.rpc.CertificateRegistrationRequest request)
Registers the certificate with the specified
CertificateRegistrationRequest for digital
signature authentication. |
void |
registerContract(com.scalar.dl.rpc.ContractRegistrationRequest request)
Registers the contract with the specified
ContractRegistrationRequest . |
void |
registerFunction(com.scalar.dl.rpc.FunctionRegistrationRequest request)
Registers the function with the specified
FunctionRegistrationRequest . |
void |
registerSecret(com.scalar.dl.rpc.SecretRegistrationRequest request)
Registers the secret key with the specified
SecretRegistrationRequest for HMAC
authentication. |
com.scalar.dl.ledger.model.LedgerValidationResult |
validateLedger(com.scalar.dl.rpc.LedgerValidationRequest request)
Validates the specified asset in the ledger with the specified
LedgerValidationRequest . |
@Inject public DefaultClientServiceHandler(AbstractLedgerClient client, @Nullable AbstractAuditorClient auditorClient)
client
- a client for the ledger serverauditorClient
- a client for the auditor serverpublic void registerCertificate(com.scalar.dl.rpc.CertificateRegistrationRequest request)
CertificateRegistrationRequest
for digital
signature authentication.registerCertificate
in interface ClientServiceHandler
request
- a CertificateRegistrationRequest
.ClientException
- if a request fails for some reasonpublic void registerSecret(com.scalar.dl.rpc.SecretRegistrationRequest request)
SecretRegistrationRequest
for HMAC
authentication.registerSecret
in interface ClientServiceHandler
request
- a SecretRegistrationRequest
.ClientException
- if a request fails for some reasonpublic void registerFunction(com.scalar.dl.rpc.FunctionRegistrationRequest request)
FunctionRegistrationRequest
.registerFunction
in interface ClientServiceHandler
request
- a FunctionRegistrationRequest
.ClientException
- if a request fails for some reasonpublic void registerContract(com.scalar.dl.rpc.ContractRegistrationRequest request)
ContractRegistrationRequest
.registerContract
in interface ClientServiceHandler
request
- a ContractRegistrationRequest
.ClientException
- if a request fails for some reasonpublic javax.json.JsonObject listContracts(com.scalar.dl.rpc.ContractsListingRequest request)
ContractsListingRequest
.listContracts
in interface ClientServiceHandler
request
- a ContractsListingRequest
.JsonObject
ClientException
- if a request fails for some reasonpublic com.scalar.dl.ledger.model.ContractExecutionResult executeContract(com.scalar.dl.rpc.ContractExecutionRequest request)
ContractExecutionRequest
.executeContract
in interface ClientServiceHandler
request
- a ContractExecutionRequest
.ContractExecutionResult
ClientException
- if a request fails for some reasonpublic com.scalar.dl.ledger.model.LedgerValidationResult validateLedger(com.scalar.dl.rpc.LedgerValidationRequest request)
LedgerValidationRequest
.validateLedger
in interface ClientServiceHandler
request
- a LedgerValidationRequest
.LedgerValidationResult
ClientException
- if a request fails for some reason