Package org.wso2.carbon.registry.core.exceptions

Examples of org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException


    }

    public byte[] getProcessImage(String processId) {

        QName qName = decode(processId);
        SVGInterface svg = createSVG(qName);
        return svg.toPNGBytes();
    }
View Full Code Here


    private SVGInterface createSVG(QName qName) {

        // generate new
        InputStream in = getBpelDescriptor(qName);

        SVGInterface svg = null;

        try {
            svg = BPEL2SVGUtil.generate(in);

            if (svg == null)
View Full Code Here

   
    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here

        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

        }

        // get the source resource
        ResourceImpl sourceResource = (ResourceImpl) getMetaData(oldPath);
        if (sourceResource == null) {
            throw new ResourceNotFoundException(oldPath);
        }
        ResourceIDImpl sourceID = sourceResource.getResourceIDImpl();

        if (!(sourceResource instanceof CollectionImpl)) {
            prepareMove(oldPath, newPath);
View Full Code Here

        }
        if (clientResponse.getType() == Response.ResponseType.CLIENT_ERROR ||
                clientResponse.getType() == Response.ResponseType.SERVER_ERROR) {
            if (clientResponse.getStatus() == 404) {
                abderaClient.teardown();
                throw new ResourceNotFoundException(path);
            }
            abderaClient.teardown();
            throw new RegistryException(clientResponse.getStatusText());
        }

        if (clientResponse.getStatus() == 304) {
            abderaClient.teardown();
            /*do caching here */
            log.debug(
                    "Cached resource returned since no modification has been done on the resource");
            return cache.getCachedResource(path);
        }
        String eTag = clientResponse.getHeader("ETag");
        Element introspection = clientResponse.getDocument().getRoot();
        ResourceImpl resource;
        if (introspection instanceof Feed) {
            // This is a collection
            Feed feed = (Feed) introspection;
            String state = feed.getSimpleExtension(new QName(APPConstants.NAMESPACE, "state"));
            if (state != null && state.equals("Deleted")) {
                abderaClient.teardown();
                throw new ResourceNotFoundException(path);
            }
            resource = createResourceFromFeed(feed);
        } else {
            Entry entry = (Entry) introspection;
            resource = createResourceFromEntry(entry);
View Full Code Here

                        "?start=" + start + "&pageLen=" + pageSize, getAuthorization());
        if (clientResponse.getType() == Response.ResponseType.CLIENT_ERROR ||
                clientResponse.getType() == Response.ResponseType.SERVER_ERROR) {
            if (clientResponse.getStatus() == 404) {
                abderaClient.teardown();
                throw new ResourceNotFoundException(path);
            }
            abderaClient.teardown();
            throw new RegistryException(clientResponse.getStatusText());
        }
        Element introspection = clientResponse.getDocument().getRoot();
        if (!(introspection instanceof Feed)) {
            abderaClient.teardown();
            throw new RegistryException("Got " + introspection.getQName() +
                    " when expecting <feed>!");
        }
        CollectionImpl resource;
        // This is a collection
        Feed feed = (Feed) introspection;
        String state = feed.getSimpleExtension(new QName(APPConstants.NAMESPACE, "state"));
        if (state != null && state.equals("Deleted")) {
            abderaClient.teardown();
            throw new ResourceNotFoundException(path);
        }
        resource = createResourceFromFeed(feed);
        abderaClient.teardown();
        return resource;
    }
View Full Code Here

                        getAuthorization());
        final int status = clientResponse.getStatus();
        if (status < 200 || status > 299) {
            RegistryException e;
            if (status == 404) {
                e = new ResourceNotFoundException(path);
            } else {
                e = new RegistryException("Response Status: " + clientResponse.getStatusText());
            }
            abderaClient.teardown();
            throw e;
View Full Code Here

                    resourcePath + ". " + e.getMessage();
            log.error(msg, e);
            throw e;
        }
        if (entryBean == null) {
            throw new ResourceNotFoundException("The resource does not exist");
        }
        return entryBean;
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException

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.