com.ca.commons.opbindings
Class OpBindingsHelper

java.lang.Object
  extended by com.ca.commons.opbindings.OpBindingsHelper

public final class OpBindingsHelper
extends Object

Helper class for parsing and processing opbindings as described by opbindings.xsd.


Field Summary
static String ADD_MODIFY_ATTRS_AS_XML_ATTR
          Can be used to specify that XML representation of all attributes passed to an ADD or MODIFY operation, should be passed in as a string (the XML conforms to opattributes.xsd schema).
static String DIRECTORY_CLASS
           
static String DN_ATTR
          Different from name primary key, which is flat.
static String ERROR_STATUS_ATTR
          All "update" ops can return a error status, where null means success and otherwise a description of the error condition is returned, this is particularly important for "PRE" opbindings where a non-null error status means that the operation should be skipped.
static javax.xml.bind.JAXBContext JAXB_CTX
           
static ObjectFactory JAXB_OBJ_FACTORY
          JAXB Object factory (generated).
static int METHOD_STYLE
           
static String MODIFYRN_NEW_RDN
           
static String NAME_ATTR
          Available to be referenced in every operation, but referred to by the alias chosen by the end-user to map to it.
static String OPBINDINGS_PACKAGE
           
static Schema OPBINDINGS_SCHEMA
           
static Set<Operation> QUERY_OPS
           
static String RUNTIME_ATTR_PREF_SUFF
           
static Map<Operation,List<String>> RUNTIME_CONTEXT_ATTRS
          This maps String [op] => List (ordered runtime attrs), where the runtime attributes match the order of arguments to method-style bindings to their matching JNDI operations.
static int SCRIPT_STYLE
           
static Set<Operation> SEARCH_OPS
           
 
Method Summary
static String attr(String base)
           
static List<Operation> getCommonOperations(DataModel model, Object[] classNames, boolean isMethod)
          Return a common set of the operations for more than one object classes.
static List<Operation> getMethodOperations(DataModel model, String className)
          Returns all operations available as targets for method-style opbindings for class className in model.
static List<String> getRuntimeContextAttrs(Operation op)
           
static List<Operation> getScriptOperations(DataModel model, String className)
          Returns all operations available as targets for script-style opbindings for class className in model.
static boolean isQueryOp(Operation op)
           
static boolean isSearchVariantOp(Operation op)
           
static void marshal(Opbindings opbindings, OutputStream out, boolean pretty)
          Handles outputting script related elements as CDATA sections.
static Opbindings[] splitObBindings(Opbindings opBindings)
          Splits opBindings into separate method-style and script-style entry copies, the original opBindings object is left pointing to the same objects as the split copies so that relative ordering of method/script bindings can be respected.
static String toString(OpBindingType b)
           
static String toString(ScriptType scr)
           
static Opbindings unmarshal(String metadata)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHOD_STYLE

public static final int METHOD_STYLE
See Also:
Constant Field Values

SCRIPT_STYLE

public static final int SCRIPT_STYLE
See Also:
Constant Field Values

OPBINDINGS_PACKAGE

public static final String OPBINDINGS_PACKAGE
See Also:
Constant Field Values

RUNTIME_CONTEXT_ATTRS

public static final Map<Operation,List<String>> RUNTIME_CONTEXT_ATTRS
This maps String [op] => List (ordered runtime attrs), where the runtime attributes match the order of arguments to method-style bindings to their matching JNDI operations.


RUNTIME_ATTR_PREF_SUFF

public static final String RUNTIME_ATTR_PREF_SUFF
See Also:
Constant Field Values

NAME_ATTR

public static final String NAME_ATTR
Available to be referenced in every operation, but referred to by the alias chosen by the end-user to map to it.


DN_ATTR

public static final String DN_ATTR
Different from name primary key, which is flat.


ERROR_STATUS_ATTR

public static final String ERROR_STATUS_ATTR
All "update" ops can return a error status, where null means success and otherwise a description of the error condition is returned, this is particularly important for "PRE" opbindings where a non-null error status means that the operation should be skipped. For technologies where exceptions can be distinguished from a non-null error status, they are treated as synonymous anyway.


ADD_MODIFY_ATTRS_AS_XML_ATTR

public static final String ADD_MODIFY_ATTRS_AS_XML_ATTR
Can be used to specify that XML representation of all attributes passed to an ADD or MODIFY operation, should be passed in as a string (the XML conforms to opattributes.xsd schema).


MODIFYRN_NEW_RDN

public static final String MODIFYRN_NEW_RDN

DIRECTORY_CLASS

public static final String DIRECTORY_CLASS
See Also:
Constant Field Values

JAXB_OBJ_FACTORY

public static final ObjectFactory JAXB_OBJ_FACTORY
JAXB Object factory (generated).


JAXB_CTX

public static final javax.xml.bind.JAXBContext JAXB_CTX

QUERY_OPS

public static final Set<Operation> QUERY_OPS

SEARCH_OPS

public static final Set<Operation> SEARCH_OPS

OPBINDINGS_SCHEMA

public static Schema OPBINDINGS_SCHEMA
Method Detail

attr

public static String attr(String base)

isQueryOp

public static boolean isQueryOp(Operation op)

isSearchVariantOp

public static boolean isSearchVariantOp(Operation op)

getRuntimeContextAttrs

public static List<String> getRuntimeContextAttrs(Operation op)

marshal

public static void marshal(Opbindings opbindings,
                           OutputStream out,
                           boolean pretty)
                    throws javax.xml.bind.JAXBException
Handles outputting script related elements as CDATA sections.

Throws:
javax.xml.bind.JAXBException

unmarshal

public static Opbindings unmarshal(String metadata)
                            throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException

splitObBindings

public static Opbindings[] splitObBindings(Opbindings opBindings)
Splits opBindings into separate method-style and script-style entry copies, the original opBindings object is left pointing to the same objects as the split copies so that relative ordering of method/script bindings can be respected.


toString

public static String toString(ScriptType scr)

toString

public static String toString(OpBindingType b)

getCommonOperations

public static List<Operation> getCommonOperations(DataModel model,
                                                  Object[] classNames,
                                                  boolean isMethod)
Return a common set of the operations for more than one object classes.

Parameters:
model -
classNames -
isMethod - true means method-style, false means script-style
Returns:
A list of operations.

getMethodOperations

@NotNull
public static List<Operation> getMethodOperations(DataModel model,
                                                          String className)
Returns all operations available as targets for method-style opbindings for class className in model. If className doesn't contain a '.' then it is looked up in the first namespace in model, otherwise it is taken to be an absolute name, including namespace.


getScriptOperations

@NotNull
public static List<Operation> getScriptOperations(DataModel model,
                                                          String className)
Returns all operations available as targets for script-style opbindings for class className in model. If className doesn't contain a '.' then it is looked up in the first namespace in model, otherwise it is taken to be an absolute name, including namespace.



Created 2011-07-14 13:27 EST