use of org.wso2.carbon.user.mgt.stub.types.carbon.ClaimValue in project carbon-identity-framework by wso2.
the class MultipleCredentialsUserProxy method addUser.
/**
* @param credential
* @param roles
* @param claims
* @param profileName
* @throws MultipleCredentialsUserAdminException
*/
public void addUser(Credential credential, String[] roles, ClaimValue[] claims, String profileName) throws MultipleCredentialsUserAdminException {
try {
roles = checkRolesPermissions(roles);
MultipleCredentialUserStoreManager mgr = getUserStoreManager();
Map<String, String> claimMap = getClaimsMap(claims);
mgr.addUser(credential, roles, claimMap, profileName);
} catch (UserStoreException e) {
// previously logged so logging not needed
throw new MultipleCredentialsUserAdminException(e.getMessage(), e);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new MultipleCredentialsUserAdminException(e.getMessage(), e);
}
}
use of org.wso2.carbon.user.mgt.stub.types.carbon.ClaimValue in project carbon-identity-framework by wso2.
the class MultipleCredentialsUserProxy method setUserClaimValues.
public void setUserClaimValues(String identifer, String credentialType, ClaimValue[] claim, String profileName) throws MultipleCredentialsUserAdminException {
try {
MultipleCredentialUserStoreManager mgr = getUserStoreManager();
Map<String, String> claims = getClaimsMap(claim);
mgr.setUserClaimValues(identifer, credentialType, claims, profileName);
} catch (UserStoreException e) {
// previously logged so logging not needed
throw new MultipleCredentialsUserAdminException(e.getMessage(), e);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new MultipleCredentialsUserAdminException(e.getMessage(), e);
}
}
use of org.wso2.carbon.user.mgt.stub.types.carbon.ClaimValue in project carbon-identity-framework by wso2.
the class MultipleCredentialsUserProxy method getClaimValues.
private ClaimValue[] getClaimValues(Map<String, String> claim) {
if (claim != null) {
ClaimValue[] claimValue = new ClaimValue[claim.size()];
int i = 0;
for (Map.Entry<String, String> entry : claim.entrySet()) {
claimValue[i] = new ClaimValue();
claimValue[i].setClaimURI(entry.getKey());
claimValue[i].setValue(entry.getValue());
i++;
}
return claimValue;
}
return new ClaimValue[0];
}
use of org.wso2.carbon.user.mgt.stub.types.carbon.ClaimValue in project carbon-identity-framework by wso2.
the class MultipleCredentialsUserProxy method setUserClaimValue.
public void setUserClaimValue(String identifer, String credentialType, String claimURI, String claimValue, String profileName) throws MultipleCredentialsUserAdminException {
try {
MultipleCredentialUserStoreManager mgr = getUserStoreManager();
mgr.setUserClaimValue(identifer, credentialType, claimURI, claimValue, profileName);
} catch (UserStoreException e) {
throw new MultipleCredentialsUserAdminException(e.getMessage(), e);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new MultipleCredentialsUserAdminException(e.getMessage(), e);
}
}
use of org.wso2.carbon.user.mgt.stub.types.carbon.ClaimValue in project carbon-identity-framework by wso2.
the class MultipleCredentialsUserProxy method addUser.
public void addUser(String userId, Credential credential, String[] roleList, ClaimValue[] claims, String profileName) throws MultipleCredentialsUserAdminException {
try {
roleList = checkRolesPermissions(roleList);
MultipleCredentialUserStoreManager mgr = getUserStoreManager();
Map<String, String> claimMap = getClaimsMap(claims);
mgr.addUserWithUserId(userId, credential, roleList, claimMap, profileName);
} catch (UserStoreException e) {
// previously logged so logging not needed
throw new MultipleCredentialsUserAdminException(e.getMessage(), e);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new MultipleCredentialsUserAdminException(e.getMessage(), e);
}
}
Aggregations