@Override protected UserRealm getUserRealm() { return (UserRealm) CarbonContext.getThreadLocalCarbonContext().getUserRealm(); }
@Override protected UserRealm getUserRealm() { return (UserRealm) CarbonContext.getThreadLocalCarbonContext().getUserRealm(); }
@Override protected UserRealm getUserRealm() { return (UserRealm) CarbonContext.getThreadLocalCarbonContext().getUserRealm(); }
public MultipleCredentialsUserProxy() { this.realm = (UserRealm) CarbonContext.getThreadLocalCarbonContext().getUserRealm(); }
public MultipleCredentialsUserProxy() { this.realm = (UserRealm) CarbonContext.getThreadLocalCarbonContext().getUserRealm(); }
/** * @return */ private UserRealmProxy getUserAdminProxy() { UserRealm realm = (UserRealm) CarbonContext.getThreadLocalCarbonContext().getUserRealm(); return new UserRealmProxy(realm); }
/** * @return */ private UserRealmProxy getUserAdminProxy() { UserRealm realm = (UserRealm) CarbonContext.getThreadLocalCarbonContext().getUserRealm(); return new UserRealmProxy(realm); }
private void initDatasource() { try { dataSource = DatabaseUtil.getRealmDataSource(CarbonContext.getThreadLocalCarbonContext().getUserRealm(). getRealmConfiguration()); } catch (UserStoreException e) { log.error("Error while retrieving user management data source", e); } } }
private void initDatasource() { try { dataSource = DatabaseUtil.getRealmDataSource(CarbonContext.getThreadLocalCarbonContext().getUserRealm(). getRealmConfiguration()); } catch (UserStoreException e) { log.error("Error while retrieving user management data source", e); } } }
private void initDatasource() { try { dataSource = DatabaseUtil.getRealmDataSource(CarbonContext.getThreadLocalCarbonContext().getUserRealm(). getRealmConfiguration()); } catch (UserStoreException e) { log.error("Error while retrieving user management data source", e); } } }
private String getAdminRole() throws UserStoreException { return CarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration().getAdminRoleName(); }
/** * Check whether the user exist. * @param username Username of the user. * @return True if exist. * @throws Exception */ public boolean isUserExist(String username) throws UserRegistrationException { try { return CarbonContext.getThreadLocalCarbonContext().getUserRealm(). getUserStoreManager().isExistingUser(username); } catch (UserStoreException e) { log.error("Unable to connect to the user store.", e); throw new UserRegistrationException("Internal error occurred while connecting to the user store.", e); } }
/** * Check whether the user exist. * @param username Username of the user. * @return True if exist. * @throws Exception */ public boolean isUserExist(String username) throws UserRegistrationException { try { return CarbonContext.getThreadLocalCarbonContext().getUserRealm(). getUserStoreManager().isExistingUser(username); } catch (UserStoreException e) { log.error("Unable to connect to the user store.", e); throw new UserRegistrationException("Internal error occurred while connecting to the user store.", e); } }
/** * Delete the role of the app * * @param applicationName * @throws IdentityApplicationManagementException */ public static void deleteAppRole(String applicationName) throws IdentityApplicationManagementException { String roleName = getAppRoleName(applicationName); try { if (log.isDebugEnabled()) { log.debug("Deleting application role : " + roleName); } CarbonContext.getThreadLocalCarbonContext().getUserRealm().getUserStoreManager() .deleteRole(roleName); } catch (UserStoreException e) { throw new IdentityApplicationManagementException("Error while creating application", e); } }
public Set<String> getSupportedAttributes() { try { ClaimManager claimManager = CarbonContext.getThreadLocalCarbonContext().getUserRealm().getClaimManager(); ClaimMapping[] claims = claimManager .getAllClaimMappings(UserCoreConstants.DEFAULT_CARBON_DIALECT); for (ClaimMapping claim : claims) { supportedAttrs.add(claim.getClaim().getClaimUri()); } } catch (Exception e) { //ignore } return supportedAttrs; } }
/** * @param oldName * @param newName * @throws IdentityApplicationManagementException */ public static void renameRole(String oldName, String newName) throws UserStoreException { if (log.isDebugEnabled()) { log.debug("Renaming application role : " + UserCoreUtil.addInternalDomainName(oldName) + " to new role : " + UserCoreUtil.addInternalDomainName(newName)); } CarbonContext.getThreadLocalCarbonContext().getUserRealm().getUserStoreManager() .updateRoleName(UserCoreUtil.addInternalDomainName(oldName), UserCoreUtil.addInternalDomainName(newName)); }
public Set<String> getSupportedAttributes() { try { ClaimManager claimManager = CarbonContext.getThreadLocalCarbonContext().getUserRealm().getClaimManager(); ClaimMapping[] claims = claimManager .getAllClaimMappings(UserCoreConstants.DEFAULT_CARBON_DIALECT); for (ClaimMapping claim : claims) { supportedAttrs.add(claim.getClaim().getClaimUri()); } } catch (Exception e) { //ignore } return supportedAttrs; } }
public Set<String> getSupportedAttributes() { try { ClaimManager claimManager = CarbonContext.getThreadLocalCarbonContext().getUserRealm().getClaimManager(); ClaimMapping[] claims = claimManager .getAllClaimMappings(UserCoreConstants.DEFAULT_CARBON_DIALECT); for (ClaimMapping claim : claims) { supportedAttrs.add(claim.getClaim().getClaimUri()); } } catch (Exception e) { //ignore } return supportedAttrs; } }
/** * @param oldName * @param newName * @throws IdentityApplicationManagementException */ public static void renameRole(String oldName, String newName) throws UserStoreException { if (log.isDebugEnabled()) { log.debug("Renaming application role : " + UserCoreUtil.addInternalDomainName(oldName) + " to new role : " + UserCoreUtil.addInternalDomainName(newName)); } CarbonContext.getThreadLocalCarbonContext().getUserRealm().getUserStoreManager() .updateRoleName(UserCoreUtil.addInternalDomainName(oldName), UserCoreUtil.addInternalDomainName(newName)); }
private String[] getRoleOfDevice(Device device) throws PolicyManagementException { try { UserRealm userRealm = CarbonContext.getThreadLocalCarbonContext().getUserRealm(); if (userRealm != null) { return userRealm.getUserStoreManager().getRoleListOfUser(device.getEnrolmentInfo().getOwner()); } else { return null; } } catch (UserStoreException e) { throw new PolicyManagementException("Error occurred when retrieving roles related to user name.", e); } }