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

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


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


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

    public EntityList<JsonEntity> getCustomerByOrgName(String orgName) throws BssException {
      if (StringUtil.isEmpty(orgName)) {
        throw new IllegalArgumentException("Invalid organization name");
      }
      try {
        String serviceUrl = BssUrls.API_RESOURCE_GET_CUSTOMER_BY_ORGNAME.format(this, new NamedUrlPart("orgName", orgName));
      return (EntityList<JsonEntity>)getEntities(serviceUrl, null, getJsonFeedHandler());
    } catch (Exception e) {
      throw new BssException(e, "Error retrieving customer list by organization name {0} caused by {1]", orgName, e.getMessage());
    }
    }
View Full Code Here

     * @return
     * @throws BssException
     */
    public String[] getRoles(String loginName) throws BssException {
      try {
      String serviceUrl = BssUrls.API_AUTHORIZATION_GETROLELIST.format(this, new NamedUrlPart("loginName", loginName));
      Response serverResponse = createData(serviceUrl, null, null, null, ClientService.FORMAT_JSON);
     
      JsonJavaObject rolesObject = (JsonJavaObject)serverResponse.getData();
      List<Object> roles = rolesObject.getAsList(PROPERTY_LIST);
      return (String[])roles.toArray(new String[roles.size()]);
View Full Code Here

     * @throws BssException
     */
    public void assignRole(String loginName, String role) throws BssException {
      try {
      String serviceUrl = BssUrls.API_AUTHORIZATION_ASSIGNROLE.format(this,
          new NamedUrlPart("loginName", loginName), new NamedUrlPart("role", role));
      Response response = createData(serviceUrl, null, null);
       
        // expect a 204
        int statusCode = response.getResponse().getStatusLine().getStatusCode();
        if (statusCode != 204) {
View Full Code Here

     * @throws BssException
     */
    public void unassignRole(String loginName, String role) throws BssException {
      try {
      String serviceUrl = BssUrls.API_AUTHORIZATION_UNASSIGNROLE.format(this,
          new NamedUrlPart("loginName", loginName), new NamedUrlPart("role", role));
      Response response = createData(serviceUrl, null, null);
       
        // 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) ? "" : auth;
    return new NamedUrlPart("authType", auth);
  }
View Full Code Here

     * @return
     * @throws BssException
     */
    public EntityList<JsonEntity> getWorkflowsByCustomerId(String customerId, int pageNumber, int pageSize) throws BssException {
      try {
        String serviceUrl = BssUrls.API_RESOURCE_GET_WORKFLOW_BY_CUSTOMERID.format(this, new NamedUrlPart("customerId", customerId));       
        HashMap<String, String> params = new HashMap<String, String>();
        params.put("_pageNumber", String.valueOf(pageNumber));
        params.put("_pageSize", String.valueOf(pageSize));
      return (EntityList<JsonEntity>)getEntities(serviceUrl, params, getJsonFeedHandler());
    } catch (Exception e) {   
View Full Code Here

     * @return
     * @throws BssException
     */
    public EntityList<JsonEntity> getWorkflowsByStatus(String workflowStatus, int pageNumber, int pageSize) throws BssException {
      try {
        String serviceUrl = BssUrls.API_RESOURCE_GET_WORKFLOW_BY_STATUS.format(this, new NamedUrlPart("workflowStatus", workflowStatus));       
        HashMap<String, String> params = new HashMap<String, String>();       
        params.put("_pageNumber", String.valueOf(pageNumber));
        params.put("_pageSize", String.valueOf(pageSize));
      return (EntityList<JsonEntity>)getEntities(serviceUrl, params, getJsonFeedHandler());
    } catch (Exception e) {   
View Full Code Here

     * @return
     * @throws BssException
     */
    public EntityList<JsonEntity> getWorkflowsBySubscriberId(String subscriberId, int pageNumber, int pageSize) throws BssException {
      try {
        String serviceUrl = BssUrls.API_RESOURCE_GET_WORKFLOW_BY_SUBSCRIBERID.format(this, new NamedUrlPart("subscriberId", subscriberId));       
        HashMap<String, String> params = new HashMap<String, String>();
        params.put("_pageNumber", String.valueOf(pageNumber));
        params.put("_pageSize", String.valueOf(pageSize));
      return (EntityList<JsonEntity>)getEntities(serviceUrl, params, getJsonFeedHandler());
    } catch (Exception e) {   
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.