/** * Get a list of all customers who are part of the vendor's organization. * * @return * @throws BssException */ public EntityList<JsonEntity> getCustomers() throws BssException { try { String serviceUrl = BssUrls.API_RESOURCE_CUSTOMER.format(this); return (EntityList<JsonEntity>) getEntities(serviceUrl, null, getJsonFeedHandler()); } catch (Exception e) { throw new BssException(e, "Error retrieving customer list caused by {0}", e.getMessage()); } }
/** * Create a customer organization with a contact person. * * @param customerObject * @return JSON object containing * @throws BssException * @throws IOException */ public JsonJavaObject registerCustomer(JsonJavaObject customerObject) throws BssException { try { String serviceUrl = BssUrls.API_RESOURCE_CUSTOMER.format(this); Response serverResponse = createData(serviceUrl, null, JsonHeader, customerObject, ClientService.FORMAT_JSON); return (JsonJavaObject) serverResponse.getData(); } catch (Exception e) { throw new BssException( e, "Error registering customer {0} caused by {1}", customerObject, e.getMessage()); } }
/** * Get a list of all customers who are part of the vendor's organization. * * @param pageNumber * @param pageSize * @return * @throws BssException */ public EntityList<JsonEntity> getCustomers(int pageNumber, int pageSize) throws BssException { try { HashMap<String, String> params = new HashMap<String, String>(); params.put("_pageNumber", String.valueOf(pageNumber)); params.put("_pageSize", String.valueOf(pageSize)); String serviceUrl = BssUrls.API_RESOURCE_CUSTOMER.format(this); return (EntityList<JsonEntity>) getEntities(serviceUrl, params, getJsonFeedHandler()); } catch (Exception e) { throw new BssException(e, "Error retrieving customer list caused by {0}", e.getMessage()); } }