Package org.objectweb.joram.shared.excepts

Examples of org.objectweb.joram.shared.excepts.AccessException


   * @exception AccessException  If the sender is not a reader.
   */
  protected void receiveRequest(AgentId from, ReceiveRequest not) throws AccessException {
    // If client is not a reader, sending an exception.
    if (! isReader(from))
      throw new AccessException("READ right not granted");

    String[] toAck = not.getMessageIds();
    if (toAck != null) {
      for (int i = 0; i < toAck.length; i++) {
        acknowledge(toAck[i]);
View Full Code Here


   * @exception AccessException  If the requester is not a reader.
   */
  protected void browseRequest(AgentId from, BrowseRequest not) throws AccessException {
    // If client is not a reader, sending an exception.
    if (! isReader(from))
      throw new AccessException("READ right not granted");

    // Building the reply:
    BrowseReply rep = new BrowseReply(not);

    // Cleaning the possibly expired messages.
View Full Code Here

      // Free reading right has been removed, reject the non readers requests.
      for (int i = 0; i < requests.size(); i++) {
        request = (ReceiveRequest) requests.get(i);
        if (! isReader(request.requester)) {
          forward(request.requester,
                  new ExceptionReply(request, new AccessException("Free READ access removed")));
          setSave(); // state change, so save.
          requests.remove(i);
          i--;
        }
      }
    } else {
      // Reading right of a given user has been removed; replying to its requests.
      for (int i = 0; i < requests.size(); i++) {
        request = (ReceiveRequest) requests.get(i);
        if (user.equals(request.requester)) {
          forward(request.requester,
                  new ExceptionReply(request, new AccessException("READ right removed")));
          setSave(); // state change, so save.
          requests.remove(i);
          i--;
        }
      }
View Full Code Here

   * @exception AccessException  If the sender is not a reader.
   */
  public void receiveRequest(AgentId from, ReceiveRequest not) throws AccessException {
    // If client is not a reader, sending an exception.
    if (! isReader(from))
      throw new AccessException("READ right not granted");

    // Storing the request:
    not.requester = from;
    not.setExpiration(System.currentTimeMillis());
    requests.add(not);
View Full Code Here

   *
   * @exception AccessException  If the sender is not a READER.
   */
  protected void subscribeRequest(AgentId from, SubscribeRequest not) throws AccessException {
    if (! isReader(from))
      throw new AccessException("READ right not granted");

    preSubscribe();

    setSave(); // state change, so save.
   
View Full Code Here

    if (user != null) {
      // Identified user: removing it.
      setSave(); // state change, so save.
      subscribers.remove(user);
      selectors.remove(user);
      forward(user, new ExceptionReply(new AccessException("READ right removed.")));
    } else {
      // Free reading right removed: removing all non readers.
      for (Iterator subs = subscribers.iterator(); subs.hasNext();) {
        user = (AgentId) subs.next();
        if (! isReader(user)) {
          setSave(); // state change, so save.
          subs.remove();
          selectors.remove(user);
          forward(user, new ExceptionReply(new AccessException("READ right removed.")));
        }
      }
    }
  }
View Full Code Here

   *
   * @exception AccessException  If the requester is not the administrator.
   */
  protected void getRights(AgentId from, GetRightsRequestNot not) throws AccessException {
    if (! isAdministrator(from))
      throw new AccessException("ADMIN right not granted");

    AgentId key;
    int right;
    Vector readers = new Vector();
    Vector writers = new Vector();
View Full Code Here

        nbMsgsSentToDMQSinceCreation++;
        dmqManager.addDeadMessage(msg, MessageErrorConstants.NOT_WRITEABLE);
        handleDeniedMessage(msg.id, AgentId.fromString(msg.replyToId));
      }
      dmqManager.sendToDMQ();
      throw new AccessException("WRITE right not granted");
    }

    doClientMessages(from, not);

    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
View Full Code Here

TOP

Related Classes of org.objectweb.joram.shared.excepts.AccessException

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.