Search in sources :

Example 26 with DataLoadingException

use of org.wso2.carbon.apimgt.keymgt.model.exception.DataLoadingException in project carbon-apimgt by wso2.

the class SubscriptionDataStoreImpl method addOrUpdateApiPolicy.

@Override
public void addOrUpdateApiPolicy(ApiPolicy apiPolicy) {
    try {
        ApiPolicy policy = new SubscriptionDataLoaderImpl().getAPIPolicy(apiPolicy.getName(), tenantDomain);
        apiPolicyMap.remove(apiPolicy.getCacheKey());
        apiPolicyMap.put(apiPolicy.getCacheKey(), policy);
    } catch (DataLoadingException e) {
        log.error("Exception while loading api policy for " + apiPolicy.getName() + " for domain " + tenantDomain, e);
    }
}
Also used : DataLoadingException(org.wso2.carbon.apimgt.keymgt.model.exception.DataLoadingException) ApiPolicy(org.wso2.carbon.apimgt.keymgt.model.entity.ApiPolicy)

Aggregations

DataLoadingException (org.wso2.carbon.apimgt.keymgt.model.exception.DataLoadingException)26 IOException (java.io.IOException)16 Gson (com.google.gson.Gson)15 ArrayList (java.util.ArrayList)10 ApiPolicy (org.wso2.carbon.apimgt.keymgt.model.entity.ApiPolicy)5 API (org.wso2.carbon.apimgt.keymgt.model.entity.API)4 ApplicationPolicy (org.wso2.carbon.apimgt.keymgt.model.entity.ApplicationPolicy)4 SubscriptionPolicy (org.wso2.carbon.apimgt.keymgt.model.entity.SubscriptionPolicy)4 SubscriptionDataLoaderImpl (org.wso2.carbon.apimgt.keymgt.model.impl.SubscriptionDataLoaderImpl)4 Application (org.wso2.carbon.apimgt.keymgt.model.entity.Application)3 ApplicationKeyMapping (org.wso2.carbon.apimgt.keymgt.model.entity.ApplicationKeyMapping)3 Subscription (org.wso2.carbon.apimgt.keymgt.model.entity.Subscription)3 API (org.wso2.carbon.apimgt.common.analytics.publishers.dto.API)2 SubscriptionDataStore (org.wso2.carbon.apimgt.keymgt.model.SubscriptionDataStore)2 APIList (org.wso2.carbon.apimgt.keymgt.model.entity.APIList)2 APIPolicyList (org.wso2.carbon.apimgt.keymgt.model.entity.APIPolicyList)2 ApplicationKeyMappingList (org.wso2.carbon.apimgt.keymgt.model.entity.ApplicationKeyMappingList)2 ApplicationList (org.wso2.carbon.apimgt.keymgt.model.entity.ApplicationList)2 ApplicationPolicyList (org.wso2.carbon.apimgt.keymgt.model.entity.ApplicationPolicyList)2 SubscriptionList (org.wso2.carbon.apimgt.keymgt.model.entity.SubscriptionList)2