Search in sources :

Example 16 with UserStorePersistanceDTO

use of org.wso2.carbon.identity.user.store.configuration.dto.UserStorePersistanceDTO in project carbon-identity-framework by wso2.

the class AbstractUserStoreDAO method updateUserStore.

@Override
public void updateUserStore(UserStoreDTO userStoreDTO, boolean isStateChange) throws IdentityUserStoreMgtException {
    if (isStateChange) {
        userStoreDTO = getUserStoreProperty(userStoreDTO);
    }
    UserStorePersistanceDTO userStorePersistanceDTO = getUserStorePersistanceDTO(userStoreDTO, getUserStoreProperties(userStoreDTO, userStoreDTO.getDomainId()));
    userStorePersistanceDTO.setUserStoreDTO(userStoreDTO);
    doUpdateUserStore(userStorePersistanceDTO, isStateChange);
}
Also used : UserStorePersistanceDTO(org.wso2.carbon.identity.user.store.configuration.dto.UserStorePersistanceDTO)

Example 17 with UserStorePersistanceDTO

use of org.wso2.carbon.identity.user.store.configuration.dto.UserStorePersistanceDTO in project carbon-identity-framework by wso2.

the class DatabaseBasedUserStoreDAOImpl method doUpdateUserStore.

@Override
protected void doUpdateUserStore(UserStorePersistanceDTO userStorePersistanceDTO, boolean isStateChange) throws IdentityUserStoreMgtException {
    String domainName = userStorePersistanceDTO.getUserStoreDTO().getDomainId();
    updateUserStoreProperties(domainName, userStorePersistanceDTO);
    try {
        removeRealmFromSecondaryUserStoreManager(domainName);
        addRealmToSecondaryUserStoreManager(userStorePersistanceDTO);
    } catch (UserStoreException | XMLStreamException e) {
        throw new IdentityUserStoreMgtException("Error occured while updating the userstore.", e);
    }
}
Also used : IdentityUserStoreMgtException(org.wso2.carbon.identity.user.store.configuration.utils.IdentityUserStoreMgtException) XMLStreamException(javax.xml.stream.XMLStreamException) UserStoreException(org.wso2.carbon.user.api.UserStoreException)

Aggregations

UserStorePersistanceDTO (org.wso2.carbon.identity.user.store.configuration.dto.UserStorePersistanceDTO)9 UserStoreException (org.wso2.carbon.user.api.UserStoreException)9 IdentityUserStoreMgtException (org.wso2.carbon.identity.user.store.configuration.utils.IdentityUserStoreMgtException)8 XMLStreamException (javax.xml.stream.XMLStreamException)5 IOException (java.io.IOException)4 SecondaryUserStoreConfigurationUtil.buildIdentityUserStoreClientException (org.wso2.carbon.identity.user.store.configuration.utils.SecondaryUserStoreConfigurationUtil.buildIdentityUserStoreClientException)4 RealmConfiguration (org.wso2.carbon.user.api.RealmConfiguration)4 ByteArrayInputStream (java.io.ByteArrayInputStream)3 InputStream (java.io.InputStream)3 Path (java.nio.file.Path)3 Connection (java.sql.Connection)3 PreparedStatement (java.sql.PreparedStatement)3 SQLException (java.sql.SQLException)3 ArrayList (java.util.ArrayList)3 IdentityUserStoreClientException (org.wso2.carbon.identity.user.store.configuration.utils.IdentityUserStoreClientException)3 ResultSet (java.sql.ResultSet)2 UserStoreDTO (org.wso2.carbon.identity.user.store.configuration.dto.UserStoreDTO)2 UserStoreClientException (org.wso2.carbon.user.api.UserStoreClientException)2 MaskedProperty (org.wso2.carbon.identity.user.store.configuration.beans.MaskedProperty)1 UserRealm (org.wso2.carbon.user.core.UserRealm)1