Search in sources :

Example 1 with FileBasedApplicationDAO

use of org.wso2.carbon.identity.application.mgt.dao.impl.FileBasedApplicationDAO in project carbon-identity-framework by wso2.

the class ApplicationManagementServiceImpl method getServiceProviderNameByClientId.

/**
 * @param clientId
 * @param clientType
 * @param tenantDomain
 * @return
 * @throws IdentityApplicationManagementException
 */
@Override
public String getServiceProviderNameByClientId(String clientId, String clientType, String tenantDomain) throws IdentityApplicationManagementException {
    String name = null;
    // invoking the listeners
    Collection<ApplicationMgtListener> listeners = getApplicationMgtListeners();
    for (ApplicationMgtListener listener : listeners) {
        if (listener.isEnable() && !listener.doPreGetServiceProviderNameByClientId(clientId, clientType, tenantDomain)) {
            return null;
        }
    }
    if (StringUtils.isNotEmpty(clientId)) {
        ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO();
        name = appDAO.getServiceProviderNameByClientId(clientId, clientType, tenantDomain);
        if (name == null) {
            name = new FileBasedApplicationDAO().getServiceProviderNameByClientId(clientId, clientType, tenantDomain);
        }
    }
    if (name == null) {
        ServiceProvider defaultSP = ApplicationManagementServiceComponent.getFileBasedSPs().get(IdentityApplicationConstants.DEFAULT_SP_CONFIG);
        name = defaultSP.getApplicationName();
    }
    for (ApplicationMgtListener listener : listeners) {
        if (listener.isEnable() && !listener.doPostGetServiceProviderNameByClientId(name, clientId, clientType, tenantDomain)) {
            return null;
        }
    }
    return name;
}
Also used : FileBasedApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.impl.FileBasedApplicationDAO) ServiceProvider(org.wso2.carbon.identity.application.common.model.ServiceProvider) AbstractApplicationMgtListener(org.wso2.carbon.identity.application.mgt.listener.AbstractApplicationMgtListener) ApplicationMgtListener(org.wso2.carbon.identity.application.mgt.listener.ApplicationMgtListener) PaginatableFilterableApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.PaginatableFilterableApplicationDAO) ApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.ApplicationDAO) FileBasedApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.impl.FileBasedApplicationDAO)

Example 2 with FileBasedApplicationDAO

use of org.wso2.carbon.identity.application.mgt.dao.impl.FileBasedApplicationDAO in project carbon-identity-framework by wso2.

the class ApplicationManagementServiceImpl method getAllRequestedClaimsByServiceProvider.

/**
 * Returns back the requested set of claims by the provided service provider in local idp claim
 * dialect.
 *
 * @param serviceProviderName
 * @param tenantDomain
 * @return
 * @throws IdentityApplicationManagementException
 */
@Override
public List<String> getAllRequestedClaimsByServiceProvider(String serviceProviderName, String tenantDomain) throws IdentityApplicationManagementException {
    ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO();
    List<String> reqClaims = appDAO.getAllRequestedClaimsByServiceProvider(serviceProviderName, tenantDomain);
    if (reqClaims == null || reqClaims.isEmpty() && ApplicationManagementServiceComponent.getFileBasedSPs().containsKey(serviceProviderName)) {
        return new FileBasedApplicationDAO().getAllRequestedClaimsByServiceProvider(serviceProviderName, tenantDomain);
    }
    return reqClaims;
}
Also used : FileBasedApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.impl.FileBasedApplicationDAO) PaginatableFilterableApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.PaginatableFilterableApplicationDAO) ApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.ApplicationDAO) FileBasedApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.impl.FileBasedApplicationDAO)

Example 3 with FileBasedApplicationDAO

use of org.wso2.carbon.identity.application.mgt.dao.impl.FileBasedApplicationDAO in project carbon-identity-framework by wso2.

the class ApplicationManagementServiceImpl method getLocalIdPToServiceProviderClaimMapping.

/**
 * [local-idp-claim-uri,sp-claim-uri]
 *
 * @param serviceProviderName
 * @param tenantDomain
 * @return
 * @throws IdentityApplicationManagementException
 */
@Override
public Map<String, String> getLocalIdPToServiceProviderClaimMapping(String serviceProviderName, String tenantDomain) throws IdentityApplicationManagementException {
    ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO();
    Map<String, String> claimMap = appDAO.getLocalIdPToServiceProviderClaimMapping(serviceProviderName, tenantDomain);
    if (claimMap == null || claimMap.isEmpty() && ApplicationManagementServiceComponent.getFileBasedSPs().containsKey(serviceProviderName)) {
        return new FileBasedApplicationDAO().getLocalIdPToServiceProviderClaimMapping(serviceProviderName, tenantDomain);
    }
    return claimMap;
}
Also used : FileBasedApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.impl.FileBasedApplicationDAO) PaginatableFilterableApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.PaginatableFilterableApplicationDAO) ApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.ApplicationDAO) FileBasedApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.impl.FileBasedApplicationDAO)

Example 4 with FileBasedApplicationDAO

use of org.wso2.carbon.identity.application.mgt.dao.impl.FileBasedApplicationDAO in project carbon-identity-framework by wso2.

the class ApplicationManagementServiceImpl method getServiceProviderToLocalIdPClaimMapping.

/**
 * [sp-claim-uri,local-idp-claim-uri]
 *
 * @param serviceProviderName
 * @param tenantDomain
 * @return
 * @throws IdentityApplicationManagementException
 */
@Override
public Map<String, String> getServiceProviderToLocalIdPClaimMapping(String serviceProviderName, String tenantDomain) throws IdentityApplicationManagementException {
    ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO();
    Map<String, String> claimMap = appDAO.getServiceProviderToLocalIdPClaimMapping(serviceProviderName, tenantDomain);
    if (claimMap == null || claimMap.isEmpty() && ApplicationManagementServiceComponent.getFileBasedSPs().containsKey(serviceProviderName)) {
        return new FileBasedApplicationDAO().getServiceProviderToLocalIdPClaimMapping(serviceProviderName, tenantDomain);
    }
    return claimMap;
}
Also used : FileBasedApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.impl.FileBasedApplicationDAO) PaginatableFilterableApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.PaginatableFilterableApplicationDAO) ApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.ApplicationDAO) FileBasedApplicationDAO(org.wso2.carbon.identity.application.mgt.dao.impl.FileBasedApplicationDAO)

Aggregations

ApplicationDAO (org.wso2.carbon.identity.application.mgt.dao.ApplicationDAO)4 PaginatableFilterableApplicationDAO (org.wso2.carbon.identity.application.mgt.dao.PaginatableFilterableApplicationDAO)4 FileBasedApplicationDAO (org.wso2.carbon.identity.application.mgt.dao.impl.FileBasedApplicationDAO)4 ServiceProvider (org.wso2.carbon.identity.application.common.model.ServiceProvider)1 AbstractApplicationMgtListener (org.wso2.carbon.identity.application.mgt.listener.AbstractApplicationMgtListener)1 ApplicationMgtListener (org.wso2.carbon.identity.application.mgt.listener.ApplicationMgtListener)1