Java Code Examples for org.wso2.carbon.apimgt.impl.APIConstants#SUBSCRIPTION_TO_CURRENT_TENANT

The following examples show how to use org.wso2.carbon.apimgt.impl.APIConstants#SUBSCRIPTION_TO_CURRENT_TENANT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: APIMappingUtil.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
private static String mapSubscriptionAvailabilityFromDTOtoAPI(
        APIDTO.SubscriptionAvailabilityEnum subscriptionAvailability) {

    switch (subscriptionAvailability) {
    case CURRENT_TENANT:
        return APIConstants.SUBSCRIPTION_TO_CURRENT_TENANT;
    case ALL_TENANTS:
        return APIConstants.SUBSCRIPTION_TO_ALL_TENANTS;
    case SPECIFIC_TENANTS:
        return APIConstants.SUBSCRIPTION_TO_SPECIFIC_TENANTS;
    default:
        return null; // how to handle this? 500 or 400
    }

}
 
Example 2
Source File: APIMappingUtil.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
private static APIDTO.SubscriptionAvailabilityEnum mapSubscriptionAvailabilityFromAPItoDTO(
        String subscriptionAvailability) {

    switch (subscriptionAvailability) {
        case APIConstants.SUBSCRIPTION_TO_CURRENT_TENANT:
            return APIDTO.SubscriptionAvailabilityEnum.CURRENT_TENANT;
        case APIConstants.SUBSCRIPTION_TO_ALL_TENANTS:
            return APIDTO.SubscriptionAvailabilityEnum.ALL_TENANTS;
        case APIConstants.SUBSCRIPTION_TO_SPECIFIC_TENANTS:
            return APIDTO.SubscriptionAvailabilityEnum.SPECIFIC_TENANTS;
        default:
            return null; // how to handle this?
    }

}
 
Example 3
Source File: APIMappingUtil.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
private static APIProductDTO.SubscriptionAvailabilityEnum mapSubscriptionAvailabilityFromAPIProducttoDTO(
        String subscriptionAvailability) {

    switch (subscriptionAvailability) {
        case APIConstants.SUBSCRIPTION_TO_CURRENT_TENANT :
            return APIProductDTO.SubscriptionAvailabilityEnum.CURRENT_TENANT;
        case APIConstants.SUBSCRIPTION_TO_ALL_TENANTS :
            return APIProductDTO.SubscriptionAvailabilityEnum.ALL_TENANTS;
        case APIConstants.SUBSCRIPTION_TO_SPECIFIC_TENANTS :
            return APIProductDTO.SubscriptionAvailabilityEnum.SPECIFIC_TENANTS;
        default:
            return null; // how to handle this?
    }

}
 
Example 4
Source File: APIMappingUtil.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
private static String mapSubscriptionAvailabilityFromDTOtoAPIProduct(
        APIProductDTO.SubscriptionAvailabilityEnum subscriptionAvailability) {
    switch (subscriptionAvailability) {
    case CURRENT_TENANT:
            return APIConstants.SUBSCRIPTION_TO_CURRENT_TENANT;
    case ALL_TENANTS:
            return APIConstants.SUBSCRIPTION_TO_ALL_TENANTS;
    case SPECIFIC_TENANTS:
            return APIConstants.SUBSCRIPTION_TO_SPECIFIC_TENANTS;
        default:
            return APIConstants.SUBSCRIPTION_TO_CURRENT_TENANT; // default to current tenant
    }

}