use of org.wso2.carbon.identity.user.store.configuration.dto.UserStoreDTO in project carbon-identity-framework by wso2.
the class AbstractUserStoreDAO method getUserStoreProperty.
private UserStoreDTO getUserStoreProperty(UserStoreDTO userStoreDTO) throws IdentityUserStoreMgtException {
boolean newState = userStoreDTO.getDisabled();
UserStoreDTO userStoreDTOTemp = getUserStore(userStoreDTO.getDomainId());
if (userStoreDTOTemp != null) {
userStoreDTO = userStoreDTOTemp;
userStoreDTO.setDisabled(newState);
PropertyDTO[] propertyDTO = userStoreDTO.getProperties();
for (PropertyDTO propertyDTOValue : propertyDTO) {
if (propertyDTOValue.getName().equals(DISABLED)) {
propertyDTOValue.setValue(String.valueOf(newState));
}
}
}
return userStoreDTO;
}
use of org.wso2.carbon.identity.user.store.configuration.dto.UserStoreDTO in project carbon-identity-framework by wso2.
the class AbstractUserStoreDAO method getUserStorePersistanceDTO.
private UserStorePersistanceDTO getUserStorePersistanceDTO(UserStoreDTO userStoreDTO, String userStoreProperties) {
UserStorePersistanceDTO userStorePersistanceDTO = new UserStorePersistanceDTO();
userStorePersistanceDTO.setUserStoreDTO(userStoreDTO);
userStorePersistanceDTO.setUserStoreProperties(userStoreProperties);
return userStorePersistanceDTO;
}
use of org.wso2.carbon.identity.user.store.configuration.dto.UserStoreDTO in project carbon-identity-framework by wso2.
the class AbstractUserStoreDAO method addUserStore.
@Override
public void addUserStore(UserStoreDTO userStoreDTO) throws IdentityUserStoreMgtException {
UserStorePersistanceDTO userStorePersistanceDTO = getUserStorePersistanceDTO(userStoreDTO, getUserStoreProperties(userStoreDTO, userStoreDTO.getDomainId()));
doAddUserStore(userStorePersistanceDTO);
}
use of org.wso2.carbon.identity.user.store.configuration.dto.UserStoreDTO in project carbon-identity-framework by wso2.
the class AbstractUserStoreDAO method getUserStores.
@Override
public UserStoreDTO[] getUserStores() throws IdentityUserStoreMgtException {
UserStorePersistanceDTO[] userStorePersistanceDTOS = doGetAllUserStores();
List<UserStoreDTO> userStoreDTOs = new ArrayList<>();
for (UserStorePersistanceDTO userStorePersistanceDTO : userStorePersistanceDTOS) {
userStoreDTOs.add(userStorePersistanceDTO.getUserStoreDTO());
}
return userStoreDTOs.toArray(new UserStoreDTO[userStoreDTOs.size()]);
}
use of org.wso2.carbon.identity.user.store.configuration.dto.UserStoreDTO in project carbon-identity-framework by wso2.
the class UserStoreConfigAdminService method changeUserStoreState.
/**
* Update a domain to be disabled/enabled in file repository.
*
* @param domain Name of the domain to be updated
* @param isDisable Whether to disable/enable domain(true/false)
* @throws IdentityUserStoreMgtException If error occurs during domain validation
* @throws TransformerConfigurationException If error occurs during configuration transformation
*/
public void changeUserStoreState(String domain, Boolean isDisable) throws IdentityUserStoreMgtException, TransformerConfigurationException {
validateDomain(domain, isDisable);
try {
triggerListenersOnUserStorePreStateChange(domain, isDisable);
} catch (UserStoreException e) {
throw new IdentityUserStoreMgtException("Error occurred while triggering the user store pre state change" + " listeners.");
}
UserStoreDTO userStoreDTO = getUserStoreDTO(domain, isDisable, null);
updateStateInFileRepository(userStoreDTO);
}
Aggregations