Package com.ibm.sbt.services.client

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


    }
    BlogPostSerializer serializer = new BlogPostSerializer(post);
    String payload = serializer.createPayload();

    String createPostUrl = BlogUrls.CREATE_BLOG_POST.format(this, BlogUrlParts.blogHandle.get(blogHandle));
    Response response = createData(createPostUrl, null, getAtomHeaders(), payload);
    checkResponseCode(response, HTTPCode.CREATED);
    post = getBlogPostFeedHandler().createEntity(response);
        return post;
  }
View Full Code Here


     
    BlogPostSerializer serializer = new BlogPostSerializer(post);
    String payload = serializer.updatePayload();
     
    String updatePostUrl = BlogUrls.UPDATE_REMOVE_POST.format(this, BlogUrlParts.blogHandle.get(blogHandle), BlogUrlParts.entryAnchor.get(post.getUid()));
    Response response = updateData(updatePostUrl, null, payload, null);
    checkResponseCode(response, HTTPCode.OK);
    post = getBlogPostFeedHandler().createEntity(response);
    return post;
  }
View Full Code Here

   * @param blogHandle
   * @throws ClientServicesException
   */
  public void deleteBlogPost(String postUuid, String blogHandle) throws ClientServicesException {
    String deletePostUrl = BlogUrls.UPDATE_REMOVE_POST.format(this, BlogUrlParts.blogHandle.get(blogHandle), BlogUrlParts.entryAnchor.get(postUuid));
    Response response = getClientService().delete(deletePostUrl);
    checkResponseCode(response, HTTPCode.NO_CONTENT);
  }
View Full Code Here

   */
  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();

    String createCommentUrl = BlogUrls.CREATE_COMMENT.format(this, BlogUrlParts.blogHandle.get(blogHandle), BlogUrlParts.entryAnchor.get(""));
View Full Code Here

   * @return Comment
   * @throws ClientServicesException
   */
  public void deleteBlogComment(String blogHandle, String commentUuid) throws ClientServicesException {
    String getCommentUrl = BlogUrls.GET_REMOVE_COMMENT.format(this, BlogUrlParts.blogHandle.get(blogHandle), BlogUrlParts.entryAnchor.get(commentUuid));
    Response response = getClientService().delete(getCommentUrl);
    checkResponseCode(response, HTTPCode.NO_CONTENT);
  }
View Full Code Here

        headers.put(Headers.ContentType, Headers.ATOM);
        Comment c = new Comment(this, null);
        c.setContent(comment);
        c.setId(commentId);
        String payload = new CommentSerializer(c).generateCommentUpdatePayload();
        Response result = updateData(requestUri, params, headers, payload, null);
        return getCommentFeedHandler().createEntity(result);
    }
View Full Code Here

        String requestUri = FileUrls.COMMUNITY_FILE_METADATA.format(this,
                FileUrlParts.accessType.get(accessType), FileUrlParts.communityLibraryId.get(communityLibraryId),
                FileUrlParts.fileId.get(fileEntry.getFileId()));
        String updateFilePayload = new FileSerializer(fileEntry).generateFileUpdatePayload();
       
        Response result = updateData(requestUri, params, new ClientService.ContentString(
                updateFilePayload, "application/atom+xml"), null);
        File r = getFileFeedHandler().createEntity(result);
        fileEntry.clearFieldsMap();
        fileEntry.setDataHandler(r.getDataHandler());
        return fileEntry;
View Full Code Here

        String requestUri = FileUrls.COMMUNITYLIBRARY_FEED.format(this,
                FileUrlParts.accessType.get(accessType), FileUrlParts.communityId.get(communityId));
        Content contentFile = getContentObject(title, iStream, length);
        Map<String, String> headers = new HashMap<String, String>();
        headers.put(FileConstants.X_UPDATE_NONCE, getNonce()); // It is not clearly documented which Content Type requires Nonce, thus adding nonce in header for all upload requests.
        Response data = createData(requestUri, null, headers, contentFile);
        return getFileFeedHandler().createEntity(data);
    }
View Full Code Here

        Content contentFile = getContentObject(title, iStream);
        Map<String, String> headers = new HashMap<String, String>();
        headers.put(FileConstants.X_UPDATE_NONCE, getNonce()); // It is not clearly documented which Content Type requires Nonce, thus adding nonce in header for all upload requests.
        //TODO: check get data wrapping
        Response result = updateData(requestUri, params, headers, contentFile, null);
        return getFileFeedHandler().createEntity(result);
    }
View Full Code Here

     */
    protected Document getFilesModerationServiceDocument() throws ClientServicesException {
        String accessType = AccessType.AUTHENTICATED.getText();
        String requestUri = FileUrls.MODERATION_SERVICE_DOCUMENT.format(this,
                FileUrlParts.accessType.get(accessType));
        Response result = null;
        result = retrieveData(requestUri, null);
        return (Document) result.getData();
    }
View Full Code Here

TOP

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

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.