Package com.google.feedserver.util

Examples of com.google.feedserver.util.FeedServerClientException


   */
  public FeedServerEntry getEntry(URL entryUrl) throws FeedServerClientException {
    try {
      return service.getEntry(entryUrl, FeedServerEntry.class);
    } catch (IOException e) {
      throw new FeedServerClientException("Error while fetching " + entryUrl, e);
    } catch (ServiceException e) {
      throw new FeedServerClientException(e);
    }
  }
View Full Code Here


  public List<FeedServerEntry> getEntries(URL feedUrl) throws FeedServerClientException {
    try {
      FeedServerFeed feed = service.getFeed(feedUrl, FeedServerFeed.class);
      return feed.getEntries();
    } catch (IOException e) {
      throw new FeedServerClientException("Error while fetching " + feedUrl, e);
    } catch (ServiceException e) {
      throw new FeedServerClientException(e);
    } catch (IllegalArgumentException e) {
      throw new RuntimeException("Invalid bean " + entityClass.getName(), e);
    }
  }
View Full Code Here

   */
  public FeedServerFeed getFeed(URL feedUrl) throws FeedServerClientException {
    try {
      return service.getFeed(feedUrl, FeedServerFeed.class);
    } catch (IOException e) {
      throw new FeedServerClientException("Error while fetching " + feedUrl, e);
    } catch (ServiceException e) {
      throw new FeedServerClientException(e);
    } catch (IllegalArgumentException e) {
      throw new RuntimeException("Invalid bean " + entityClass.getName(), e);
    }
  }
View Full Code Here

   */
  public void deleteEntry(URL entryUrl) throws FeedServerClientException {
    try {
      service.delete(entryUrl);
    } catch (IOException e) {
      throw new FeedServerClientException("Error while deleting " + entryUrl, e);
    } catch (ServiceException e) {
      throw new FeedServerClientException(e);
    }
  }
View Full Code Here

    Object id = getBeanProperty(NAME_ELEMENT, entry.getEntity(entityClass));
    if (id == null) {
      id = getBeanProperty(ID_ELEMENT, entry.getEntity(entityClass));
    }
    if (id == null) {
      throw new FeedServerClientException("name or id is required in the entry to update");
    }
    try {
      URL feedUrl = new URL(baseUrl.toString() + "/" + id);
      LOG.info("deleting entry at feed " + feedUrl);
      deleteEntry(feedUrl);
    } catch (MalformedURLException e) {
      throw new FeedServerClientException("invalid base URL", e);
    }
  }
View Full Code Here

    Object id = getBeanProperty(NAME_ELEMENT, entity);
    if (id == null) {
      id = getBeanProperty(ID_ELEMENT, entity);
    }
    if (id == null) {
      throw new FeedServerClientException("name or id is required in the entry to update");
    }
    try {
      URL feedUrl = new URL(baseUrl.toString() + "/" + id);
      LOG.info("deleting entry at feed " + feedUrl);
      deleteEntry(feedUrl);
    } catch (MalformedURLException e) {
      throw new FeedServerClientException("invalid base URL", e);
    }
  }
View Full Code Here

    Object id = getBeanProperty(NAME_ELEMENT, entry.getEntity(entityClass));
    if (id == null) {
      id = getBeanProperty(ID_ELEMENT, entry.getEntity(entityClass));
    }
    if (id == null) {
      throw new FeedServerClientException("name or id is required in the entry to update");
    }
    try {
      LOG.info("updating entry at feed " + baseUrl + "/" + id);
      URL url = new URL(baseUrl + "/" + id);
      service.update(url, entry);
    } catch (IOException e) {
      throw new FeedServerClientException(e);
    } catch (ServiceException e) {
      throw new FeedServerClientException(e);
    }
  }
View Full Code Here

    try {
      LOG.info("inserting entry at feed " + baseUrl);
      entry = service.insert(baseUrl, entry);
      return (T) entry.getEntity(entity.getClass());
    } catch (IOException e) {
      throw new FeedServerClientException(e);
    } catch (ServiceException e) {
      throw new FeedServerClientException(e);
    }
  }
View Full Code Here

  public void insertEntry(URL baseUrl, FeedServerEntry entry) throws FeedServerClientException {
    try {
      LOG.info("inserting entry at feed " + baseUrl);
      service.insert(baseUrl, entry);
    } catch (IOException e) {
      throw new FeedServerClientException(e);
    } catch (ServiceException e) {
      throw new FeedServerClientException(e);
    }
  }
View Full Code Here

      contentUtil.fillBean((OtherContent) this.getContent(), entity, id);
      return entity;
    } catch (IllegalArgumentException e) {
      throw new RuntimeException("Invalid bean " + entityClass.getName(), e);
    } catch (SAXException e) {
      throw new FeedServerClientException(e);
    } catch (ParserConfigurationException e) {
      throw new RuntimeException("Invalid XML handler", e);
    } catch (IntrospectionException e) {
      throw new RuntimeException("Invalid bean " + entityClass.getName(), e);
    } catch (IllegalAccessException e) {
      throw new RuntimeException("Invalid bean " + entityClass.getName(), e);
    } catch (InvocationTargetException e) {
      throw new RuntimeException("Invalid bean " + entityClass.getName(), e);
    } catch (InstantiationException e) {
      throw new RuntimeException("Could not instantiate bean class" + entityClass.getName());
    } catch (IOException e) {
      throw new FeedServerClientException(e);
    } catch (ParseException e) {
      throw new FeedServerClientException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.feedserver.util.FeedServerClientException

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.