Package com.ibm.sbt.services.client

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


     * @throws IOException
     */
    private File uploadNewVersion(String requestUri, ContentStream stream, Map<String, String> params,
            Map<String, String> headers) throws ClientServicesException {
        //TODO: check get data wrapping
        Response result = updateData(requestUri, params, headers, stream, null);
        return getFileFeedHandler().createEntity(result);
    }
View Full Code Here


     * @throws IOException
     */
    public void changePassword(JsonJavaObject userCredentialObject) throws BssException {
    try {
      String serviceUrl = BssUrls.API_AUTHENTICATION_CHANGEPASSWORD.format(this);
      Response response = createData(serviceUrl, null, JsonHeader, userCredentialObject, ClientService.FORMAT_JSON);
       
        // expect a 204
        int statusCode = response.getResponse().getStatusLine().getStatusCode();
        if (statusCode != 204) {
          throw new BssException(response, "Error changing password {0}", userCredentialObject);
        }
    } catch (Exception e) {
      throw new BssException(e, "Error changing password {0} caused by {1]", userCredentialObject, e.getMessage());     
View Full Code Here

     * @throws BssException
     */
    public void resetPassword(String loginName) throws BssException {
    try {
      String serviceUrl = BssUrls.API_AUTHENTICATION_RESETPASSWORD.format(this, new NamedUrlPart("loginName", loginName));
      Response response = createData(serviceUrl, null, null);
       
        // expect a 204
        int statusCode = response.getResponse().getStatusLine().getStatusCode();
        if (statusCode != 204) {
          throw new BssException(response, "Error resetting password {0}", loginName);
        }
    } catch (Exception e) {
      throw new BssException(e, "Error resetting password {0} caused by {1}", loginName, e.getMessage());     
View Full Code Here

     * @throws BssException
     */
    public void setOneTimePassword(JsonJavaObject userCredentialObject) throws BssException {
    try {
      String serviceUrl = BssUrls.API_AUTHENTICATION_SETONETIMEPASSWORD.format(this);
      Response response = createData(serviceUrl, null, JsonHeader, userCredentialObject, ClientService.FORMAT_JSON);
       
        // expect a 204
        int statusCode = response.getResponse().getStatusLine().getStatusCode();
        if (statusCode != 204) {
          throw new BssException(response, "Error setting one time password {0}", userCredentialObject);
        }
    } catch (Exception e) {
      throw new BssException(e, "Error setting one time password {0} caused by {1}", userCredentialObject, e.getMessage());     
View Full Code Here

     * @throws BssException
     */
    public void setUserPassword(JsonJavaObject userCredentialObject, boolean bypassPolicy) throws BssException {
    try {
      String serviceUrl = BssUrls.API_AUTHENTICATION_SETUSERPASSWORD.format(this, new NamedUrlPart("bypassPolicy", bypassPolicy ? "true" : "false"));
        Response response = createData(serviceUrl, null, JsonHeader, userCredentialObject, ClientService.FORMAT_JSON);
       
        // expect a 204
        int statusCode = response.getResponse().getStatusLine().getStatusCode();
        if (statusCode != 204) {
          throw new BssException(response, "Error setting one time password {0}", userCredentialObject);
        }
    } catch (Exception e) {
      throw new BssException(e, "Error setting one time password {0} caused by {1}", userCredentialObject, e.getMessage());     
View Full Code Here

    return moveFieldToEntry(destinationUuid, fieldUuid, parameters);
  }

  public ActivityNode moveFieldToEntry(String destinationUuid, String fieldUuid, Map<String, String> parameters) throws ClientServicesException {
    String requestUrl = ActivityUrls.MOVE_FIELD.format(this, ActivityUrls.destinationPart(destinationUuid), ActivityUrls.fieldPart(fieldUuid));
    Response response = putData(requestUrl, parameters, getAtomHeaders(), null, null);
    checkResponseCode(response, HTTPCode.OK);

    return getActivityNodeFeedHandler(false).createEntity(response);
  }
View Full Code Here

    return this.moveNode(nodeUuid, destinationUuid, null);
  }

  public ActivityNode moveNode(String nodeUuid, String destinationUuid, Map<String, String> parameters) throws ClientServicesException {
    String requestUrl = ActivityUrls.MOVE_NODE.format(this, ActivityUrls.activityNodePart(nodeUuid), ActivityUrls.destinationPart(destinationUuid));
    Response response = createData(requestUrl, parameters, getAtomHeaders(), null, null);
    checkResponseCode(response, HTTPCode.OK);

    return getActivityNodeFeedHandler(false).createEntity(response);
  }
View Full Code Here

    return this.copyNode(nodeUuid, destinationUuid, null);
  }

  public ActivityNode copyNode(String nodeUuid, String destinationUuid, Map<String, String> parameters) throws ClientServicesException {
    String requestUrl = ActivityUrls.COPY_NODE.format(this, ActivityUrls.activityNodePart(nodeUuid), ActivityUrls.destinationPart(destinationUuid));
    Response response = createData(requestUrl, parameters, getAtomHeaders(), null, null);
    checkResponseCode(response, HTTPCode.OK);

    return getActivityNodeFeedHandler(false).createEntity(response);
  }
View Full Code Here

  protected Activity createActivityEntity(String requestUrl, Activity activity, Map<String, String> parameters) throws ClientServicesException {
    try {
      ActivitySerializer serializer = new ActivitySerializer(activity);
      Map<String, String> headers = activity.hasAttachments() ? getMultipartHeaders() : getAtomHeaders();
      Response response = createData(requestUrl, parameters, headers, serializer.generateCreate());
      checkResponseCode(response, HTTPCode.CREATED);
      return updateActivityEntityData(activity, response);
    } catch (ClientServicesException e) {
      throw e;
    } catch (Exception e) {
View Full Code Here

  protected void createMembers(String requestUrl, List<Member> members, Map<String, String> parameters) throws ClientServicesException {
    try {
      MemberSerializer serializer = new MemberSerializer(members.get(0));

      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

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.