Class QueryObjectsRequest
- java.lang.Object
-
- com.emc.object.ObjectRequest
-
- com.emc.object.s3.request.AbstractBucketRequest
-
- com.emc.object.s3.request.QueryObjectsRequest
-
public class QueryObjectsRequest extends AbstractBucketRequest
GET /?query={expression}&attributes={name, ...}&sorted={key}&include-older-versions={true|false}
Executes a bucket search and returns list of objects, and their system and user metadata values, that match the selection conditions in the search query expression.
The objects returned can be restricted using the max-keys parameter. Where a subset of the search matches are returned, subsequent pages can be retrieved by using the marker from the previous search; the objects returned will start with the key after the marker.
Query Parameters
query (required) is an expression takes the form:
[(]{condition1}[%20[and/or]%20{condition2}][)][%20[and/or]%20...]
where:
condition is a metadata keyname filter in the form:
{selector} {operator} {argument}
, for example"LastModified>2015-01-01T00:00:00Z"
in which:selector
is a searchable keyname associated with the bucketoperator
is one of: ==, >, <, >=, <=argument
is a value against which the selector is tested. The form of the argument must match the datatype of the key being indexed, which is one of: string, integer, datetime, decimal
Other Parameters
attributes
(optional) is a list one or more metadata names that are not being indexed, but which can be listed in the query results. For example: "&attributes=ContentType,Retention"sorted
(optional) is the name of one key that appears in the query expression that becomes the sort key for the query results. If this optional parameter is absent, the sort order is the first keyname that appears in the expression.include-older-versions
(optional) is a boolean that when set to true causes both current and non-current versions of the keys to be listed, and when set to false causes only the current versions of keys to be listed. The default is false.max-keys
(optional) specifies the number of keys returned in the response body. Allows you to return fewer keys that the default.marker
(optional) specifies the key to start with which will be the one after the marker. When no more pages exist, a marker will not be returned and NO MORE PAGES will be returned
-
-
Constructor Summary
Constructors Constructor Description QueryObjectsRequest(java.lang.String bucketName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
getAttributes()
java.lang.String
getDelimiter()
EncodingType
getEncodingType()
boolean
getIncludeOlderVersions()
java.lang.String
getMarker()
java.lang.Integer
getMaxKeys()
java.lang.String
getPrefix()
java.lang.String
getQuery()
java.util.Map<java.lang.String,java.lang.String>
getQueryParams()
Override to return the request-specific query parameters based on properties of the request.java.lang.String
getSorted()
void
setAttributes(java.util.List<java.lang.String> attributes)
void
setDelimiter(java.lang.String delimiter)
void
setEncodingType(EncodingType encodingType)
void
setIncludeOlderVersions(boolean includeOlderVersions)
void
setMarker(java.lang.String marker)
void
setMaxKeys(java.lang.Integer maxKeys)
void
setPrefix(java.lang.String prefix)
void
setQuery(java.lang.String query)
void
setSorted(java.lang.String sorted)
QueryObjectsRequest
withAttribute(java.lang.String attribute)
QueryObjectsRequest
withAttributes(java.util.List<java.lang.String> attributes)
QueryObjectsRequest
withDelimiter(java.lang.String delimiter)
QueryObjectsRequest
withEncodingType(EncodingType encodingType)
QueryObjectsRequest
withIncludeOlderVersions(boolean includeOlderVersions)
QueryObjectsRequest
withMarker(java.lang.String marker)
QueryObjectsRequest
withMaxKeys(java.lang.Integer maxKeys)
QueryObjectsRequest
withPrefix(java.lang.String prefix)
QueryObjectsRequest
withQuery(java.lang.String query)
QueryObjectsRequest
withSorted(java.lang.String sorted)
-
Methods inherited from class com.emc.object.s3.request.AbstractBucketRequest
getBucketName, setBucketName
-
Methods inherited from class com.emc.object.ObjectRequest
addCustomHeader, getCustomHeaders, getHeaders, getMethod, getNamespace, getPath, getProperties, getQueryString, getRawQueryString, getSubresource, property, setNamespace, setPath
-
-
-
-
Method Detail
-
getQueryParams
public java.util.Map<java.lang.String,java.lang.String> getQueryParams()
Description copied from class:ObjectRequest
Override to return the request-specific query parameters based on properties of the request. Do NOT include the subresource in this map; it will be inserted automatically. Note this implementation uses a TreeSet, which will sort the parameters by name. This is done to make URLs consistent for testing and should not change the semantics of any request.- Overrides:
getQueryParams
in classObjectRequest
-
getPrefix
public java.lang.String getPrefix()
-
setPrefix
public void setPrefix(java.lang.String prefix)
-
getDelimiter
public java.lang.String getDelimiter()
-
setDelimiter
public void setDelimiter(java.lang.String delimiter)
-
getMaxKeys
public java.lang.Integer getMaxKeys()
-
setMaxKeys
public void setMaxKeys(java.lang.Integer maxKeys)
-
getMarker
public java.lang.String getMarker()
-
setMarker
public void setMarker(java.lang.String marker)
-
getQuery
public java.lang.String getQuery()
-
setQuery
public void setQuery(java.lang.String query)
-
getAttributes
public java.util.List<java.lang.String> getAttributes()
-
setAttributes
public void setAttributes(java.util.List<java.lang.String> attributes)
-
getSorted
public java.lang.String getSorted()
-
setSorted
public void setSorted(java.lang.String sorted)
-
getIncludeOlderVersions
public boolean getIncludeOlderVersions()
-
setIncludeOlderVersions
public void setIncludeOlderVersions(boolean includeOlderVersions)
-
getEncodingType
public EncodingType getEncodingType()
-
setEncodingType
public void setEncodingType(EncodingType encodingType)
-
withPrefix
public QueryObjectsRequest withPrefix(java.lang.String prefix)
-
withDelimiter
public QueryObjectsRequest withDelimiter(java.lang.String delimiter)
-
withMaxKeys
public QueryObjectsRequest withMaxKeys(java.lang.Integer maxKeys)
-
withMarker
public QueryObjectsRequest withMarker(java.lang.String marker)
-
withQuery
public QueryObjectsRequest withQuery(java.lang.String query)
-
withAttributes
public QueryObjectsRequest withAttributes(java.util.List<java.lang.String> attributes)
-
withAttribute
public QueryObjectsRequest withAttribute(java.lang.String attribute)
-
withSorted
public QueryObjectsRequest withSorted(java.lang.String sorted)
-
withIncludeOlderVersions
public QueryObjectsRequest withIncludeOlderVersions(boolean includeOlderVersions)
-
withEncodingType
public QueryObjectsRequest withEncodingType(EncodingType encodingType)
-
-