Package io.inversion.action.db
Class DbGetAction
- All Implemented Interfaces:
Comparable<DbGetAction>
-
Nested Class Summary
Nested classes/interfaces inherited from class io.inversion.Rule
Rule.RuleMatcher -
Field Summary
FieldsFields inherited from class io.inversion.Rule
configMap, configStr, excludeMatchers, excludeOn, includeMatchers, includeOn, log, name, order -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected static booleanprotected voidprotected voidexpand(Request request, Collection collection, List<JSNode> parentObjs, Set expands, String expandsPath, org.apache.commons.collections4.map.MultiKeyMap pkCache) This is more complicated than it seems like it would need to be because it attempts to retrieve all values of a relationship at a time for the whole document.protected static StringexpandPath(String path, Object next) protected static booleanfind(Collection<String> params, String path, boolean matchStart) intgetRelatedKeys(Relationship rel, Index idxToMatch, Index idxToRetrieve, List<String> toMatchEks) protected static StringgetResourceKey(Object obj) recursiveGet(org.apache.commons.collections4.map.MultiKeyMap pkCache, Collection collection, Collection resourceKeys, String expandsPath) voidOverride this method with your custom business logic or override one of the http method "doMETHOD" specific handlers.protected Resultsselect(Request req, Collection collection, Api api) protected static booleanshouldExpand(Set<String> expands, String path, Relationship rel) protected static Stringstatic StringstripTerms(String url, String... tokens) withMaxRows(int maxRows) Methods inherited from class io.inversion.Rule
checkLazyConfig, compareTo, doLazyConfig, getAllExcludePaths, getAllIncludePaths, getConfig, getConfig, getConfigKeys, getDefaultIncludeMatch, getExcludeMatchers, getIncludeMatchers, getName, getOrder, match, matches, matches, toString, withConfig, withExcludeOn, withExcludeOn, withExcludeOn, withIncludeOn, withIncludeOn, withIncludeOn, withName, withOrder
-
Field Details
-
maxRows
protected int maxRows
-
-
Constructor Details
-
DbGetAction
public DbGetAction()
-
-
Method Details
-
exclude
-
getResourceKey
-
stripTerms
-
stripTerm
-
expandPath
-
shouldExpand
-
find
-
run
Description copied from class:ActionOverride this method with your custom business logic or override one of the http method "doMETHOD" specific handlers.- Overrides:
runin classAction<DbGetAction>- Parameters:
req- the Request being servicedres- the Reponse being generated- Throws:
ApiException
-
select
- Throws:
ApiException
-
exclude
-
exclude
-
expand
protected void expand(Request request, Collection collection, List<JSNode> parentObjs, Set expands, String expandsPath, org.apache.commons.collections4.map.MultiKeyMap pkCache) This is more complicated than it seems like it would need to be because it attempts to retrieve all values of a relationship at a time for the whole document. It does not run a recursive query for each resource and each relationship which could mean hundreds and hundreds of queries per document. This should result in number of queries proportional to the number of expands terms that does not increase with the number of results at any level of the expansion.- Parameters:
request- the request being servicedcollection- the collection being queriedparentObjs- the records that were just selectedexpands- the definition of which properties should be expandedexpandsPath- the path we are currently onpkCache- a cache of things already looked up
-
getRelatedKeys
protected List<org.apache.commons.collections4.KeyValue<String,String>> getRelatedKeys(Relationship rel, Index idxToMatch, Index idxToRetrieve, List<String> toMatchEks) throws ApiException - Throws:
ApiException
-
recursiveGet
protected List<JSNode> recursiveGet(org.apache.commons.collections4.map.MultiKeyMap pkCache, Collection collection, Collection resourceKeys, String expandsPath) throws ApiException - Throws:
ApiException
-
getMaxRows
public int getMaxRows() -
withMaxRows
-