From edfe14be6cb0668bc503faf371c225c2cbb542d9 Mon Sep 17 00:00:00 2001 From: hamlakshan Date: Tue, 2 Jul 2019 15:04:22 +0530 Subject: [PATCH] INTGW-608: removed unwanted classes --- .../dep/manageservice/resource/model/App.java | 60 --- .../resource/model/LoginResponse.java | 81 ----- .../manageservice/resource/model/User.java | 60 --- .../resource/model/rate/ApiOperation.java | 112 ------ .../model/rate/ApiOperationRates.java | 73 ---- .../resource/model/rate/AssignedRate.java | 95 ----- .../resource/model/rate/Category.java | 96 ----- .../resource/model/rate/Currency.java | 82 ----- .../resource/model/rate/Operator.java | 95 ----- .../resource/model/rate/RateCard.java | 89 ----- .../resource/model/rate/RateCategory.java | 114 ------ .../resource/model/rate/RateDefinition.java | 162 --------- .../resource/model/rate/RateType.java | 84 ----- .../resource/model/rate/Tariff.java | 214 ----------- .../resource/model/rate/Tax.java | 83 ----- .../resource/model/whitelist/Application.java | 42 --- .../resource/model/workflow/Api.java | 93 ----- .../workflow/ApplicationDetailRequest.java | 118 ------ .../workflow/ApplicationDetailsResponse.java | 92 ----- .../model/workflow/ApplicationTask.java | 267 -------------- .../model/workflow/ApprovalRequest.java | 143 -------- .../model/workflow/ApproveEntity.java | 56 --- .../resource/model/workflow/Assign.java | 52 --- .../model/workflow/AssignRequest.java | 53 --- .../resource/model/workflow/CreateTime.java | 82 ----- .../resource/model/workflow/GraphData.java | 57 --- .../model/workflow/GraphResponse.java | 54 --- .../resource/model/workflow/Metadata.java | 95 ----- .../resource/model/workflow/Operation.java | 94 ----- .../model/workflow/OperationRateResponse.java | 53 --- .../resource/model/workflow/Range.java | 55 --- .../resource/model/workflow/RelevantRate.java | 57 --- .../model/workflow/SearchResponse.java | 60 --- .../resource/model/workflow/Task.java | 344 ------------------ .../model/workflow/TaskDetailsResponse.java | 105 ------ .../model/workflow/TempLoginRespnse.java | 139 ------- .../resource/model/workflow/Variable.java | 68 ---- .../resource/resource/AbstractResource.java | 22 -- .../AuthenticationResource.java | 1 - .../authentication/TempAuthResource.java | 42 --- .../resource/blacklist/ApiResource.java | 25 -- .../resource/quota/QuotaLimitResource.java | 47 --- .../rate/ApiOperationRatesResource.java | 47 --- .../resource/rate/ApiOperationsResource.java | 45 --- .../resource/rate/AssignRateResource.java | 49 --- .../resource/rate/CategoryResource.java | 46 --- .../resource/rate/CurrencyResource.java | 48 --- .../resource/rate/OperatorResource.java | 39 -- .../resource/rate/RateCardResource.java | 49 --- .../resource/rate/RateDefinitionResource.java | 41 --- .../resource/rate/RateTypeResource.java | 42 --- .../resource/rate/TariffResource.java | 46 --- .../resource/resource/rate/TaxResource.java | 41 --- .../whitelist/ApplicationResource.java | 25 -- .../whitelist/SubscriberResource.java | 25 -- .../workflow/ApplicationAssignResource.java | 23 -- .../workflow/ApplicationSearchResource.java | 23 -- .../workflow/ApproveApplicationResource.java | 23 -- .../workflow/ApproveSubscriptionResource.java | 23 -- .../resource/workflow/HistoryResource.java | 22 -- .../resource/service/AbstractService.java | 9 - .../resource/service/ServiceFactory.java | 49 --- .../resource/service/Serviceable.java | 7 - .../authentication/AuthServiceTemp.java | 44 --- .../service/blacklist/ApiService.java | 87 ----- .../service/blacklist/BlackListFactory.java | 35 -- .../clients/LoginAdminServiceClient.java | 41 --- .../service/clients/RoleServiceClient.java | 100 ----- .../clients/SampleUserRoleMgtClient.java | 241 ------------ .../resource/service/quota/QuotaFactory.java | 35 -- .../service/quota/QuotaLimitService.java | 44 --- .../rate/ApiOperationRatesService.java | 156 -------- .../service/rate/ApiOperationsService.java | 82 ----- .../service/rate/AssignRateService.java | 106 ------ .../service/rate/CategoryService.java | 113 ------ .../service/rate/CurrencyService.java | 113 ------ .../service/rate/OperatorService.java | 81 ----- .../service/rate/RateCardService.java | 117 ------ .../service/rate/RateDefinitionService.java | 81 ----- .../resource/service/rate/RateFactory.java | 78 ---- .../resource/service/rate/RateService.java | 89 ----- .../service/rate/RateTypeService.java | 85 ----- .../resource/service/rate/TariffService.java | 112 ------ .../resource/service/rate/TaxService.java | 82 ----- .../validation/MsisdnValidationService.java | 17 - .../service/whitelist/ApplicationService.java | 90 ----- .../service/whitelist/SubscriberService.java | 76 ---- .../service/whitelist/WhiteListFactory.java | 41 --- .../workflow/ApplicationAssignService.java | 66 ---- .../workflow/ApplicationSearchService.java | 327 ----------------- .../workflow/ApproveApplicationService.java | 90 ----- .../workflow/ApproveSubscriptionService.java | 92 ----- .../service/workflow/HistoryService.java | 113 ------ .../util/ApplicationConfiguration.java | 37 -- .../manageservice/resource/util/Messages.java | 22 -- .../resource/util/ServiceTypes.java | 15 - .../resource/util/ServiceUrl.java | 3 - .../src/main/resources/config.yml | 13 - .../resources/configurations12.properties | 6 - 99 files changed, 7468 deletions(-) delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/App.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/LoginResponse.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/User.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/ApiOperation.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/ApiOperationRates.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/AssignedRate.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Category.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Currency.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Operator.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateCard.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateCategory.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateDefinition.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateType.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Tariff.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Tax.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/whitelist/Application.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Api.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApplicationDetailRequest.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApplicationDetailsResponse.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApplicationTask.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApprovalRequest.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApproveEntity.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Assign.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/AssignRequest.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/CreateTime.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/GraphData.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/GraphResponse.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Metadata.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Operation.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/OperationRateResponse.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Range.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/RelevantRate.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/SearchResponse.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Task.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/TaskDetailsResponse.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/TempLoginRespnse.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Variable.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/authentication/TempAuthResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/blacklist/ApiResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/quota/QuotaLimitResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/ApiOperationRatesResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/ApiOperationsResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/AssignRateResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/CategoryResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/CurrencyResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/OperatorResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/RateCardResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/RateDefinitionResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/RateTypeResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/TariffResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/TaxResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/whitelist/ApplicationResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/whitelist/SubscriberResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApplicationAssignResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApplicationSearchResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApproveApplicationResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApproveSubscriptionResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/HistoryResource.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/authentication/AuthServiceTemp.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/blacklist/ApiService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/blacklist/BlackListFactory.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/clients/LoginAdminServiceClient.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/clients/RoleServiceClient.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/clients/SampleUserRoleMgtClient.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/quota/QuotaFactory.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/quota/QuotaLimitService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/ApiOperationRatesService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/ApiOperationsService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/AssignRateService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/CategoryService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/CurrencyService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/OperatorService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateCardService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateDefinitionService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateFactory.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateTypeService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/TariffService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/TaxService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/whitelist/ApplicationService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/whitelist/SubscriberService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/whitelist/WhiteListFactory.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApplicationAssignService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApplicationSearchService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApproveApplicationService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApproveSubscriptionService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/HistoryService.java delete mode 100644 component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/ApplicationConfiguration.java delete mode 100644 component/manage-service/src/main/resources/config.yml delete mode 100644 component/manage-service/src/main/resources/configurations12.properties diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/App.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/App.java deleted file mode 100644 index fcf26c3c..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/App.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model; - -/** - * Created by manoj on 9/15/17. - */ -import java.util.HashMap; -import java.util.Map; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "appId", - "appName" -}) -public class App { - - @JsonProperty("appId") - private Integer appId; - @JsonProperty("appName") - private String appName; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("appId") - public Integer getAppId() { - return appId; - } - - @JsonProperty("appId") - public void setAppId(Integer appId) { - this.appId = appId; - } - - @JsonProperty("appName") - public String getAppName() { - return appName; - } - - @JsonProperty("appName") - public void setAppName(String appName) { - this.appName = appName; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/LoginResponse.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/LoginResponse.java deleted file mode 100644 index f6a2cc7f..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/LoginResponse.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model; - -import javax.xml.bind.annotation.XmlRootElement; - -@Deprecated -@XmlRootElement -public class LoginResponse { - - private String userName; - private String firstName; - private String lastName; - private String emailAddress; - private String organization; - private String department; - private String[] uiPermissions; - private String[] roles; - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String[] getUiPermissions() { - return uiPermissions; - } - - public void setUiPermissions(String[] uiPermissions) { - this.uiPermissions = uiPermissions; - } - - public String[] getRoles() { - return roles; - } - - public void setRoles(String[] roles) { - this.roles = roles; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getEmailAddress() { - return emailAddress; - } - - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - - public String getOrganization() { - return organization; - } - - public void setOrganization(String organization) { - this.organization = organization; - } - - public String getDepartment() { - return department; - } - - public void setDepartment(String department) { - this.department = department; - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/User.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/User.java deleted file mode 100644 index a6f7deff..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/User.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model; - -/** - * Created by manoj on 9/26/17. - */ -import java.util.HashMap; -import java.util.Map; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "userName", - "password" -}) -public class User { - - @JsonProperty("userName") - private String userName; - @JsonProperty("password") - private String password; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("userName") - public String getUserName() { - return userName; - } - - @JsonProperty("userName") - public void setUserName(String userName) { - this.userName = userName; - } - - @JsonProperty("password") - public String getPassword() { - return password; - } - - @JsonProperty("password") - public void setPassword(String password) { - this.password = password; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/ApiOperation.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/ApiOperation.java deleted file mode 100644 index 7ea1750e..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/ApiOperation.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.rate; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ -import java.util.HashMap; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.wso2telco.dep.manageservice.resource.model.workflow.Api; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "apiOperationId", - "api", - "apiOperation", - "apiOperationCode", - "createdBy" -}) -public class ApiOperation implements RequestTransferable { - - @JsonProperty("apiOperationId") - private Integer apiOperationId; - @JsonProperty("api") - private Api api; - @JsonProperty("apiOperation") - private String apiOperation; - @JsonProperty("apiOperationCode") - private String apiOperationCode; - @JsonProperty("createdBy") - private String createdBy; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("apiOperationId") - public Integer getApiOperationId() { - return apiOperationId; - } - - @JsonProperty("apiOperationId") - public void setApiOperationId(Integer apiOperationId) { - this.apiOperationId = apiOperationId; - } - - @JsonProperty("api") - public Api getApi() { - return api; - } - - @JsonProperty("api") - public void setApi(Api api) { - this.api = api; - } - - @JsonProperty("apiOperation") - public String getApiOperation() { - return apiOperation; - } - - @JsonProperty("apiOperation") - public void setApiOperation(String apiOperation) { - this.apiOperation = apiOperation; - } - - @JsonProperty("apiOperationCode") - public String getApiOperationCode() { - return apiOperationCode; - } - - @JsonProperty("apiOperationCode") - public void setApiOperationCode(String apiOperationCode) { - this.apiOperationCode = apiOperationCode; - } - - @JsonProperty("createdBy") - public String getCreatedBy() { - return createdBy; - } - - @JsonProperty("createdBy") - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/ApiOperationRates.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/ApiOperationRates.java deleted file mode 100644 index e9e57393..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/ApiOperationRates.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.rate; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "source", - "destination" -}) -public class ApiOperationRates { - - @JsonProperty("source") - private RateDefinition[] source = null; - @JsonProperty("destination") - private RateDefinition[] destination = null; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("source") - public RateDefinition[] getSource() { - return source; - } - - @JsonProperty("source") - public void setSource(RateDefinition[] source) { - this.source = source; - } - - @JsonProperty("destination") - public RateDefinition[] getDestination() { - return destination; - } - - @JsonProperty("destination") - public void setDestination(RateDefinition[] destination) { - this.destination = destination; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/AssignedRate.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/AssignedRate.java deleted file mode 100644 index a0c5f7fd..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/AssignedRate.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.rate; - -import com.fasterxml.jackson.annotation.*; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; - -import java.util.HashMap; -import java.util.Map; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "operator", - "apiOperation", - "rateDefinition", - "createdBy" -}) -public class AssignedRate implements RequestTransferable { - - @JsonProperty("operator") - private Operator operator; - @JsonProperty("apiOperation") - private ApiOperation apiOperation; - @JsonProperty("rateDefinition") - private RateDefinition rateDefinition; - @JsonProperty("createdBy") - private String createdBy; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("operator") - public Operator getOperator() { - return operator; - } - - @JsonProperty("operator") - public void setOperator(Operator operator) { - this.operator = operator; - } - - @JsonProperty("apiOperation") - public ApiOperation getApiOperation() { - return apiOperation; - } - - @JsonProperty("apiOperation") - public void setApiOperation(ApiOperation apiOperation) { - this.apiOperation = apiOperation; - } - - @JsonProperty("rateDefinition") - public RateDefinition getRateDefinition() { - return rateDefinition; - } - - @JsonProperty("rateDefinition") - public void setRateDefinition(RateDefinition rateDefinition) { - this.rateDefinition = rateDefinition; - } - - @JsonProperty("createdBy") - public String getCreatedBy() { - return createdBy; - } - - @JsonProperty("createdBy") - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Category.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Category.java deleted file mode 100644 index 4131abf6..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Category.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.rate; - -/** - * Created by manoj on 10/11/17. - */ - -import com.fasterxml.jackson.annotation.*; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; - -import java.util.HashMap; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "categoryId", - "categoryName", - "categoryCode", - "categoryDescription", - "createdBy" -}) -public class Category implements RequestTransferable { - - @JsonProperty("categoryId") - private Integer categoryId; - @JsonProperty("categoryName") - private String categoryName; - @JsonProperty("categoryCode") - private String categoryCode; - @JsonProperty("categoryDescription") - private String categoryDescription; - @JsonProperty("createdBy") - private String createdBy; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("categoryId") - public Integer getCategoryId() { - return categoryId; - } - - @JsonProperty("categoryId") - public void setCategoryId(Integer categoryId) { - this.categoryId = categoryId; - } - - @JsonProperty("categoryName") - public String getCategoryName() { - return categoryName; - } - - @JsonProperty("categoryName") - public void setCategoryName(String categoryName) { - this.categoryName = categoryName; - } - - @JsonProperty("categoryCode") - public String getCategoryCode() { - return categoryCode; - } - - @JsonProperty("categoryCode") - public void setCategoryCode(String categoryCode) { - this.categoryCode = categoryCode; - } - - @JsonProperty("categoryDescription") - public String getCategoryDescription() { - return categoryDescription; - } - - @JsonProperty("categoryDescription") - public void setCategoryDescription(String categoryDescription) { - this.categoryDescription = categoryDescription; - } - - @JsonProperty("createdBy") - public String getCreatedBy() { - return createdBy; - } - - @JsonProperty("createdBy") - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Currency.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Currency.java deleted file mode 100644 index a8fe280e..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Currency.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.rate; - -/** - * Created by manoj on 10/12/17. - */ -import com.fasterxml.jackson.annotation.*; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; - -import java.util.HashMap; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "currencyId", - "currencyCode", - "currencyDescription", - "createdBy" -}) -public class Currency implements RequestTransferable { - - @JsonProperty("currencyId") - private Integer currencyId; - @JsonProperty("currencyCode") - private String currencyCode; - @JsonProperty("currencyDescription") - private String currencyDescription; - @JsonProperty("createdBy") - private String createdBy; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("currencyId") - public Integer getCurrencyId() { - return currencyId; - } - - @JsonProperty("currencyId") - public void setCurrencyId(Integer currencyId) { - this.currencyId = currencyId; - } - - @JsonProperty("currencyCode") - public String getCurrencyCode() { - return currencyCode; - } - - @JsonProperty("currencyCode") - public void setCurrencyCode(String currencyCode) { - this.currencyCode = currencyCode; - } - - @JsonProperty("currencyDescription") - public String getCurrencyDescription() { - return currencyDescription; - } - - @JsonProperty("currencyDescription") - public void setCurrencyDescription(String currencyDescription) { - this.currencyDescription = currencyDescription; - } - - @JsonProperty("createdBy") - public String getCreatedBy() { - return createdBy; - } - - @JsonProperty("createdBy") - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Operator.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Operator.java deleted file mode 100644 index f99d5fa9..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Operator.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.rate; - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.Map; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "operatorId", - "operatorName", - "operatorDescription", - "createdBy" -}) -public class Operator { - - @JsonProperty("operatorId") - private Integer operatorId; - @JsonProperty("operatorName") - private String operatorName; - @JsonProperty("operatorDescription") - private String operatorDescription; - @JsonProperty("createdBy") - private String createdBy; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("operatorId") - public Integer getOperatorId() { - return operatorId; - } - - @JsonProperty("operatorId") - public void setOperatorId(Integer operatorId) { - this.operatorId = operatorId; - } - - @JsonProperty("operatorName") - public String getOperatorName() { - return operatorName; - } - - @JsonProperty("operatorName") - public void setOperatorName(String operatorName) { - this.operatorName = operatorName; - } - - @JsonProperty("operatorDescription") - public String getOperatorDescription() { - return operatorDescription; - } - - @JsonProperty("operatorDescription") - public void setOperatorDescription(String operatorDescription) { - this.operatorDescription = operatorDescription; - } - - @JsonProperty("createdBy") - public String getCreatedBy() { - return createdBy; - } - - @JsonProperty("createdBy") - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateCard.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateCard.java deleted file mode 100644 index 06f31622..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateCard.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.rate; - -/** - * Created by manoj on 10/13/17. - */ -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "rateDefinition", - "rateCategories", - "rateTaxes", - "createdBy" -}) -public class RateCard implements RequestTransferable { - - @JsonProperty("rateDefinition") - private RateDefinition rateDefinition; - @JsonProperty("rateCategories") - private List rateCategories = null; - @JsonProperty("rateTaxes") - private List rateTaxes = null; - @JsonProperty("createdBy") - private Object createdBy; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("rateDefinition") - public RateDefinition getRateDefinition() { - return rateDefinition; - } - - @JsonProperty("rateDefinition") - public void setRateDefinition(RateDefinition rateDefinition) { - this.rateDefinition = rateDefinition; - } - - @JsonProperty("rateCategories") - public List getRateCategories() { - return rateCategories; - } - - @JsonProperty("rateCategories") - public void setRateCategories(List rateCategories) { - this.rateCategories = rateCategories; - } - - @JsonProperty("rateTaxes") - public List getRateTaxes() { - return rateTaxes; - } - - @JsonProperty("rateTaxes") - public void setRateTaxes(List rateTaxes) { - this.rateTaxes = rateTaxes; - } - - @JsonProperty("createdBy") - public Object getCreatedBy() { - return createdBy; - } - - @JsonProperty("createdBy") - public void setCreatedBy(Object createdBy) { - this.createdBy = createdBy; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} - diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateCategory.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateCategory.java deleted file mode 100644 index ef40cca2..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateCategory.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.rate; - -/** - * Created by manoj on 10/13/17. - */ - -import java.util.HashMap; -import java.util.Map; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "rateCategoryId", - "rateDefinition", - "category", - "subCategory", - "tariff", - "createdBy" -}) -public class RateCategory implements RequestTransferable { - - @JsonProperty("rateCategoryId") - private Integer rateCategoryId; - @JsonProperty("rateDefinition") - private RateDefinition rateDefinition; - @JsonProperty("category") - private Category category; - @JsonProperty("subCategory") - private Category subCategory; - @JsonProperty("tariff") - private Tariff tariff; - @JsonProperty("createdBy") - private String createdBy; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("rateCategoryId") - public Integer getRateCategoryId() { - return rateCategoryId; - } - - @JsonProperty("rateCategoryId") - public void setRateCategoryId(Integer rateCategoryId) { - this.rateCategoryId = rateCategoryId; - } - - @JsonProperty("rateDefinition") - public RateDefinition getRateDefinition() { - return rateDefinition; - } - - @JsonProperty("rateDefinition") - public void setRateDefinition(RateDefinition rateDefinition) { - this.rateDefinition = rateDefinition; - } - - @JsonProperty("category") - public Category getCategory() { - return category; - } - - @JsonProperty("category") - public void setCategory(Category category) { - this.category = category; - } - - @JsonProperty("subCategory") - public Category getSubCategory() { - return subCategory; - } - - @JsonProperty("subCategory") - public void setSubCategory(Category subCategory) { - this.subCategory = subCategory; - } - - @JsonProperty("tariff") - public Tariff getTariff() { - return tariff; - } - - @JsonProperty("tariff") - public void setTariff(Tariff tariff) { - this.tariff = tariff; - } - - @JsonProperty("createdBy") - public String getCreatedBy() { - return createdBy; - } - - @JsonProperty("createdBy") - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateDefinition.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateDefinition.java deleted file mode 100644 index f6ed7256..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateDefinition.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.rate; - -/** - * Created by manoj on 10/12/17. - */ - - -import com.fasterxml.jackson.annotation.*; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; - -import java.util.HashMap; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "operationRateId", - "rateDefId", - "rateDefName", - "rateDefDescription", - "rateDefDefault", - "currency", - "rateType", - "rateDefCategoryBase", - "tariff", - "createdBy" -}) -public class RateDefinition implements RequestTransferable { - - @JsonProperty("operationRateId") - private Integer operationRateId; - @JsonProperty("rateDefId") - private Integer rateDefId; - @JsonProperty("rateDefName") - private String rateDefName; - @JsonProperty("rateDefDescription") - private String rateDefDescription; - @JsonProperty("rateDefDefault") - private Integer rateDefDefault; - @JsonProperty("currency") - private Currency currency; - @JsonProperty("rateType") - private RateType rateType; - @JsonProperty("rateDefCategoryBase") - private Integer rateDefCategoryBase; - @JsonProperty("tariff") - private Tariff tariff; - @JsonProperty("createdBy") - private String createdBy; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("operationRateId") - public Integer getOperationRateId() { - return operationRateId; - } - - @JsonProperty("operationRateId") - public void setOperationRateId(Integer operationRateId) { - this.operationRateId = operationRateId; - } - - @JsonProperty("rateDefId") - public Integer getRateDefId() { - return rateDefId; - } - - @JsonProperty("rateDefId") - public void setRateDefId(Integer rateDefId) { - this.rateDefId = rateDefId; - } - - @JsonProperty("rateDefName") - public String getRateDefName() { - return rateDefName; - } - - @JsonProperty("rateDefName") - public void setRateDefName(String rateDefName) { - this.rateDefName = rateDefName; - } - - @JsonProperty("rateDefDescription") - public String getRateDefDescription() { - return rateDefDescription; - } - - @JsonProperty("rateDefDescription") - public void setRateDefDescription(String rateDefDescription) { - this.rateDefDescription = rateDefDescription; - } - - @JsonProperty("rateDefDefault") - public Integer getRateDefDefault() { - return rateDefDefault; - } - - @JsonProperty("rateDefDefault") - public void setRateDefDefault(Integer rateDefDefault) { - this.rateDefDefault = rateDefDefault; - } - - @JsonProperty("currency") - public Currency getCurrencyDAO() { - return currency; - } - - @JsonProperty("currency") - public void setCurrencyDAO(Currency currency) { - this.currency = currency; - } - - @JsonProperty("rateType") - public RateType getRateTypeDAO() { - return rateType; - } - - @JsonProperty("rateType") - public void setRateTypeDAO(RateType rateType) { - this.rateType = rateType; - } - - @JsonProperty("rateDefCategoryBase") - public Integer getRateDefCategoryBase() { - return rateDefCategoryBase; - } - - @JsonProperty("rateDefCategoryBase") - public void setRateDefCategoryBase(Integer rateDefCategoryBase) { - this.rateDefCategoryBase = rateDefCategoryBase; - } - - @JsonProperty("tariff") - public Tariff getTariffDAO() { - return tariff; - } - - @JsonProperty("tariff") - public void setTariffDAO(Tariff tariff) { - this.tariff = tariff; - } - - @JsonProperty("createdBy") - public String getCreatedBy() { - return createdBy; - } - - @JsonProperty("createdBy") - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateType.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateType.java deleted file mode 100644 index 95032d1c..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/RateType.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.rate; - -/** - * Created by manoj on 10/12/17. - */ - - -import com.fasterxml.jackson.annotation.*; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; - -import java.util.HashMap; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "rateTypeId", - "rateTypeCode", - "createdBy", - "rateTypeDesc" -}) -public class RateType implements RequestTransferable { - - @JsonProperty("rateTypeId") - private Integer rateTypeId; - @JsonProperty("rateTypeCode") - private String rateTypeCode; - @JsonProperty("createdBy") - private String createdBy; - @JsonProperty("rateTypeDesc") - private String rateTypeDesc; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("rateTypeId") - public Integer getRateTypeId() { - return rateTypeId; - } - - @JsonProperty("rateTypeId") - public void setRateTypeId(Integer rateTypeId) { - this.rateTypeId = rateTypeId; - } - - @JsonProperty("rateTypeCode") - public String getRateTypeCode() { - return rateTypeCode; - } - - @JsonProperty("rateTypeCode") - public void setRateTypeCode(String rateTypeCode) { - this.rateTypeCode = rateTypeCode; - } - - @JsonProperty("createdBy") - public String getCreatedBy() { - return createdBy; - } - - @JsonProperty("createdBy") - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - @JsonProperty("rateTypeDesc") - public String getRateTypeDesc() { - return rateTypeDesc; - } - - @JsonProperty("rateTypeDesc") - public void setRateTypeDesc(String rateTypeDesc) { - this.rateTypeDesc = rateTypeDesc; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Tariff.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Tariff.java deleted file mode 100644 index ca84ba45..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Tariff.java +++ /dev/null @@ -1,214 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.rate; - -/** - * Created by manoj on 10/12/17. - */ - - -import com.fasterxml.jackson.annotation.*; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; - -import java.util.HashMap; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "tariffId", - "tariffName", - "tariffDescription", - "tariffDefaultVal", - "tariffMaxCount", - "tariffExcessRate", - "tariffDefRate", - "tariffSPCommission", - "tariffAdsCommission", - "tariffOpcoCommission", - "tariffSurChargeval", - "tariffSurChargeAds", - "tariffSurChargeOpco", - "createdBy" -}) -public class Tariff implements RequestTransferable { - - @JsonProperty("tariffId") - private Integer tariffId; - @JsonProperty("tariffName") - private String tariffName; - @JsonProperty("tariffDescription") - private String tariffDescription; - @JsonProperty("tariffDefaultVal") - private Integer tariffDefaultVal; - @JsonProperty("tariffMaxCount") - private Integer tariffMaxCount; - @JsonProperty("tariffExcessRate") - private Integer tariffExcessRate; - @JsonProperty("tariffDefRate") - private Integer tariffDefRate; - @JsonProperty("tariffSPCommission") - private Integer tariffSPCommission; - @JsonProperty("tariffAdsCommission") - private Integer tariffAdsCommission; - @JsonProperty("tariffOpcoCommission") - private Integer tariffOpcoCommission; - @JsonProperty("tariffSurChargeval") - private Integer tariffSurChargeval; - @JsonProperty("tariffSurChargeAds") - private Integer tariffSurChargeAds; - @JsonProperty("tariffSurChargeOpco") - private Integer tariffSurChargeOpco; - @JsonProperty("createdBy") - private String createdBy; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("tariffId") - public Integer getTariffId() { - return tariffId; - } - - @JsonProperty("tariffId") - public void setTariffId(Integer tariffId) { - this.tariffId = tariffId; - } - - @JsonProperty("tariffName") - public String getTariffName() { - return tariffName; - } - - @JsonProperty("tariffName") - public void setTariffName(String tariffName) { - this.tariffName = tariffName; - } - - @JsonProperty("tariffDescription") - public String getTariffDescription() { - return tariffDescription; - } - - @JsonProperty("tariffDescription") - public void setTariffDescription(String tariffDescription) { - this.tariffDescription = tariffDescription; - } - - @JsonProperty("tariffDefaultVal") - public Integer getTariffDefaultVal() { - return tariffDefaultVal; - } - - @JsonProperty("tariffDefaultVal") - public void setTariffDefaultVal(Integer tariffDefaultVal) { - this.tariffDefaultVal = tariffDefaultVal; - } - - @JsonProperty("tariffMaxCount") - public Integer getTariffMaxCount() { - return tariffMaxCount; - } - - @JsonProperty("tariffMaxCount") - public void setTariffMaxCount(Integer tariffMaxCount) { - this.tariffMaxCount = tariffMaxCount; - } - - @JsonProperty("tariffExcessRate") - public Integer getTariffExcessRate() { - return tariffExcessRate; - } - - @JsonProperty("tariffExcessRate") - public void setTariffExcessRate(Integer tariffExcessRate) { - this.tariffExcessRate = tariffExcessRate; - } - - @JsonProperty("tariffDefRate") - public Integer getTariffDefRate() { - return tariffDefRate; - } - - @JsonProperty("tariffDefRate") - public void setTariffDefRate(Integer tariffDefRate) { - this.tariffDefRate = tariffDefRate; - } - - @JsonProperty("tariffSPCommission") - public Integer getTariffSPCommission() { - return tariffSPCommission; - } - - @JsonProperty("tariffSPCommission") - public void setTariffSPCommission(Integer tariffSPCommission) { - this.tariffSPCommission = tariffSPCommission; - } - - @JsonProperty("tariffAdsCommission") - public Integer getTariffAdsCommission() { - return tariffAdsCommission; - } - - @JsonProperty("tariffAdsCommission") - public void setTariffAdsCommission(Integer tariffAdsCommission) { - this.tariffAdsCommission = tariffAdsCommission; - } - - @JsonProperty("tariffOpcoCommission") - public Integer getTariffOpcoCommission() { - return tariffOpcoCommission; - } - - @JsonProperty("tariffOpcoCommission") - public void setTariffOpcoCommission(Integer tariffOpcoCommission) { - this.tariffOpcoCommission = tariffOpcoCommission; - } - - @JsonProperty("tariffSurChargeval") - public Integer getTariffSurChargeval() { - return tariffSurChargeval; - } - - @JsonProperty("tariffSurChargeval") - public void setTariffSurChargeval(Integer tariffSurChargeval) { - this.tariffSurChargeval = tariffSurChargeval; - } - - @JsonProperty("tariffSurChargeAds") - public Integer getTariffSurChargeAds() { - return tariffSurChargeAds; - } - - @JsonProperty("tariffSurChargeAds") - public void setTariffSurChargeAds(Integer tariffSurChargeAds) { - this.tariffSurChargeAds = tariffSurChargeAds; - } - - @JsonProperty("tariffSurChargeOpco") - public Integer getTariffSurChargeOpco() { - return tariffSurChargeOpco; - } - - @JsonProperty("tariffSurChargeOpco") - public void setTariffSurChargeOpco(Integer tariffSurChargeOpco) { - this.tariffSurChargeOpco = tariffSurChargeOpco; - } - - @JsonProperty("createdBy") - public String getCreatedBy() { - return createdBy; - } - - @JsonProperty("createdBy") - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Tax.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Tax.java deleted file mode 100644 index 92ddbebd..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/rate/Tax.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.rate; - -/** - * Created by manoj on 10/12/17. - */ - -import com.fasterxml.jackson.annotation.*; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; - -import java.util.HashMap; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "taxId", - "taxCode", - "taxName", - "createdBy" -}) -public class Tax implements RequestTransferable { - - @JsonProperty("taxId") - private Integer taxId; - @JsonProperty("taxCode") - private String taxCode; - @JsonProperty("taxName") - private String taxName; - @JsonProperty("createdBy") - private String createdBy; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("taxId") - public Integer getTaxId() { - return taxId; - } - - @JsonProperty("taxId") - public void setTaxId(Integer taxId) { - this.taxId = taxId; - } - - @JsonProperty("taxCode") - public String getTaxCode() { - return taxCode; - } - - @JsonProperty("taxCode") - public void setTaxCode(String taxCode) { - this.taxCode = taxCode; - } - - @JsonProperty("taxName") - public String getTaxName() { - return taxName; - } - - @JsonProperty("taxName") - public void setTaxName(String taxName) { - this.taxName = taxName; - } - - @JsonProperty("createdBy") - public String getCreatedBy() { - return createdBy; - } - - @JsonProperty("createdBy") - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/whitelist/Application.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/whitelist/Application.java deleted file mode 100644 index f9f62d45..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/whitelist/Application.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.whitelist; - -import com.fasterxml.jackson.annotation.*; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; - -import java.util.HashMap; -import java.util.Map; - - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "id", - "operator" -}) -public class Application implements RequestTransferable { - - @JsonProperty("id") - private String id; - @JsonProperty("operator") - private String operator; - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("id") - public void setId(String id) { - this.id = id; - } - - @JsonProperty("operator") - public String getOperator() { - return operator; - } - - @JsonProperty("operator") - public void setOperator(String operator) { - this.operator = operator; - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Api.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Api.java deleted file mode 100644 index 022c94e4..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Api.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "apiId", - "apiName", - "apiDescription", - "operations", - "createdBy" -}) -public class Api { - - @JsonProperty("apiId") - private Integer apiId; - @JsonProperty("apiName") - private String apiName; - @JsonProperty("apiDescription") - private String apiDescription; - @JsonProperty("operations") - private List operations = null; - @JsonProperty("createdBy") - private String createdBy; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("apiId") - public Integer getApiId() { - return apiId; - } - - @JsonProperty("apiId") - public void setApiId(Integer apiId) { - this.apiId = apiId; - } - - @JsonProperty("apiName") - public String getApiName() { - return apiName; - } - - @JsonProperty("apiName") - public void setApiName(String apiName) { - this.apiName = apiName; - } - - @JsonProperty("apiDescription") - public String getApiDescription() { - return apiDescription; - } - - @JsonProperty("apiDescription") - public void setApiDescription(String apiDescription) { - this.apiDescription = apiDescription; - } - - @JsonProperty("operations") - public List getOperations() { - return operations; - } - - @JsonProperty("operations") - public void setOperations(List operations) { - this.operations = operations; - } - - @JsonProperty("createdBy") - public String getCreatedBy() { - return createdBy; - } - - @JsonProperty("createdBy") - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApplicationDetailRequest.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApplicationDetailRequest.java deleted file mode 100644 index c74c54d4..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApplicationDetailRequest.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "assignee", - "isAdmin", - "operator", - "size", - "start", - "processType", - "candidateGroups" -}) -public class ApplicationDetailRequest { - - @JsonProperty("assignee") - private String assignee; - @JsonProperty("isAdmin") - private Boolean isAdmin; - @JsonProperty("operator") - private String operator; - @JsonProperty("size") - private Integer size; - @JsonProperty("start") - private Integer start; - @JsonProperty("processType") - private String processType; - @JsonProperty("candidateGroups") - private String candidateGroups; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("assignee") - public String getAssignee() { - return assignee; - } - - @JsonProperty("assignee") - public void setAssignee(String assignee) { - this.assignee = assignee; - } - - @JsonProperty("isAdmin") - public Boolean getIsAdmin() { - return isAdmin; - } - - @JsonProperty("isAdmin") - public void setIsAdmin(Boolean isAdmin) { - this.isAdmin = isAdmin; - } - - @JsonProperty("operator") - public String getOperator() { - return operator; - } - - @JsonProperty("operator") - public void setOperator(String operator) { - this.operator = operator; - } - - @JsonProperty("size") - public Integer getSize() { - return size; - } - - @JsonProperty("size") - public void setSize(Integer size) { - this.size = size; - } - - @JsonProperty("start") - public Integer getStart() { - return start; - } - - @JsonProperty("start") - public void setStart(Integer start) { - this.start = start; - } - - @JsonProperty("processType") - public String getProcessType() { - return processType; - } - - @JsonProperty("processType") - public void setProcessType(String processType) { - this.processType = processType; - } - - @JsonProperty("candidateGroups") - public String getCandidateGroups() { - return candidateGroups; - } - - @JsonProperty("candidateGroups") - public void setCandidateGroups(String candidateGroups) { - this.candidateGroups = candidateGroups; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} - diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApplicationDetailsResponse.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApplicationDetailsResponse.java deleted file mode 100644 index 9c1a9ffb..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApplicationDetailsResponse.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "name", - "type", - "value", - "scope", - "valueUrl" -}) -public class ApplicationDetailsResponse { - - @JsonProperty("name") - private String name; - @JsonProperty("type") - private String type; - @JsonProperty("value") - private String value; - @JsonProperty("scope") - private String scope; - @JsonProperty("valueUrl") - private String valueUrl; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("name") - public void setName(String name) { - this.name = name; - } - - @JsonProperty("type") - public String getType() { - return type; - } - - @JsonProperty("type") - public void setType(String type) { - this.type = type; - } - - @JsonProperty("value") - public String getValue() { - return value; - } - - @JsonProperty("value") - public void setValue(String value) { - this.value = value; - } - - @JsonProperty("scope") - public String getScope() { - return scope; - } - - @JsonProperty("scope") - public void setScope(String scope) { - this.scope = scope; - } - - @JsonProperty("valueUrl") - public String getValueUrl() { - return valueUrl; - } - - @JsonProperty("valueUrl") - public void setValueUrl(String valueUrl) { - this.valueUrl = valueUrl; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApplicationTask.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApplicationTask.java deleted file mode 100644 index 595e78b7..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApplicationTask.java +++ /dev/null @@ -1,267 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "id", - "assignee", - "apiName", - "createTime", - "taskDescription", - "applicationId", - "applicationName", - "applicationDescription", - "operators", - "tier", - "tiersStr", - "userName", - "apiVersion", - "apiContext", - "subscriber", - "relevantRates", - "selectedRate", - "creditPlan" -}) -public class ApplicationTask { - - @JsonProperty("id") - private String id; - @JsonProperty("assignee") - private String assignee; - @JsonProperty("apiName") - private String apiName; - @JsonProperty("createTime") - private CreateTime createTime; - @JsonProperty("taskDescription") - private String taskDescription; - @JsonProperty("applicationId") - private String applicationId; - @JsonProperty("applicationName") - private String applicationName; - @JsonProperty("applicationDescription") - private String applicationDescription; - @JsonProperty("operators") - private String operators; - @JsonProperty("tier") - private String tier; - @JsonProperty("tiersStr") - private List tiersStr = null; - @JsonProperty("userName") - private String userName; - @JsonProperty("apiVersion") - private String apiVersion; - @JsonProperty("apiContext") - private String apiContext; - @JsonProperty("subscriber") - private String subscriber; - @JsonProperty("relevantRates") - private List relevantRates = null; - @JsonProperty("selectedRate") - private String selectedRate; - @JsonProperty("creditPlan") - private String creditPlan; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("id") - public void setId(String id) { - this.id = id; - } - - @JsonProperty("assignee") - public Object getAssignee() { - return assignee; - } - - @JsonProperty("assignee") - public void setAssignee(String assignee) { - this.assignee = assignee; - } - - @JsonProperty("apiName") - public String getApiName() { - return apiName; - } - - @JsonProperty("apiName") - public void setApiName(String apiName) { - this.apiName = apiName; - } - - @JsonProperty("createTime") - public CreateTime getCreateTime() { - return createTime; - } - - @JsonProperty("createTime") - public void setCreateTime(CreateTime createTime) { - this.createTime = createTime; - } - - @JsonProperty("taskDescription") - public Object getTaskDescription() { - return taskDescription; - } - - @JsonProperty("taskDescription") - public void setTaskDescription(String taskDescription) { - this.taskDescription = taskDescription; - } - - @JsonProperty("applicationId") - public String getApplicationId() { - return applicationId; - } - - @JsonProperty("applicationId") - public void setApplicationId(String applicationId) { - this.applicationId = applicationId; - } - - @JsonProperty("applicationName") - public String getApplicationName() { - return applicationName; - } - - @JsonProperty("applicationName") - public void setApplicationName(String applicationName) { - this.applicationName = applicationName; - } - - @JsonProperty("applicationDescription") - public String getApplicationDescription() { - return applicationDescription; - } - - @JsonProperty("applicationDescription") - public void setApplicationDescription(String applicationDescription) { - this.applicationDescription = applicationDescription; - } - - @JsonProperty("operators") - public String getOperators() { - return operators; - } - - @JsonProperty("operators") - public void setOperators(String operators) { - this.operators = operators; - } - - @JsonProperty("tier") - public String getTier() { - return tier; - } - - @JsonProperty("tier") - public void setTier(String tier) { - this.tier = tier; - } - - @JsonProperty("tiersStr") - public List getTiersStr() { - return tiersStr; - } - - @JsonProperty("tiersStr") - public void setTiersStr(List tiersStr) { - this.tiersStr = tiersStr; - } - - @JsonProperty("userName") - public String getUserName() { - return userName; - } - - @JsonProperty("userName") - public void setUserName(String userName) { - this.userName = userName; - } - - @JsonProperty("apiVersion") - public String getApiVersion() { - return apiVersion; - } - - @JsonProperty("apiVersion") - public void setApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - } - - @JsonProperty("apiContext") - public String getApiContext() { - return apiContext; - } - - @JsonProperty("apiContext") - public void setApiContext(String apiContext) { - this.apiContext = apiContext; - } - - @JsonProperty("subscriber") - public String getSubscriber() { - return subscriber; - } - - @JsonProperty("subscriber") - public void setSubscriber(String subscriber) { - this.subscriber = subscriber; - } - - @JsonProperty("relevantRates") - public List getRelevantRates() { - return relevantRates; - } - - @JsonProperty("relevantRates") - public void setRelevantRates(List relevantRates) { - this.relevantRates = relevantRates; - } - - @JsonProperty("selectedRate") - public String getSelectedRate() { - return selectedRate; - } - - @JsonProperty("selectedRate") - public void setSelectedRate(String selectedRate) { - this.selectedRate = selectedRate; - } - - @JsonProperty("creditPlan") - public String getCreditPlan() { - return creditPlan; - } - - @JsonProperty("creditPlan") - public void setCreditPlan(String creditPlan) { - this.creditPlan = creditPlan; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApprovalRequest.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApprovalRequest.java deleted file mode 100644 index 3af83635..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApprovalRequest.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "taskId", - "description", - "selectedTier", - "status", - "user", - "taskType", - "role", - "creditPlan", - "selectedRate" -}) -public class ApprovalRequest { - - @JsonProperty("taskId") - private String taskId; - @JsonProperty("description") - private String description; - @JsonProperty("selectedTier") - private String selectedTier; - @JsonProperty("status") - private String status; - @JsonProperty("user") - private String user; - @JsonProperty("taskType") - private String taskType; - @JsonProperty("role") - private Boolean role; - @JsonProperty("creditPlan") - private String creditPlan; - @JsonProperty("selectedRate") - private String selectedRate; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("taskId") - public String getTaskId() { - return taskId; - } - - @JsonProperty("taskId") - public void setTaskId(String taskId) { - this.taskId = taskId; - } - - @JsonProperty("description") - public String getDescription() { - return description; - } - - @JsonProperty("description") - public void setDescription(String description) { - this.description = description; - } - - @JsonProperty("selectedTier") - public String getSelectedTier() { - return selectedTier; - } - - @JsonProperty("selectedTier") - public void setSelectedTier(String selectedTier) { - this.selectedTier = selectedTier; - } - - @JsonProperty("status") - public String getStatus() { - return status; - } - - @JsonProperty("status") - public void setStatus(String status) { - this.status = status; - } - - @JsonProperty("user") - public String getUser() { - return user; - } - - @JsonProperty("user") - public void setUser(String user) { - this.user = user; - } - - @JsonProperty("taskType") - public String getTaskType() { - return taskType; - } - - @JsonProperty("taskType") - public void setTaskType(String taskType) { - this.taskType = taskType; - } - - @JsonProperty("role") - public Boolean getRole() { - return role; - } - - @JsonProperty("role") - public void setRole(Boolean role) { - this.role = role; - } - - @JsonProperty("creditPlan") - public String getCreditPlan() { - return creditPlan; - } - - @JsonProperty("creditPlan") - public void setCreditPlan(String creditPlan) { - this.creditPlan = creditPlan; - } - - @JsonProperty("selectedRate") - public String getSelectedRate() { - return selectedRate; - } - - @JsonProperty("selectedRate") - public void setSelectedRate(String selectedRate) { - this.selectedRate = selectedRate; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApproveEntity.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApproveEntity.java deleted file mode 100644 index 946ef8ae..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/ApproveEntity.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "action", - "variables" -}) -public class ApproveEntity { - - @JsonProperty("action") - private String action; - @JsonProperty("variables") - private List variables = null; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("action") - public String getAction() { - return action; - } - - @JsonProperty("action") - public void setAction(String action) { - this.action = action; - } - - @JsonProperty("variables") - public List getVariables() { - return variables; - } - - @JsonProperty("variables") - public void setVariables(List variables) { - this.variables = variables; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} - - diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Assign.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Assign.java deleted file mode 100644 index 29e86949..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Assign.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "action", - "assignee" -}) -public class Assign { - - @JsonProperty("action") - private String action; - @JsonProperty("assignee") - private String assignee; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("action") - public String getAction() { - return action; - } - - @JsonProperty("action") - public void setAction(String action) { - this.action = action; - } - - @JsonProperty("assignee") - public String getAssignee() { - return assignee; - } - - @JsonProperty("assignee") - public void setAssignee(String assignee) { - this.assignee = assignee; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/AssignRequest.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/AssignRequest.java deleted file mode 100644 index c1114114..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/AssignRequest.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "taskId", - "assignee" -}) -public class AssignRequest { - - @JsonProperty("taskId") - private Integer taskId; - @JsonProperty("assignee") - private String assignee; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("taskId") - public Integer getTaskId() { - return taskId; - } - - @JsonProperty("taskId") - public void setTaskId(Integer taskId) { - this.taskId = taskId; - } - - @JsonProperty("assignee") - public String getAssignee() { - return assignee; - } - - @JsonProperty("assignee") - public void setAssignee(String assignee) { - this.assignee = assignee; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/CreateTime.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/CreateTime.java deleted file mode 100644 index 35f14092..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/CreateTime.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - -import java.util.HashMap; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "date", - "time", - "offset", - "unformatted" -}) -public class CreateTime { - - @JsonProperty("date") - private String date; - @JsonProperty("time") - private String time; - @JsonProperty("offset") - private String offset; - @JsonProperty("unformatted") - private String unformatted; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("date") - public String getDate() { - return date; - } - - @JsonProperty("date") - public void setDate(String date) { - this.date = date; - } - - @JsonProperty("time") - public String getTime() { - return time; - } - - @JsonProperty("time") - public void setTime(String time) { - this.time = time; - } - - @JsonProperty("offset") - public String getOffset() { - return offset; - } - - @JsonProperty("offset") - public void setOffset(String offset) { - this.offset = offset; - } - - @JsonProperty("unformatted") - public String getUnformatted() { - return unformatted; - } - - @JsonProperty("unformatted") - public void setUnformatted(String unformatted) { - this.unformatted = unformatted; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/GraphData.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/GraphData.java deleted file mode 100644 index 1a5b87a4..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/GraphData.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "data", - "label" -}) -public class GraphData { - - @JsonProperty("data") - private List data = null; - @JsonProperty("label") - private String label; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("data") - public List getData() { - return data; - } - - @JsonProperty("data") - public void setData(List data) { - this.data = data; - } - - @JsonProperty("label") - public String getLabel() { - return label; - } - - @JsonProperty("label") - public void setLabel(String label) { - this.label = label; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/GraphResponse.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/GraphResponse.java deleted file mode 100644 index 2aa2d04d..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/GraphResponse.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "graphData", - "xAxisLabels" -}) -public class GraphResponse { - - @JsonProperty("graphData") - private List graphData = null; - @JsonProperty("xAxisLabels") - private List xAxisLabels = null; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("graphData") - public List getGraphData() { - return graphData; - } - - @JsonProperty("graphData") - public void setGraphData(List graphData) { - this.graphData = graphData; - } - - @JsonProperty("xAxisLabels") - public List getXAxisLabels() { - return xAxisLabels; - } - - @JsonProperty("xAxisLabels") - public void setXAxisLabels(List xAxisLabels) { - this.xAxisLabels = xAxisLabels; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Metadata.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Metadata.java deleted file mode 100644 index 05427d07..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Metadata.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - -import java.util.HashMap; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "order", - "size", - "sort", - "start", - "total" -}) -public class Metadata { - - @JsonProperty("order") - private String order; - @JsonProperty("size") - private Integer size; - @JsonProperty("sort") - private String sort; - @JsonProperty("start") - private Integer start; - @JsonProperty("total") - private Integer total; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("order") - public String getOrder() { - return order; - } - - @JsonProperty("order") - public void setOrder(String order) { - this.order = order; - } - - @JsonProperty("size") - public Integer getSize() { - return size; - } - - @JsonProperty("size") - public void setSize(Integer size) { - this.size = size; - } - - @JsonProperty("sort") - public String getSort() { - return sort; - } - - @JsonProperty("sort") - public void setSort(String sort) { - this.sort = sort; - } - - @JsonProperty("start") - public Integer getStart() { - return start; - } - - @JsonProperty("start") - public void setStart(Integer start) { - this.start = start; - } - - @JsonProperty("total") - public Integer getTotal() { - return total; - } - - @JsonProperty("total") - public void setTotal(Integer total) { - this.total = total; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Operation.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Operation.java deleted file mode 100644 index d1f988c6..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Operation.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - - -import com.fasterxml.jackson.annotation.*; -import com.wso2telco.dep.manageservice.resource.model.rate.RateDefinition; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "apiOperationId", - "apiOperationName", - "apiOperationCode", - "rates", - "createdBy" -}) -public class Operation { - - @JsonProperty("apiOperationId") - private Integer apiOperationId; - @JsonProperty("apiOperationName") - private String apiOperationName; - @JsonProperty("apiOperationCode") - private String apiOperationCode; - @JsonProperty("rates") - private List rates = null; - @JsonProperty("createdBy") - private String createdBy; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("apiOperationId") - public Integer getApiOperationId() { - return apiOperationId; - } - - @JsonProperty("apiOperationId") - public void setApiOperationId(Integer apiOperationId) { - this.apiOperationId = apiOperationId; - } - - @JsonProperty("apiOperationName") - public String getApiOperationName() { - return apiOperationName; - } - - @JsonProperty("apiOperationName") - public void setApiOperationName(String apiOperationName) { - this.apiOperationName = apiOperationName; - } - - @JsonProperty("apiOperationCode") - public String getApiOperationCode() { - return apiOperationCode; - } - - @JsonProperty("apiOperationCode") - public void setApiOperationCode(String apiOperationCode) { - this.apiOperationCode = apiOperationCode; - } - - @JsonProperty("rates") - public List getRates() { - return rates; - } - - @JsonProperty("rates") - public void setRates(List rates) { - this.rates = rates; - } - - @JsonProperty("createdBy") - public String getCreatedBy() { - return createdBy; - } - - @JsonProperty("createdBy") - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/OperationRateResponse.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/OperationRateResponse.java deleted file mode 100644 index 91ca724e..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/OperationRateResponse.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "api", - "operator" -}) -public class OperationRateResponse { - - @JsonProperty("api") - private Api api; - @JsonProperty("operator") - private Object operator; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("api") - public Api getApi() { - return api; - } - - @JsonProperty("api") - public void setApi(Api api) { - this.api = api; - } - - @JsonProperty("operator") - public Object getOperator() { - return operator; - } - - @JsonProperty("operator") - public void setOperator(Object operator) { - this.operator = operator; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Range.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Range.java deleted file mode 100644 index d8f67b8a..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Range.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "start", - "end" -}) -public class Range { - - @JsonProperty("start") - private String start; - @JsonProperty("end") - private String end; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("start") - public String getStart() { - return start; - } - - @JsonProperty("start") - public Range setStart(String start) { - this.start = start; - return this; - } - - @JsonProperty("end") - public String getEnd() { - return end; - } - - @JsonProperty("end") - public Range setEnd(String end) { - this.end = end; - return this; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/RelevantRate.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/RelevantRate.java deleted file mode 100644 index b29f1a37..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/RelevantRate.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.wso2telco.dep.manageservice.resource.model.rate.RateDefinition; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "apiOperation", - "rateDefinitions" -}) -public class RelevantRate { - - @JsonProperty("apiOperation") - private String apiOperation; - @JsonProperty("rateDefinitions") - private List rateDefinitions = null; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("apiOperation") - public String getApiOperation() { - return apiOperation; - } - - @JsonProperty("apiOperation") - public void setApiOperation(String apiOperation) { - this.apiOperation = apiOperation; - } - - @JsonProperty("rateDefinitions") - public List getRateDefinitions() { - return rateDefinitions; - } - - @JsonProperty("rateDefinitions") - public void setRateDefinitions(List rateDefinitions) { - this.rateDefinitions = rateDefinitions; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/SearchResponse.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/SearchResponse.java deleted file mode 100644 index 53884697..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/SearchResponse.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - -/** - * Created by manoj on 10/17/17. - */ - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "applicationTasks", - "metadata" -}) -public class SearchResponse { - - @JsonProperty("applicationTasks") - private List applicationTasks = null; - @JsonProperty("metadata") - private Metadata metadata; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("applicationTasks") - public List getApplicationTasks() { - return applicationTasks; - } - - @JsonProperty("applicationTasks") - public void setApplicationTasks(List applicationTasks) { - this.applicationTasks = applicationTasks; - } - - @JsonProperty("metadata") - public Metadata getMetadata() { - return metadata; - } - - @JsonProperty("metadata") - public void setMetadata(Metadata metadata) { - this.metadata = metadata; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} - - - diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Task.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Task.java deleted file mode 100644 index ff8e306c..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Task.java +++ /dev/null @@ -1,344 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - -/** - * Created by manoj on 10/16/17. - */ - - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "id", - "url", - "owner", - "assignee", - "delegationState", - "name", - "description", - "createTime", - "dueDate", - "priority", - "suspended", - "taskDefinitionKey", - "tenantId", - "category", - "formKey", - "parentTaskId", - "parentTaskUrl", - "executionId", - "executionUrl", - "processInstanceId", - "processInstanceUrl", - "processDefinitionId", - "processDefinitionUrl", - "variables" -}) -public class Task { - - @JsonProperty("id") - private String id; - @JsonProperty("url") - private String url; - @JsonProperty("owner") - private Object owner; - @JsonProperty("assignee") - private String assignee; - @JsonProperty("delegationState") - private Object delegationState; - @JsonProperty("name") - private String name; - @JsonProperty("description") - private String description; - @JsonProperty("createTime") - private String createTime; - @JsonProperty("dueDate") - private Object dueDate; - @JsonProperty("priority") - private Integer priority; - @JsonProperty("suspended") - private Boolean suspended; - @JsonProperty("taskDefinitionKey") - private String taskDefinitionKey; - @JsonProperty("tenantId") - private String tenantId; - @JsonProperty("category") - private Object category; - @JsonProperty("formKey") - private Object formKey; - @JsonProperty("parentTaskId") - private Object parentTaskId; - @JsonProperty("parentTaskUrl") - private Object parentTaskUrl; - @JsonProperty("executionId") - private String executionId; - @JsonProperty("executionUrl") - private String executionUrl; - @JsonProperty("processInstanceId") - private String processInstanceId; - @JsonProperty("processInstanceUrl") - private String processInstanceUrl; - @JsonProperty("processDefinitionId") - private String processDefinitionId; - @JsonProperty("processDefinitionUrl") - private String processDefinitionUrl; - @JsonProperty("variables") - private List variables = null; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("id") - public String getId() { - return id; - } - - @JsonProperty("id") - public void setId(String id) { - this.id = id; - } - - @JsonProperty("url") - public String getUrl() { - return url; - } - - @JsonProperty("url") - public void setUrl(String url) { - this.url = url; - } - - @JsonProperty("owner") - public Object getOwner() { - return owner; - } - - @JsonProperty("owner") - public void setOwner(Object owner) { - this.owner = owner; - } - - @JsonProperty("assignee") - public String getAssignee() { - return assignee; - } - - @JsonProperty("assignee") - public void setAssignee(String assignee) { - this.assignee = assignee; - } - - @JsonProperty("delegationState") - public Object getDelegationState() { - return delegationState; - } - - @JsonProperty("delegationState") - public void setDelegationState(Object delegationState) { - this.delegationState = delegationState; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("name") - public void setName(String name) { - this.name = name; - } - - @JsonProperty("description") - public String getDescription() { - return description; - } - - @JsonProperty("description") - public void setDescription(String description) { - this.description = description; - } - - @JsonProperty("createTime") - public String getCreateTime() { - return createTime; - } - - @JsonProperty("createTime") - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - @JsonProperty("dueDate") - public Object getDueDate() { - return dueDate; - } - - @JsonProperty("dueDate") - public void setDueDate(Object dueDate) { - this.dueDate = dueDate; - } - - @JsonProperty("priority") - public Integer getPriority() { - return priority; - } - - @JsonProperty("priority") - public void setPriority(Integer priority) { - this.priority = priority; - } - - @JsonProperty("suspended") - public Boolean getSuspended() { - return suspended; - } - - @JsonProperty("suspended") - public void setSuspended(Boolean suspended) { - this.suspended = suspended; - } - - @JsonProperty("taskDefinitionKey") - public String getTaskDefinitionKey() { - return taskDefinitionKey; - } - - @JsonProperty("taskDefinitionKey") - public void setTaskDefinitionKey(String taskDefinitionKey) { - this.taskDefinitionKey = taskDefinitionKey; - } - - @JsonProperty("tenantId") - public String getTenantId() { - return tenantId; - } - - @JsonProperty("tenantId") - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - @JsonProperty("category") - public Object getCategory() { - return category; - } - - @JsonProperty("category") - public void setCategory(Object category) { - this.category = category; - } - - @JsonProperty("formKey") - public Object getFormKey() { - return formKey; - } - - @JsonProperty("formKey") - public void setFormKey(Object formKey) { - this.formKey = formKey; - } - - @JsonProperty("parentTaskId") - public Object getParentTaskId() { - return parentTaskId; - } - - @JsonProperty("parentTaskId") - public void setParentTaskId(Object parentTaskId) { - this.parentTaskId = parentTaskId; - } - - @JsonProperty("parentTaskUrl") - public Object getParentTaskUrl() { - return parentTaskUrl; - } - - @JsonProperty("parentTaskUrl") - public void setParentTaskUrl(Object parentTaskUrl) { - this.parentTaskUrl = parentTaskUrl; - } - - @JsonProperty("executionId") - public String getExecutionId() { - return executionId; - } - - @JsonProperty("executionId") - public void setExecutionId(String executionId) { - this.executionId = executionId; - } - - @JsonProperty("executionUrl") - public String getExecutionUrl() { - return executionUrl; - } - - @JsonProperty("executionUrl") - public void setExecutionUrl(String executionUrl) { - this.executionUrl = executionUrl; - } - - @JsonProperty("processInstanceId") - public String getProcessInstanceId() { - return processInstanceId; - } - - @JsonProperty("processInstanceId") - public void setProcessInstanceId(String processInstanceId) { - this.processInstanceId = processInstanceId; - } - - @JsonProperty("processInstanceUrl") - public String getProcessInstanceUrl() { - return processInstanceUrl; - } - - @JsonProperty("processInstanceUrl") - public void setProcessInstanceUrl(String processInstanceUrl) { - this.processInstanceUrl = processInstanceUrl; - } - - @JsonProperty("processDefinitionId") - public String getProcessDefinitionId() { - return processDefinitionId; - } - - @JsonProperty("processDefinitionId") - public void setProcessDefinitionId(String processDefinitionId) { - this.processDefinitionId = processDefinitionId; - } - - @JsonProperty("processDefinitionUrl") - public String getProcessDefinitionUrl() { - return processDefinitionUrl; - } - - @JsonProperty("processDefinitionUrl") - public void setProcessDefinitionUrl(String processDefinitionUrl) { - this.processDefinitionUrl = processDefinitionUrl; - } - - @JsonProperty("variables") - public List getVariables() { - return variables; - } - - @JsonProperty("variables") - public void setVariables(List variables) { - this.variables = variables; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/TaskDetailsResponse.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/TaskDetailsResponse.java deleted file mode 100644 index cd3f95b7..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/TaskDetailsResponse.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "data", - "total", - "start", - "sort", - "order", - "size" -}) -public class TaskDetailsResponse { - - @JsonProperty("data") - private List data = null; - @JsonProperty("total") - private Integer total; - @JsonProperty("start") - private Integer start; - @JsonProperty("sort") - private String sort; - @JsonProperty("order") - private String order; - @JsonProperty("size") - private Integer size; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("data") - public List getData() { - return data; - } - - @JsonProperty("data") - public void setData(List data) { - this.data = data; - } - - @JsonProperty("total") - public Integer getTotal() { - return total; - } - - @JsonProperty("total") - public void setTotal(Integer total) { - this.total = total; - } - - @JsonProperty("start") - public Integer getStart() { - return start; - } - - @JsonProperty("start") - public void setStart(Integer start) { - this.start = start; - } - - @JsonProperty("sort") - public String getSort() { - return sort; - } - - @JsonProperty("sort") - public void setSort(String sort) { - this.sort = sort; - } - - @JsonProperty("order") - public String getOrder() { - return order; - } - - @JsonProperty("order") - public void setOrder(String order) { - this.order = order; - } - - @JsonProperty("size") - public Integer getSize() { - return size; - } - - @JsonProperty("size") - public void setSize(Integer size) { - this.size = size; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/TempLoginRespnse.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/TempLoginRespnse.java deleted file mode 100644 index 7d4a6c95..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/TempLoginRespnse.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "roles", - "userName", - "token", - "isAdmin", - "operator", - "billing", - "success", - "message" -}) -public class TempLoginRespnse { - - @JsonProperty("roles") - private List roles = null; - @JsonProperty("userName") - private String userName; - @JsonProperty("token") - private String token; - @JsonProperty("isAdmin") - private Boolean isAdmin; - @JsonProperty("operator") - private String operator; - @JsonProperty("billing") - private Boolean billing; - - public void setSuccess(Boolean success) { - this.success = success; - } - - @JsonProperty("success") - private Boolean success; - @JsonProperty("message") - private String message; - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @JsonIgnore - - private Map additionalProperties = new HashMap(); - - @JsonProperty("roles") - public List getRoles() { - return roles; - } - - @JsonProperty("roles") - public void setRoles(List roles) { - this.roles = roles; - } - - @JsonProperty("userName") - public String getUserName() { - return userName; - } - - @JsonProperty("userName") - public void setUserName(String userName) { - this.userName = userName; - } - - @JsonProperty("token") - public String getToken() { - return token; - } - - @JsonProperty("token") - public void setToken(String token) { - this.token = token; - } - - @JsonProperty("isAdmin") - public Boolean getIsAdmin() { - return isAdmin; - } - - @JsonProperty("isAdmin") - public void setIsAdmin(Boolean isAdmin) { - this.isAdmin = isAdmin; - } - - @JsonProperty("operator") - public String getOperator() { - return operator; - } - - @JsonProperty("operator") - public void setOperator(String operator) { - this.operator = operator; - } - - @JsonProperty("billing") - public Boolean getBilling() { - return billing; - } - - @JsonProperty("billing") - public void setBilling(Boolean billing) { - this.billing = billing; - } - - @JsonProperty("success") - public Boolean getSuccess() { - return success; - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Variable.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Variable.java deleted file mode 100644 index d2e567f8..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/model/workflow/Variable.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.model.workflow; - -import com.fasterxml.jackson.annotation.*; - -import java.util.HashMap; -import java.util.Map; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ - "name", - "value", - "type" -}) -public class Variable { - - @JsonProperty("name") - private String name; - @JsonProperty("value") - private String value; - @JsonProperty("type") - private String type; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("name") - public Variable setName(String name) { - this.name = name; - return this; - } - - @JsonProperty("value") - public String getValue() { - return value; - } - - @JsonProperty("value") - public Variable setValue(String value) { - this.value = value; - return this; - } - - @JsonProperty("type") - public String getType() { - return type; - } - - @JsonProperty("type") - public Variable setType(String type) { - this.type = type; - return this; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/AbstractResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/AbstractResource.java index b008c9b2..bf1d5008 100644 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/AbstractResource.java +++ b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/AbstractResource.java @@ -21,7 +21,6 @@ import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; import javax.ws.rs.core.Response; -import java.util.List; public abstract class AbstractResource { @@ -29,31 +28,10 @@ public abstract class AbstractResource { protected abstract ServiceTypes getService(); - protected Response doGet(String authenticationCredential) { - Serviceable service = serviceFactory.getService(getService()); - - Callback callback = service.executeGet(authenticationCredential); - return Response.status(Response.Status.OK).entity(callback).build(); - } - - protected Response doGet(String authenticationCredential, List pathParamStringList) { - Serviceable service = serviceFactory.getService(getService()); - - Callback callback = service.executeGet(authenticationCredential, pathParamStringList); - return Response.status(Response.Status.OK).entity(callback).build(); - } - protected Response doPost(RequestTransferable request, String authenticationCredential) { Serviceable service = serviceFactory.getService(getService()); Callback callback = service.executePost(request, authenticationCredential); return Response.status(Response.Status.OK).entity(callback).build(); } - - protected Response doPost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - Serviceable service = serviceFactory.getService(getService()); - - Callback callback = service.executePost(request, authenticationCredential, pathParamStringList); - return Response.status(Response.Status.OK).entity(callback).build(); - } } diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/authentication/AuthenticationResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/authentication/AuthenticationResource.java index 2da77466..84f8b048 100644 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/authentication/AuthenticationResource.java +++ b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/authentication/AuthenticationResource.java @@ -11,7 +11,6 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.NewCookie; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import com.wso2telco.dep.manageservice.resource.util.ErrorDTO; diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/authentication/TempAuthResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/authentication/TempAuthResource.java deleted file mode 100644 index 5cfcdef8..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/authentication/TempAuthResource.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.authentication; - -import com.wso2telco.dep.manageservice.resource.service.authentication.AuthServiceTemp; -import com.wso2telco.dep.manageservice.resource.service.authentication.AuthenticationService; - -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ -@Path("/authentication1") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class TempAuthResource { - - private AuthServiceTemp authenticationService = new AuthServiceTemp(); - - @POST - @Path("/login") - public Response setApp(@Context HttpHeaders headers) { - - Object responseString = null; - responseString = authenticationService.doLogin(); - return Response.status(Response.Status.OK).entity(responseString).build(); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/blacklist/ApiResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/blacklist/ApiResource.java deleted file mode 100644 index 279e2aac..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/blacklist/ApiResource.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.blacklist; - -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -@Path("/blacklist") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class ApiResource extends AbstractResource { - - @Override - protected ServiceTypes getService() { - return ServiceTypes.BLACKLIST; - } - - @GET - public Response getApis(@HeaderParam("authorization") String authHeader) { - return doGet(authHeader); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/quota/QuotaLimitResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/quota/QuotaLimitResource.java deleted file mode 100644 index 6fcc6956..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/quota/QuotaLimitResource.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.quota; - -import com.wso2telco.dep.manageservice.resource.model.rate.RateCard; -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -@Path("/quota/quotalimit") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class QuotaLimitResource extends AbstractResource { - - - protected ServiceTypes getService() { - return ServiceTypes.QUOTA_LIMIT; - } - - @GET - public Response getQuotaLimit(@HeaderParam("authorization") String authHeader) throws Exception { - return doGet(authHeader); - } - - @POST - public Response setQuotaLimit(@HeaderParam("authorization") String authHeader, RateCard rateCard) { - return doPost(rateCard,authHeader); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/ApiOperationRatesResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/ApiOperationRatesResource.java deleted file mode 100644 index a75804cd..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/ApiOperationRatesResource.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.rate; - -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import java.util.ArrayList; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -@Path("/rate/apioperationrates/{apiName}/{apiOperationId}/{operatorId}") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class ApiOperationRatesResource extends AbstractResource { - @Override - protected ServiceTypes getService() { - return ServiceTypes.RATE_API_OPERATION_RATES; - } - - @GET - public Response getApiOperationRates(@HeaderParam("authorization") String authHeader, @PathParam("apiName") String apiName, - @PathParam("apiOperationId") String apiOperationId, @PathParam("operatorId") String operatorId) { - List pathParamStringList = new ArrayList<>(); - pathParamStringList.add(apiName); - pathParamStringList.add(apiOperationId); - pathParamStringList.add(operatorId); - return doGet(authHeader, pathParamStringList); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/ApiOperationsResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/ApiOperationsResource.java deleted file mode 100644 index f4cebc72..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/ApiOperationsResource.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.rate; - -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import java.util.ArrayList; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -@Path("/rate/apioperations/{api}") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class ApiOperationsResource extends AbstractResource { - - @Override - protected ServiceTypes getService() { - return ServiceTypes.RATE_API_OPERATIONS; - } - - @GET - public Response getApiOperations(@HeaderParam("authorization") String authHeader, @PathParam("api") String api) { - List pathParamStringList = new ArrayList<>(); - pathParamStringList.add(api); - return doGet(authHeader, pathParamStringList); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/AssignRateResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/AssignRateResource.java deleted file mode 100644 index eb3381d9..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/AssignRateResource.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.rate; - -import com.wso2telco.dep.manageservice.resource.model.rate.AssignedRate; -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import java.util.ArrayList; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -@Path("/rate/assignrates/{apiName}/{apiOperationId}/{operatorId}") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class AssignRateResource extends AbstractResource { - @Override - protected ServiceTypes getService() { - return ServiceTypes.RATE_ASSIGN_RATES; - } - - @POST - public Response setAssignedRates(@HeaderParam("authorization") String authHeader, @PathParam("apiName") String apiName, - @PathParam("apiOperationId") String apiOperationId, @PathParam("operatorId") String operatorId, - AssignedRate[] assignedRates) { - - List pathParamStringList = new ArrayList<>(); - pathParamStringList.add(apiName); - pathParamStringList.add(apiOperationId); - pathParamStringList.add(operatorId); - return doPost(assignedRates, authHeader, pathParamStringList); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/CategoryResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/CategoryResource.java deleted file mode 100644 index cadd69cf..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/CategoryResource.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.rate; - -import com.wso2telco.dep.manageservice.resource.model.rate.Category; -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -@Path("/rate/categories") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class CategoryResource extends AbstractResource { - - @Override - protected ServiceTypes getService() { - return ServiceTypes.RATE_CATEGORY; - } - - @GET - public Response getCategories(@HeaderParam("authorization") String authHeader) { - return doGet(authHeader); - } - - @POST - public Response setCategory(@HeaderParam("authorization") String authHeader, Category category) { - return doPost(category, authHeader); - } -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/CurrencyResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/CurrencyResource.java deleted file mode 100644 index e1b9f719..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/CurrencyResource.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.rate; - -import com.wso2telco.dep.manageservice.resource.model.rate.Currency; -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - - -@Path("/rate/currencies") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class CurrencyResource extends AbstractResource { - - @Override - protected ServiceTypes getService() { - return ServiceTypes.RATE_CURRENCY; - } - - @GET - public Response getCurrencies(@HeaderParam("authorization") String authHeader) { - return doGet(authHeader); - } - - @POST - public Response setCurrency(@HeaderParam("authorization") String authHeader, Currency currency) { - return doPost(currency, authHeader); - } - -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/OperatorResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/OperatorResource.java deleted file mode 100644 index 6855fc48..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/OperatorResource.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.rate; - -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -@Path("/rate/operators") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class OperatorResource extends AbstractResource { - @Override - protected ServiceTypes getService() { - return ServiceTypes.RATE_OPERATORS; - } - - @GET - public Response getOperators(@HeaderParam("authorization") String authHeader) { - return doGet(authHeader); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/RateCardResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/RateCardResource.java deleted file mode 100644 index 3cf11878..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/RateCardResource.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.rate; - -import com.wso2telco.dep.manageservice.resource.model.rate.RateCard; -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - - -@Path("/rate/ratecards") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class RateCardResource extends AbstractResource{ - - - protected ServiceTypes getService() { - return ServiceTypes.RATE_CARD; - } - - @GET - public Response getRateCards(@HeaderParam("authorization") String authHeader) throws Exception { - return doGet(authHeader); - } - - @POST - public Response setRateCard(@HeaderParam("authorization") String authHeader, RateCard rateCard) { - return doPost(rateCard,authHeader); - } - -} - diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/RateDefinitionResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/RateDefinitionResource.java deleted file mode 100644 index 2fd6c00a..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/RateDefinitionResource.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.rate; - -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -@Path("/rate/ratedefinitions") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class RateDefinitionResource extends AbstractResource { - - @Override - protected ServiceTypes getService() { - return ServiceTypes.RATE_DEFINITION; - } - - @GET - public Response getRateDefinitions(@HeaderParam("authorization") String authHeader) { - return doGet(authHeader); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/RateTypeResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/RateTypeResource.java deleted file mode 100644 index e5b8e61a..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/RateTypeResource.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.rate; - -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - - -@Path("/rate/ratetypes") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class RateTypeResource extends AbstractResource { - - @Override - protected ServiceTypes getService() { - return ServiceTypes.RATE_TYPE; - } - - @GET - public Response getTypes(@HeaderParam("authorization") String authHeader) { - return doGet(authHeader); - } -} - diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/TariffResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/TariffResource.java deleted file mode 100644 index af477784..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/TariffResource.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.rate; - -import com.wso2telco.dep.manageservice.resource.model.rate.Tariff; -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -@Path("/rate/tariffs") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class TariffResource extends AbstractResource { - - @Override - protected ServiceTypes getService() { - return ServiceTypes.RATE_TARIFF; - } - - @GET - public Response getTariffs(@HeaderParam("authorization") String authHeader) { - return doGet(authHeader); - } - - @POST - public Response setCurrencies(@HeaderParam("authorization") String authHeader, Tariff tariff) { - return doPost(tariff, authHeader); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/TaxResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/TaxResource.java deleted file mode 100644 index 78bde665..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/rate/TaxResource.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.rate; - -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -@Path("/rate/taxes") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class TaxResource extends AbstractResource { - - @Override - protected ServiceTypes getService() { - return ServiceTypes.RATE_TAX; - } - - @GET - public Response getTaxes(@HeaderParam("authorization") String authHeader) { - return doGet(authHeader); - } -} - diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/whitelist/ApplicationResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/whitelist/ApplicationResource.java deleted file mode 100644 index 9c8792c1..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/whitelist/ApplicationResource.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.whitelist; - -import com.wso2telco.dep.manageservice.resource.model.whitelist.Application; -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -@Path("/whitelist/getapps") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class ApplicationResource extends AbstractResource { - - protected ServiceTypes getService() { - return ServiceTypes.WHITELIST_APPLICATIONS; - } - - @POST - public Response setApplications(@HeaderParam("authorization") String authHeader, Application application) { - return doPost(application, authHeader); - } -} - diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/whitelist/SubscriberResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/whitelist/SubscriberResource.java deleted file mode 100644 index 9e23ef38..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/whitelist/SubscriberResource.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.whitelist; - -import com.wso2telco.dep.manageservice.resource.resource.AbstractResource; -import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -@Path("/whitelist/getsubscribers") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) - -public class SubscriberResource extends AbstractResource { - - @Override - protected ServiceTypes getService() { - return ServiceTypes.WHITELIST_SUBSCRIBERS; - } - - @POST - public Response getSubscribers(@HeaderParam("authorization") String authHeader) { - return doPost(null, authHeader); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApplicationAssignResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApplicationAssignResource.java deleted file mode 100644 index d621e03c..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApplicationAssignResource.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.workflow; - -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.workflow.AssignRequest; -import com.wso2telco.dep.manageservice.resource.service.workflow.ApplicationAssignService; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -@Path("/applications/assign") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class ApplicationAssignResource { - - ApplicationAssignService applicationAssignService = new ApplicationAssignService(); - - @POST - public Response assignApplication(@HeaderParam("authorization") String authHeader, AssignRequest assignRequest) throws Exception { - Callback callback = applicationAssignService.assignApplication(authHeader, assignRequest); - return Response.status(Response.Status.OK).entity(callback).build(); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApplicationSearchResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApplicationSearchResource.java deleted file mode 100644 index 7db5496a..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApplicationSearchResource.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.workflow; - -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.workflow.ApplicationDetailRequest; -import com.wso2telco.dep.manageservice.resource.service.workflow.ApplicationSearchService; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -@Path("/applications/search") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class ApplicationSearchResource { - - ApplicationSearchService applicationDetailService = new ApplicationSearchService(); - - @POST - public Response getCurrencies(@HeaderParam("authorization") String authHeader, ApplicationDetailRequest detailRequestDAO) throws Exception { - Callback callback = applicationDetailService.getDetails(authHeader, detailRequestDAO); - return Response.status(Response.Status.OK).entity(callback).build(); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApproveApplicationResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApproveApplicationResource.java deleted file mode 100644 index 35ae1287..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApproveApplicationResource.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.workflow; - -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.workflow.ApprovalRequest; -import com.wso2telco.dep.manageservice.resource.service.workflow.ApproveApplicationService; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -@Path("/applications/approve/application/creation") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class ApproveApplicationResource { - - ApproveApplicationService approveApplicationService = new ApproveApplicationService(); - - @POST - public Response assignApplication(@HeaderParam("authorization") String authHeader, ApprovalRequest approveApplicationRequest) throws Exception { - Callback callback = approveApplicationService.approveApplication(authHeader, approveApplicationRequest); - return Response.status(Response.Status.OK).entity(callback).build(); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApproveSubscriptionResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApproveSubscriptionResource.java deleted file mode 100644 index 434204f8..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/ApproveSubscriptionResource.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.workflow; - -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.workflow.ApprovalRequest; -import com.wso2telco.dep.manageservice.resource.service.workflow.ApproveSubscriptionService; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -@Path("/applications/approve/subscription/creation") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class ApproveSubscriptionResource { - - ApproveSubscriptionService approveSubscriptionService = new ApproveSubscriptionService(); - - @POST - public Response assignApplication(@HeaderParam("authorization") String authHeader, ApprovalRequest approvalRequest) throws Exception { - Callback callback = approveSubscriptionService.approveSubscription(authHeader, approvalRequest); - return Response.status(Response.Status.OK).entity(callback).build(); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/HistoryResource.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/HistoryResource.java deleted file mode 100644 index 93988059..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/resource/workflow/HistoryResource.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.resource.workflow; - -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.service.workflow.HistoryService; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -@Path("/applications/graph/{type}/{user}") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class HistoryResource { - - HistoryService historyService = new HistoryService(); - - @GET - public Response getCurrencies(@HeaderParam("authorization") String authHeader, @PathParam("type") String type, @PathParam("user") String user) throws Exception { - Callback callback = historyService.getHistory(authHeader, type, user); - return Response.status(Response.Status.OK).entity(callback).build(); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/AbstractService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/AbstractService.java index 167ec50b..8c6a90da 100644 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/AbstractService.java +++ b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/AbstractService.java @@ -25,15 +25,6 @@ public String getUrl(ServiceUrl serviceUrl) { String url = ""; switch (serviceUrl) { - case RATE_SERVICE: - url = serviceUrl.getValue(); - break; - case QUOTA_SERVICE: - url= serviceUrl.getValue(); - break; - case BLACKLIST_WHITELIST: - url =serviceUrl.getValue(); - break; case MSISDN_VALIDATION_SERVICE: url = serviceUrl.getValue(); break; diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/ServiceFactory.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/ServiceFactory.java index 96549450..c786ed0d 100644 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/ServiceFactory.java +++ b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/ServiceFactory.java @@ -1,10 +1,6 @@ package com.wso2telco.dep.manageservice.resource.service; -import com.wso2telco.dep.manageservice.resource.service.blacklist.BlackListFactory; -import com.wso2telco.dep.manageservice.resource.service.quota.QuotaFactory; -import com.wso2telco.dep.manageservice.resource.service.rate.RateFactory; import com.wso2telco.dep.manageservice.resource.service.validation.ValidationFactory; -import com.wso2telco.dep.manageservice.resource.service.whitelist.WhiteListFactory; import com.wso2telco.dep.manageservice.resource.util.ServiceTypes; /** @@ -39,51 +35,6 @@ public static synchronized ServiceFactory getInstance() { public Serviceable getService(ServiceTypes serviceTypes) { Serviceable service = null; switch (serviceTypes) { - case QUOTA_LIMIT: - service = QuotaFactory.getInstance().getQuotaLimitService(); - break; - case RATE_CARD: - service = RateFactory.getInstance().getRateCardService(); - break; - case RATE_CATEGORY: - service = RateFactory.getInstance().getRateCategoryService(); - break; - case RATE_CURRENCY: - service = RateFactory.getInstance().getRateCurrencyService(); - break; - case RATE_TAX: - service = RateFactory.getInstance().getRateTaxService(); - break; - case RATE_TYPE: - service = RateFactory.getInstance().getRateTypeService(); - break; - case RATE_TARIFF: - service = RateFactory.getInstance().getRateTariffService(); - break; - case RATE_DEFINITION: - service = RateFactory.getInstance().getRateDefinitionService(); - break; - case RATE_API_OPERATIONS: - service = RateFactory.getInstance().getApiOperationsService(); - break; - case RATE_API_OPERATION_RATES: - service = RateFactory.getInstance().getApiOperationRatesService(); - break; - case RATE_OPERATORS: - service = RateFactory.getInstance().getOperatorsService(); - break; - case RATE_ASSIGN_RATES: - service = RateFactory.getInstance().getAssignRatesService(); - break; - case BLACKLIST: - service = BlackListFactory.getInstance().getApiService(); - break; - case WHITELIST_SUBSCRIBERS: - service = WhiteListFactory.getInstance().getSubscriberService(); - break; - case WHITELIST_APPLICATIONS: - service = WhiteListFactory.getInstance().getApplicationService(); - break; case MSISDN_VALIDATION: service = ValidationFactory.getInstance().getMsisdnValidationService(); break; diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/Serviceable.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/Serviceable.java index ec3a7014..6f41c369 100644 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/Serviceable.java +++ b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/Serviceable.java @@ -3,7 +3,6 @@ import com.wso2telco.dep.manageservice.resource.model.Callback; import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import java.util.List; /** * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. @@ -22,11 +21,5 @@ */ public interface Serviceable { - Callback executeGet(String authenticationCredential); - - Callback executeGet(String authenticationCredential, List pathParamStringList); - Callback executePost(RequestTransferable request, String authenticationCredential); - - Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList); } \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/authentication/AuthServiceTemp.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/authentication/AuthServiceTemp.java deleted file mode 100644 index 04b77b25..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/authentication/AuthServiceTemp.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.authentication; - -import com.wso2telco.dep.manageservice.resource.model.workflow.TempLoginRespnse; - -import java.util.ArrayList; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ -public class AuthServiceTemp { - - public TempLoginRespnse doLogin() { - - TempLoginRespnse loginResponse = new TempLoginRespnse(); - loginResponse.setUserName("admin"); - loginResponse.setToken("YWRtaW46YWRtaW4="); - loginResponse.setIsAdmin(true); - loginResponse.setBilling(true); - loginResponse.setSuccess(true); - loginResponse.setMessage("user verified successfully"); - - List roles = new ArrayList(); - roles.add("Internal/subscriber"); - roles.add("manage-app-admin"); - roles.add("Internal/everyone"); - roles.add("admin"); - loginResponse.setRoles(roles); - - return loginResponse; - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/blacklist/ApiService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/blacklist/ApiService.java deleted file mode 100644 index ea0e867f..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/blacklist/ApiService.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016-2017, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - * - * WSO2.Telco Inc. licences this file to you 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.wso2telco.dep.manageservice.resource.service.blacklist; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; -import com.wso2telco.dep.manageservice.resource.util.Messages; -import com.wso2telco.dep.manageservice.resource.util.ServiceUrl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.util.List; - -public class ApiService extends AbstractService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(ApiService.class); - - public ApiService () { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - @Override - public Callback executeGet(String authenticationCredential) { - HttpGet httpGet = new HttpGet(new StringBuilder(super.getUrl(ServiceUrl.BLACKLIST_WHITELIST)).append("apis").toString()); - httpGet.addHeader("Authorization", authenticationCredential); - - try { - - HttpResponse response = client.execute(httpGet); - - if (response.getStatusLine().getStatusCode() == 200) { - String[] apis = mapper.readValue(response.getEntity().getContent(), String[].class); - - System.out.println(apis.toString()); - - return new Callback().setPayload(apis).setSuccess(true).setMessage("Api List loaded Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading apis from hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.API_LOADING_ERROR.getValue()); - } - - - } catch (IOException e) { - log.error(" Exception while loading apis from hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.API_LOADING_ERROR.getValue()); - } - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - return null; - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - return null; - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - return null; - } -} - diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/blacklist/BlackListFactory.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/blacklist/BlackListFactory.java deleted file mode 100644 index 7713d77c..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/blacklist/BlackListFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016-2017, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - * - * WSO2.Telco Inc. licences this file to you 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.wso2telco.dep.manageservice.resource.service.blacklist; - -import com.wso2telco.dep.manageservice.resource.service.Serviceable; - -public class BlackListFactory { - - static BlackListFactory instance; - BlackListFactory () { - } - - public static synchronized BlackListFactory getInstance(){ - if(instance==null){ - instance = new BlackListFactory(); - } - return instance; - } - - public Serviceable getApiService() { return new ApiService(); } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/clients/LoginAdminServiceClient.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/clients/LoginAdminServiceClient.java deleted file mode 100644 index e6ed2fba..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/clients/LoginAdminServiceClient.java +++ /dev/null @@ -1,41 +0,0 @@ -//package com.wso2telco.dep.manageservice.resource.service.clients; -// -//import org.apache.axis2.AxisFault; -//import org.apache.axis2.transport.http.HTTPConstants; -//import org.wso2.carbon.authenticator.stub.AuthenticationAdminStub; -//import org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException; -//import org.wso2.carbon.authenticator.stub.LogoutAuthenticationExceptionException; -//import org.apache.axis2.context.ServiceContext; -//import java.rmi.RemoteException; -// -//public class LoginAdminServiceClient { -// private final String serviceName = "AuthenticationAdmin"; -// private AuthenticationAdminStub authenticationAdminStub; -// private String endPoint; -// -// public LoginAdminServiceClient(String backEndUrl) throws AxisFault { -// this.endPoint = backEndUrl + "/services/" + serviceName; -// authenticationAdminStub = new AuthenticationAdminStub(endPoint); -// } -// -// public String authenticate(String userName, String password) throws RemoteException, -// LoginAuthenticationExceptionException { -// -// String sessionCookie = null; -// -// if (authenticationAdminStub.login(userName, password, "localhost")) { -// System.out.println("Login Successful"); -// -// ServiceContext serviceContext = authenticationAdminStub. -// _getServiceClient().getLastOperationContext().getServiceContext(); -// sessionCookie = (String) serviceContext.getProperty(HTTPConstants.COOKIE_STRING); -// System.out.println(sessionCookie); -// } -// -// return sessionCookie; -// } -// -// public void logOut() throws RemoteException, LogoutAuthenticationExceptionException { -// authenticationAdminStub.logout(); -// } -//} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/clients/RoleServiceClient.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/clients/RoleServiceClient.java deleted file mode 100644 index 1170fc9a..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/clients/RoleServiceClient.java +++ /dev/null @@ -1,100 +0,0 @@ -//package com.wso2telco.dep.manageservice.resource.service.clients; -// -///** -// * Created by manoj on 9/28/17. -// */ -// -//import java.util.HashMap; -//import java.util.Map; -// -//import org.apache.axis2.context.ConfigurationContext; -//import org.apache.axis2.context.ConfigurationContextFactory; -//import org.apache.axis2.transport.http.HTTPConstants; -//import org.wso2.carbon.authenticator.stub.AuthenticationAdminStub; -//import org.wso2.carbon.um.ws.api.WSRealmBuilder; -//import org.wso2.carbon.user.core.UserRealm; -//import org.wso2.carbon.user.core.UserStoreManager; -// -//public class RoleServiceClient { -// -// private final static String SERVER_URL = "https://localhost:9443/services/"; -// private final static String APP_ID = "myapp"; -// -// /** -// * @param args -// */ -// public static void main(String[] args) { -// -// AuthenticationAdminStub authstub = null; -// ConfigurationContext configContext = null; -// String cookie = null; -// -// System.setProperty("javax.net.ssl.trustStore", "wso2carbon.jks"); -// System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon"); -// -// try { -// configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem( -// "repo", "repo/conf/client.axis2.xml"); -// authstub = new AuthenticationAdminStub(configContext, SERVER_URL -// + "AuthenticationAdmin"); -// -// // Authenticates as a user having rights to add users. -// if (authstub.login("admin", "admin", null)) { -// cookie = (String) authstub._getServiceClient().getServiceContext().getProperty( -// HTTPConstants.COOKIE_STRING); -// -// UserRealm realm = WSRealmBuilder.createWSRealm(SERVER_URL, cookie, configContext); -// UserStoreManager storeManager = realm.getUserStoreManager(); -// -// // Add a new role - with no users - with APP_ID as the role name -// -// if (!storeManager.isExistingRole(APP_ID)) { -// -// storeManager.addRole(APP_ID, null, null); -// System.out.println("The role added successfully to the system"); -// } else { -// System.out.println("The role trying to add - already there in the system"); -// } -// -// if (!storeManager.isExistingUser(newUser)) { -// // Let's the this user to APP_ID role we just created. -// -// // First let's create claims for users. -// // If you are using a claim that does not exist in default IS instance, -// Map claims = new HashMap (); -// -// // TASK-1 and TASK-2 should be completed by now. -// // Here I am using an already existing claim -// claims.put("http://wso2.org/claims/businessphone", "0112842302"); -// -// // Here we pass null for the profile - so it will use the default profile. -// storeManager.addUser(newUser, "password", new String[]{APP_ID, "loginOnly"}, -// claims, null); -// System.out.println("The use added successfully to the system"); -// } else { -// System.out.println("The user trying to add - already there in the system"); -// } -// -// // Now let's see the given user [newUser] belongs to the role APP_ID. -// String[] userRoles = storeManager.getRoleListOfUser(newUser); -// boolean found = false; -// -// if (userRoles != null) { -// for (int i = 0; i < userRoles.length; i++) { -// if (APP_ID.equals(userRoles[i])) { -// found = true; -// System.out.println("The user is in the required role"); -// break; -// } -// } -// } -// -// if (!found) { -// System.out.println("The user is NOT in the required role"); -// } -// } -// } catch (Exception e) { -// e.printStackTrace(); -// } -// } -//} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/clients/SampleUserRoleMgtClient.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/clients/SampleUserRoleMgtClient.java deleted file mode 100644 index 29083f9c..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/clients/SampleUserRoleMgtClient.java +++ /dev/null @@ -1,241 +0,0 @@ -//package com.wso2telco.dep.manageservice.resource.service.clients; -///* -// * Copyright soasecurity.org -// * -// * 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. -// */ -// -// -//import org.apache.axis2.client.Options; -//import org.apache.axis2.client.ServiceClient; -//import org.apache.axis2.context.ConfigurationContext; -//import org.apache.axis2.context.ConfigurationContextFactory; -//import org.apache.axis2.transport.http.HTTPConstants; -//import org.apache.axis2.transport.http.HttpTransportProperties; -//import org.wso2.carbon.um.ws.api.stub.Claim; -//import org.wso2.carbon.um.ws.api.stub.ClaimValue; -//import org.wso2.carbon.um.ws.api.stub.RemoteUserStoreManagerServiceStub; -// -//import java.io.File; -// -///** -// * This sample client demo user mgt web service API of WSO2 Carbon Server. -// * You can use both UserAdmin and RemoteUserStoreManagerService service APIs -// * As both are secured one. To call them, you want to pass valid credentials as -// * basic authentication header. -// */ -//public class SampleUserRoleMgtClient { -// -// -// /** -// * Server url of the WSO2 Carbon Server -// */ -// private static String SEVER_URL = "https://localhost:9443/services/"; -// -// /** -// * User Name to access WSO2 Carbon Server -// */ -// private static String USER_NAME = "admin"; -// -// /** -// * Password of the User who access the WSO2 Carbon Server -// */ -// private static String PASSWORD = "admin"; -// -// -// public static void main(String args[]) { -// -// -// /** -// * trust store path. this must contains server's certificate or Server's CA chain -// */ -// String trustStore = System.getProperty("user.dir") + File.separator + -// "src" + File.separator + "main" + File.separator + -// "resources" + File.separator + "wso2carbon.jks"; -// -// /** -// * Call to https://localhost:9443/services/ uses HTTPS protocol. -// * Therefore we to validate the server certificate or CA chain. The server certificate is looked up in the -// * trust store. -// * Following code sets what trust-store to look for and its JKs password. -// */ -// -// System.setProperty("javax.net.ssl.trustStore", trustStore); -// -// System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon"); -// -// /** -// * Axis2 configuration context -// */ -// ConfigurationContext configContext; -// -// try { -// -// /** -// * Create a configuration context. A configuration context contains information for -// * axis2 environment. This is needed to create an axis2 service client -// */ -// configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); -// -// /** -// * end point url with service name -// */ -// String serviceEndPoint = SEVER_URL + "RemoteUserStoreManagerService"; -// -// /** -// * create stub and service client -// */ -// RemoteUserStoreManagerServiceStub adminStub = new RemoteUserStoreManagerServiceStub(configContext, serviceEndPoint); -// ServiceClient client = adminStub._getServiceClient(); -// Options option = client.getOptions(); -// -// /** -// * Setting a authenticated cookie that is received from Carbon server. -// * If you have authenticated with Carbon server earlier, you can use that cookie, if -// * it has not been expired -// */ -// option.setProperty(HTTPConstants.COOKIE_STRING, null); -// -// /** -// * Setting basic auth headers for authentication for carbon server -// */ -// HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator(); -// auth.setUsername(USER_NAME); -// auth.setPassword(PASSWORD); -// auth.setPreemptiveAuthentication(true); -// option.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, auth); -// option.setManageSession(true); -// -// -// /** -// * Do any thing with user mgt API. you can authenticate users, list user. add users, roles, assignments... -// * Here as an example just have implemented list user operation. -// */ -// -// String[] users = adminStub.listUsers("*", 100); -// -// if (users != null) { -// System.out.println("Listing user names of Carbon server...... "); -// for (String user : users) { -// System.out.println("User Name : " + user); -// } -// } -// -// /** -// * creates user -// */ -// -// try { -// adminStub.addUser("asela", "password", null, null, null, false); -// System.out.println("User is created successfully"); -// } catch (Exception e) { -// System.err.println("User creation is failed"); -// e.printStackTrace(); -// } -// -// /** -// * authenticate User -// */ -// boolean authenticate = false; -// -// try { -// authenticate = adminStub.authenticate("asela", "password"); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// -// if (authenticate) { -// System.out.println("User is authenticated successfully"); -// } else { -// System.err.println("User is authentication failed"); -// } -// -// /** -// * creates role by assigning created user -// */ -// try { -// adminStub.addRole("testRole", new String[]{"asela"}, null); -// System.out.println("Role is created successfully"); -// } catch (Exception e) { -// System.err.println("Role creation is failed"); -// e.printStackTrace(); -// } -// -// -// /** -// * set user attribute to user asela -// */ -// try { -// adminStub.setUserClaimValue("asela", "http://wso2.org/claims/emailaddress", "asela@wso2.com", null); -// System.out.println("User Attribute is updated successfully "); -// } catch (Exception e) { -// System.err.println("User Attribute updating is failed"); -// e.printStackTrace(); -// } -// -// /** -// * set multiple attributes to user asela -// */ -// try { -// -// ClaimValue email = new ClaimValue(); -// email.setClaimURI("http://wso2.org/claims/emailaddress"); -// email.setValue("newasela@wso2.com"); -// -// ClaimValue givenName = new ClaimValue(); -// givenName.setClaimURI("http://wso2.org/claims/givenname"); -// givenName.setValue("Asela Pathberiya"); -// -// ClaimValue[] values = new ClaimValue[]{email, givenName}; -// -// adminStub.setUserClaimValues("asela", values, null); -// -// System.out.println("User Attributes are updated successfully "); -// } catch (Exception e) { -// System.err.println("User Attributes updating is failed"); -// e.printStackTrace(); -// } -// -// /** -// * get users of the role -// */ -// try { -// String[] usersList = adminStub.getUserListOfRole("testRole"); -// System.out.println("Listing user names assigned to testRole...... "); -// for (String user : usersList) { -// System.out.println("Assigned User : " + user); -// } -// } catch (Exception e) { -// System.err.println("Users can not be retrieved"); -// e.printStackTrace(); -// } -// -// /** -// * you can retrieve the cookie to use for sub sequent communications -// */ -// String authCookie = (String) adminStub._getServiceClient().getServiceContext() -// .getProperty(HTTPConstants.COOKIE_STRING); -// -// System.out.println(authCookie); -// -// /** -// * If WSO2 Carbon has been connected with multiple user stores. Say you need to create a user in -// * domain called it.com, user name must be passed as it.com/asela -// */ -// //adminStub.addUser("it.com/asela", "password", null, null, null); -// -// } catch (Exception e) { -// e.printStackTrace(); -// } -// } -//} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/quota/QuotaFactory.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/quota/QuotaFactory.java deleted file mode 100644 index 4a421aec..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/quota/QuotaFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.quota; - -import com.wso2telco.dep.manageservice.resource.service.Serviceable; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ -public class QuotaFactory { - static QuotaFactory instance; - QuotaFactory(){ - } - - public static synchronized QuotaFactory getInstance(){ - if(instance==null){ - instance = new QuotaFactory(); - } - return instance; - } - - public Serviceable getQuotaLimitService() { - return new QuotaLimitService(); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/quota/QuotaLimitService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/quota/QuotaLimitService.java deleted file mode 100644 index 64eabde3..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/quota/QuotaLimitService.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.quota; - -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; - -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ -public class QuotaLimitService extends AbstractService { - @Override - public Callback executeGet(String authenticationCredential) { - return null; - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - return null; - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - return null; - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - return null; - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/ApiOperationRatesService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/ApiOperationRatesService.java deleted file mode 100644 index 69bec33f..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/ApiOperationRatesService.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.rate; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.rate.ApiOperationRates; -import com.wso2telco.dep.manageservice.resource.model.rate.RateDefinition; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; -import com.wso2telco.dep.manageservice.resource.util.ServiceUrl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ -public class ApiOperationRatesService extends AbstractService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(CategoryService.class); - - private static final String OPERATIONS = "/operations/"; - - public ApiOperationRatesService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - @Override - public Callback executeGet(String authenticationCredential) { - return null; - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - - RateDefinition[] rateDefinitions; - RateDefinition[] operationrates; - - if (!pathParamStringList.get(2).equals("null")) { - rateDefinitions = requestRateDefinitions(authenticationCredential, pathParamStringList, "operator"); - operationrates = requestOperationRates(authenticationCredential, pathParamStringList, "operator-assign"); - - } else { - rateDefinitions = requestRateDefinitions(authenticationCredential, pathParamStringList, "admin"); - operationrates = requestOperationRates(authenticationCredential, pathParamStringList, "admin-assign"); - } - - ApiOperationRates apiOperationRates = new ApiOperationRates(); - apiOperationRates.setSource(rateDefinitions); - apiOperationRates.setDestination(operationrates); - - return new Callback().setPayload(apiOperationRates).setSuccess(true).setMessage("Api Operations Loaded Successfully"); - } - - public RateDefinition[] requestRateDefinitions(String authenticationCredential, List pathParamStringList, String type) { - - StringBuilder url = new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)); - RateDefinition[] rateDefinitions = new RateDefinition[0]; - - switch (type) { - case "admin": - url.append("apis/" + pathParamStringList.get(0) + OPERATIONS + pathParamStringList.get(1) + "/ratedefinitions"); - break; - case "operator": - url.append("operators/" + pathParamStringList.get(2) + "/apis/" + pathParamStringList.get(0) + OPERATIONS + pathParamStringList.get(1) + "/ratedefinitions"); - break; - default: - break; - } - - HttpGet httpGet = new HttpGet(url.toString()); - - httpGet.addHeader("Authorization", authenticationCredential); - - try { - HttpResponse response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - rateDefinitions = mapper.readValue(response.getEntity().getContent(), RateDefinition[].class); - return rateDefinitions; - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading api operation rates from hub"); - return rateDefinitions; - } - - } catch (IOException e) { - log.error(" Exception while loading api operation rates from hub " + e); - return rateDefinitions; - } - } - - public RateDefinition[] requestOperationRates(String authenticationCredential, List pathParamStringList, String type) { - - StringBuilder url = new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)); - RateDefinition[] rateDefinitions = new RateDefinition[0]; - - switch (type) { - case "admin-assign": - url.append("apis/" + pathParamStringList.get(0) + OPERATIONS + pathParamStringList.get(1) + "/operationrates"); - break; - case "operator-assign": - url.append("operators/" + pathParamStringList.get(2) + "/apis/" + pathParamStringList.get(0) + OPERATIONS + pathParamStringList.get(1) + "/operatorrates"); - break; - default: - break; - } - - HttpGet httpGet = new HttpGet(url.toString()); - - httpGet.addHeader("Authorization", authenticationCredential); - - try { - HttpResponse response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - rateDefinitions = mapper.readValue(response.getEntity().getContent(), RateDefinition[].class); - return rateDefinitions; - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading operation rates from hub"); - return rateDefinitions; - } - - } catch (IOException e) { - log.error(" Exception while loading operation rates from hub " + e); - return rateDefinitions; - } - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - return null; - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - return null; - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/ApiOperationsService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/ApiOperationsService.java deleted file mode 100644 index f929ac31..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/ApiOperationsService.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.rate; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.rate.ApiOperation; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; -import com.wso2telco.dep.manageservice.resource.util.Messages; -import com.wso2telco.dep.manageservice.resource.util.ServiceUrl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ -public class ApiOperationsService extends AbstractService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(CategoryService.class); - - public ApiOperationsService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - @Override - public Callback executeGet(String authenticationCredential) { - return null; - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - HttpGet httpGet = new HttpGet(new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)).append("apis/" + pathParamStringList.get(0) + "/operations").toString()); - - httpGet.addHeader("Authorization", authenticationCredential); - - try { - HttpResponse response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - ApiOperation[] apiOperations = mapper.readValue(response.getEntity().getContent(), ApiOperation[].class); - return new Callback().setPayload(apiOperations).setSuccess(true).setMessage("Api Operations Loaded Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading api operations from hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.API_OPERATIONS_LOADING_EROOR.getValue()); - } - - } catch (IOException e) { - log.error(" Exception while loading categories from hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.API_OPERATIONS_LOADING_EROOR.getValue()); - } - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - return null; - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - return null; - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/AssignRateService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/AssignRateService.java deleted file mode 100644 index 84c320f2..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/AssignRateService.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.rate; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.rate.AssignedRate; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; -import com.wso2telco.dep.manageservice.resource.util.Messages; -import com.wso2telco.dep.manageservice.resource.util.ServiceUrl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ -public class AssignRateService extends AbstractService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(CategoryService.class); - - private static final String OPERATIONS = "/operations/"; - - public AssignRateService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - @Override - public Callback executeGet(String authenticationCredential) { - return null; - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - return null; - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - return null; - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - - StringBuilder url = new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)); - - if (pathParamStringList.get(2).equals("null")) { - url.append("apis/" + pathParamStringList.get(0) + OPERATIONS + pathParamStringList.get(1) + "/operationrates"); - } else { - url.append("operators/" + pathParamStringList.get(2) + "/apis/" + pathParamStringList.get(0) + OPERATIONS + pathParamStringList.get(1) + "/operatorrates"); - } - - HttpPost httpPost = new HttpPost(url.toString()); - /** add headers */ - httpPost.setHeader("Content-Type", "application/json"); - httpPost.setHeader("Authorization", authenticationCredential); - - if (validateRequest((AssignedRate[])request)) { - try { - /** set request body */ - httpPost.setEntity(new StringEntity(mapper.writeValueAsString(request))); - - HttpResponse response = client.execute(httpPost); - if (response.getStatusLine().getStatusCode() == 201) { - return new Callback().setPayload(null).setSuccess(true).setMessage("Rate Values Assigned Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error while assigning rates to hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.CURRENCY_ADDING_ERROR.getValue()); - } - } catch (IOException e) { - log.error("Exception while assigning rates to hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.CURRENCY_ADDING_ERROR.getValue()); - } - } else { - log.error("Assign Rates : Invalid Request"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.CURRENCY_ADDING_ERROR.getValue()); - } - } - - public boolean validateRequest(AssignedRate[] assignedRates) { - - return (assignedRates != null); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/CategoryService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/CategoryService.java deleted file mode 100644 index f1191e62..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/CategoryService.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.rate; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.rate.Category; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; -import com.wso2telco.dep.manageservice.resource.util.Messages; -import com.wso2telco.dep.manageservice.resource.util.ServiceUrl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -public class CategoryService extends AbstractService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(CategoryService.class); - - public CategoryService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - @Override - public Callback executeGet(String authenticationCredential) { - HttpGet httpGet = new HttpGet(new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)).append("categories").toString()); - - httpGet.addHeader("Authorization", authenticationCredential); - - try { - HttpResponse response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - Category[] categories = mapper.readValue(response.getEntity().getContent(), Category[].class); - return new Callback().setPayload(categories).setSuccess(true).setMessage("Rate Category List Loaded Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading categories from hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.CATEGORY_LOADING_ERROR.getValue()); - } - - } catch (IOException e) { - log.error(" Exception while loading categories from hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.CATEGORY_LOADING_ERROR.getValue()); - } - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - return null; - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - HttpPost httpPost = new HttpPost(new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)).append("categories").toString()); - /** add headers */ - httpPost.setHeader("Content-Type", "application/json"); - httpPost.setHeader("Authorization", authenticationCredential); - - if (validateRequest((Category)request)) { - try { - /** set request body */ - httpPost.setEntity(new StringEntity(mapper.writeValueAsString(request))); - HttpResponse response = client.execute(httpPost); - if (response.getStatusLine().getStatusCode() == 201) { - Category category = mapper.readValue(response.getEntity().getContent(), Category.class); - return new Callback().setPayload(category).setSuccess(true).setMessage("New Category Created Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error while adding new Category to hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.CATEGORY_ADDING_ERROR.getValue()); - } - } catch (IOException e) { - log.error(" Exception while adding new Category to hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.CATEGORY_ADDING_ERROR.getValue()); - } - } else { - log.error("Add New Category : Invalid Request"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.CATEGORY_ADDING_ERROR.getValue()); - } - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - return null; - } - - public boolean validateRequest(Category category) { - return (category != null); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/CurrencyService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/CurrencyService.java deleted file mode 100644 index 25c724c3..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/CurrencyService.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.rate; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.rate.Currency; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; -import com.wso2telco.dep.manageservice.resource.util.Messages; -import com.wso2telco.dep.manageservice.resource.util.ServiceUrl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -public class CurrencyService extends AbstractService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(CurrencyService.class); - - public CurrencyService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - @Override - public Callback executeGet(String authenticationCredential) { - HttpGet httpGet = new HttpGet(new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)).append("currencies").toString()); - /** add headers*/ - httpGet.setHeader("Authorization", authenticationCredential); - - try { - HttpResponse response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - Currency[] currencies = mapper.readValue(response.getEntity().getContent(), Currency[].class); - return new Callback().setPayload(currencies).setSuccess(true).setMessage("Rate Currency List Loaded Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading currencies from hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.CURRENCY_LOADING_ERROR.getValue()); - } - } catch (IOException e) { - log.error("Exception while loading currencies from hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.CURRENCY_LOADING_ERROR.getValue()); - } - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - return null; - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - HttpPost httpPost = new HttpPost(new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)).append("currencies").toString()); - /** add headers */ - httpPost.setHeader("Content-Type", "application/json"); - httpPost.setHeader("Authorization", authenticationCredential); - - if (validateRequest((Currency)request)) { - try { - /** set request body */ - httpPost.setEntity(new StringEntity(mapper.writeValueAsString(request))); - - HttpResponse response = client.execute(httpPost); - if (response.getStatusLine().getStatusCode() == 201) { - Currency currency = mapper.readValue(response.getEntity().getContent(), Currency.class); - return new Callback().setPayload(currency).setSuccess(true).setMessage("New Currency Added Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error while adding new currency to hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.CURRENCY_ADDING_ERROR.getValue()); - } - } catch (IOException e) { - log.error("Exception while adding new currency to hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.CURRENCY_ADDING_ERROR.getValue()); - } - } else { - log.error("Add New Currency : Invalid Request"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.CURRENCY_ADDING_ERROR.getValue()); - } - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - return null; - } - - public boolean validateRequest(Currency currencyDAO) { - return (currencyDAO.getCurrencyCode() != null); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/OperatorService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/OperatorService.java deleted file mode 100644 index d41751cf..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/OperatorService.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.rate; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.rate.Operator; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; -import com.wso2telco.dep.manageservice.resource.util.Messages; -import com.wso2telco.dep.manageservice.resource.util.ServiceUrl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ -public class OperatorService extends AbstractService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(CurrencyService.class); - - public OperatorService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - @Override - public Callback executeGet(String authenticationCredential) { - HttpGet httpGet = new HttpGet(new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)).append("operators").toString()); - /** add headers*/ - httpGet.setHeader("Authorization", authenticationCredential); - - try { - HttpResponse response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - Operator[] operators = mapper.readValue(response.getEntity().getContent(), Operator[].class); - return new Callback().setPayload(operators).setSuccess(true).setMessage("Operator List Loaded Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading operators from hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.OPERATOR_LOADING_ERROR.getValue()); - } - } catch (IOException e) { - log.error("Exception while loading operators from hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.OPERATOR_LOADING_ERROR.getValue()); - } - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - return null; - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - return null; - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - return null; - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateCardService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateCardService.java deleted file mode 100644 index 40dfac5e..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateCardService.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.rate; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.rate.RateCard; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; -import com.wso2telco.dep.manageservice.resource.util.Messages; -import com.wso2telco.dep.manageservice.resource.util.ServiceUrl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -class RateCardService extends AbstractService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(RateCardService.class); - - private static final String ADDING_ERROR = Messages.RATE_CARD_ADDING_ERROR.getValue(); - private static final String LOADING_ERROR = Messages.RATE_CARD_LOADING_ERROR.getValue(); - - public RateCardService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - @Override - public Callback executeGet(String authenticationCredential) { - HttpGet httpGet = new HttpGet(new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)).append("ratecards?schema=full").toString()); - /** add headers*/ - httpGet.setHeader("Authorization", authenticationCredential); - - try { - HttpResponse response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - RateCard[] rateCards = mapper.readValue(response.getEntity().getContent(), RateCard[].class); - return new Callback().setPayload(rateCards).setSuccess(true).setMessage("Rate Definitions Loaded Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error Loading Rate Definition List from hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(LOADING_ERROR); - } - } catch (IOException e) { - log.error(" Exception while loading Rate Definition list from hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(LOADING_ERROR); - } - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - return null; - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - HttpPost httpPost = new HttpPost(new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)).append("ratecards").toString()); - /** add headers */ - httpPost.setHeader("Content-Type", "application/json"); - httpPost.setHeader("Authorization", authenticationCredential); - - - if (validateRequest((RateCard) request)) { - try { - /** set request body */ - httpPost.setEntity(new StringEntity(mapper.writeValueAsString(request))); - - HttpResponse response = client.execute(httpPost); - if (response.getStatusLine().getStatusCode() == 201) { - RateCard rateCard = mapper.readValue(response.getEntity().getContent(), RateCard.class); - return new Callback().setPayload(rateCard).setSuccess(true).setMessage("Rate Card Created Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error while adding new Rate Card to hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(ADDING_ERROR); - } - } catch (IOException e) { - log.error("Exception while adding new Rate Card to hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(ADDING_ERROR); - } - } else { - log.error("Add New Rate Card : Invalid Request"); - return new Callback().setPayload(null).setSuccess(false).setMessage(ADDING_ERROR); - } - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - return null; - } - - public boolean validateRequest(RateCard rateCardDAO) { - return (rateCardDAO != null); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateDefinitionService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateDefinitionService.java deleted file mode 100644 index e5362605..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateDefinitionService.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.rate; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.rate.RateDefinition; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; -import com.wso2telco.dep.manageservice.resource.util.Messages; -import com.wso2telco.dep.manageservice.resource.util.ServiceUrl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -public class RateDefinitionService extends AbstractService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(RateDefinitionService.class); - - public RateDefinitionService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - @Override - public Callback executeGet(String authenticationCredential) { - HttpGet httpGet = new HttpGet(new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)).append("ratedefinitions").toString()); - httpGet.addHeader("Authorization", authenticationCredential); - - try { - HttpResponse response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - RateDefinition[] rateDefinitions = mapper.readValue(response.getEntity().getContent(), RateDefinition[].class); - return new Callback().setPayload(rateDefinitions).setSuccess(true).setMessage("Rate Definition List Loaded Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading rate definitions from hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.RATE_DEFINITION_LOADING_ERROR.getValue()); - } - } catch (IOException e) { - log.error(" Exception while loading rate definitions from hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.RATE_DEFINITION_LOADING_ERROR.getValue()); - } - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - return null; - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - return null; - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - return null; - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateFactory.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateFactory.java deleted file mode 100644 index 30124e5b..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateFactory.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.rate; - -import com.wso2telco.dep.manageservice.resource.service.Serviceable; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ -public class RateFactory { - - static RateFactory instance; - - RateFactory() { - } - - public static synchronized RateFactory getInstance() { - if (instance == null) { - instance = new RateFactory(); - } - return instance; - } - - - public Serviceable getRateCardService() { - return new RateCardService(); - } - - public Serviceable getRateCategoryService() { - return new CategoryService(); - } - - public Serviceable getRateCurrencyService() { - return new CurrencyService(); - } - - public Serviceable getRateTaxService() { - return new TaxService(); - } - - public Serviceable getRateDefinitionService() { - return new RateDefinitionService(); - } - - public Serviceable getRateTariffService() { - return new TariffService(); - } - - public Serviceable getRateTypeService() { - return new RateTypeService(); - } - - public Serviceable getApiOperationsService(){ - return new ApiOperationsService(); - } - - public Serviceable getApiOperationRatesService(){ - return new ApiOperationRatesService(); - } - - public Serviceable getOperatorsService(){ - return new OperatorService(); - } - - public Serviceable getAssignRatesService(){ - return new AssignRateService(); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateService.java deleted file mode 100644 index f05ac26e..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateService.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.rate; - -import java.io.IOException; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClientBuilder; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ -public class RateService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(RateService.class); - - - public RateService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - public Callback get(String ERROR, String SUCCESS, String url, String authHeader) { - HttpGet httpGet = new HttpGet(url); - - httpGet.addHeader("Authorization", authHeader); - - try { - HttpResponse response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - Object object = mapper.readValue(response.getEntity().getContent(), Object.class); - return new Callback().setPayload(object).setSuccess(true).setMessage(SUCCESS); - } else { - log.error(response.getStatusLine().getStatusCode() + " " + ERROR); - return new Callback().setPayload(null).setSuccess(false).setMessage(ERROR); - } - - } catch (IOException e) { - log.error(" Exception while loading categories from hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(ERROR); - } - } - - public Callback set(Object object, String ERROR, String SUCCESS, String url, String authHeader) { - HttpPost httpPost = new HttpPost(url); - /** add headers */ - httpPost.setHeader("Content-Type", "application/json"); - httpPost.setHeader("Authorization", authHeader); - - try { - /** set request body */ - httpPost.setEntity(new StringEntity(mapper.writeValueAsString(object))); - HttpResponse response = client.execute(httpPost); - if (response.getStatusLine().getStatusCode() == 201) { - Object responseObject = mapper.readValue(response.getEntity().getContent(), Object.class); - return new Callback().setPayload(responseObject).setSuccess(true).setMessage(SUCCESS); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error while adding new Category to hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(ERROR); - } - } catch (IOException e) { - log.error(" Exception while adding new Category to hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(ERROR); - } - } - - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateTypeService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateTypeService.java deleted file mode 100644 index dc53194e..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/RateTypeService.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.rate; - - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.rate.RateType; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; -import com.wso2telco.dep.manageservice.resource.util.Messages; -import com.wso2telco.dep.manageservice.resource.util.ServiceUrl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -public class RateTypeService extends AbstractService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(RateTypeService.class); - - - public RateTypeService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - @Override - public Callback executeGet(String authenticationCredential) { - HttpGet httpGet = new HttpGet(new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)).append("ratetypes").toString()); - httpGet.addHeader("Authorization", authenticationCredential); - - try { - HttpResponse response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - RateType[] rateTypes = mapper.readValue(response.getEntity().getContent(), RateType[].class); - return new Callback().setPayload(rateTypes).setSuccess(true).setMessage("Rate Type List Loaded Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading rate types from hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.RATE_TYPE_LOADING_ERROR.getValue()); - } - } catch (IOException e) { - log.error(" Exception while loading taxes from hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.RATE_TYPE_LOADING_ERROR.getValue()); - } - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - return null; - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - return null; - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - return null; - } -} - - diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/TariffService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/TariffService.java deleted file mode 100644 index 5e9f851d..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/TariffService.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.rate; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.rate.Tariff; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; -import com.wso2telco.dep.manageservice.resource.util.Messages; -import com.wso2telco.dep.manageservice.resource.util.ServiceUrl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -public class TariffService extends AbstractService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(TariffService.class); - - public TariffService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - public boolean validateRequest(Tariff tariffDAO) { - return (tariffDAO != null); - } - - @Override - public Callback executeGet(String authenticationCredential) { - HttpGet httpGet = new HttpGet(new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)).append("tariffs").toString()); - httpGet.addHeader("Authorization", authenticationCredential); - - try { - HttpResponse response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - Tariff[] tariffs = mapper.readValue(response.getEntity().getContent(), Tariff[].class); - return new Callback().setPayload(tariffs).setSuccess(true).setMessage("Rate Tariff List Loaded Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading Tariff from hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.TARIFF_LOADING_ERROR.getValue()); - } - } catch (IOException e) { - log.error("Exception while loading Tariff from hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.TARIFF_LOADING_ERROR.getValue()); - } - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - return null; - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - HttpPost httpPost = new HttpPost(new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)).append("tariffs").toString()); - /** add headers */ - httpPost.setHeader("Content-Type", "application/json"); - httpPost.setHeader("Authorization", authenticationCredential); - - if (validateRequest((Tariff) request)) { - try { - /** set request body */ - httpPost.setEntity(new StringEntity(mapper.writeValueAsString(request))); - - HttpResponse response = client.execute(httpPost); - if (response.getStatusLine().getStatusCode() == 201) { - Tariff tariff = mapper.readValue(response.getEntity().getContent(), Tariff.class); - return new Callback().setPayload(tariff).setSuccess(true).setMessage("New Tariff Created Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error while adding new tariff to hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.TARIFF_ADDING_ERROR.getValue()); - } - } catch (IOException e) { - log.error("Exception while adding new tariff to hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.TARIFF_ADDING_ERROR.getValue()); - } - } else { - log.error("Add New Tariff : Invalid Request"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.TARIFF_ADDING_ERROR.getValue()); - } - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - return null; - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/TaxService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/TaxService.java deleted file mode 100644 index ceefe36f..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/rate/TaxService.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.rate; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.rate.Tax; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; -import com.wso2telco.dep.manageservice.resource.util.Messages; -import com.wso2telco.dep.manageservice.resource.util.ServiceUrl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.util.List; - -/** - * Copyright (c) 2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - *

- * WSO2.Telco Inc. licences this file to you 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. - */ - -public class TaxService extends AbstractService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(TaxService.class); - - public TaxService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - @Override - public Callback executeGet(String authenticationCredential) { - HttpGet httpGet = new HttpGet(new StringBuilder(super.getUrl(ServiceUrl.RATE_SERVICE)).append("taxes").toString()); - httpGet.addHeader("Authorization", authenticationCredential); - - try { - HttpResponse response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - Tax[] taxes = mapper.readValue(response.getEntity().getContent(), Tax[].class); - return new Callback().setPayload(taxes).setSuccess(true).setMessage("Rate Tax List Loaded Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading taxes from hub"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.TAX_LOADING_ERROR.getValue()); - } - } catch (IOException e) { - log.error("Exception while loading taxes from hub " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.TAX_LOADING_ERROR.getValue()); - } - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - return null; - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - return null; - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - return null; - } -} - diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/validation/MsisdnValidationService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/validation/MsisdnValidationService.java index d0979c3f..f16e5e2d 100644 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/validation/MsisdnValidationService.java +++ b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/validation/MsisdnValidationService.java @@ -31,7 +31,6 @@ import org.apache.http.impl.client.HttpClientBuilder; import java.io.IOException; -import java.util.List; public class MsisdnValidationService extends AbstractService { @@ -44,16 +43,6 @@ public MsisdnValidationService() { this.mapper = new ObjectMapper(); } - @Override - public Callback executeGet(String authenticationCredential) { - return null; - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - return null; - } - @Override public Callback executePost(RequestTransferable request, String authenticationCredential) { HttpPost httpPost = new HttpPost(new StringBuilder(super.getUrl(ServiceUrl.MSISDN_VALIDATION_SERVICE)).toString()); @@ -79,10 +68,4 @@ public Callback executePost(RequestTransferable request, String authenticationCr } } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List - pathParamStringList) { - return null; - } } diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/whitelist/ApplicationService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/whitelist/ApplicationService.java deleted file mode 100644 index 54b3fd7f..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/whitelist/ApplicationService.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016-2017, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - * - * WSO2.Telco Inc. licences this file to you 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.wso2telco.dep.manageservice.resource.service.whitelist; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; -import com.wso2telco.dep.manageservice.resource.util.Messages; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.List; - -public class ApplicationService extends AbstractService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(ApplicationService.class); - - public ApplicationService () { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - @Override - public Callback executeGet(String authenticationCredential) { - return null; - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - return null; - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - - HttpPost httpPost = new HttpPost(new StringBuilder("http://localhost:9763/blacklist-whitelist-service/queries/").append("apps").toString()); - httpPost.setHeader("Content-Type", "application/json"); - httpPost.setHeader("Authorization", authenticationCredential); - - try { - httpPost.setEntity(new StringEntity(mapper.writeValueAsString(request))); - HttpResponse response = client.execute(httpPost); - - if (response.getStatusLine().getStatusCode() == 200) { - String[] application = mapper.readValue(response.getEntity().getContent(), String[].class); - return new Callback().setPayload(application).setSuccess(true).setMessage("Applications Loaded SuccessFully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error while loading applications"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.APPLICATION_LOADING_ERROR.getValue()); - } - - } catch (UnsupportedEncodingException | JsonProcessingException | ClientProtocolException e) { - log.error("Error while loading applications " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.APPLICATION_LOADING_ERROR.getValue()); - } catch (IOException e) { - log.error("Error while loading applications " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.APPLICATION_LOADING_ERROR.getValue()); - } - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - return null; - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/whitelist/SubscriberService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/whitelist/SubscriberService.java deleted file mode 100644 index 067a0ca4..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/whitelist/SubscriberService.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.whitelist; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.resource.RequestTransferable; -import com.wso2telco.dep.manageservice.resource.service.AbstractService; -import com.wso2telco.dep.manageservice.resource.service.blacklist.ApiService; -import com.wso2telco.dep.manageservice.resource.util.Messages; -import com.wso2telco.dep.manageservice.resource.util.ServiceUrl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.List; - -public class SubscriberService extends AbstractService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(ApiService.class); - - public SubscriberService () { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - @Override - public Callback executeGet(String authenticationCredential) { - return null; - } - - @Override - public Callback executeGet(String authenticationCredential, List pathParamStringList) { - return null; - } - - @Override - public Callback executePost(RequestTransferable request, String authenticationCredential) { - HttpPost httpPost = new HttpPost(new StringBuilder(super.getUrl(ServiceUrl.BLACKLIST_WHITELIST)).append("subscribers").toString()); - httpPost.setHeader("Content-Type", "application/json"); - httpPost.setHeader("Authorization", authenticationCredential); - - try { - httpPost.setEntity(new StringEntity(mapper.writeValueAsString(request))); - HttpResponse response = client.execute(httpPost); - - if (response.getStatusLine().getStatusCode() == 200) { - String[] subscribers = mapper.readValue(response.getEntity().getContent(), String[].class); - return new Callback().setPayload(subscribers).setSuccess(true).setMessage("Subscribers Loaded Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading subscribers"); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.SUBSCRIBERS_LOADING_ERROR.getValue()); - } - - } catch (UnsupportedEncodingException | JsonProcessingException | ClientProtocolException e) { - log.error(" Exception while loading subscribers" + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.SUBSCRIBERS_LOADING_ERROR.getValue()); - } catch (IOException e) { - log.error(" Exception while loading subscribers" + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.SUBSCRIBERS_LOADING_ERROR.getValue()); - } - } - - @Override - public Callback executePost(RequestTransferable[] request, String authenticationCredential, List pathParamStringList) { - return null; - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/whitelist/WhiteListFactory.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/whitelist/WhiteListFactory.java deleted file mode 100644 index c37acc47..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/whitelist/WhiteListFactory.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016-2017, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - * - * WSO2.Telco Inc. licences this file to you 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.wso2telco.dep.manageservice.resource.service.whitelist; - -import com.wso2telco.dep.manageservice.resource.service.Serviceable; - -public class WhiteListFactory { - - static WhiteListFactory instance; - WhiteListFactory () { - } - - public static synchronized WhiteListFactory getInstance() { - if (instance == null) { - instance = new WhiteListFactory(); - } - return instance; - } - - public Serviceable getSubscriberService() { - return new SubscriberService(); - } - - public Serviceable getApplicationService() { - return new ApplicationService(); - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApplicationAssignService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApplicationAssignService.java deleted file mode 100644 index ba9320d1..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApplicationAssignService.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.workflow; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.workflow.Assign; -import com.wso2telco.dep.manageservice.resource.model.workflow.AssignRequest; -import com.wso2telco.dep.manageservice.resource.service.rate.CurrencyService; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; - -public class ApplicationAssignService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(CurrencyService.class); - private static final String ERROR = "Error Assigning Task"; - - public ApplicationAssignService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - public Callback assignApplication(String authHeader, AssignRequest request) { - HttpPost httpPost = new HttpPost("http://localhost:9763/activiti-rest/service" + "/runtime/tasks/" + request.getTaskId()); - /** add headers */ - httpPost.setHeader("Content-Type", "application/json"); - httpPost.setHeader("Authorization", authHeader); - - - if (validateRequest(request)) { - - try { - /** set request body */ - Assign assign = new Assign(); - assign.setAction("claim"); - assign.setAssignee(request.getAssignee().toLowerCase()); - httpPost.setEntity(new StringEntity(mapper.writeValueAsString(assign))); - - HttpResponse response = client.execute(httpPost); - if (response.getStatusLine().getStatusCode() == 200) { - return new Callback().setPayload(null).setSuccess(true).setMessage("New Currency Added Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + ERROR); - return new Callback().setPayload(null).setSuccess(false).setMessage(ERROR); - } - } catch (IOException e) { - log.error(" Exception while assigning task " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(ERROR); - } - } else { - log.error("Assign Task : Invalid Request"); - return new Callback().setPayload(null).setSuccess(false).setMessage(ERROR); - } - } - - public boolean validateRequest(AssignRequest request) { - return (request != null); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApplicationSearchService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApplicationSearchService.java deleted file mode 100644 index d89d41c4..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApplicationSearchService.java +++ /dev/null @@ -1,327 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.workflow; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.rate.RateDefinition; -import com.wso2telco.dep.manageservice.resource.model.workflow.*; -import com.wso2telco.dep.manageservice.resource.service.rate.CurrencyService; -import com.wso2telco.dep.manageservice.resource.util.Messages; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; - - -/** - * Created by manoj on 10/16/17. - */ -public class ApplicationSearchService { - private HttpResponse response; - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(CurrencyService.class); - - private static final String AUTHORIZATION = "Authorization"; - private static final String API_NAME = "apiName"; - - public ApplicationSearchService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - public Callback getDetails(String authHeader, ApplicationDetailRequest request) throws Exception { - - TaskDetailsResponse taskDetailsResponseDAO; - List applicationDetailsResponses; - List operationRateResponses; - - if (validateApplicationRequest(request)) { - taskDetailsResponseDAO = getApplicationTasks(authHeader, request); - if (taskDetailsResponseDAO != null) { - if (taskDetailsResponseDAO.getData().size() > 0) { - applicationDetailsResponses = getApplicationDetails(authHeader, taskDetailsResponseDAO); - if (applicationDetailsResponses != null) { - if (request.getProcessType().equals("SUBSCRIPTION_CREATION")) { - operationRateResponses = getOperationRates(authHeader, applicationDetailsResponses, request); - return new Callback().setPayload(generateResponse(taskDetailsResponseDAO, applicationDetailsResponses, operationRateResponses)).setSuccess(true).setMessage(Messages.APPLICATION_SEARCH_SUCCESS.getValue()); - } else { - return new Callback().setPayload(generateResponse(taskDetailsResponseDAO, applicationDetailsResponses, null)).setSuccess(true).setMessage(Messages.APPLICATION_SEARCH_SUCCESS.getValue()); - } - } else { - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.APPLICATION_SEARCH_ERROR.getValue()); - } - } else { - return new Callback().setPayload(generateResponse(taskDetailsResponseDAO, null, null)).setSuccess(true).setMessage(Messages.APPLICATION_SEARCH_SUCCESS.getValue()); - } - } else { - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.APPLICATION_SEARCH_ERROR.getValue()); - } - } else { - return new Callback().setPayload(null).setSuccess(false).setMessage(Messages.APPLICATION_SEARCH_ERROR.getValue()); - } - } - - /** - * this method will validate the received request parameters - * - * @param requestDAO - * @return - */ - public boolean validateApplicationRequest(ApplicationDetailRequest requestDAO) { - return (requestDAO != null); - } - - /** - * this method will make a request to activity engine and get all the available application/subscription - * approval tasks. - * - * @param authHeader - * @param requestDAO - * @return - */ - public TaskDetailsResponse getApplicationTasks(String authHeader, ApplicationDetailRequest requestDAO) { - - String url = "http://localhost:9763/activiti-rest/service" + "/runtime/tasks?"; - boolean isSearchForUser = false; - TaskDetailsResponse responseDAO; - - if (requestDAO.getAssignee() != null) { - isSearchForUser = true; - url += ("assignee=" + requestDAO.getAssignee()); - } - - if (!isSearchForUser && requestDAO.getCandidateGroups() != null) { - url += ("candidateGroups=" + requestDAO.getCandidateGroups()); - } - - url += ((requestDAO.getSize() != null) ? "&size=" + requestDAO.getSize() : "&size=100"); - url += ((requestDAO.getSize() != null) ? "&start=" + requestDAO.getStart() : "&start=0"); - url += "&order=desc"; - url += "&sort=createTime"; - - if (requestDAO.getProcessType().equals("APPLICATION_CREATION")) { - url += "&processDefinitionKey=application_creation_approval_process"; - } else if (requestDAO.getProcessType().equals("SUBSCRIPTION_CREATION")) { - url += "&processDefinitionKey=subscription_approval_process"; - } - - HttpGet httpGet = new HttpGet(url); - /** add headers */ - httpGet.setHeader(AUTHORIZATION, authHeader); - - try { - response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - responseDAO = mapper.readValue(response.getEntity().getContent(), TaskDetailsResponse.class); - return responseDAO; - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading approval tasks from hub"); - return null; - } - } catch (IOException e) { - log.error(" Exception while loading approval tasks from hub " + e); - return null; - } - - - } - - public List getApplicationDetails(String authHeader, TaskDetailsResponse responseDAO) { - String url; - ApplicationDetailsResponse[] detailsResponseDAO; - List detailsResponseDAOS = new ArrayList<>(); - for (int i = 0; i < responseDAO.getData().size(); i++) { - url = "http://localhost:9763/activiti-rest/service" + "/runtime/tasks/" + responseDAO.getData().get(i).getId() + "/variables"; - HttpGet httpGet = new HttpGet(url); - /** add headers */ - httpGet.setHeader(AUTHORIZATION, authHeader); - - try { - response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - detailsResponseDAO = mapper.readValue(response.getEntity().getContent(), ApplicationDetailsResponse[].class); - detailsResponseDAOS.add(detailsResponseDAO); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading application of task id from hub"); - return null; - } - } catch (IOException e) { - log.error(" Exception while loading application of task id from hub " + e); - return null; - } - } - - return detailsResponseDAOS; - } - - public List getOperationRates(String authHeader, List applicationDetailsList, ApplicationDetailRequest request) { - HttpGet httpGet; - StringBuilder url = new StringBuilder("http://localhost:9763/ratecard-service/ratecardservice/"); - List operationRateResponses = new ArrayList<>(); - - for (int i = 0; i < applicationDetailsList.size(); i++) { - - OperationRateResponse operationRateResponse; - - Map appDetails = new HashMap<>(); - for (final ApplicationDetailsResponse choice : Arrays.asList(applicationDetailsList.get(i))) { - appDetails.put(choice.getName(), choice.getValue()); - } - - if (request.getIsAdmin()) { - url.append("apis/" + appDetails.get(API_NAME) + "/operations/operationrates"); - } else { - url.append("http://localhost:9763/ratecard-service/ratecardservice/" + "operators/" + request.getOperator() + "/apis/" + appDetails.get(API_NAME) + "/operatorrates"); - } - - httpGet = new HttpGet(url.toString()); - /** add headers */ - httpGet.setHeader(AUTHORIZATION, authHeader); - - try { - response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - operationRateResponse = mapper.readValue(response.getEntity().getContent(), OperationRateResponse.class); - operationRateResponses.add(operationRateResponse); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading operation rates from hub"); - return null; - } - } catch (IOException e) { - log.error(" Exception while loading operation rates from hub " + e); - return null; - } - } - - return operationRateResponses; - } - - public SearchResponse generateResponse(TaskDetailsResponse taskDetails, List applicationDetailsResponses, List operationRateResponses) throws ParseException { - - DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ENGLISH); - SimpleDateFormat dateFormatter = new SimpleDateFormat("dd-MMM-yyyy"); - SimpleDateFormat timeFormatter = new SimpleDateFormat("HH:mm:ss"); - SimpleDateFormat offsetFormatter = new SimpleDateFormat("XXX"); - - SearchResponse searchResponse = new SearchResponse(); - - Metadata metadata = new Metadata(); - metadata.setOrder(taskDetails.getOrder()); - metadata.setSize(taskDetails.getSize()); - metadata.setSort(taskDetails.getSort()); - metadata.setStart(taskDetails.getStart()); - metadata.setTotal(taskDetails.getTotal()); - - List applicationTasks = new ArrayList<>(); - - for (int k = 0; k < taskDetails.getData().size(); k++) { - - Task task = taskDetails.getData().get(k); - ApplicationTask applicationTask = new ApplicationTask(); - List relevantRates = new ArrayList<>(); - List operationRates; - CreateTime createTime = new CreateTime(); - - if (task.getCreateTime() != null) { - Date date = format.parse(task.getCreateTime()); - createTime.setDate(dateFormatter.format(date)); - createTime.setTime(timeFormatter.format(date)); - createTime.setOffset(offsetFormatter.format(date)); - createTime.setUnformatted(task.getCreateTime()); - } else { - createTime.setDate(""); - createTime.setTime(""); - createTime.setOffset(""); - createTime.setUnformatted(""); - } - - Map map = new HashMap<>(); - for (final ApplicationDetailsResponse choice : Arrays.asList(applicationDetailsResponses.get(k))) { - map.put(choice.getName(), choice.getValue()); - } - - if (operationRateResponses != null && operationRateResponses.get(k).getApi() != null) { - - operationRates = operationRateResponses.get(k).getApi().getOperations(); - - for (Operation operation : operationRates) { - - RelevantRate relevantRate = new RelevantRate(); - List rateDefinitions = new ArrayList<>(); - for (RateDefinition rateDefinition : operation.getRates()) { - - RateDefinition tempDef = new RateDefinition(); - tempDef.setRateDefId(rateDefinition.getOperationRateId()); - tempDef.setRateDefName(rateDefinition.getRateDefName()); - tempDef.setRateDefDescription(rateDefinition.getRateDefDescription()); - - rateDefinitions.add(tempDef); - } - relevantRate.setApiOperation(operation.getApiOperationName()); - relevantRate.setRateDefinitions(rateDefinitions); - - relevantRates.add(relevantRate); - } - } - - String description; - String tier; - - if (map.get("description") != null) { - description = map.get("description"); - } else if (map.get("applicationDescription") != null) { - description = map.get("applicationDescription"); - } else { - description = ""; - } - - if (map.get("tier") != null) { - tier = map.get("tier"); - } else if (map.get("tierName") != null) { - tier = map.get("tierName"); - } else { - tier = ""; - } - - applicationTask.setId(task.getId()); - applicationTask.setAssignee(task.getAssignee()); - applicationTask.setApiName((map.get(API_NAME) != null) ? map.get(API_NAME) : ""); - applicationTask.setCreateTime(createTime); - applicationTask.setTaskDescription(task.getDescription()); - applicationTask.setApplicationId((map.get("applicationId") != null) ? map.get("applicationId") : ""); - applicationTask.setApplicationName((map.get("applicationName") != null) ? map.get("applicationName") : ""); - applicationTask.setApplicationDescription(description); - applicationTask.setOperators(map.get("operators")); - applicationTask.setTier(tier); - - if (map.get("tiersStr") != null) { - applicationTask.setTiersStr(new ArrayList(Arrays.asList(map.get("tiersStr").split(",")))); - } else if (map.get("apiTiers") != null) { - applicationTask.setTiersStr(new ArrayList(Arrays.asList(map.get("apiTiers").split(",")))); - } - - applicationTask.setUserName(map.get("userName")); - applicationTask.setApiContext(map.get("apiVersion")); - applicationTask.setApiContext(map.get("apiContext")); - applicationTask.setSubscriber(map.get("subscriber")); - applicationTask.setRelevantRates(relevantRates); - applicationTask.setSelectedRate(""); - applicationTask.setCreditPlan(""); - - applicationTasks.add(applicationTask); - } - - searchResponse.setMetadata(metadata); - searchResponse.setApplicationTasks(applicationTasks); - - return searchResponse; - } -} \ No newline at end of file diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApproveApplicationService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApproveApplicationService.java deleted file mode 100644 index 2aa83ac3..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApproveApplicationService.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.workflow; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.workflow.ApprovalRequest; -import com.wso2telco.dep.manageservice.resource.model.workflow.ApproveEntity; -import com.wso2telco.dep.manageservice.resource.model.workflow.Variable; -import com.wso2telco.dep.manageservice.resource.service.rate.CurrencyService; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Locale; - - -public class ApproveApplicationService { - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(CurrencyService.class); - private static final String ERROR = "Error Approving Application"; - - public ApproveApplicationService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - public Callback approveApplication(String authHeader, ApprovalRequest request) { - HttpPost httpPost = new HttpPost("http://localhost:9763/activiti-rest/service" + "/runtime/tasks/" + request.getTaskId()); - /** add headers */ - httpPost.setHeader("Content-Type", "application/json"); - httpPost.setHeader("Authorization", authHeader); - - final String type = "string"; - - if (validateRequest(request)) { - - List variables = new ArrayList<>(); - - if (request.getRole()) { - variables.add(new Variable().setName("hubAdminApproval").setValue(request.getStatus()).setType(type)); - variables.add(new Variable().setName("completedByUser").setValue(request.getUser()).setType(type)); - variables.add(new Variable().setName("status").setValue(request.getStatus()).setType(type)); - variables.add(new Variable().setName("completedOn").setValue(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ENGLISH).format(new Date())).setType(type)); - variables.add(new Variable().setName("description").setValue(request.getDescription()).setType(type)); - variables.add(new Variable().setName("selectedTier").setValue(request.getSelectedTier()).setType(type)); - variables.add(new Variable().setName("creditPlan").setValue(request.getCreditPlan()).setType(type)); - } else { - variables.add(new Variable().setName("operatorAdminApproval").setValue(request.getStatus()).setType(type)); - variables.add(new Variable().setName("completedByUser").setValue(request.getUser()).setType(type)); - variables.add(new Variable().setName("status").setValue(request.getStatus()).setType(type)); - variables.add(new Variable().setName("completedOn").setValue(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ENGLISH).format(new Date())).setType(type)); - variables.add(new Variable().setName("description").setValue(request.getDescription()).setType(type)); - } - - ApproveEntity entity = new ApproveEntity(); - entity.setAction("complete"); - entity.setVariables(variables); - - try { - httpPost.setEntity(new StringEntity(mapper.writeValueAsString(entity))); - HttpResponse response = client.execute(httpPost); - if (response.getStatusLine().getStatusCode() == 200) { - return new Callback().setPayload(null).setSuccess(true).setMessage("Application Approved Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + " " + ERROR); - return new Callback().setPayload(null).setSuccess(false).setMessage(ERROR); - } - } catch (IOException e) { - log.error( " Exception while Approving Application " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(ERROR); - } - } else { - log.error("Approving Application : Invalid Request"); - return new Callback().setPayload(null).setSuccess(false).setMessage(ERROR); - } - } - - public boolean validateRequest(ApprovalRequest request) { - return (request != null && request.getTaskId() != null && request.getStatus() != null && request.getSelectedTier() != null); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApproveSubscriptionService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApproveSubscriptionService.java deleted file mode 100644 index 289e2ad8..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/ApproveSubscriptionService.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.workflow; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.workflow.ApprovalRequest; -import com.wso2telco.dep.manageservice.resource.model.workflow.ApproveEntity; -import com.wso2telco.dep.manageservice.resource.model.workflow.Variable; -import com.wso2telco.dep.manageservice.resource.service.rate.CurrencyService; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Locale; - -public class ApproveSubscriptionService { - - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(CurrencyService.class); - private static final String ERROR = "Error Approving Subscription"; - - public ApproveSubscriptionService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - public Callback approveSubscription(String authHeader, ApprovalRequest request) { - HttpPost httpPost = new HttpPost("http://localhost:9763/activiti-rest/service" + "/runtime/tasks/" + request.getTaskId()); - /** add headers */ - httpPost.setHeader("Content-Type", "application/json"); - httpPost.setHeader("Authorization", authHeader); - - final String type = "string"; - - if (validateRequest(request)) { - - List variables = new ArrayList<>(); - - if (request.getRole()) { - variables.add(new Variable().setName("hubAdminApproval").setValue(request.getStatus()).setType(type)); - variables.add(new Variable().setName("completedByUser").setValue(request.getUser()).setType(type)); - variables.add(new Variable().setName("status").setValue(request.getStatus()).setType(type)); - variables.add(new Variable().setName("completedOn").setValue(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ENGLISH).format(new Date())).setType(type)); - variables.add(new Variable().setName("description").setValue(request.getDescription()).setType(type)); - variables.add(new Variable().setName("selectedTier").setValue(request.getSelectedTier()).setType(type)); - variables.add(new Variable().setName("selectedRate").setValue(request.getSelectedRate()).setType(type)); - } else { - variables.add(new Variable().setName("operatorAdminApproval").setValue(request.getStatus()).setType(type)); - variables.add(new Variable().setName("completedByUser").setValue(request.getUser()).setType(type)); - variables.add(new Variable().setName("status").setValue(request.getStatus()).setType(type)); - variables.add(new Variable().setName("completedOn").setValue(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ENGLISH).format(new Date())).setType(type)); - variables.add(new Variable().setName("description").setValue(request.getDescription()).setType(type)); - variables.add(new Variable().setName("selectedRate").setValue(request.getSelectedRate()).setType(type)); - } - - try { - ApproveEntity entity = new ApproveEntity(); - entity.setAction("complete"); - entity.setVariables(variables); - - httpPost.setEntity(new StringEntity(mapper.writeValueAsString(entity))); - - HttpResponse response = client.execute(httpPost); - if (response.getStatusLine().getStatusCode() == 200) { - return new Callback().setPayload(null).setSuccess(true).setMessage("Subscription Approved Successfully"); - } else { - log.error(response.getStatusLine().getStatusCode() + ERROR); - return new Callback().setPayload(null).setSuccess(false).setMessage(ERROR); - } - } catch (IOException e) { - log.error(" Exception while Approving Subscription " + e); - return new Callback().setPayload(null).setSuccess(false).setMessage(ERROR); - } - } else { - log.error("Approving Subscription : Invalid Request"); - return new Callback().setPayload(null).setSuccess(false).setMessage(ERROR); - } - } - - public boolean validateRequest(ApprovalRequest request) { - return (request != null && request.getTaskId() != null && request.getStatus() != null && request.getSelectedTier() != null); - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/HistoryService.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/HistoryService.java deleted file mode 100644 index 9c379511..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/service/workflow/HistoryService.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.wso2telco.dep.manageservice.resource.service.workflow; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.wso2telco.dep.manageservice.resource.model.Callback; -import com.wso2telco.dep.manageservice.resource.model.workflow.GraphData; -import com.wso2telco.dep.manageservice.resource.model.workflow.GraphResponse; -import com.wso2telco.dep.manageservice.resource.model.workflow.Range; -import com.wso2telco.dep.manageservice.resource.model.workflow.TaskDetailsResponse; -import com.wso2telco.dep.manageservice.resource.service.rate.CurrencyService; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.HttpClientBuilder; - -import java.io.IOException; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.*; - -/** - * Created by manoj on 10/19/17. - */ -public class HistoryService { - private HttpClient client; - private ObjectMapper mapper; - private final Log log = LogFactory.getLog(CurrencyService.class); - - public HistoryService() { - this.client = HttpClientBuilder.create().build(); - this.mapper = new ObjectMapper(); - } - - public Callback getHistory(String authHeader, String type, String user) { - - DateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ENGLISH); - DateFormat monthFormat = new SimpleDateFormat("MMM", Locale.ENGLISH); - - List months = new ArrayList<>(); - List xAxisLabels = new ArrayList<>(); - - for (int i = -5; i < 1; i++) { - Calendar calendar = Calendar.getInstance(); - calendar.add(Calendar.MONTH, i); - calendar.set(Calendar.DATE, 1); - calendar.set(Calendar.HOUR, -12); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - - Date start = calendar.getTime(); - - calendar.add(Calendar.MONTH, 1); - calendar.set(Calendar.DATE, 0); - calendar.set(Calendar.HOUR, 23); - calendar.set(Calendar.MINUTE, 59); - calendar.set(Calendar.SECOND, 59); - - Date stop = calendar.getTime(); - - months.add(new Range().setStart(simpleDateFormat.format(start)).setEnd(simpleDateFormat.format(stop))); - xAxisLabels.add(monthFormat.format(start)); - } - - List data = getData(authHeader, type, user, months); - if (!data.isEmpty()) { - GraphData graphData = new GraphData(); - graphData.setData(data); - graphData.setLabel(type.toUpperCase()); - List graphDataList = new ArrayList<>(); - graphDataList.add(graphData); - GraphResponse graphResponse = new GraphResponse(); - graphResponse.setXAxisLabels(xAxisLabels); - graphResponse.setGraphData(graphDataList); - return new Callback().setPayload(graphResponse).setSuccess(false).setMessage("Error Adding New Currency"); - } else { - return new Callback().setPayload(Collections.emptyList()).setSuccess(false).setMessage("Error Adding New Currency"); - } - - } - - - public List getData(String authHeader, String type, String user, List months) { - String process = (type.equals("applications")) ? "application_creation_approval_process" : "subscription_approval_process"; - List data = new ArrayList<>(); - - for (Range month : months) { - - HttpGet httpGet = new HttpGet("http://localhost:9763/activiti-rest/service" + "/history/historic-task-instances?taskCreatedAfter=" - + month.getStart() + "&taskCreatedBefore=" + month.getEnd() + "&processDefinitionKey=" + process + "&taskAssignee=" + user); - - httpGet.addHeader("Authorization", authHeader); - - try { - HttpResponse response = client.execute(httpGet); - if (response.getStatusLine().getStatusCode() == 200) { - TaskDetailsResponse taskResponse = mapper.readValue(response.getEntity().getContent(), TaskDetailsResponse.class); - data.add(taskResponse.getTotal()); - } else { - log.error(response.getStatusLine().getStatusCode() + " Error loading categories from hub"); - return Collections.emptyList(); - } - - } catch (IOException e) { - log.error(" Exception while loading categories from hub " + e); - return Collections.emptyList(); - } - } - - return data; - } - -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/ApplicationConfiguration.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/ApplicationConfiguration.java deleted file mode 100644 index 954fd8c5..00000000 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/ApplicationConfiguration.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016-2017, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved. - * - * WSO2.Telco Inc. licences this file to you 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.wso2telco.dep.manageservice.resource.util; - -import com.wso2telco.core.dbutils.fileutils.PropertyFileReader; - -import java.util.Properties; - - -public class ApplicationConfiguration { - - private static final String MANAGE_APP_CONFIG_FILE = "manage.properties"; - - private ApplicationConfiguration() { - } - - public static Properties readAppConfig() { - - Properties properties = null; - properties = PropertyFileReader.getFileReader().getProperties(MANAGE_APP_CONFIG_FILE); - return properties; - - } -} diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/Messages.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/Messages.java index f3b654ac..a8fef763 100644 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/Messages.java +++ b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/Messages.java @@ -18,28 +18,6 @@ public enum Messages { /** to define error messages*/ - ERROR_MESSAGES("ERROR MESSAGES"), - CATEGORY_ADDING_ERROR("Error Adding New Category"), - CATEGORY_LOADING_ERROR("Error Loading Category List"), - CATEGORY_ADDING_SUCCESS("New Category Created Successfully"), - CATEGORY_LOADING_SUCCESS("Rate Category List Loaded Successfully"), - CURRENCY_ADDING_ERROR( "Error Adding New Currency"), - CURRENCY_LOADING_ERROR("Error Loading Currency List"), - TARIFF_ADDING_ERROR( "Error Adding New Tariff"), - TARIFF_LOADING_ERROR("Error Loading Tariff List"), - RATE_CARD_ADDING_ERROR( "Error Adding New Rate Card"), - RATE_CARD_LOADING_ERROR("Error Loading Rate Card List"), - RATE_DEFINITION_LOADING_ERROR("Error Loading Rate Definition List"), - TAX_LOADING_ERROR("Error Loading Tax List"), - RATE_TYPE_LOADING_ERROR("Error Loading Rate Type List"), - APPLICATION_SEARCH_ERROR("Error Loading Approval Tasks"), - APPLICATION_SEARCH_SUCCESS("Approval Tasks Loaded"), - API_OPERATIONS_LOADING_EROOR("Error Loading Api Operations"), - API_OPERATION_RATES_LOADING_ERROR("Error Loading Api Operation Rates"), - API_LOADING_ERROR("Error Loading api List"), - SUBSCRIBERS_LOADING_ERROR("Error Loading subscribers"), - OPERATOR_LOADING_ERROR("Error Loading Operators"), - APPLICATION_LOADING_ERROR("Error Loading applications"), VALIDATION_SERVICE_ERROR("Error occurred in validation service"); private String value; diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/ServiceTypes.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/ServiceTypes.java index 96bfa44f..222ce1b2 100644 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/ServiceTypes.java +++ b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/ServiceTypes.java @@ -17,21 +17,6 @@ */ public enum ServiceTypes { - RATE_CARD("rate_card"), - RATE_CATEGORY("rate_category"), - RATE_CURRENCY("rate_currency"), - RATE_TAX("rate_tax"), - RATE_DEFINITION("rate_definition"), - RATE_TYPE("rate_type"), - RATE_TARIFF("rate_tariff"), - RATE_API_OPERATIONS("rate_api_operations"), - RATE_API_OPERATION_RATES("rate_api_operation_rates"), - RATE_OPERATORS("rate_operators"), - RATE_ASSIGN_RATES("rate_assign_rates"), - QUOTA_LIMIT("quota_limit"), - BLACKLIST("blacklist"), - WHITELIST_SUBSCRIBERS("whitelist"), - WHITELIST_APPLICATIONS("application_list"), MSISDN_VALIDATION("msisdn_validation"); diff --git a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/ServiceUrl.java b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/ServiceUrl.java index 17afdd14..64bab9ea 100644 --- a/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/ServiceUrl.java +++ b/component/manage-service/src/main/java/com/wso2telco/dep/manageservice/resource/util/ServiceUrl.java @@ -17,9 +17,6 @@ */ public enum ServiceUrl { - RATE_SERVICE("http://localhost:9763/ratecard-service/ratecardservice/"), - BLACKLIST_WHITELIST("http://localhost:9763/blacklist-whitelist-service/queries/"), - QUOTA_SERVICE("http://localhost:9763/quota-service/services/"), MSISDN_VALIDATION_SERVICE("http://localhost:8281/services/msisdnValidation"); private String value; diff --git a/component/manage-service/src/main/resources/config.yml b/component/manage-service/src/main/resources/config.yml deleted file mode 100644 index 1846387b..00000000 --- a/component/manage-service/src/main/resources/config.yml +++ /dev/null @@ -1,13 +0,0 @@ -spCreateURL: "http://52.9.174.25:9763/client-registration/v0.10/register" -tokenRequestURL: "https://52.9.174.25:8243/token" -appCreateURL: "http://52.9.174.25:9763/api/am/store/v0.10/applications" -generateKeyURL: "http://52.9.174.25:9763/api/am/store/v0.10/applications/generate-keys?applicationId=" -subscriptionURL: "http://52.9.174.25:9763/api/am/store/v0.10/subscriptions" -createNewUserURL: "https://52.9.174.25:9443/wso2/scim/Users" -callbackUrl: "http://www.google.com" -tokenScope: "Production" -tokenAPI: "http://52.9.174.25:9763/api/am/store/v0.10/applications" -owner: "admin" -grantType: "password refresh_token" -nexmoAPI: "8b6bf242-2216-4f53-9779-394c60247ea2" -SmsAPI: "92b82a9b-5f9d-4c60-9d00-27aebebf438f" \ No newline at end of file diff --git a/component/manage-service/src/main/resources/configurations12.properties b/component/manage-service/src/main/resources/configurations12.properties deleted file mode 100644 index 53a0f8e1..00000000 --- a/component/manage-service/src/main/resources/configurations12.properties +++ /dev/null @@ -1,6 +0,0 @@ -database.host = db.acme.com -database.port = 8199 -database.user = admin -database.password = ??? -database.timeout = 60000 -rateServiceURL = 'http://localhost:9763/ratecard-service/ratecardservice/' \ No newline at end of file