public class ShorthandKeyFinder
extends java.lang.Object
Usage
You can use esexplorer to help generate the correct shorthand key. In the navigation tree, you can right click on an Entity and print out the shorthand key for it, then in the 'Find Entity' action you can use the key to find that entity, or fashion a more general search string to find entities at a given level, e.g.
will get all filter circuits at all levels etc..../[CircuitContainer]**/[FilterCircuit]
gets all filters of type Reflector etc.../[CircuitContainer]**/[FilterCircuit]/[Reflector]
as above, but restricted to name 'Reflect'./[CircuitContainer]**/[FilterCircuit]/[Reflector]name=Reflect
When applying the search to API Gateway EntityStores, due to legacy reasons wrt the Entity 'schema', you'll need need 2 key expressions to find all policy instances: one to check all containers, and one for policies directly under the root node:
/[CircuitContainer]**/[FilterCircuit] /[FilterCircuit]
Escaping forward slashes:
You'll need to escape any forward slashes you want to find as part of a key value. You can use
escape(String)
and escapeFieldValue(String)
to help here. Example:
/[NetService]name=Service/[HTTP]name=Management Services/[ServletApplication]uriprefix=\/manager\//[Servlet]uri=webManager
Modifier and Type | Class and Description |
---|---|
class |
ShorthandKeyFinder.SingleEntityPF |
Constructor and Description |
---|
ShorthandKeyFinder(EntityStore es) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkForAbsolutePath(java.lang.String shorthandKey) |
static java.lang.String |
escape(java.lang.String shk)
Escape a string to be used as a shorthand key.
|
static java.lang.String |
escapeFieldValue(java.lang.String val)
Escape a field for use when assembling a shorthand query string.
|
java.util.List<Entity> |
getEntities(ESPK currPK,
java.lang.String shorthandKey) |
java.util.List<Entity> |
getEntities(java.lang.String shorthandKey) |
Entity |
getEntity(ESPK currPK,
java.lang.String shorthandKey) |
Entity |
getEntity(java.lang.String shorthandKey)
Getting an Entity using a 'shorthand' key.
|
EntityStore |
getEntityStore() |
java.util.List<Field> |
getFieldData(EntityType type,
java.lang.String shk) |
java.util.Collection<ESPK> |
getPKs(java.lang.String shorthandKey) |
EntityType |
getType(java.lang.String shk) |
static void |
main(java.lang.String[] args) |
void |
setEntityStore(EntityStore es) |
public ShorthandKeyFinder(EntityStore es)
public void setEntityStore(EntityStore es)
public EntityStore getEntityStore()
public Entity getEntity(java.lang.String shorthandKey) throws EntityStoreException
shorthandKey
- A path referencing an Entity in the specified store.EntityStoreException
protected void checkForAbsolutePath(java.lang.String shorthandKey)
public Entity getEntity(ESPK currPK, java.lang.String shorthandKey) throws EntityStoreException
EntityStoreException
public java.util.List<Entity> getEntities(ESPK currPK, java.lang.String shorthandKey) throws EntityStoreException
EntityStoreException
public java.util.List<Entity> getEntities(java.lang.String shorthandKey) throws EntityStoreException
EntityStoreException
public java.util.Collection<ESPK> getPKs(java.lang.String shorthandKey) throws EntityStoreException
EntityStoreException
public EntityType getType(java.lang.String shk) throws EntityStoreException
EntityStoreException
public java.util.List<Field> getFieldData(EntityType type, java.lang.String shk) throws EntityStoreException
EntityStoreException
public static java.lang.String escape(java.lang.String shk)
shk
- The shorthand key for escaped.public static java.lang.String escapeFieldValue(java.lang.String val)
yields the escaped string:String alias = "CN=www.amazon.com, O=Amazon.com Inc., L=Seattle, ST=Washington, C=US"; String shk = "[Certificate]dname=" + Util.escapeFieldValue(alias); System.out.println(shk);
[Certificate]dname=CN=www.amazon.com\, O=Amazon.com Inc.\, L=Seattle\, ST=Washington\, C=US
val
- The field value to escape.public static final void main(java.lang.String[] args)
This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel