Package org.apache.xmlrpc

Examples of org.apache.xmlrpc.XmlRpcClient


    private XmlRpcClient client = null;

    public CrawlDaemonController(String crawlUrlStr)
            throws InstantiationException {
        try {
            client = new XmlRpcClient(new URL(crawlUrlStr));
        } catch (MalformedURLException e) {
            throw new InstantiationException(e.getMessage());
        }
    }
View Full Code Here


            public void setProperty(String arg0, Object arg1) {
            }

        };

        client = new XmlRpcClient(url, transportFactory);
        fileManagerUrl = url;

        if (testConnection && !isAlive()) {
            throw new ConnectionException("Exception connecting to filemgr: ["
                    + this.fileManagerUrl + "]");
View Full Code Here

     */
    public void setFileManagerUrl(URL fileManagerUrl) {
        this.fileManagerUrl = fileManagerUrl;

        // reset the client
        this.client = new XmlRpcClient(fileManagerUrl);
    }
View Full Code Here

        String msg = null;

        boolean detected;
        try
        {
            XmlRpcClient cl = new XmlRpcClient(apiURL);
            Vector<String> params = new Vector<String>(3);
            params.add("0");
            params.add(apiUser);
            params.add(apiPassword);

            Object res = cl.execute("blogger.getUsersBlogs", params);
            detected = (res instanceof List && ((List)res).size() > 0);
        } catch (IOException e)
        {
            LOG.log(Level.FINE, ERR_FAILED_TO_CONTACT, e);
            detected = false;
View Full Code Here

        TargetBlog.Category[] categories = null;

        URL url = getApiURL(blog);
        if (url != null)
        {
            XmlRpcClient cl = new XmlRpcClient(url);
            Vector<String> params = new Vector<String>(3);
            params.add(getBlogID(blog));
            params.add(blog.getUser());
            params.add(blog.getPassword());

            try
            {
                Object res = cl.execute(apiCall, params);
                categories = res == null ? null : parseFetchedCategories(res);
            } catch (IOException e)
            {
                LOG.log(Level.FINE, ERR_FAILED_CATEGORIES, e);
            } catch (XmlRpcException e)
View Full Code Here

        TargetBlog.Blog[] blogs = null;

        URL url = getApiURL(blog);
        if (url != null)
        {
            XmlRpcClient cl = new XmlRpcClient(url);
            Vector<String> params = new Vector<String>(3);
            params.add(getBlogID(blog));
            params.add(blog.getUser());
            params.add(blog.getPassword());

            try
            {
                List bs = (List)cl.execute("blogger.getUsersBlogs", params);
                if (bs != null)
                {
                    blogs = new TargetBlog.Blog[bs.size()];
                    for (int i = 0; i < bs.size(); i++)
                    {
View Full Code Here

        // Excerpt
        if (StringUtils.isNotEmpty(post.excerpt)) content.put("mt_excerpt", post.excerpt.trim());
        setSpecificContentFields(content, post);

        XmlRpcClient cl = new XmlRpcClient(apiURL);
        Vector<Object> params = new Vector<Object>(5);
        params.add(getBlogID(prefs));
        params.add(prefs.getUser());
        params.add(prefs.getPassword());
        params.add(content);
        params.add(post.publish);

        try
        {
            res = cl.execute("metaWeblog.newPost", params);
        } catch (Throwable e)
        {
            throw new WeblogAPIException("Failed to create a post.", e);
        }
View Full Code Here

        if (res != null)
        {
            String postId = (String)res;

            // Setting category
            XmlRpcClient cl = new XmlRpcClient(getApiURL(prefs));
            Vector<Object> params = new Vector<Object>(4);
            params.add(postId);
            params.add(prefs.getUser());
            params.add(prefs.getPassword());

            try
            {
                params.add(packCategories(post.categories));
                cl.execute("mt.setPostCategories", params);
            } catch (Throwable e)
            {
                throw new WeblogAPIException("Failed to set category to a post.", e);
            }
        }
View Full Code Here

      System.out.println(" username=" + username);
      System.out.println(" password=********");
      System.out.println(" name=" + dest);
      System.out.println(" type=" + "");

      XmlRpcClient xmlrpc = new XmlRpcClient(url);
      Vector params = new Vector();
      params.add(blogid);
      params.add(username);
      params.add(password);

      Hashtable struct = new Hashtable();
      struct.put("name", dest);
      struct.put("type", "");
      struct.put("bits", readFile());

      params.add(struct);

      struct = (Hashtable)xmlrpc.execute(handler + ".newMediaObject", params);

      System.out.println("URL for media object is " + struct.get("url"));

    } catch (Exception e) {
      throw new BuildException(e);
View Full Code Here

      System.out.println(" title=" + title);
      System.out.println(" content=" + content);
      System.out.println(" category=" + category);
      System.out.println(" publish=true");

      XmlRpcClient xmlrpc = new XmlRpcClient(url);
      Vector params = new Vector();
      params.add(blogid);
      params.add(username);
      params.add(password);

      Hashtable struct = new Hashtable();
      struct.put("title", title);
      struct.put("description", content);
      Vector categories = new Vector();
      if (category != null) {
        StringTokenizer tok = new StringTokenizer(category, ",");
        while (tok.hasMoreTokens()) {
          categories.add(tok.nextToken().trim());
        }
      }
      struct.put("categories", categories);

      params.add(struct);
      params.add(Boolean.TRUE);
      Object postId = xmlrpc.execute(handler + ".newPost", params);

      System.out.println("New post id is " + postId);

    } catch (Exception e) {
      throw new BuildException(e);
View Full Code Here

TOP

Related Classes of org.apache.xmlrpc.XmlRpcClient

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.