@Immutable public class ContractRegistrationRequest extends AbstractRequest
Constructor and Description |
---|
ContractRegistrationRequest(java.lang.String contractId,
java.lang.String contractBinaryName,
byte[] contractByteCode,
java.lang.String contractProperties,
java.lang.String entityId,
int keyVersion,
byte[] signature)
Constructs a
ContractRegistrationRequest with the specified contract id, contract
binary name, contract itself in byte-code format, entity ID, key version and signature of the
request. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this object.
|
java.lang.String |
getContractBinaryName()
Returns the binary name of the contract.
|
byte[] |
getContractByteCode()
Returns the contract in byte-code format.
|
java.lang.String |
getContractId()
Returns the id of the contract.
|
java.util.Optional<java.lang.String> |
getContractProperties()
Returns the properties of the contract.
|
byte[] |
getSignature()
Returns the signature of the request.
|
int |
hashCode()
Returns a hash code value for the object.
|
static byte[] |
serialize(java.lang.String contractId,
java.lang.String contractBinaryName,
byte[] contractByteCode,
java.lang.String contractProperties,
java.lang.String entityId,
int keyVersion) |
void |
validateWith(com.scalar.dl.ledger.crypto.SignatureValidator validator)
Validates if the request is not tampered.
|
getEntityId, getKeyVersion
public ContractRegistrationRequest(java.lang.String contractId, java.lang.String contractBinaryName, byte[] contractByteCode, @Nullable java.lang.String contractProperties, java.lang.String entityId, int keyVersion, byte[] signature)
ContractRegistrationRequest
with the specified contract id, contract
binary name, contract itself in byte-code format, entity ID, key version and signature of the
request.contractId
- an id of a registered contract to executecontractBinaryName
- a binary name of a registered contract to executecontractByteCode
- a contract itself in byte-code formatcontractProperties
- properties in json formatentityId
- an entity IDkeyVersion
- the version of a digital signature certificate or a HMAC secret keysignature
- a signature of the requestpublic java.lang.String getContractId()
public java.lang.String getContractBinaryName()
public byte[] getContractByteCode()
public java.util.Optional<java.lang.String> getContractProperties()
Optional
with the properties of the contractpublic byte[] getSignature()
public int hashCode()
hashCode
in class AbstractRequest
public boolean equals(java.lang.Object o)
ContractRegistrationRequest
and
equals
in class AbstractRequest
o
- an object to be tested for equalitytrue
if the other object is "equal to" this object otherwise false
public void validateWith(com.scalar.dl.ledger.crypto.SignatureValidator validator)
validateWith
in class AbstractRequest
validator
- a SignatureValidator
com.scalar.dl.ledger.exception.SignatureException
- if the request is invalid.public static byte[] serialize(java.lang.String contractId, java.lang.String contractBinaryName, byte[] contractByteCode, @Nullable java.lang.String contractProperties, java.lang.String entityId, int keyVersion)