Package com.cloud.bridge.service.exception

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


                    jsonElementToResolveAt = ((JsonObject)jsonElementToResolveAt).get(_propName);
                } else {
                    if (jsonElementToResolveAt.isJsonNull())
                        throw new NullPointerException(String.format("Property %s points to a null element on object: %s", _propName, jsonElementToResolveAt.toString()));

                    throw new InternalErrorException("Unable to evaluate JSON accessor property: " + _propName + ", on object: " + jsonElementToResolveAt.toString());
                }
            }

            if (jsonElementToResolveAt instanceof JsonArray) {
                return ((JsonArray)jsonElementToResolveAt).get(_index);
            }

            if (jsonElementToResolveAt.isJsonNull())
                throw new NullPointerException(String.format("Property %s points to a null element on object: %s", _propName, jsonElementToResolveAt.toString()));

            throw new InternalErrorException("Unable to evaluate JSON accessor property: " + _propName + ", on object: " + jsonElementToResolveAt.toString());
        }
View Full Code Here


    // To make things simple, only allow one local mounted storage root
    String localStorageRoot = ServiceProvider.getInstance().getStartupProperties().getProperty("storage.root");
    if(localStorageRoot != null) {
      SHost localSHost = shostDao.getLocalStorageHost(mhost.getId(), localStorageRoot);
      if(localSHost == null)
        throw new InternalErrorException("storage.root is configured but not initialized");
     
      S3BucketAdapter bucketAdapter =  getStorageHostBucketAdapter(localSHost);
      bucketAdapter.createContainer(localSHost.getExportRoot(),(null != overrideName ? overrideName : bucketName));
      return new Tuple<SHost, String>(localSHost, localStorageRoot);
    }
View Full Code Here

 
  public S3BucketAdapter getStorageHostBucketAdapter(SHost shost)
  {
    S3BucketAdapter adapter = bucketAdapters.get(shost.getHostType());
    if(adapter == null)
      throw new InternalErrorException("Bucket adapter is not installed for host type: " + shost.getHostType());
   
    return adapter;
  }
View Full Code Here

  }
 
  public JsonElement eval(String propPath) {
    JsonElement jsonElement = tryEval(propPath);
    if(jsonElement == null)
      throw new InternalErrorException("Property " + propPath + " is resolved to null JSON element on object: " + _json.toString());

    return jsonElement;
  }
View Full Code Here

        return ((JsonObject)jsonElementToResolveAt).get(_propName);

      if(jsonElementToResolveAt.isJsonNull())
        throw new NullPointerException(String.format("Property %s points to a null element on object: %s", _propName, jsonElementToResolveAt.toString()));
     
      throw new InternalErrorException("Unable to evaluate JSON accessor property: " + _propName
        + ", on object: " + jsonElementToResolveAt.toString());
    }
View Full Code Here

           ((Group)grantee).setURI( "http://acs.amazonaws.com/groups/global/Authenticated" );
           grants[i].setGrantee(grantee);
           break;
         
        default :
          throw new InternalErrorException("Unsupported grantee type");
        }
       
       
        switch( engineGrants[i].getPermission()) {
        case SAcl.PERMISSION_READ:      grants[i].setPermission(Permission.READ);   break;
View Full Code Here

   
    try {
      md5 = MessageDigest.getInstance("MD5");
    } catch (NoSuchAlgorithmException e) {
      logger.error("Unexpected exception " + e.getMessage(), e);
      throw new InternalErrorException("Unable to get MD5 MessageDigest", e);
    }
   
    File file = new File(getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName);
    try {
      // -> when versioning is off we need to rewrite the file contents
View Full Code Here

   
    try {
      md5 = MessageDigest.getInstance("MD5");
    } catch (NoSuchAlgorithmException e) {
      logger.error("Unexpected exception " + e.getMessage(), e);
      throw new InternalErrorException("Unable to get MD5 MessageDigest", e);
    }
   
    File file = new File(getBucketFolderDir(mountedRoot, destBucket) + File.separatorChar + fileName);
    try {
      // -> when versioning is off we need to rewrite the file contents
View Full Code Here

        } else {
          if(jsonElementToResolveAt.isJsonNull())
            throw new NullPointerException(String.format("Property %s points to a null element on object: %s", _propName, jsonElementToResolveAt.toString()));
         
         
          throw new InternalErrorException("Unable to evaluate JSON accessor property: " + _propName
              + ", on object: " + jsonElementToResolveAt.toString());
        }
      }
     
      if(jsonElementToResolveAt instanceof JsonArray) {
        return ((JsonArray)jsonElementToResolveAt).get(_index);
      }

      if(jsonElementToResolveAt.isJsonNull())
        throw new NullPointerException(String.format("Property %s points to a null element on object: %s", _propName, jsonElementToResolveAt.toString()));
     
      throw new InternalErrorException("Unable to evaluate JSON accessor property: " + _propName
          + ", on object: " + jsonElementToResolveAt.toString());
    }
View Full Code Here

    if (annonymous)
      return StringHelper.EMPTY_STRING;
   
    if (accessKey == null) {
      logger.error("Fatal - UserContext has not been correctly setup");
      throw new InternalErrorException("Uninitalized user context");
    }
    return accessKey;
  }
View Full Code Here

TOP

Related Classes of com.cloud.bridge.service.exception.InternalErrorException

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.