Package org.lexev.bestwisethoughts.client.data

Examples of org.lexev.bestwisethoughts.client.data.Author


  public void showAuthorDetailes(final String authorName){
    SwingWorker<Author, Void> swingWorker = new SwingWorker<Author, Void>() {
            @Override
            public Author doInBackground() throws IOException{
              if (authorName == null || authorName.equalsIgnoreCase(Const.K_UNKOWN_AUTHOR_NAME)){
                return new Author();
              }
              Author author = cachedAuthors.getValidValue(authorName);
            if (author!=null){
              return author;
            }
            author =  webServiceREST.getAuthor(authorName);
            cachedAuthors.addAndSaveToFile(author.getName(), author);
            return author;
            }

            @Override
            public void done() {       
                try {
                  Author authorAcquired = get();
                toaster.showToaster(authorAcquired);
                } catch (InterruptedException ignore) {
                } catch (ExecutionException e) {
                  if (e.getCause() != null){
                    if (e.getCause().getClass() == UniformInterfaceException.class){
View Full Code Here


   * @param authorName
   * @return fetched author
   * @throws UniformInterfaceException
   */
  public Author getAuthor(String authorName) throws UniformInterfaceException{
    Author author = getWebService()
      .path("author/get/details")
      .queryParam("authorname", authorName)
      .accept(MediaType.APPLICATION_XML)
      .get(Author.class);
    return author;
View Full Code Here

TOP

Related Classes of org.lexev.bestwisethoughts.client.data.Author

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.