Package org.objectweb.joram.shared.admin

Examples of org.objectweb.joram.shared.admin.AdminReply


    if (contexts.size() > 0) {
      String info = "Delete proxy request successful [false]: proxy [" + getId() + "] of user ["
          + userName + "] is currently in use.";

      if (not.getReplyTo() != null) {
        replyToTopic(new AdminReply(AdminReply.PERMISSION_DENIED, info), not.getReplyTo(),
            not.getRequestMsgId(), not.getReplyMsgId());
      }
      return;
    }

    AdminTopic.deleteUser(userName);

    String info = "Delete proxy request successful [true]: proxy [" + getId() + "] of user ["
        + userName + "] has been notified of deletion";

    if (not.getReplyTo() != null) {
      replyToTopic(new AdminReply(true, info), not.getReplyTo(), not.getRequestMsgId(), not.getReplyMsgId());
    }

    // Removing all proxy's subscriptions:
    AgentId destId;
    for (Iterator topics = topicsTable.keySet().iterator(); topics.hasNext();) {
View Full Code Here


    try {
      processSetRight(user, right);
      doRightRequest(user, right);

      replyToTopic(new AdminReply(true, null), replyTo, requestMsgId, replyMsgId);
    } catch (RequestException exc) {
      strbuf.append("Request [").append(request.getClass().getName());
      strbuf.append("], sent to Destination [").append(getId());
      strbuf.append("], successful [false]: ").append(exc.getMessage());
      replyToTopic(new AdminReply(false, strbuf.toString()), replyTo, requestMsgId, replyMsgId);
      logger.log(BasicLevel.ERROR, strbuf.toString());
      strbuf.setLength(0);
    }
  }
View Full Code Here

      if (((SetDMQRequest)adminRequest).getDmqId() != null)
        dmqId = AgentId.fromString(((SetDMQRequest)adminRequest).getDmqId());
      else
        dmqId = null;

      replyToTopic(new AdminReply(true, null),
                   not.getReplyTo(), not.getRequestMsgId(), not.getReplyMsgId());
    } else if (adminRequest instanceof AdminCommandRequest) {
      processAdminCommand((AdminCommandRequest) adminRequest, not.getReplyTo(), not.getRequestMsgId());
    } else {
      logger.log(BasicLevel.ERROR, "Unknown administration request for destination " + getId());
      replyToTopic(new AdminReply(AdminReply.UNKNOWN_REQUEST, null),
                   not.getReplyTo(),
                   not.getRequestMsgId(),
                   not.getReplyMsgId());
     
    }
View Full Code Here

      // reply
      replyToTopic(new AdminCommandReply(true, AdminCommandConstant.commandNames[request.getCommand()] + " done.", replyProp), replyTo, requestMsgId, requestMsgId);
    } catch (Exception exc) {
      if (logger.isLoggable(BasicLevel.WARN))
        logger.log(BasicLevel.WARN, "", exc);
      replyToTopic(new AdminReply(-1, exc.getMessage()), replyTo, requestMsgId, requestMsgId);
    }
  }
View Full Code Here

  /**
   * Method used to send a response when a message is denied because of a lack
   * of rights.
   */
  protected void handleDeniedMessage(String msgId, AgentId replyTo) {
    distributeReply(replyTo, msgId, new AdminReply(AdminReply.PERMISSION_DENIED, "Permission denied."));
  }
View Full Code Here

    if (requestId == null) return;

    AgentId replyTo = (AgentId) requestsTable.remove(requestId);
    if (replyTo == null) return;

    AdminReply reply;

    if (not instanceof GetRightsReplyNot)
      reply = doProcess((GetRightsReplyNot) not);
    else
      reply = new AdminReply(not.getSuccess(), not.getInfo());

    distributeReply(replyTo, requestId, reply);
  }
View Full Code Here

        strbuf.append("Request [").append(not.getClass().getName());
        strbuf.append("], sent to AdminTopic on server [").append(serverId);
        strbuf.append("], successful [false]: unknown agent [").append(agId).append(']');

        distributeReply(replyTo, reqId, new AdminReply(false, strbuf.toString()));
        strbuf.setLength(0);
      }
    } else {
      super.doUnknownAgent(uA);
    }
View Full Code Here

      if (logger.isLoggable(BasicLevel.DEBUG))
        logger.log(BasicLevel.DEBUG, "--- " + this + ": got " + request);

      if (request == null) {
        logger.log(BasicLevel.ERROR, "--- " + this + ": got bad AdminRequest.");
        distributeReply(replyTo, msgId, new AdminReply(false, "Unexpected request to AdminTopic"));
      }

      processAdminRequests(replyTo, msgId, request, null);
    }
  }
View Full Code Here

      info = strbuf.append("Request [").append(request.getClass().getName())
      .append("], successful [false]: ")
      .append(exc.getMessage()).toString();
      strbuf.setLength(0);

      distributeReply(replyTo, msgId, new AdminReply(AdminReply.UNKNOWN_SERVER, info));
    } catch (MomException exc) {
      if (logger.isLoggable(BasicLevel.WARN))
        logger.log(BasicLevel.WARN, exc);

      if (request == null) {
        info = strbuf.append("Unexpected request to AdminTopic on server [")
        .append(serverId).append("]: ").append(exc.getMessage()).toString();
        strbuf.setLength(0);
      } else {
        info = strbuf.append("Request [").append(request.getClass().getName())
        .append("], sent to AdminTopic on server [").append(serverId)
        .append("], successful [false]: ")
        .append(exc.getMessage()).toString();
        strbuf.setLength(0);
      }

      distributeReply(replyTo, msgId, new AdminReply(false, info));
    }
  }
View Full Code Here

                         AgentId replyTo,
                         String msgId) throws UnknownServerException {
    if (checkServerId(request.getServerId())) {
      // It's the local server, process the request.
      distributeReply(replyTo, msgId,
                      new AdminReply(true, "Server stopped"));
      AgentServer.stop(false, 500L, true);
    } else {
      // Forward the request to the right AdminTopic agent.
      forward(getDefault((short) request.getServerId()),
              new FwdAdminRequestNot(request, replyTo, msgId));
View Full Code Here

TOP

Related Classes of org.objectweb.joram.shared.admin.AdminReply

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.