| Modifier and Type | Class and Description |
|---|---|
static interface |
Api.ApiListener
Listener that can be registered with an
Api to receive lifecycle,
per request and per error callback notifications. |
Rule.RuleMatcher| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<Action> |
actions
Actions that may be selected to run regardless of the matched Endpoint.
|
protected java.util.List<Collection> |
collections
The data objects being served by this API.
|
protected java.util.List<Db> |
dbs
The underlying data sources for the Api.
|
protected boolean |
debug |
protected java.util.List<Endpoint> |
endpoints
The Request HTTP method/path combinations that map to a distinct set of Actions.
|
protected java.lang.String |
hash |
protected java.util.List<Api.ApiListener> |
listeners
Listeners that receive callbacks on startup/shutdown/request/error.
|
protected java.lang.String |
url |
configMap, configStr, excludeMatchers, excludeOn, includeMatchers, includeOn, log, name, order| Modifier and Type | Method and Description |
|---|---|
java.util.List<Action> |
getActions() |
java.util.List<Api.ApiListener> |
getApiListeners() |
Collection |
getCollection(java.lang.String name) |
java.util.List<Collection> |
getCollections() |
Db |
getDb(java.lang.String name) |
java.util.List<Db> |
getDbs() |
protected Rule.RuleMatcher |
getDefaultIncludeMatch()
Designed to allow subclasses to provide a default match behavior
of no configuration was provided by the developer.
|
java.util.List<Endpoint> |
getEndpoints() |
java.lang.String |
getHash() |
long |
getLoadTime() |
java.lang.String |
getUrl() |
boolean |
isDebug() |
boolean |
isStarted() |
void |
removeExcludes() |
void |
setDebug(boolean debug) |
void |
setLoadTime(long loadTime) |
Api |
withAction(Action action) |
Api |
withActions(Action... actions)
Add Action(s) may be selected to run across multiple Endpoints.
|
Api |
withApiListener(Api.ApiListener listener) |
Api |
withCollection(Collection coll) |
<T extends Db> |
withDb(Db<T> db) |
Api |
withDbs(Db... dbs) |
Api |
withEndpoint(Endpoint... endpoints) |
Api |
withEndpoint(java.lang.String methods,
java.lang.String includePaths,
Action... actions) |
Api |
withHash(java.lang.String hash) |
Api |
withRelationship(Collection parentCollection,
java.lang.String parentPropertyName,
Collection childCollection,
java.lang.String childPropertyName,
Property... childFkProps)
Creates a ONE_TO_MANY Relationship from the parent to child collection and the inverse MANY_TO_ONE from the child to the parent.
|
Api |
withRelationship(java.lang.String parentCollectionName,
java.lang.String parentPropertyName,
java.lang.String childCollectionName,
java.lang.String childPropertyName,
java.lang.String... childFkProps)
This method takes String instead of actual Collections and Properties as a convenience to people hand wiring up an Api.
|
Api |
withUrl(java.lang.String url) |
checkLazyConfig, compareTo, doLazyConfig, getAllExcludePaths, getAllIncludePaths, getConfig, getConfig, getConfigKeys, getExcludeMatchers, getIncludeMatchers, getName, getOrder, match, matches, matches, toString, withConfig, withExcludeOn, withExcludeOn, withExcludeOn, withIncludeOn, withIncludeOn, withIncludeOn, withName, withOrderprotected final java.util.List<Db> dbs
protected final java.util.List<Endpoint> endpoints
A single Endpoint will be selected to run to service a Request. Any additional Path matching rules that exist on these Endpoint's Actions will be interpreted as relative to the end of the selected Endpoint's Path match.
protected final java.util.List<Action> actions
The Action's Path match statements will be considered relative to the Api's base URL NOT relative to the selected Endpoint.
protected final java.util.List<Collection> collections
protected final transient java.util.List<Api.ApiListener> listeners
protected transient java.lang.String hash
protected boolean debug
protected java.lang.String url
protected Rule.RuleMatcher getDefaultIncludeMatch()
RulegetDefaultIncludeMatch in class Rule<Api>public boolean isStarted()
public void removeExcludes()
public java.lang.String getHash()
public Api withHash(java.lang.String hash)
public Api withCollection(Collection coll)
public java.util.List<Collection> getCollections()
public Collection getCollection(java.lang.String name)
public Db getDb(java.lang.String name)
public java.util.List<Db> getDbs()
public long getLoadTime()
public void setLoadTime(long loadTime)
public java.util.List<Endpoint> getEndpoints()
public Api withEndpoint(java.lang.String methods, java.lang.String includePaths, Action... actions)
public Api withRelationship(java.lang.String parentCollectionName, java.lang.String parentPropertyName, java.lang.String childCollectionName, java.lang.String childPropertyName, java.lang.String... childFkProps)
parentCollectionName - the name of the parent collectionparentPropertyName - the name of the json property for the parent that references the childchildCollectionName - the target child collection namechildPropertyName - the name of hte json property for the child that references the parentchildFkProps - names of the existing Properties that make up the foreign keypublic Api withRelationship(Collection parentCollection, java.lang.String parentPropertyName, Collection childCollection, java.lang.String childPropertyName, Property... childFkProps)
For collections backed by relational data sources (like a SQL db) the length of childFkProps will generally match the
length of parentCollections primary index. If the two don't match, then childFkProps must be 1. In this
case, the compound primary index of parentCollection will be encoded as an resourceKey in the single child table property.
parentCollection - the collection to add the relationship toparentPropertyName - the name of the json property for the parent that references the childchildCollection - the target child collectionchildPropertyName - the name of hte json property for the child that references the parentchildFkProps - Properties that make up the foreign keypublic java.util.List<Action> getActions()
public Api withActions(Action... actions)
actions - actions to match and conditionally run across all Requestspublic boolean isDebug()
public void setDebug(boolean debug)
public java.lang.String getUrl()
public Api withUrl(java.lang.String url)
public Api withApiListener(Api.ApiListener listener)
public java.util.List<Api.ApiListener> getApiListeners()
Copyright © 2021 Rocket Partners, LLC. All rights reserved.