use of org.wso2.carbon.identity.claim.metadata.mgt.model.LocalClaim in project carbon-identity-framework by wso2.
the class ClaimMetadataEventPublisherProxy method publishPostUpdateLocalClaim.
public void publishPostUpdateLocalClaim(int tenantId, LocalClaim localClaim) {
Map<String, Object> eventProperties = new HashMap<>();
eventProperties.put(IdentityEventConstants.EventProperty.TENANT_ID, tenantId);
eventProperties.put(IdentityEventConstants.EventProperty.LOCAL_CLAIM_URI, localClaim.getClaimURI());
eventProperties.put(IdentityEventConstants.EventProperty.CLAIM_DIALECT_URI, localClaim.getClaimDialectURI());
eventProperties.put(IdentityEventConstants.EventProperty.LOCAL_CLAIM_PROPERTIES, localClaim.getClaimProperties());
eventProperties.put(IdentityEventConstants.EventProperty.MAPPED_ATTRIBUTES, localClaim.getMappedAttributes());
Event event = createEvent(eventProperties, IdentityEventConstants.Event.POST_UPDATE_LOCAL_CLAIM);
doPublishEvent(event);
}
use of org.wso2.carbon.identity.claim.metadata.mgt.model.LocalClaim in project carbon-identity-framework by wso2.
the class ClaimMetadataEventPublisherProxy method publishPostDeleteLocalClaim.
public void publishPostDeleteLocalClaim(int tenantId, String localClaim) {
Map<String, Object> eventProperties = new HashMap<>();
eventProperties.put(IdentityEventConstants.EventProperty.TENANT_ID, tenantId);
eventProperties.put(IdentityEventConstants.EventProperty.LOCAL_CLAIM_URI, localClaim);
Event event = createEvent(eventProperties, IdentityEventConstants.Event.POST_DELETE_LOCAL_CLAIM);
doPublishEvent(event);
}
use of org.wso2.carbon.identity.claim.metadata.mgt.model.LocalClaim in project carbon-identity-framework by wso2.
the class ClaimMetadataEventPublisherProxy method publishPreAddLocalClaim.
public void publishPreAddLocalClaim(int tenantId, LocalClaim localClaim) {
Map<String, Object> eventProperties = new HashMap<>();
eventProperties.put(IdentityEventConstants.EventProperty.TENANT_ID, tenantId);
eventProperties.put(IdentityEventConstants.EventProperty.LOCAL_CLAIM_URI, localClaim.getClaimURI());
eventProperties.put(IdentityEventConstants.EventProperty.CLAIM_DIALECT_URI, localClaim.getClaimDialectURI());
eventProperties.put(IdentityEventConstants.EventProperty.MAPPED_ATTRIBUTES, localClaim.getMappedAttributes());
eventProperties.put(IdentityEventConstants.EventProperty.LOCAL_CLAIM_PROPERTIES, localClaim.getClaimProperties());
Event event = createEvent(eventProperties, IdentityEventConstants.Event.PRE_ADD_LOCAL_CLAIM);
doPublishEvent(event);
}
use of org.wso2.carbon.identity.claim.metadata.mgt.model.LocalClaim in project carbon-identity-framework by wso2.
the class ClaimMetadataEventPublisherProxy method publishPreDeleteLocalClaim.
public void publishPreDeleteLocalClaim(int tenantId, String localClaim) {
Map<String, Object> eventProperties = new HashMap<>();
eventProperties.put(IdentityEventConstants.EventProperty.TENANT_ID, tenantId);
eventProperties.put(IdentityEventConstants.EventProperty.LOCAL_CLAIM_URI, localClaim);
Event event = createEvent(eventProperties, IdentityEventConstants.Event.PRE_DELETE_LOCAL_CLAIM);
doPublishEvent(event);
}
use of org.wso2.carbon.identity.claim.metadata.mgt.model.LocalClaim in project carbon-identity-framework by wso2.
the class ClaimMetadataHandler method getMappingsFromOtherDialectToCarbon.
/**
* @param otherDialectURI
* @param otherClaimURIs
* @param tenantDomain
* @return
* @throws ClaimMetadataException
*/
public Set<ExternalClaim> getMappingsFromOtherDialectToCarbon(String otherDialectURI, Set<String> otherClaimURIs, String tenantDomain) throws ClaimMetadataException {
Set<ExternalClaim> returnSet = new HashSet<ExternalClaim>();
if (otherDialectURI == null) {
String message = "Invalid argument: \'otherDialectURI\' is \'NULL\'";
log.error(message);
throw new ClaimMetadataException(message);
}
try {
ClaimMetadataManagementServiceImpl claimMetadataService = new ClaimMetadataManagementServiceImpl();
if (otherDialectURI.equals(UserCoreConstants.DEFAULT_CARBON_DIALECT)) {
List<LocalClaim> localClaims = claimMetadataService.getLocalClaims(tenantDomain);
if (otherClaimURIs == null || otherClaimURIs.isEmpty()) {
for (LocalClaim localClaim : localClaims) {
ExternalClaim claimMapping = new ExternalClaim(localClaim.getClaimDialectURI(), localClaim.getClaimURI(), localClaim.getClaimURI());
returnSet.add(claimMapping);
}
return returnSet;
} else {
for (LocalClaim localClaim : localClaims) {
if (otherClaimURIs.contains(localClaim.getClaimURI())) {
ExternalClaim claimMapping = new ExternalClaim(otherDialectURI, localClaim.getClaimURI(), localClaim.getClaimURI());
returnSet.add(claimMapping);
}
}
return returnSet;
}
} else {
List<ExternalClaim> externalClaims = claimMetadataService.getExternalClaims(otherDialectURI, tenantDomain);
if (otherClaimURIs == null || otherClaimURIs.isEmpty()) {
returnSet = new HashSet<ExternalClaim>(externalClaims);
} else {
for (ExternalClaim externalClaim : externalClaims) {
if (otherClaimURIs.contains(externalClaim.getClaimURI())) {
returnSet.add(externalClaim);
}
}
}
return returnSet;
}
} catch (ClaimMetadataException e) {
throw new ClaimMetadataException(e.getMessage(), e);
}
}
Aggregations