Class PropertiesCommand
java.lang.Object
org.apache.openjpa.persistence.jest.PropertiesCommand
- All Implemented Interfaces:
JESTCommand
Represents configuration properties in HTML.
- Author:
- Pinaki Poddar
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.openjpa.persistence.jest.JESTCommand
JESTCommand.Format -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JPAServletContextprotected ObjectFormatter<?>protected static Localizerstatic final Collection<String>static final charstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddebug(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, JPAServletContext ctx) getArgument(String key) Get the value of this command's argument of the given name.Get this command's arguments.protected JESTCommand.FormatGet the execution context of this command.protected Collection<String>Gets the mandatory arguments.protected intGets the maximum number of arguments excluding the mandatory arguments.protected intGets the minimum number of arguments excluding the mandatory arguments.getQualifier(String key) Get the value of this command's qualifier of the given name.Get this command's qualifiers.protected Collection<String>Gets the valid qualifiers.booleanhasArgument(String key) Affirm this command contains an argument of the given name.booleanhasQualifier(String key) Affirm this command contains an qualifier of the given name.protected booleanisBooleanQualifier(String key) voidparse()Parses HTTP Request for the qualifier and argument of a command.protected voidpopFetchPlan(boolean finder) voidprocess()Process the given request and write the output on to the given response in the given context.protected voidpushFetchPlan(Object target) protected OpenJPAStateManagertoStateManager(Object obj) protected List<OpenJPAStateManager>toStateManager(Collection<?> objects) protected voidvalidate()Called post-parse to validate this command has requisite qualifiers and arguments.
-
Field Details
-
EQUAL
public static final char EQUAL- See Also:
-
PATH_SEPARATOR
- See Also:
-
EMPTY_LIST
-
_formatter
-
_ctx
-
_loc
-
-
Constructor Details
-
PropertiesCommand
-
-
Method Details
-
getMaximumArguments
protected int getMaximumArguments()Gets the maximum number of arguments excluding the mandatory arguments.- Returns:
- Integer.MAX_VALUE by default.
-
process
Description copied from interface:JESTCommandProcess the given request and write the output on to the given response in the given context.- Throws:
ProcessingExceptionIOException
-
getDefaultFormat
-
getExecutionContext
Description copied from interface:JESTCommandGet the execution context of this command.- Specified by:
getExecutionContextin interfaceJESTCommand- Returns:
- the execution context. never null.
-
getMandatoryArgument
-
getArgument
Description copied from interface:JESTCommandGet the value of this command's argument of the given name.- Specified by:
getArgumentin interfaceJESTCommand- Returns:
- null if the argument does not exist.
-
hasArgument
Description copied from interface:JESTCommandAffirm this command contains an argument of the given name.- Specified by:
hasArgumentin interfaceJESTCommand
-
getArguments
Description copied from interface:JESTCommandGet this command's arguments.- Specified by:
getArgumentsin interfaceJESTCommand
-
getQualifier
Description copied from interface:JESTCommandGet the value of this command's qualifier of the given name.- Specified by:
getQualifierin interfaceJESTCommand- Returns:
- null if the qualifier does not exist.
-
hasQualifier
Description copied from interface:JESTCommandAffirm this command contains an qualifier of the given name.- Specified by:
hasQualifierin interfaceJESTCommand
-
isBooleanQualifier
-
getQualifiers
Description copied from interface:JESTCommandGet this command's qualifiers.- Specified by:
getQualifiersin interfaceJESTCommand
-
parse
Parses HTTP Request for the qualifier and argument of a command.
Each servlet path segment, except the first (which is the command name itself), is a qualifier. Each qualifier can be either a key or a key-value pair separated by a = sign.
Each request parameter key-value pair is an argument. A concrete command may specify mandatory arguments (e.g.typemust be mandatory argument forfindcommand, orqforquery. The mandatory arguments, if any, are not captured in the argument list.
The qualifiers and arguments are immutable after parse.- Specified by:
parsein interfaceJESTCommand- Throws:
ProcessingException
-
getMandatoryArguments
Gets the mandatory arguments.- Returns:
- empty list by default.
-
getMinimumArguments
protected int getMinimumArguments()Gets the minimum number of arguments excluding the mandatory arguments.- Returns:
- zero by default.
-
getValidQualifiers
Gets the valid qualifiers.- Returns:
- empty list by default.
-
validate
protected void validate()Called post-parse to validate this command has requisite qualifiers and arguments. -
getObjectFormatter
-
toStateManager
-
toStateManager
-
pushFetchPlan
-
popFetchPlan
protected void popFetchPlan(boolean finder) -
debug
protected void debug(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, JPAServletContext ctx) throws IOException - Throws:
IOException
-