Package de.metalcon.server.tomcat.NSSP.delete

Examples of de.metalcon.server.tomcat.NSSP.delete.DeleteResponse


      final HttpServletResponse response) throws IOException {
    // store response item for the server response creation
    final TomcatClientResponder responder = new TomcatClientResponder(
        response);

    DeleteResponse deleteResponse = new DeleteResponse();
    final DeleteRequest deleteRequest = DeleteRequest.checkRequest(request,
        deleteResponse);

    boolean commandStacked = false;
    if (deleteRequest != null) {
      switch (deleteRequest.getType()) {

      // TODO: user delete requests/responses to instantiate commands

      // delete a user
      case USER:
        final DeleteUserResponse deleteUserResponse = new DeleteUserResponse();
        final DeleteUserRequest deleteUserRequest = DeleteUserRequest
            .checkRequest(request, deleteRequest,
                deleteUserResponse);
        deleteResponse = deleteUserResponse;

        if (deleteUserRequest != null) {
          // delete user
          final DeleteUser deleteUserCommand = new DeleteUser(this,
              deleteUserResponse, deleteUserRequest);
          this.commandQueue.add(deleteUserCommand);

          commandStacked = true;
        }
        break;

      // delete a follow edge
      case FOLLOW:
        final DeleteFollowResponse deleteFollowResponse = new DeleteFollowResponse();
        final DeleteFollowRequest deleteFollowRequest = DeleteFollowRequest
            .checkRequest(request, deleteRequest,
                deleteFollowResponse);
        deleteResponse = deleteFollowResponse;

        if (deleteFollowRequest != null) {
          // delete follow edge
          final DeleteFollow deleteFollowCommand = new DeleteFollow(
              this, deleteFollowResponse, deleteFollowRequest);
          this.commandQueue.add(deleteFollowCommand);

          commandStacked = true;
        }
        break;

      // delete status update
      default:
        // TODO: check status update ownage in request instantiation
        final DeleteStatusUpdateResponse deleteStatusUpdateResponse = new DeleteStatusUpdateResponse();
        final DeleteStatusUpdateRequest deleteStatusUpdateRequest = DeleteStatusUpdateRequest
            .checkRequest(request, deleteRequest,
                deleteStatusUpdateResponse);
        deleteResponse = deleteStatusUpdateResponse;

        if (deleteStatusUpdateRequest != null) {
          // delete status update
          final DeleteStatusUpdate deleteStatusUpdateCommand = new DeleteStatusUpdate(
              this, deleteStatusUpdateResponse,
              deleteStatusUpdateRequest);
          this.commandQueue.add(deleteStatusUpdateCommand);

          commandStacked = true;
        }
        break;

      }

      if (commandStacked) {
        try {
          this.workingQueue.take();
        } catch (final InterruptedException e) {
          System.err
              .println("request status queue failed due to delete request");
          e.printStackTrace();
        }
      }
    }

    responder.addLine(deleteResponse.toString());
    responder.finish();
  }
View Full Code Here

TOP

Related Classes of de.metalcon.server.tomcat.NSSP.delete.DeleteResponse

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.