Class PropertiesCommand

  • All Implemented Interfaces:
    JESTCommand

    public class PropertiesCommand
    extends java.lang.Object
    Represents configuration properties in HTML.
    Author:
    Pinaki Poddar
    • Method Detail

      • getMaximumArguments

        protected int getMaximumArguments()
        Gets the maximum number of arguments excluding the mandatory arguments.
        Returns:
        Integer.MAX_VALUE by default.
      • process

        public void process()
                     throws ProcessingException,
                            java.io.IOException
        Description copied from interface: JESTCommand
        Process the given request and write the output on to the given response in the given context.
        Throws:
        ProcessingException
        java.io.IOException
      • getMandatoryArgument

        public java.lang.String getMandatoryArgument​(java.lang.String key)
      • getArgument

        public java.lang.String getArgument​(java.lang.String key)
        Description copied from interface: JESTCommand
        Get the value of this command's argument of the given name.
        Specified by:
        getArgument in interface JESTCommand
        Returns:
        null if the argument does not exist.
      • hasArgument

        public boolean hasArgument​(java.lang.String key)
        Description copied from interface: JESTCommand
        Affirm this command contains an argument of the given name.
        Specified by:
        hasArgument in interface JESTCommand
      • getArguments

        public java.util.Map<java.lang.String,​java.lang.String> getArguments()
        Description copied from interface: JESTCommand
        Get this command's arguments.
        Specified by:
        getArguments in interface JESTCommand
      • getQualifier

        public java.lang.String getQualifier​(java.lang.String key)
        Description copied from interface: JESTCommand
        Get the value of this command's qualifier of the given name.
        Specified by:
        getQualifier in interface JESTCommand
        Returns:
        null if the qualifier does not exist.
      • hasQualifier

        public boolean hasQualifier​(java.lang.String key)
        Description copied from interface: JESTCommand
        Affirm this command contains an qualifier of the given name.
        Specified by:
        hasQualifier in interface JESTCommand
      • isBooleanQualifier

        protected boolean isBooleanQualifier​(java.lang.String key)
      • getQualifiers

        public java.util.Map<java.lang.String,​java.lang.String> getQualifiers()
        Description copied from interface: JESTCommand
        Get this command's qualifiers.
        Specified by:
        getQualifiers in interface JESTCommand
      • parse

        public void parse()
                   throws ProcessingException
        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 for find command, or q for query. The mandatory arguments, if any, are not captured in the argument list.
        The qualifiers and arguments are immutable after parse.
        Specified by:
        parse in interface JESTCommand
        Throws:
        ProcessingException
      • getMandatoryArguments

        protected java.util.Collection<java.lang.String> 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

        protected java.util.Collection<java.lang.String> 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.
      • toStateManager

        protected java.util.List<OpenJPAStateManager> toStateManager​(java.util.Collection<?> objects)
      • pushFetchPlan

        protected void pushFetchPlan​(java.lang.Object target)
      • popFetchPlan

        protected void popFetchPlan​(boolean finder)
      • debug

        protected void debug​(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response,
                             JPAServletContext ctx)
                      throws java.io.IOException
        Throws:
        java.io.IOException