Package com.ibm.sbt.services.client.base

Examples of com.ibm.sbt.services.client.base.NamedUrlPart




    @Override
    public NamedUrlPart getAuthType() {
        return new NamedUrlPart(CommonConstants.AUTH_TYPE, AuthType.BASIC.get());
    }
View Full Code Here


     * @param loginName
     * @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) {
View Full Code Here

     * @param bypassPolicy
     * @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) {
View Full Code Here

 
  @Override
  public NamedUrlPart getAuthType(){
    String auth = super.getAuthType().getValue();
    auth = AuthType.BASIC.get().equalsIgnoreCase(auth)?EMPTY:auth;
    return new NamedUrlPart(AUTH_TYPE, auth);
  }
View Full Code Here

  @Override
  public NamedUrlPart getAuthType(){
    String auth = super.getAuthType().getValue();
    auth = AuthType.BASIC.get().equalsIgnoreCase(auth)?"":auth;
    return new NamedUrlPart("authType", auth);
  }
View Full Code Here

    public EntityList<JsonEntity> getSubscribersByEmail(String email, HashMap<String, String> params) throws BssException {
      if (StringUtil.isEmpty(email)) {
        throw new IllegalArgumentException("Invalid email address");
      }
      try {
      String serviceUrl = BssUrls.API_RESOURCE_GET_SUBSCRIBERS_BY_EMAIL_ADDRESS.format(this, new NamedUrlPart("emailAddress", email));
      return (EntityList<JsonEntity>)getEntities(serviceUrl, params, getJsonFeedHandler());
    } catch (Exception e) {
      throw new BssException(e, "Error retrieving subscriber list by email {0} caused by {1}", email, e.getMessage());
    }
    }
View Full Code Here

    public EntityList<JsonEntity> getSubscribersById(String customerId, Map<String, String> params) throws BssException {
      if (StringUtil.isEmpty(customerId)) {
        throw new IllegalArgumentException("Invalid id");
      }
      try {
      String serviceUrl = BssUrls.API_RESOURCE_GET_SUBSCRIBER_BY_CUSTOMER.format(this, new NamedUrlPart("customerId", customerId));
      return (EntityList<JsonEntity>)getEntities(serviceUrl, params, getJsonFeedHandler());
    } catch (Exception e) {
      throw new BssException(e, "Error retrieving subscriber list by customer id {0} caused by {1}", customerId, e.getMessage());
    }
    }
View Full Code Here

     * @throws BssException
     */
    public JsonEntity entitleSubscriber(String subscriberId, String subscriptionId, boolean acceptTOU) throws BssException {
         try {
           String serviceUrl = BssUrls.API_RESOURCE_ENTITLE_SUBSCRIBER.format(this,
               new NamedUrlPart("subscriberId", subscriberId),
               new NamedUrlPart("subscriptionId", subscriptionId),
               new NamedUrlPart("acceptTOU", acceptTOU ? "true" : "false"));
        Response response = createData(serviceUrl, null, EntitleSubscriberHeader, (Object)null);
        return getJsonFeedHandler().createEntity(response);
    } catch (Exception e) {
      throw new BssException(e, "Error entitling subscriber {0} to {1} with {2} caused by {3}", subscriberId, subscriptionId, acceptTOU, e.getMessage());
    }
View Full Code Here

     * @throws BssException
     */
    public void revokeSubscriber(String subscriberId, String seatId, boolean force) throws BssException {
         try {
           String serviceUrl = BssUrls.API_RESOURCE_REVOKE_SUBSCRIBER.format(this,
               new NamedUrlPart("subscriberId", subscriberId),
               new NamedUrlPart("seatId", seatId),
               new NamedUrlPart("_force", force ? "true" : "false"));
        Response response = createData(serviceUrl, null, RevokeSubscriberHeader, (Object)null);
       
        // expect a 204
        int statusCode = response.getResponse().getStatusLine().getStatusCode();
        if (statusCode != 204) {
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.base.NamedUrlPart

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.