Search in sources :

Example 6 with DataNotFoundException

use of org.wso2.carbon.apimgt.common.analytics.exceptions.DataNotFoundException in project carbon-apimgt by wso2.

the class SynapseAnalyticsDataProvider method getApplication.

@Override
public Application getApplication() throws DataNotFoundException {
    AuthenticationContext authContext = APISecurityUtils.getAuthenticationContext(messageContext);
    if (authContext == null) {
        throw new DataNotFoundException("Error occurred when getting Application information");
    }
    Application application = new Application();
    application.setApplicationId(authContext.getApplicationUUID());
    application.setApplicationName(authContext.getApplicationName());
    application.setApplicationOwner(authContext.getSubscriber());
    application.setKeyType(authContext.getKeyType());
    return application;
}
Also used : DataNotFoundException(org.wso2.carbon.apimgt.common.analytics.exceptions.DataNotFoundException) AuthenticationContext(org.wso2.carbon.apimgt.gateway.handlers.security.AuthenticationContext) Application(org.wso2.carbon.apimgt.common.analytics.publishers.dto.Application)

Aggregations

DataNotFoundException (org.wso2.carbon.apimgt.common.analytics.exceptions.DataNotFoundException)3 API (org.wso2.carbon.apimgt.common.analytics.publishers.dto.API)2 Application (org.wso2.carbon.apimgt.common.analytics.publishers.dto.Application)2 Operation (org.wso2.carbon.apimgt.common.analytics.publishers.dto.Operation)2 AuthenticationContext (org.wso2.carbon.apimgt.gateway.handlers.security.AuthenticationContext)2 Event (org.wso2.carbon.apimgt.common.analytics.publishers.dto.Event)1 MetaInfo (org.wso2.carbon.apimgt.common.analytics.publishers.dto.MetaInfo)1 Target (org.wso2.carbon.apimgt.common.analytics.publishers.dto.Target)1 SubscriptionDataStore (org.wso2.carbon.apimgt.keymgt.model.SubscriptionDataStore)1 DataLoadingException (org.wso2.carbon.apimgt.keymgt.model.exception.DataLoadingException)1 SubscriptionDataLoaderImpl (org.wso2.carbon.apimgt.keymgt.model.impl.SubscriptionDataLoaderImpl)1