Java Code Examples for org.wso2.carbon.apimgt.impl.utils.APIUtil#getApplicationId()

The following examples show how to use org.wso2.carbon.apimgt.impl.utils.APIUtil#getApplicationId() . 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: ApplicationImportExportManager.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
/**
 * Retrieve all the details of an Application by name for a given user.
 *
 * @param appName name of the application
 * @return {@link Application} instance
 * @throws APIManagementException if an error occurs while retrieving Application details
 */
public Application getApplicationDetails(String appName, String username) throws
        APIManagementException {
    Application application;
    int appId = APIUtil.getApplicationId(appName, username);
    String groupId = apiConsumer.getGroupId(appId);
    application = apiConsumer.getApplicationById(appId);
    if (application != null) {
        application.setGroupId(groupId);
        application.setOwner(application.getSubscriber().getName());
    }
    return application;
}
 
Example 2
Source File: ApplicationImportExportManager.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
/**
 * Retrieve all the details of an Application by name for a given user.
 *
 * @param appName name of the application
 * @return {@link Application} instance
 * @throws APIManagementException if an error occurs while retrieving Application details
 */
public Application getApplicationDetails(String appName, String username) throws
        APIManagementException {
    Application application;
    int appId = APIUtil.getApplicationId(appName, username);
    String groupId = apiConsumer.getGroupId(appId);
    application = apiConsumer.getApplicationById(appId);
    if (application != null) {
        application.setGroupId(groupId);
        application.setOwner(application.getSubscriber().getName());
    }
    return application;
}