Package com.ibm.sbt.services.client

Examples of com.ibm.sbt.services.client.ClientServicesException


   * Return JSON object returned by the server if available and otherwise returns null.
   * 
   * @return
   */
  public JsonJavaObject getResponseJson() {
    ClientServicesException cse = getClientServicesException(this);
    if (cse != null) {
      String responseBody = cse.getResponseBody();
      if (StringUtil.isNotEmpty(responseBody)) {
        try {
          return (JsonJavaObject)JsonParser.fromJson(JsonJavaFactory.instanceEx, responseBody);
        } catch (JsonException je) {
          logger.log(Level.WARNING, "Unable to parse JSON response: "+responseBody, je);
View Full Code Here


   * @param blogHandle
   * @throws ClientServicesException
   */
  public BlogPost updateBlogPost(BlogPost post, String blogHandle) throws ClientServicesException {
    if (null == post){
      throw new ClientServicesException(null,"null post");
    }
    if(post.getFieldsMap().get(AtomXPath.title)== null)
      post.setTitle(post.getTitle());
    if(post.getFieldsMap().get(AtomXPath.content)== null)
      post.setContent(post.getContent());
View Full Code Here

   * @return Comment
   * @throws ClientServicesException
   */
  public Comment createBlogComment(Comment comment, String blogHandle, String postUuid) throws ClientServicesException {
    if (null == comment){
      throw new ClientServicesException(null,"null comment");
    }
    Response result = null;
    comment.setPostUuid(postUuid);
    BlogCommentSerializer serializer = new BlogCommentSerializer(comment);
    String payload = serializer.createPayload();
View Full Code Here

   * Helper method to return the response status code if the cause is a ClientServicesException.
   *
   * @return
   */
  public int getResponseStatusCode() {
    ClientServicesException cse = getClientServicesException(this);
    if (cse != null) {
      return cse.getResponseStatusCode();
    }
    return 0;
  }
View Full Code Here

    try {
      return getEntity(requestUrl, parameters, getActivityFeedHandler(false));
    } catch (ClientServicesException e) {
      throw e;
    } catch (Exception e) {
      throw new ClientServicesException(e);
    }
  }
View Full Code Here

      checkResponseCode(response, HTTPCode.CREATED);
      return updateActivityEntityData(activity, response);
    } catch (ClientServicesException e) {
      throw e;
    } catch (Exception e) {
      throw new ClientServicesException(e);
    }
  }
View Full Code Here

      Response response = createData(requestUrl, parameters, getAtomHeaders(), serializer.generateMemberFeed(members));
      //checkResponseCode(response, HTTPCode.CREATED);
    } catch (ClientServicesException e) {
      throw e;
    } catch (Exception e) {
      throw new ClientServicesException(e);
    }

  }
View Full Code Here

      Response response = delete(requestUrl, parameters, getAtomHeaders(), null, serializer.generateMemberFeed(members));
      checkResponseCode(response, HTTPCode.OK);
    } catch (ClientServicesException e) {
      throw e;
    } catch (Exception e) {
      throw new ClientServicesException(e);
    }

  }
View Full Code Here

      Response response = putData(requestUrl, parameters, headers, payload, uniqueId);
      checkResponseCode(response, expectedCode);
    } catch (ClientServicesException e) {
      throw e;
    } catch (Exception e) {
      throw new ClientServicesException(e);
    }
  }
View Full Code Here

      Response response = deleteData(requestUrl, parameters, activityUuid);
      checkResponseCode(response, HTTPCode.NO_CONTENT);
    } catch (ClientServicesException e) {
      throw e;
    } catch (Exception e) {
      throw new ClientServicesException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.ClientServicesException

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.