Package com.cloud.bridge.service.exception

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


        // To make things simple, only allow one local mounted storage root TODO - Change in the future
        String localStorageRoot = ServiceProvider.getInstance().getStartupProperties().getProperty("storage.root");
        if(localStorageRoot != null) {
            SHostVO 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 OrderedPair<SHostVO, String>(localSHost, localStorageRoot);
        }
View Full Code Here


    public S3BucketAdapter getStorageHostBucketAdapter(SHostVO 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

                        ((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);
View Full Code Here

        // To make things simple, only allow one local mounted storage root TODO - Change in the future
        String localStorageRoot = ServiceProvider.getInstance().getStartupProperties().getProperty("storage.root");
        if (localStorageRoot != null) {
            SHostVO 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 OrderedPair<SHostVO, String>(localSHost, localStorageRoot);
        }
View Full Code Here

    }

    public S3BucketAdapter getStorageHostBucketAdapter(SHostVO 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

        try {
            md5 = MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException e) {
            s_logger.error("Unexpected exception " + e.getMessage(), e);
            throw new InternalErrorException("Unable to get MD5 MessageDigest", e);
        }

        File spoolFile = null;
        try {
            spoolFile = File.createTempFile("castor", null);
        } catch (IOException e) {
            s_logger.error("Unexpected exception creating temporary CAStor spool file: " + e.getMessage(), e);
            throw new InternalErrorException("Unable to create temporary CAStor spool file", e);
        }
        try {
            String retVal;
            int streamLen = 0;
            try {
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

    }

    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

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.