public class SignatureRequest
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SIGNATURE_TYPE_ACL_LOOKUP |
static java.lang.String |
SIGNATURE_TYPE_ACL_UPDATE |
static java.lang.String |
SIGNATURE_TYPE_DELETE |
static java.lang.String |
SIGNATURE_TYPE_GET |
static java.lang.String |
SIGNATURE_TYPE_HEAD |
static java.lang.String |
SIGNATURE_TYPE_PUT |
Constructor and Description |
---|
SignatureRequest()
Constructs an empty signature request.
|
SignatureRequest(java.lang.String signatureType,
java.lang.String objectKey)
Constructs a signature request for an operation on a specific object key.
|
Modifier and Type | Method and Description |
---|---|
void |
addObjectMetadata(java.lang.String metadataName,
java.lang.String metadataValue)
Adds to the object's metadata, that will be included in the Gatekeeer message.
|
S3Object |
buildObject() |
void |
declineRequest(java.lang.String reason)
Decline the request by setting the decline reason for this request - performed by a
Gatekeeper service when a request has been disallowed.
|
java.lang.String |
getBucketName() |
java.lang.String |
getDeclineReason() |
java.lang.String |
getObjectKey() |
java.util.Map |
getObjectMetadata() |
java.lang.String |
getSignatureType() |
java.lang.String |
getSignedUrl() |
boolean |
isSigned()
Returns true if this request has been allowed and includes a signed URL, false otherwise.
|
void |
setBucketName(java.lang.String bucketName)
Sets the name of the bucket in which an object is stored - this is not generally required.
|
void |
setObjectKey(java.lang.String objectKey)
Sets the key name of the object on which the operation will be performed.
|
void |
setObjectMetadata(java.util.Map objectMetadata)
Sets the object's metadata, that will be included in the Gatekeeer message.
|
void |
setSignatureType(java.lang.String signatureType)
Sets the signature type (operation) being requested for the object in this request.
|
void |
signRequest(java.lang.String signedUrl)
Approve the request by setting the signed URL for this request - performed by a
Gatekeeper service when a request has been allowed.
|
public static final java.lang.String SIGNATURE_TYPE_GET
public static final java.lang.String SIGNATURE_TYPE_HEAD
public static final java.lang.String SIGNATURE_TYPE_PUT
public static final java.lang.String SIGNATURE_TYPE_DELETE
public static final java.lang.String SIGNATURE_TYPE_ACL_LOOKUP
public static final java.lang.String SIGNATURE_TYPE_ACL_UPDATE
public SignatureRequest()
public SignatureRequest(java.lang.String signatureType, java.lang.String objectKey)
signatureType
- objectKey
- public java.lang.String getBucketName()
public void setBucketName(java.lang.String bucketName)
bucketName
- public java.lang.String getObjectKey()
public void setObjectKey(java.lang.String objectKey)
objectKey
- public java.util.Map getObjectMetadata()
public void setObjectMetadata(java.util.Map objectMetadata)
objectMetadata
- public void addObjectMetadata(java.lang.String metadataName, java.lang.String metadataValue)
metadataName
- metadataValue
- public java.lang.String getSignatureType()
public void setSignatureType(java.lang.String signatureType)
signatureType
- the operation being requested, must match one of the SIGNATURE_TYPE_xyz constants
in this class.public void signRequest(java.lang.String signedUrl)
signedUrl
- a URL signed to allow the requested operation on the S3 object.public java.lang.String getSignedUrl()
public void declineRequest(java.lang.String reason)
reason
- a short explanation for why the request was not allowed, such as "Unrecognised user".public java.lang.String getDeclineReason()
public boolean isSigned()
public S3Object buildObject()