Package com.ibm.sbt.services.client

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


        return result;
   }

   public Response putData(String serviceUrl, Map<String, String> parameters, Map<String, String> headers, Object content, String uniqueId) throws ClientServicesException {
       Response result = getClientService().put(serviceUrl, parameters, headers, content, getDataFormat());
      
       if (cacheSize > 0 && uniqueId != null) {
           addDataToCache(uniqueId, content);
       }
View Full Code Here


  }
 
  @Override
  public void readExternal(ObjectInput inputStream) throws IOException, ClassNotFoundException {
    // Retrieve the entity data and other values like endpoint name and service name
    Response data = (Response) inputStream.readObject();
    List<Entity> entities = (List<Entity>) inputStream.readObject();
    BaseService service = (BaseService) inputStream.readObject();
   
    this.requestData = data;
    this.entities = entities;
View Full Code Here

      }
      return repositoryId;
    }
   
  private String getRepositoryId(String repositoryUrl) throws ClientServicesException {
    Response response = endpoint.getClientService().get(repositoryUrl, ClientService.FORMAT_JSON);
    JsonObject result = (JsonObject) response.getData() ;
    JsonObject entry = (JsonObject) result.getJsonProperty("entry");
    if(entry != null) {
      String repId = (String) ((JsonObject)result.getJsonProperty("entry")).getJsonProperty("id");
      if(StringUtil.isNotEmpty(repId)) {
        repId = "p!" + repId.substring("urn:lsid:lconn.ibm.com:profiles.person:".length());
View Full Code Here

   * @return Wiki
   * @throws ClientServicesException
   */
  public Wiki createWiki(Wiki wiki, Map<String, String> parameters) throws ClientServicesException {
    String requestUrl = WikiUrls.ALL_WIKIS.format(this);
    Response response = createWiki(requestUrl, wiki, parameters);
    checkResponseCode(response, HTTPCode.CREATED);
    return getWikiFeedHandler().createEntity(response);
  }
View Full Code Here

   * @throws ClientServicesException
   */
  public void updateWiki(Wiki wiki, Map<String, String> parameters)
      throws ClientServicesException {
    String requestUrl = WikiUrls.WIKI.format(this, WikiUrls.getWikiLabel(wiki.getLabel()));
    Response response = updateWikiAux(requestUrl, wiki, parameters);
    checkResponseCode(response, HTTPCode.OK);
  }
View Full Code Here

   * @param wikiLabel
   * @throws ClientServicesException
   */
  public void deleteWiki(String wikiLabel) throws ClientServicesException {
    String requestUrl = WikiUrls.WIKI.format(this, WikiUrls.getWikiLabel(wikiLabel));
    Response response = deleteData(requestUrl);
    //FIX: According to documentation should return 204 but returns 200
    checkResponseCode(response, HTTPCode.OK);
  }
View Full Code Here

   * @throws ClientServicesException
   */
  public WikiPage createWikiPage(String wikiLabel, WikiPage wikiPage, Map<String, String> parameters) throws ClientServicesException {
    parameters = getParameters(parameters);
    String requestUrl = WikiUrls.WIKI_PAGES.format(this, WikiUrls.getWikiLabel(wikiLabel));
    Response response = createWikiPageAux(requestUrl, wikiPage, parameters);
    checkResponseCode(response, HTTPCode.CREATED);
    return getWikiPageFeedHandler().createEntity(response);
  }
View Full Code Here

   * @throws ClientServicesException
   */
  public void updateWikiPage(String wikiLabel, WikiPage wikiPage,
      Map<String, String> parameters) throws ClientServicesException {
    String requestUrl = WikiUrls.WIKI_PAGE.format(this, WikiUrls.getWikiLabel(wikiLabel), WikiUrls.getWikiPage(wikiPage.getLabel()));
    Response response = updateWikiPageAux(requestUrl, wikiPage, parameters);
    checkResponseCode(response, HTTPCode.OK);
  }
View Full Code Here

   * @param wikiPageLable
   * @throws ClientServicesException
   */
  public void deleteWikiPage(String wikiLabel, String wikiPageLabel) throws ClientServicesException {
    String requestUrl = WikiUrls.WIKI_PAGE.format(this, WikiUrls.getWikiLabel(wikiLabel), WikiUrls.getWikiPage(wikiPageLabel));
    Response response = deleteData(requestUrl);
    checkResponseCode(response, HTTPCode.NO_CONTENT);
  }
View Full Code Here

    else return createResponseFromInputStream(in);
  }
 
  protected static Response createResponseFromInputStream(InputStream inputSteam) {
    try {
      return new Response(DOMUtil.createDocument(inputSteam));
    }
    catch (XMLException e) {
      throw new RuntimeException(e);
    }
  }
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.