Package org.nimbustools.api.repr

Examples of org.nimbustools.api.repr.CannotTranslateException


        } else if (cmpName.equals(this.getXlargeName())) {
            return this.xlargePublicNetwork;
        } else if (cmpName.equals(this.getCustomName())) {
            return this.customPublicNetwork;
        } else {
            throw new CannotTranslateException(
                    "Unknown instance type '" + cmpName + "'");
        }
    }
View Full Code Here


        } else if (cmpName.equals(this.getXlargeName())) {
            return this.xlargePrivateNetwork;
        } else if (cmpName.equals(this.getCustomName())) {
            return this.customPrivateNetwork;
        } else {
            throw new CannotTranslateException(
                    "Unknown instance type '" + cmpName + "'");
        }
    }
View Full Code Here

            throws CannotTranslateException {

        final String ownerID = this.container.getOwnerID(caller);

        if (ownerID == null) {
            throw new CannotTranslateException("No caller/ownerID?");
        }

        return this.getBaseDirectory() + "/" + ownerID + "/";
    }
View Full Code Here

            throws CannotTranslateException {

        final String ownerID = this.container.getOwnerID(caller);

        if (ownerID == null) {
            throw new CannotTranslateException("Cannot construct file " +
                    "request without owner hash/ID, the file(s) location is " +
                    "based on it");
        }

        // todo: look at RA and construct blankspace request
View Full Code Here

   
    protected VMFile getRootFile(String imageID, String ownerID)
            throws CannotTranslateException {

        if (imageID == null) {
            throw new CannotTranslateException("Request is missing image ID");
        }

        if (ownerID == null) {
            throw new CannotTranslateException("Request is missing image ID");
        }

        String baseDir = this.getBaseDirectory();
        if (baseDir == null) {
            throw new CannotTranslateException("base directory missing");
        }

        final String imageURIstr = baseDir + "/" + ownerID + "/" + imageID;
        URI imageURI;
        try {
            imageURI = new URI(imageURIstr);
        } catch (URISyntaxException e) {
            throw new CannotTranslateException(e.getMessage(), e);
        }

        if (this.scheme != null && this.scheme.equals("scp")) {
            baseDir = baseDir.replaceFirst("gsiftp", "http");
            final URL url;
            try {
                url = new URL(baseDir);
            } catch (MalformedURLException e) {
                throw new CannotTranslateException("unexpected, invalid URL: " +
                        imageURI.toASCIIString(), e);
            }
            if (url.getPort() != 22) {
                String newurl = "scp://";
                newurl += url.getHost();
                newurl += ":22";
                newurl += url.getPath() + "/" + ownerID + "/" + imageID;
                try {
                    imageURI = new URI(newurl);
                } catch (URISyntaxException e) {
                    throw new CannotTranslateException(e.getMessage(), e);
                }
            }
        }

View Full Code Here

                                          String[] nameScoped,
                                          String[] ownerScoped)
                throws Exception {

        if (ownerID == null) {
            throw new CannotTranslateException("Cannot contact repository " +
                    "without owner ID");
        }

        final String directoryURLstr =
                this.getBaseDirectory() + "/" + ownerID + "/";
View Full Code Here

    // -------------------------------------------------------------------------

    public VM getVM(InstanceResource resource) throws CannotTranslateException {

        if (resource == null) {
            throw new CannotTranslateException("no resource?");
        }

        final _VM vm = this.repr._newVM();
        vm.setID(String.valueOf(resource.getID()));
        vm.setGroupID(resource.getGroupId());
View Full Code Here

    }

    private String getDetails(VirtualMachine vm)
            throws CannotTranslateException {
        if (vm == null) {
            throw new CannotTranslateException("null VirtualMachine?");
        }

        String details = null;
        if (this.exposeVMMHostname) {
            details = "VMM=" + vm.getNode();
View Full Code Here

   
    public RequestInfo getRequestInfo(AsyncRequest backfillRequest) throws CannotTranslateException {
        VirtualMachine[] bindings = backfillRequest.getBindings();
       
        if (bindings == null || bindings.length == 0) {
            throw new CannotTranslateException("no resource?");
        }       
       
        final _RequestInfo result = repr._newRequestInfo();
       
        populate(backfillRequest, result);
View Full Code Here

    public SpotRequestInfo getSpotRequest(AsyncRequest siRequest) throws CannotTranslateException {

        VirtualMachine[] bindings = siRequest.getBindings();
       
        if (bindings == null || bindings.length == 0) {
            throw new CannotTranslateException("no resource?");
        }       
       
        final _SpotRequestInfo result = repr._newSpotRequestInfo();

        populate(siRequest, result);       
View Full Code Here

TOP

Related Classes of org.nimbustools.api.repr.CannotTranslateException

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.