Examples of teardown()


Examples of org.apache.abdera.protocol.client.AbderaClient.teardown()

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

Examples of org.apache.abdera.protocol.client.AbderaClient.teardown()

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

Examples of org.apache.abdera.protocol.client.AbderaClient.teardown()

        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

Examples of org.apache.abdera.protocol.client.AbderaClient.teardown()

        if (state != null && state.equals("Deleted")) {
            abderaClient.teardown();
            throw new ResourceNotFoundException(path);
        }
        resource = createResourceFromFeed(feed);
        abderaClient.teardown();
        return resource;
    }

    /**
     * This method will generate a resource object representing the Feed object and the logic will
View Full Code Here

Examples of org.apache.abdera.protocol.client.AbderaClient.teardown()

    public boolean resourceExists(String path) throws RegistryException {
        AbderaClient abderaClient = new AbderaClient(abdera);
        ClientResponse response = abderaClient.head(baseURI + APPConstants.ATOM + encodeURL(path),
                getAuthorization());
        boolean exists = (response.getType() == Response.ResponseType.SUCCESS);
        abderaClient.teardown();
        return exists;
    }

    public String put(String suggestedPath, org.wso2.carbon.registry.api.Resource resource)
            throws org.wso2.carbon.registry.api.RegistryException {
View Full Code Here

Examples of org.apache.abdera.protocol.client.AbderaClient.teardown()

        if (resp.getType() == Response.ResponseType.SUCCESS) {
            if (log.isDebugEnabled()) {
//                log.debug(Messages.getMessage("resource.add", suggestedPath));
            }
        } else if (resp.getStatus() == 401) {
            abderaClient.teardown();
            String msg = "User is not authorized to add the resource to " + suggestedPath;
            log.error(msg);
            throw new RegistryException(msg);
        } else {
            String msg = "Add resource fail. Suggested Path: " + suggestedPath +
View Full Code Here

Examples of org.apache.abdera.protocol.client.AbderaClient.teardown()

            throw new RegistryException(msg);
        } else {
            String msg = "Add resource fail. Suggested Path: " + suggestedPath +
                    ", Response Status: " + resp.getStatus() +
                    ", Response Type: " + resp.getType();
            abderaClient.teardown();
            log.error(msg);
            throw new RegistryException(msg);
        }
//        ResourceImpl impl = (ResourceImpl)resource;
//        impl.setPath(resultPath);
View Full Code Here

Examples of org.apache.abdera.protocol.client.AbderaClient.teardown()

//        ResourceImpl impl = (ResourceImpl)resource;
//        impl.setPath(resultPath);
//        // todo - fix this to use util routine?
//        int i = resultPath.lastIndexOf('/');
//        impl.setParentPath(i == 0 ? "/" : resultPath.substring(0, i));
        abderaClient.teardown();
        return suggestedPath;
    }

    /**
     * Method to add resource properties from the properties extension element.
View Full Code Here

Examples of org.apache.abdera.protocol.client.AbderaClient.teardown()

            if (log.isDebugEnabled()) {
                log.debug("resource at " + sourceURL + " imported." +
                        ", Response Status: " + response.getStatus() +
                        ", Response Type: " + response.getType());
            }
            abderaClient.teardown();
            return response.getLocation().toString();
        } else {
            String msg = "failed to import resource at " + sourceURL + "." +
                    ", Response Status: " + response.getStatus() +
                    ", Response Type: " + response.getType();
View Full Code Here

Examples of org.apache.abdera.protocol.client.AbderaClient.teardown()

            return response.getLocation().toString();
        } else {
            String msg = "failed to import resource at " + sourceURL + "." +
                    ", Response Status: " + response.getStatus() +
                    ", Response Type: " + response.getType();
            abderaClient.teardown();
            log.error(msg);
            throw new RegistryException(msg);
        }
    }
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.