Examples of CreateRequest


Examples of org.apache.zookeeper.proto.CreateRequest

        request.txn = null;
       
        try {
            switch (request.type) {
                case OpCode.create:
                CreateRequest createRequest = new CreateRequest();
                pRequest2Txn(request.type, zks.getNextZxid(), request, createRequest, true);
                break;
            case OpCode.delete:
                DeleteRequest deleteRequest = new DeleteRequest();              
                pRequest2Txn(request.type, zks.getNextZxid(), request, deleteRequest, true);
View Full Code Here

Examples of org.apache.zookeeper.proto.CreateRequest

      (CreateAndFailSilent)ZKUtilOp.createAndFailSilent(znode, data));
  }

  private static void createAndFailSilent(ZooKeeperWatcher zkw, CreateAndFailSilent cafs)
  throws KeeperException {
    CreateRequest create = (CreateRequest)toZooKeeperOp(zkw, cafs).toRequestRecord();
    String znode = create.getPath();
    try {
      RecoverableZooKeeper zk = zkw.getRecoverableZooKeeper();
      if (zk.exists(znode, false) == null) {
        zk.create(znode, create.getData(), create.getAcl(), CreateMode.fromFlag(create.getFlags()));
      }
    } catch(KeeperException.NodeExistsException nee) {
    } catch(KeeperException.NoAuthException nee){
      try {
        if (null == zkw.getRecoverableZooKeeper().exists(znode, false)) {
View Full Code Here

Examples of org.apache.zookeeper.proto.CreateRequest

    if(ops == null) return null;

    List<Op> preparedOps = new LinkedList<Op>();
    for (Op op : ops) {
      if (op.getType() == ZooDefs.OpCode.create) {
        CreateRequest create = (CreateRequest)op.toRequestRecord();
        preparedOps.add(Op.create(create.getPath(), appendMetaData(create.getData()),
          create.getAcl(), create.getFlags()));
      } else if (op.getType() == ZooDefs.OpCode.delete) {
        // no need to appendMetaData for delete
        preparedOps.add(op);
      } else if (op.getType() == ZooDefs.OpCode.setData) {
        SetDataRequest setData = (SetDataRequest)op.toRequestRecord();
View Full Code Here

Examples of org.apache.zookeeper_voltpatches.proto.CreateRequest

        try {
            switch (request.type) {
            case OpCode.create:
                txnHeader = new TxnHeader(request.sessionId, request.cxid,
                        txnId, getTime(), OpCode.create);
                CreateRequest createRequest = new CreateRequest();
                ZooKeeperServer.byteBuffer2Record(request.request,
                        createRequest);
                String path = createRequest.getPath();
                int lastSlash = path.lastIndexOf('/');
                if (lastSlash == -1 || path.indexOf('\0') != -1) {
                    LOG.info("Invalid path " + path + " with session 0x"
                            + Long.toHexString(request.sessionId));
                    throw new KeeperException.BadArgumentsException(path);
                }
                if (!fixupACL(request.authInfo, createRequest.getAcl())) {
                    throw new KeeperException.InvalidACLException(path);
                }
                String parentPath = path.substring(0, lastSlash);
                ChangeRecord parentRecord = getRecordForPath(parentPath);

                checkACL(parentRecord.acl, ZooDefs.Perms.CREATE,
                        request.authInfo);
                int parentCVersion = parentRecord.stat.getCversion();
                CreateMode createMode = CreateMode.fromFlag(createRequest
                        .getFlags());
                if (createMode.isSequential()) {
                    path = path + String.format("%010d", parentCVersion);
                }
                try {
                    PathUtils.validatePath(path);
                } catch (IllegalArgumentException ie) {
                    LOG.info("Invalid path " + path + " with session 0x"
                            + Long.toHexString(request.sessionId));
                    throw new KeeperException.BadArgumentsException(path);
                }
                try {
                    if (getRecordForPath(path) != null) {
                        throw new KeeperException.NodeExistsException(path);
                    }
                } catch (KeeperException.NoNodeException e) {
                    // ignore this one
                }
                boolean ephemeralParent = parentRecord.stat.getEphemeralOwner() != 0;
                if (ephemeralParent) {
                    throw new KeeperException.NoChildrenForEphemeralsException(
                            path);
                }
                txn = new CreateTxn(path, createRequest.getData(),
                        createRequest.getAcl(), createMode.isEphemeral());
                StatPersisted s = new StatPersisted();
                if (createMode.isEphemeral()) {
                    s.setEphemeralOwner(request.sessionId);
                }
                parentRecord = parentRecord.duplicate(txnHeader.getZxid());
                parentRecord.childCount++;
                parentRecord.stat
                        .setCversion(parentRecord.stat.getCversion() + 1);
                addChangeRecord(parentRecord);
                addChangeRecord(new ChangeRecord(txnHeader.getZxid(), path, s,
                        0, createRequest.getAcl()));

                break;
            case OpCode.delete:
                txnHeader = new TxnHeader(request.sessionId, request.cxid,
                        txnId, getTime(), OpCode.delete);
View Full Code Here

Examples of org.dmd.dmp.server.extended.CreateRequest

  @Override
  public CreateResponseDMO create(CreateRequestDMO createRequest) {
    // All requests are immediately wrapped for use on the server. This includes
    // associating the request with the originating HttpServletRequest.
    CreateRequest   request    = new CreateRequest(createRequest, getThreadLocalRequest());
    CreateResponse  response   = null;
   
    if (request.isTrackingEnabled())
      logger.trace("Received by DMP servlet:\n" + request.toOIF());
   
    try {
      response = (CreateResponse) pluginManager.getSecurityManager().validateSession(request);
     
      if (response == null){
        SessionRI session = pluginManager.getSecurityManager().getSession(request);

        response = session.handleCreateRequest(request);
      }
    } catch (DmcValueException e) {
      response = (CreateResponse) request.getErrorResponse();
      response.setResponseText(e.toString());
     
      e.printStackTrace();
    }   
View Full Code Here

Examples of org.dmd.dmp.server.extended.CreateRequest

        super(new CreateRequestDMO(mods), org.dmd.dmp.server.generated.DmpSchemaAG._CreateRequest);
    }

    // Generated from: org.dmd.dmg.generators.BaseDMWGeneratorNewest.dumpWrapper(BaseDMWGeneratorNewest.java:470)
    public CreateRequest getModificationRecorder(){
        CreateRequest rc = new CreateRequest();
        rc.setModifier(new DmcTypeModifierMV(MetaDMSAG.__modify));
        return(rc);
    }
View Full Code Here

Examples of org.dmd.dmp.server.extended.CreateRequest

    public CreateRequestDMW(CreateRequestDMO obj) {
        super(obj, org.dmd.dmp.server.generated.DmpSchemaAG._CreateRequest);
    }

    public CreateRequest cloneIt() {
        CreateRequest rc = new CreateRequest();
        rc.setDmcObject(getDMO().cloneIt());
        return(rc);
    }
View Full Code Here

Examples of org.eclipse.gef.requests.CreateRequest

    this.main = main;
  }

  protected Request createTargetRequest()
  {
    CreateRequest request = new CreateRequest();
    return request;
  }
View Full Code Here

Examples of org.eclipse.gef.requests.CreateRequest

  /**
   * Adds a new entry to the category. Returns the new model object.
   */
  protected Object addEntry() {
    CreateRequest request = new CreateRequest();
    request.setFactory(getCreationFactory());
    Command command = getCommand(request);
    getCommandStack().execute(command);
    Object newObject = request.getNewObject();
    // Select the new item after creation
    selectEditPart(newObject);
    return newObject;
  }
View Full Code Here

Examples of org.eclipse.wb.gef.core.requests.CreateRequest

  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected boolean isRequestCondition(Request request) {
    // we understand only LayoutInfo drop
    if (request.getType() == Request.REQ_CREATE) {
      CreateRequest createRequest = (CreateRequest) request;
      return createRequest.getNewObject() instanceof LayoutInfo;
    }
    return false;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.