diff --git a/samples/java/bss.provisioning.sample.app/src/main/java/com/ibm/sbt/provisioning/sample/app/services/GRTESubscriber.java b/samples/java/bss.provisioning.sample.app/src/main/java/com/ibm/sbt/provisioning/sample/app/services/GRTESubscriber.java deleted file mode 100644 index 2a61fb857d..0000000000 --- a/samples/java/bss.provisioning.sample.app/src/main/java/com/ibm/sbt/provisioning/sample/app/services/GRTESubscriber.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * © Copyright IBM Corp. 2014 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied. See the License for the specific language governing - * permissions and limitations under the License. - */ -package com.ibm.sbt.provisioning.sample.app.services; - -import com.ibm.sbt.provisioning.sample.app.task.BSSProvisioning; -/** - * This class represents a singleton that encapsulate an instance of - * the class com.ibm.sbt.services.client.smartcloud.bss.GRTESubscriberManagementService - * */ - - -//TODO Temp class Subscriber can be used when rest of code moved to SocialSDK -public class GRTESubscriber { - - private static GRTESubscriber instance = null; - private GRTESubscriberManagementService service; - - private GRTESubscriber() { - this.service = new GRTESubscriberManagementService(BSSProvisioning.getBasicEndpoint()); - } - - public static synchronized GRTESubscriber getInstance() { - if (instance == null) - instance = new GRTESubscriber(); - return instance; - } - - public GRTESubscriberManagementService getService() { - return service; - } -} \ No newline at end of file diff --git a/samples/java/bss.provisioning.sample.app/src/main/java/com/ibm/sbt/provisioning/sample/app/services/GRTESubscriberManagementService.java b/samples/java/bss.provisioning.sample.app/src/main/java/com/ibm/sbt/provisioning/sample/app/services/GRTESubscriberManagementService.java deleted file mode 100644 index 1b1c5fdda8..0000000000 --- a/samples/java/bss.provisioning.sample.app/src/main/java/com/ibm/sbt/provisioning/sample/app/services/GRTESubscriberManagementService.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.ibm.sbt.provisioning.sample.app.services; - -import java.io.IOException; - -import com.ibm.commons.util.io.json.JsonException; -import com.ibm.commons.util.io.json.JsonJavaFactory; -import com.ibm.commons.util.io.json.JsonJavaObject; -import com.ibm.commons.util.io.json.JsonParser; -import com.ibm.sbt.services.client.ClientService; -import com.ibm.sbt.services.client.Response; -import com.ibm.sbt.services.client.smartcloud.bss.BssException; -import com.ibm.sbt.services.client.smartcloud.bss.SubscriberJsonBuilder; -import com.ibm.sbt.services.client.smartcloud.bss.SubscriberManagementService; -import com.ibm.sbt.services.endpoints.Endpoint; - -// TODO Move to SubscriberManagementService when code can be merged to SocialSDK - - -public class GRTESubscriberManagementService extends - SubscriberManagementService { - - /** - * Constructor - * - * @param endpointName - */ - public GRTESubscriberManagementService(Endpoint endpoint) { - super(endpoint); - } - - private static final long serialVersionUID = 2L; - - /** - * Add a subscriber w/ suppressing emails either to the vendor's organization or to the organization of one of the vendor's customers. - * - * @param subscriber - * @return {JsonJavaObject} - * @throws BssException - * @throws JsonException - * @throws IOException - */ - public JsonJavaObject addSubscriberSuppressEmail(SubscriberJsonBuilder subscriber) throws BssException, IOException, JsonException { - return addSubscriberSuppressEmail(subscriber.toJson()); - } - - /** - * Add a subscriber w/ suppressing emails either to the vendor's organization or to the organization of one of the vendor's customers. - * - * @param subscriberJson - * @return {JsonJavaObject} - * @throws BssException - * @throws JsonException - * @throws IOException - */ - public JsonJavaObject addSubscriberSuppressEmail(String subscriberJson) throws BssException, JsonException, IOException { - JsonJavaObject jsonObject = (JsonJavaObject)JsonParser.fromJson(JsonJavaFactory.instanceEx, subscriberJson); - return addSubscriberSuppressEmail(jsonObject); - } - - /** - * Add a subscriber w/ suppressing emails either to the vendor's organization or to the organization of one of the vendor's customers. - * - * @param subscriberJson - * @return JSON object containing - * @throws BssException - * @throws IOException - */ - public JsonJavaObject addSubscriberSuppressEmail(JsonJavaObject subscriberJson) throws BssException { - try { - // TODO add url to BSSUrls when moving to SocialSDK - String serviceUrl = "/api/bss/resource/subscriber?suppressEmail=true"; - Response serverResponse = createData(serviceUrl, null, JsonHeader, subscriberJson, ClientService.FORMAT_JSON); - return (serverResponse == null) ? null : (JsonJavaObject)serverResponse.getData(); - } catch (Exception e) { - throw new BssException(e, "Error adding subscriber {0} caused by {1}", subscriberJson, e.getMessage()); - } - } -}