Ejemplo n.º 1
0
  @Override
  public void databases(final LockResult lr) {
    for (final Command c : cmds) c.databases(lr);

    // lock globally if context-dependent is found (context will be changed by commands)
    final boolean wc = lr.write.contains(DBLocking.CTX) || lr.write.contains(DBLocking.COLL);
    final boolean rc = lr.read.contains(DBLocking.CTX) || lr.read.contains(DBLocking.COLL);
    if (wc || rc && !lr.write.isEmpty()) {
      lr.writeAll = true;
      lr.readAll = true;
    } else if (rc) {
      lr.readAll = true;
    }
  }
Ejemplo n.º 2
0
 @Override
 public boolean updating(final Context ctx) {
   boolean up = false;
   for (final Command c : cmds) up |= c.updating(ctx);
   return up;
 }
Ejemplo n.º 3
0
 /**
  * Runs the specified command.
  *
  * @param c command
  * @param os output stream
  * @throws HTTPException HTTP exception
  */
 final void run(final Command c, final OutputStream os) throws HTTPException {
   final boolean ok = c.run(context, os);
   error(c.info());
   if (!ok) throw HTTPCode.BAD_REQUEST_X.get(c.info());
 }