Package org.davinci.server.internal.command

Examples of org.davinci.server.internal.command.CommandDescriptor


          String pathInfo = req.getPathInfo();
          if (pathInfo.startsWith("/")) {
              pathInfo = pathInfo.substring(1);
          }
 
          CommandDescriptor commandDescriptor = this.commands.get(pathInfo);
          if (commandDescriptor.isPut()) {
              throw new AssertionError(new String("commandDescriptor is Put in doGet"));
          }
          user = checkLogin(req, resp, commandDescriptor);
          if (user == null && !commandDescriptor.isNoLogin()) {
              return;
          }
 
          Command command = commandDescriptor.getCommand();
          command.init();
 
          command.handleCommand(req, resp, user);
          if (command.getErrorString() != null) {
              resp.sendError(HttpServletResponse.SC_BAD_REQUEST, command.getErrorString());
View Full Code Here


          String pathInfo = req.getPathInfo();
          if (pathInfo.startsWith("/")) {
              pathInfo = pathInfo.substring(1);
          }
 
          CommandDescriptor commandDescriptor = this.commands.get(pathInfo);
          if (!commandDescriptor.isPut()) {
              throw new AssertionError(new String("commandDescriptor is not Put in doPut"));
          }
 
          user = checkLogin(req, resp, commandDescriptor);
          if (user == null && !commandDescriptor.isNoLogin()) {
              return;
          }
          Command command = commandDescriptor.getCommand();
          command.init();
 
          command.handleCommand(req, resp, user);
      } catch (RuntimeException re) {
        log(req, "doPut", re, user);
View Full Code Here

          if (pathInfo.startsWith("/")) {
              pathInfo = pathInfo.substring(1);
          }
 
       
          CommandDescriptor commandDescriptor = this.commands.get(pathInfo);
          if (commandDescriptor.isPut()) {
              throw new AssertionError(new String("commandDescriptor is Put in doPost"));
          }
          user = checkLogin(req, resp, commandDescriptor);
          if (user == null) {
              if (!commandDescriptor.isNoLogin()) {
                  resp.sendError(HttpServletResponse.SC_UNAUTHORIZED);
                  return;
              }
          }
          Command command = commandDescriptor.getCommand();
          command.init();
 
          command.handleCommand(req, resp, user);
          if (command.getErrorString() != null) {
              resp.sendError(HttpServletResponse.SC_BAD_REQUEST, command.getErrorString());
View Full Code Here

                IExtension[] extensions = point.getExtensions();
                for (int i = 0; i < extensions.length; i++) {
                    IConfigurationElement[] elements = extensions[i].getConfigurationElements();
                    for (int j = 0; j < elements.length; j++) {
                        if (elements[j].getName().equals(IDavinciServerConstants.EP_TAG_COMMAND)) {
                            CommandDescriptor cmd = new CommandDescriptor(elements[j]);
                            this.commands.put(cmd.getPath(), cmd);
                        }
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.davinci.server.internal.command.CommandDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.