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