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;
}
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;
}
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;
}
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;
}
Aggregations