Examples of ObjectAlreadyExistsException


Examples of com.cloud.bridge.service.exception.ObjectAlreadyExistsException

        boolean success = false;
        try {
            txn = Transaction.open(Transaction.AWSAPI_DB);

            if (bucketDao.getByName(request.getBucketName()) != null)
                throw new ObjectAlreadyExistsException("Bucket already exists");

            shost_storagelocation_pair = allocBucketStorageHost(
                    request.getBucketName(), null);
            SBucketVO sbucket = new SBucketVO(request.getBucketName(),
                    DateHelper.currentGMTTime(), UserContext.current()
View Full Code Here

Examples of com.cloud.bridge.service.exception.ObjectAlreadyExistsException

        boolean success = false;
        try {
            txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);

            if (bucketDao.getByName(request.getBucketName()) != null)
                throw new ObjectAlreadyExistsException("Bucket already exists");

            shost_storagelocation_pair = allocBucketStorageHost(request.getBucketName(), null);
            SBucketVO sbucket =
                new SBucketVO(request.getBucketName(), DateHelper.currentGMTTime(), UserContext.current().getCanonicalUserId(), shost_storagelocation_pair.getFirst());
View Full Code Here

Examples of com.cloud.bridge.service.exception.ObjectAlreadyExistsException

      try {
        SBucketDao bucketDao = new SBucketDao();
        SAclDao    aclDao    = new SAclDao();
       
        if (bucketDao.getByName(request.getBucketName()) != null)
          throw new ObjectAlreadyExistsException("Bucket already exists");
         
        shostTuple = allocBucketStorageHost(request.getBucketName(), null);
       
        SBucket sbucket = new SBucket();
        sbucket.setName(request.getBucketName());
View Full Code Here

Examples of org.apache.slide.structure.ObjectAlreadyExistsException

                    "select * from objects where uri= ?");
            statement.setString(1, uri.toString());
            ResultSet res = statement.executeQuery();
            // Parsing result set
            if (res.next()) {
                throw new ObjectAlreadyExistsException(uri.toString());
            }

            closeStatement(statement);
            statement =
                connection.prepareStatement("insert into objects values(?,?)");
View Full Code Here

Examples of org.apache.slide.structure.ObjectAlreadyExistsException

    //----------------------------------------
    public void createObject(Uri uri,ObjectNode aObject)
        throws ServiceAccessException, ObjectAlreadyExistsException {
        try {
            if (object.getUri().equals(uri.toString())) {
                throw new ObjectAlreadyExistsException(uri.toString());
            }
            storeObject(uri,aObject);
        } catch(ObjectNotFoundException e) {
            // Never happens
        }
View Full Code Here

Examples of org.apache.slide.structure.ObjectAlreadyExistsException

    // Object

    public void createObject(Connection connection, Uri uri, ObjectNode object)
        throws ObjectAlreadyExistsException, ServiceAccessException {
        if (!storeObject(connection, uri, object, true))
            throw new ObjectAlreadyExistsException(uri.toString());
    }
View Full Code Here

Examples of org.apache.slide.structure.ObjectAlreadyExistsException

                    "select * from objects where uri= ?");
            statement.setString(1, uri.toString());
            ResultSet res = statement.executeQuery();
            // Parsing result set
            if (res.next()) {
                throw new ObjectAlreadyExistsException(uri.toString());
            }

            closeStatement(statement);
            statement =
                connection.prepareStatement("insert into objects values(?,?)");
View Full Code Here

Examples of org.apache.slide.structure.ObjectAlreadyExistsException

    // Object

    public void createObject(Connection connection, Uri uri, ObjectNode object)
        throws ObjectAlreadyExistsException, ServiceAccessException {
        if (!storeObject(connection, uri, object, true))
            throw new ObjectAlreadyExistsException(uri.toString());
    }
View Full Code Here

Examples of org.apache.slide.structure.ObjectAlreadyExistsException

        try {
            rm.createResource(txId, loadPath, false);
            init();
        } catch (ResourceManagerException e) {
            if (e.getStatus() == ResourceManagerException.ERR_RESOURCE_EXISTS) {
                throw new ObjectAlreadyExistsException(uri.toString());
            } else {
                store.throwInternalError(e, uri);
            }
        }
    }
View Full Code Here

Examples of org.apache.slide.structure.ObjectAlreadyExistsException

      debug("createObject {0}", uri);
      ObjectNode node = (ObjectNode)get(uri.toString());
      if (node == null) {
         put(uri.toString(), object);
      } else {
         throw new ObjectAlreadyExistsException(uri.toString());
      }
   }
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.