|
Esri Geoportal Server 1.0
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.gpt.catalog.discovery.rest.RestQueryParser
public class RestQueryParser
Provides functionality to parse a rest query URL.
The primary goal is to build filter and response components associated with the query.
Constructor Summary | |
---|---|
RestQueryParser(HttpServletRequest request,
RequestContext context,
RestQuery query)
Constructs the parser. |
Method Summary | |
---|---|
void |
appendClause(LogicalClause parent,
DiscoveryClause clause)
Appends a clause to the query filter. |
PropertyClause |
extractProperty(PropertyClause clause,
String restKey,
String discoverableKey)
Extracts a property clause from the HTTP request. |
DiscoveryClause |
extractPropertyList(String restKey,
String discoverableKey,
String delimiter,
boolean orBased)
Extracts a grouping of property clauses (delimited list) from the HTTP request. |
DiscoveryClause |
extractPropertyRange(String restLowerKey,
String restUpperKey,
String discoverableKey)
Extracts a range based discovery clause from the HTTP request. |
Sortables |
extractSortables(String restKey)
Extracts sort option parameters from the HTTP request. |
SpatialClause |
extractSpatialClause(String restBBoxKey,
String restOperatorKey,
String discoverableKey)
Extracts the spatial clause from the HTTP request. |
Discoverable |
findDiscoverable(String discoverableKey)
Finds the discoverable property associated with a discoverable key. |
AliasedDiscoverables |
getDiscoverables()
Gets the aliased map of configured discoverable properties. |
DiscoveryFilter |
getFilter()
Convenience method to return the filter associated with the query being populated. |
RestQuery |
getQuery()
Gets the query being populated. |
String |
getRequestParameter(String parameterKey)
Gets the HTTP request parameter value associated with a key. |
void |
parseMaxRecords(String restKey,
int defaultValue)
Parses and sets the maximum number of return records for the query filter. |
void |
parsePropertyIsEqualTo(String restKey,
String discoverableKey)
Parses and appends a PropertyIsEqualTo clause to the query filter if located. |
void |
parsePropertyIsLike(String restKey,
String discoverableKey)
Parses and appends a PropertyIsLike clause to the query filter if located. |
void |
parsePropertyList(String restKey,
String discoverableKey,
String delimiter,
boolean orBased)
Parses and appends a grouping of property clauses (delimited list) to the query filter if located. |
void |
parsePropertyRange(String restLowerKey,
String restUpperKey,
String discoverableKey)
Parses and appends a range based discovery clause to the query filter if located. |
void |
parseRepositoryId(String restKey)
Parses and sets the repository ID. |
void |
parseResponseFormat(String restKey)
Parses and sets the response format for the query. |
void |
parseResponseGeometry(String restKey)
Parses and sets the response geometry for the query. |
void |
parseResponseStyle(String restKey)
Parses and sets the response style for the query. |
void |
parseResponseTarget(String restKey)
Parses and sets the response target for the query. |
void |
parseSortables(String restKey)
Parses sort option parameters and sets the query sortables if found. |
void |
parseSpatialClause(String restBBoxKey,
String restOperatorKey,
String discoverableKey)
Parses and appends a spatial clause to the query filter if located. |
void |
parseStartRecord(String restKey,
int defaultValue)
Parses and sets the start record for the query filter. |
void |
setDiscoverables(AliasedDiscoverables discoverables)
Sets the aliased map of configured discoverable properties. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RestQueryParser(HttpServletRequest request, RequestContext context, RestQuery query)
request
- the active HTTP requestcontext
- the request contextquery
- the query to populateMethod Detail |
---|
public AliasedDiscoverables getDiscoverables()
public void setDiscoverables(AliasedDiscoverables discoverables)
discoverables
- the discoverablespublic DiscoveryFilter getFilter()
public RestQuery getQuery()
public void appendClause(LogicalClause parent, DiscoveryClause clause)
parent
- the parent to which the supplied discovery clause will be appendedclause
- the clause to appendpublic PropertyClause extractProperty(PropertyClause clause, String restKey, String discoverableKey)
clause
- the property clause to populate and returnrestKey
- the URL key for the parameterdiscoverableKey
- the key associated with the target discoverable
public DiscoveryClause extractPropertyList(String restKey, String discoverableKey, String delimiter, boolean orBased)
PropertyClause.PropertyIsEqualTo
).
LogicalClause
).
restKey
- the URL key for the parameterdiscoverableKey
- the key associated with the target discoverabledelimiter
- the value delimiterorBased
- if true, group within a logical or, otherwise group within a logical and
public DiscoveryClause extractPropertyRange(String restLowerKey, String restUpperKey, String discoverableKey)
PropertyClause.PropertyIsGreaterThanOrEqualTo
clause, the upper boundary with a
PropertyClause.PropertyIsLessThanOrEqualTo
clause.
LogicalClause.LogicalAnd
clause is returned.
restLowerKey
- the URL key for the lower value parameter of the rangerestUpperKey
- the URL key for the upper value parameter of the rangediscoverableKey
- the key associated with the target discoverable
public Sortables extractSortables(String restKey)
restKey
- the URL key for the sort option parameter
public SpatialClause extractSpatialClause(String restBBoxKey, String restOperatorKey, String discoverableKey)
restBBoxKey
- the URL key for the BBOX parameterrestOperatorKey
- the URL key for the spatial operator parameterdiscoverableKey
- the key associated with the target discoverable
public Discoverable findDiscoverable(String discoverableKey)
discoverableKey
- the discoverable key (or alias)
public String getRequestParameter(String parameterKey)
parameterKey
- the parameter key
public void parseMaxRecords(String restKey, int defaultValue)
DiscoveryFilter.setMaxRecords(int)
restKey
- the URL key for the parameterdefaultValue
- the default value (if the parameter is not located on the URL)public void parsePropertyIsEqualTo(String restKey, String discoverableKey)
extractProperty(PropertyClause, String, String)
PropertyClause.PropertyIsEqualTo
DiscoveryQuery.getFilter()
restKey
- the URL key for the parameterdiscoverableKey
- the key associated with the target discoverablepublic void parsePropertyIsLike(String restKey, String discoverableKey)
extractProperty(PropertyClause, String, String)
PropertyClause.PropertyIsLike
DiscoveryQuery.getFilter()
restKey
- the URL key for the parameterdiscoverableKey
- the key associated with the target discoverablepublic void parsePropertyList(String restKey, String discoverableKey, String delimiter, boolean orBased)
extractPropertyList(String, String, String, boolean)
DiscoveryQuery.getFilter()
restKey
- the URL key for the parameterdiscoverableKey
- the key associated with the target discoverabledelimiter
- the value delimiterorBased
- if true, group within a logical or, otherwise group within a logical andpublic void parsePropertyRange(String restLowerKey, String restUpperKey, String discoverableKey)
extractPropertyRange(String, String, String)
DiscoveryQuery.getFilter()
restLowerKey
- the URL key for the lower value parameter of the rangerestUpperKey
- the URL key for the upper value parameter of the rangediscoverableKey
- the key associated with the target discoverablepublic void parseRepositoryId(String restKey)
RestQuery.setRepositoryId(String)
restKey
- the URL key for the parameterpublic void parseResponseFormat(String restKey)
RestQuery.setResponseFormat(String)
restKey
- the URL key for the parameterpublic void parseResponseGeometry(String restKey)
RestQuery.setResponseGeometry(String)
restKey
- the URL key for the parameterpublic void parseResponseStyle(String restKey)
RestQuery.setResponseStyle(String)
restKey
- the URL key for the parameterpublic void parseResponseTarget(String restKey)
RestQuery.setResponseTarget(String)
restKey
- the URL key for the parameterpublic void parseSortables(String restKey)
extractSortables(String)
DiscoveryQuery.setSortables(Sortables)
restKey
- the URL key for the parameterpublic void parseSpatialClause(String restBBoxKey, String restOperatorKey, String discoverableKey)
extractSpatialClause(String, String, String)
DiscoveryQuery.getFilter()
restBBoxKey
- the URL key for the BBOX parameterrestOperatorKey
- the URL key for the spatial operator parameterdiscoverableKey
- the key associated with the target discoverablepublic void parseStartRecord(String restKey, int defaultValue)
DiscoveryFilter.setStartRecord(int)
restKey
- the URL key for the parameterdefaultValue
- the default value (if the parameter is not located on the URL)
|
Esri Geoportal Server 1.0
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |