Search in sources :

Example 1 with AccountMapperHelper

use of io.vertigo.account.impl.account.AccountMapperHelper in project vertigo by KleeGroup.

the class AbstractAccountStorePlugin method start.

/**
 * {@inheritDoc}
 */
@Override
public final void start() {
    userDtDefinition = Home.getApp().getDefinitionSpace().resolve(userDtDefinitionName, DtDefinition.class);
    mapperHelper = new AccountMapperHelper(userDtDefinition, AccountProperty.class, userToAccountMappingStr).withMandatoryDestField(AccountProperty.id).withMandatoryDestField(AccountProperty.displayName).withMandatoryDestField(AccountProperty.authToken).parseAttributeMapping();
    postStart();
}
Also used : DtDefinition(io.vertigo.dynamo.domain.metamodel.DtDefinition) AccountMapperHelper(io.vertigo.account.impl.account.AccountMapperHelper)

Example 2 with AccountMapperHelper

use of io.vertigo.account.impl.account.AccountMapperHelper in project vertigo by KleeGroup.

the class StoreAccountStorePlugin method postStart.

@Override
protected void postStart() {
    userGroupDtDefinition = Home.getApp().getDefinitionSpace().resolve(groupIdentityEntity, DtDefinition.class);
    mapperHelper = new AccountMapperHelper(userGroupDtDefinition, GroupProperty.class, groupToGroupAccountMappingStr).withMandatoryDestField(GroupProperty.id).withMandatoryDestField(GroupProperty.displayName).parseAttributeMapping();
    for (final AssociationDefinition association : Home.getApp().getDefinitionSpace().getAll(AssociationDefinition.class)) {
        if ((userGroupDtDefinition.equals(association.getAssociationNodeA().getDtDefinition()) && getUserDtDefinition().equals(association.getAssociationNodeB().getDtDefinition()))) {
            associationUserGroup = association;
            associationUserRoleName = association.getAssociationNodeB().getRole();
            associationGroupRoleName = association.getAssociationNodeA().getRole();
            break;
        } else if (userGroupDtDefinition.equals(association.getAssociationNodeB().getDtDefinition()) && getUserDtDefinition().equals(association.getAssociationNodeA().getDtDefinition())) {
            associationUserGroup = association;
            associationUserRoleName = association.getAssociationNodeA().getRole();
            associationGroupRoleName = association.getAssociationNodeB().getRole();
            break;
        }
    }
    Assertion.checkNotNull(associationUserGroup, "Association between User ({0}) and Group ({1}) not found", getUserDtDefinition().getClassSimpleName(), userGroupDtDefinition.getClassSimpleName());
    Assertion.checkState(associationUserGroup instanceof AssociationSimpleDefinition || associationUserGroup instanceof AssociationNNDefinition, "Association ({0}) between User and Group must be an AssociationSimpleDefinition or an AssociationNNDefinition", associationUserGroup.getName());
}
Also used : AssociationDefinition(io.vertigo.dynamo.domain.metamodel.association.AssociationDefinition) DtDefinition(io.vertigo.dynamo.domain.metamodel.DtDefinition) AccountMapperHelper(io.vertigo.account.impl.account.AccountMapperHelper) AssociationSimpleDefinition(io.vertigo.dynamo.domain.metamodel.association.AssociationSimpleDefinition) AssociationNNDefinition(io.vertigo.dynamo.domain.metamodel.association.AssociationNNDefinition)

Example 3 with AccountMapperHelper

use of io.vertigo.account.impl.account.AccountMapperHelper in project vertigo by KleeGroup.

the class LdapIdentityProviderPlugin method start.

/**
 * {@inheritDoc}
 */
@Override
public void start() {
    final DtDefinition userDtDefinition = Home.getApp().getDefinitionSpace().resolve(userDtDefinitionName, DtDefinition.class);
    mapperHelper = new AccountMapperHelper(userDtDefinition, ldapUserAttributeMappingStr).withReservedDestField(PHOTO_RESERVED_FIELD).parseAttributeMapping();
}
Also used : DtDefinition(io.vertigo.dynamo.domain.metamodel.DtDefinition) AccountMapperHelper(io.vertigo.account.impl.account.AccountMapperHelper)

Aggregations

AccountMapperHelper (io.vertigo.account.impl.account.AccountMapperHelper)3 DtDefinition (io.vertigo.dynamo.domain.metamodel.DtDefinition)3 AssociationDefinition (io.vertigo.dynamo.domain.metamodel.association.AssociationDefinition)1 AssociationNNDefinition (io.vertigo.dynamo.domain.metamodel.association.AssociationNNDefinition)1 AssociationSimpleDefinition (io.vertigo.dynamo.domain.metamodel.association.AssociationSimpleDefinition)1