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
Modifier and TypeFieldDescriptionprotected final JPAServletContext
protected ObjectFormatter<?>
protected static Localizer
static final Collection<String>
static final char
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
debug
(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.Format
Get the execution context of this command.protected Collection<String>
Gets the mandatory arguments.protected int
Gets the maximum number of arguments excluding the mandatory arguments.protected int
Gets 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.boolean
hasArgument
(String key) Affirm this command contains an argument of the given name.boolean
hasQualifier
(String key) Affirm this command contains an qualifier of the given name.protected boolean
isBooleanQualifier
(String key) void
parse()
Parses HTTP Request for the qualifier and argument of a command.protected void
popFetchPlan
(boolean finder) void
process()
Process the given request and write the output on to the given response in the given context.protected void
pushFetchPlan
(Object target) protected OpenJPAStateManager
toStateManager
(Object obj) protected List<OpenJPAStateManager>
toStateManager
(Collection<?> objects) protected void
validate()
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:JESTCommand
Process the given request and write the output on to the given response in the given context.- Throws:
ProcessingException
IOException
-
getDefaultFormat
-
getExecutionContext
Description copied from interface:JESTCommand
Get the execution context of this command.- Specified by:
getExecutionContext
in interfaceJESTCommand
- Returns:
- the execution context. never null.
-
getMandatoryArgument
-
getArgument
Description copied from interface:JESTCommand
Get the value of this command's argument of the given name.- Specified by:
getArgument
in interfaceJESTCommand
- Returns:
- null if the argument does not exist.
-
hasArgument
Description copied from interface:JESTCommand
Affirm this command contains an argument of the given name.- Specified by:
hasArgument
in interfaceJESTCommand
-
getArguments
Description copied from interface:JESTCommand
Get this command's arguments.- Specified by:
getArguments
in interfaceJESTCommand
-
getQualifier
Description copied from interface:JESTCommand
Get the value of this command's qualifier of the given name.- Specified by:
getQualifier
in interfaceJESTCommand
- Returns:
- null if the qualifier does not exist.
-
hasQualifier
Description copied from interface:JESTCommand
Affirm this command contains an qualifier of the given name.- Specified by:
hasQualifier
in interfaceJESTCommand
-
isBooleanQualifier
-
getQualifiers
Description copied from interface:JESTCommand
Get this command's qualifiers.- Specified by:
getQualifiers
in 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.type
must be mandatory argument forfind
command, orq
forquery
. The mandatory arguments, if any, are not captured in the argument list.
The qualifiers and arguments are immutable after parse.- Specified by:
parse
in 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
-