Package com.ibm.sbt.services.client

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


    checkVersion();
    String recommendationsUrl = ForumUrls.RECOMMENDATION_ENTRIES.format(this, ForumUrls.postPart(postUuid));
    Recommendation recommendation;
    // not using transformer, as the payload to be sent is constant
    String payload = "<entry xmlns='http://www.w3.org/2005/Atom'><category scheme='http://www.ibm.com/xmlns/prod/sn/type' term='recommendation'></category></entry>";
    Response response = createData(recommendationsUrl, null, null,payload);
    checkResponseCode(response, HTTPCode.CREATED);
    recommendation = getRecommendationFeedHandler().createEntity(response);

    return recommendation;
  }
View Full Code Here


            requestUri = FileUrls.USERLIBRARY_DOCUMENT_FEED.format(this,
                    FileUrlParts.accessType.get(accessType), FileUrlParts.userId.get(userId),
                    FileUrlParts.fileId.get(fileId));
        }
        String payload = new CommentSerializer(comment).generateCommentUpdatePayload();
        Response response = createData(requestUri, null, new ClientService.ContentString(payload,
                CommonConstants.APPLICATION_ATOM_XML));
        checkResponseCode(response, HTTPCode.CREATED);
        Comment ret = getCommentFeedHandler().createEntity(response);
        comment.clearFieldsMap();
        comment.setDataHandler(ret.getDataHandler());
View Full Code Here

   * @throws ClientServicesException
   */
  public void deleteRecommendation(String postUuid) throws ClientServicesException{
    checkVersion();
    String recommendationsUrl = ForumUrls.RECOMMENDATION_ENTRIES.format(this, ForumUrls.postPart(postUuid));
    Response response = deleteData(recommendationsUrl, null, null);
    checkResponseCode(response, HTTPCode.NO_CONTENT);
  }
View Full Code Here

      throw new ClientServicesException(null,"Topic object passed was null");
    }
    ForumSerializer serializer = new ForumSerializer(topic);

    String postUrl = ForumUrls.COMMUNITY_TOPICS.format(this, ForumUrls.communityPart(communityUuid));
    Response response = createData(postUrl, null, getAtomHeaders(), serializer.generateCreate());
    checkResponseCode(response, HTTPCode.CREATED);
    topic = getForumTopicFeedHandler().createEntity(response);

    return topic;
  }
View Full Code Here

                FileUrlParts.accessType.get(accessType), FileUrlParts.communityId.get(communityId),
                FileUrlParts.fileId.get(fileId));
        Comment c = new Comment(this, null);
        c.setContent(comment);
        String payload = new CommentSerializer(c).generateCommentUpdatePayload();
        Response result = createData(requestUri, null, new ClientService.ContentString(payload,
                CommonConstants.APPLICATION_ATOM_XML));
        return getCommentFeedHandler().createEntity(result);
    }
View Full Code Here

        Comment c = new Comment(this, null);
        c.setContent(comment);
        String payload = new CommentSerializer(c).generateCommentUpdatePayload();
        Map<String, String> headers = new HashMap<String, String>();
        Response result = createData(requestUri, params, headers, new ClientService.ContentString(
                payload, CommonConstants.APPLICATION_ATOM_XML));
        return getCommentFeedHandler().createEntity(result);
    }
View Full Code Here

                    FileUrlParts.fileId.get(fileId));
        }
        Map<String, String> params = new HashMap<String, String>();
        params.put(FileRequestParams.UNDELETE.getFileRequestParams(), CommonConstants.TRUE);
        Map<String, String> headers = new HashMap<String, String>();
        Response data = updateData(requestUri, params, headers, null, null);
        return getFileFeedHandler().createEntity(data);
    }
View Full Code Here

    if (null == blog) {
      throw new ClientServicesException(null,"null blog");
    }
    BlogSerializer serializer = new BlogSerializer(blog);
    String payload = serializer.createPayload();
    Response response = createData(requestUrl, parameters, getAtomHeaders(), payload);
    checkResponseCode(response, HTTPCode.CREATED);
    blog = getBlogFeedHandler().createEntity(response);
    return blog;
  }
View Full Code Here

    BlogSerializer serializer = new BlogSerializer(blog);
    String payload = serializer.updatePayload();
   
    String updateBlogUrl = BlogUrls.GET_UPDATE_REMOVE_BLOG.format(this, BlogUrlParts.blogHandle.get(defaultHomepageHandle), BlogUrlParts.entryAnchor.get(blog.getUid()));
    Response response = updateData(updateBlogUrl, null, payload, null);
    checkResponseCode(response, HTTPCode.OK);
  }
View Full Code Here

   *         blogUuid which is to be deleted
   * @throws ClientServicesException
   */
  public void deleteBlog(String blogUuid) throws ClientServicesException {
    String deleteBlogUrl = BlogUrls.GET_UPDATE_REMOVE_BLOG.format(this, BlogUrlParts.blogHandle.get(defaultHomepageHandle), BlogUrlParts.entryAnchor.get(blogUuid));
    Response response = getClientService().delete(deleteBlogUrl);
    checkResponseCode(response, HTTPCode.NO_CONTENT);
  }
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.