Search in sources :

Example 1 with UserStorePersistanceDTO

use of org.wso2.carbon.identity.user.store.configuration.dto.UserStorePersistanceDTO 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;
}
Also used : UserStorePersistanceDTO(org.wso2.carbon.identity.user.store.configuration.dto.UserStorePersistanceDTO)

Example 2 with UserStorePersistanceDTO

use of org.wso2.carbon.identity.user.store.configuration.dto.UserStorePersistanceDTO 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);
}
Also used : UserStorePersistanceDTO(org.wso2.carbon.identity.user.store.configuration.dto.UserStorePersistanceDTO)

Example 3 with UserStorePersistanceDTO

use of org.wso2.carbon.identity.user.store.configuration.dto.UserStorePersistanceDTO 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()]);
}
Also used : UserStoreDTO(org.wso2.carbon.identity.user.store.configuration.dto.UserStoreDTO) ArrayList(java.util.ArrayList) UserStorePersistanceDTO(org.wso2.carbon.identity.user.store.configuration.dto.UserStorePersistanceDTO)

Example 4 with UserStorePersistanceDTO

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

the class DatabaseBasedUserStoreDAOImpl method getUserStorePersistanceDTOs.

private void getUserStorePersistanceDTOs(List<UserStorePersistanceDTO> userStorePersistanceDTOs, RealmConfiguration realmConfiguration, String userStorePorpertyValues) {
    UserStorePersistanceDTO userStorePersistanceDTO = new UserStorePersistanceDTO();
    userStorePersistanceDTO.setUserStoreDTO(getUserStoreDTO(realmConfiguration));
    userStorePersistanceDTO.setUserStoreProperties(userStorePorpertyValues);
    userStorePersistanceDTOs.add(userStorePersistanceDTO);
}
Also used : UserStorePersistanceDTO(org.wso2.carbon.identity.user.store.configuration.dto.UserStorePersistanceDTO)

Example 5 with UserStorePersistanceDTO

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

the class DatabaseBasedUserStoreDAOImpl method addRealmToSecondaryUserStoreManager.

private void addRealmToSecondaryUserStoreManager(UserStorePersistanceDTO userStorePersistanceDTO) throws UserStoreException, XMLStreamException {
    UserRealm userRealm = (UserRealm) CarbonContext.getThreadLocalCarbonContext().getUserRealm();
    AbstractUserStoreManager primaryUSM = (AbstractUserStoreManager) userRealm.getUserStoreManager();
    InputStream targetStream = new ByteArrayInputStream(userStorePersistanceDTO.getUserStoreProperties().getBytes());
    RealmConfiguration realmConfiguration = getRealmConfiguration(userStorePersistanceDTO.getUserStoreDTO().getDomainId(), targetStream);
    primaryUSM.addSecondaryUserStoreManager(realmConfiguration, userRealm);
}
Also used : RealmConfiguration(org.wso2.carbon.user.api.RealmConfiguration) UserRealm(org.wso2.carbon.user.core.UserRealm) ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) AbstractUserStoreManager(org.wso2.carbon.user.core.common.AbstractUserStoreManager)

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