com.vordel.es.util
Class ShorthandKeyFinder
java.lang.Object
com.vordel.es.util.ShorthandKeyFinder
public class ShorthandKeyFinder
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ShorthandKeyFinder
public ShorthandKeyFinder(EntityStore es)
setEntityStore
public void setEntityStore(EntityStore es)
getEntity
public Entity getEntity(java.lang.String shorthandKey)
throws EntityStoreException
- Getting an Entity using a 'shorthand' key.
- Parameters:
shorthandKey
- A path referencing an Entity in the specified store.
- Returns:
- The first Entity referenced by the shorthand key, or null if a matching Entity can't be found.
- Throws:
EntityStoreException
getEntity
public Entity getEntity(ESPK currPK,
java.lang.String shorthandKey)
throws EntityStoreException
- Throws:
EntityStoreException
getEntities
public java.util.List<Entity> getEntities(ESPK currPK,
java.lang.String shorthandKey)
throws EntityStoreException
- Throws:
EntityStoreException
getEntities
public java.util.List<Entity> getEntities(java.lang.String shorthandKey)
throws EntityStoreException
- Throws:
EntityStoreException
getType
public EntityType getType(java.lang.String shk)
throws EntityStoreException
- Throws:
EntityStoreException
getFieldData
public java.util.List<Field> getFieldData(EntityType type,
java.lang.String shk)
throws EntityStoreException
- Throws:
EntityStoreException
escape
public static java.lang.String escape(java.lang.String shk)
- Escape a string to be used as a shorthand key
- Parameters:
shk
-
- Returns:
escapeFieldValue
public static java.lang.String escapeFieldValue(java.lang.String val)
- Escape a field for use when assembling a shorthand query string. This will escape '/' and ',' characters,
which are used as shorthand key delimiters.
For example, you may be assembling a certificate alias whose dname contains commas:
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);
yields the escaped string:
[Certificate]dname=CN=www.amazon.com\, O=Amazon.com Inc.\, L=Seattle\, ST=Washington\, C=US
- Parameters:
val
- The field value to escape.
- Returns:
main
public static final void main(java.lang.String[] args)
This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel