Package org.apache.abdera.protocol.client

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


            return resp.getLocation().toString().substring(baseURI.length());
        } else {
            String msg = "Adding comment for resourcePath + " + resourcePath + " failed." +
                    ", Response Status: " + resp.getStatus() +
                    ", Response Type: " + resp.getType();
            abderaClient.teardown();
            log.error(msg);
            throw new RegistryException(msg);
        }
    }
View Full Code Here


            if (log.isDebugEnabled()) {
                log.debug("Editing comment for resourcePath + " + commentPath + " succeeded." +
                        ", Response Status: " + resp.getStatus() +
                        ", Response Type: " + resp.getType());
            }
            abderaClient.teardown();
        } else {
            String msg = "Editing comment for resourcePath + " + commentPath + " failed." +
                    ", Response Status: " + resp.getStatus() +
                    ", Response Type: " + resp.getType();
            abderaClient.teardown();
View Full Code Here

            abderaClient.teardown();
        } else {
            String msg = "Editing comment for resourcePath + " + commentPath + " failed." +
                    ", Response Status: " + resp.getStatus() +
                    ", Response Type: " + resp.getType();
            abderaClient.teardown();
            log.error(msg);
            throw new RegistryException(msg);
        }
    }
View Full Code Here

                        getAuthorization());
        Document introspection = clientResponse.getDocument();
        Element element = introspection.getRoot();
        Feed feed = (Feed) element;
        org.wso2.carbon.registry.core.Comment[] comments = getCommentsFromFeed(feed);
        abderaClient.teardown();

        return comments;
    }

    // method to obtain comments from feed.
View Full Code Here

            if (log.isDebugEnabled()) {
                log.debug("rating resource + " + resourcePath + " succeeded." +
                        ", Response Status: " + resp.getStatus() +
                        ", Response Type: " + resp.getType());
            }
            abderaClient.teardown();
        } else {
            String msg = "rating resource + " + resourcePath + " failed." +
                    ", Response Status: " + resp.getStatus() +
                    ", Response Type: " + resp.getType();
View Full Code Here

        } else {
            String msg = "rating resource + " + resourcePath + " failed." +
                    ", Response Status: " + resp.getStatus() +
                    ", Response Type: " + resp.getType();

            abderaClient.teardown();
            log.error(msg);
            throw new RegistryException(msg);
        }
    }
View Full Code Here

        if (clientResponse.getStatus() != 200) {
            // throw RegistryException
            String msg = "Getting average rating failed. Path: " + resourcePath +
                    ", Response Status: " + clientResponse.getStatus() +
                    ", Response Type: " + clientResponse.getType();
            abderaClient.teardown();
            log.error(msg);
            throw new RegistryException(msg);
        }

        Document introspection = clientResponse.getDocument();
View Full Code Here

        Document introspection = clientResponse.getDocument();
        if (introspection.getRoot() instanceof Feed) {
            Feed feed = (Feed) introspection.getRoot();
            String floatValue = feed.getSimpleExtension(APPConstants.QN_AVERAGE_RATING);
            abderaClient.teardown();
            return Float.parseFloat(floatValue);
        }
        return 0;
    }
View Full Code Here

                        getAuthorization());
        Document introspection =
                clientResponse.getDocument();
        Entry entry = (Entry) introspection.getRoot();
        String intValue = entry.getContent();
        abderaClient.teardown();
        return Integer.parseInt(intValue);
    }

    public Collection executeQuery(String path, Map parameters) throws RegistryException {
        AbderaClient abderaClient = new AbderaClient(abdera);
View Full Code Here

                buildQueryString(parameters),
                requestOptions);
        Document introspection = resp.getDocument();
        Feed feed = (Feed) introspection.getRoot();
        Collection c = createResourceFromFeed(feed);
        abderaClient.teardown();
        return c;
    }

    /**
     * Method to build the query string from a parameter map.
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.