Search in sources :

Example 1 with TrustLevel

use of joynr.infrastructure.DacTypes.TrustLevel in project joynr by bmwcarit.

the class MasterAccessControlEntryManager method mapEntityToJoynrType.

private MasterAccessControlEntry mapEntityToJoynrType(MasterAccessControlEntryEntity entity) {
    MasterAccessControlEntry result = new MasterAccessControlEntry();
    result.setUid(entity.getUserId());
    result.setDomain(entity.getDomain());
    result.setInterfaceName(entity.getInterfaceName());
    result.setDefaultRequiredTrustLevel(entity.getDefaultRequiredTrustLevel());
    result.setPossibleRequiredTrustLevels(entity.getPossibleRequiredTrustLevels().toArray(new TrustLevel[entity.getPossibleRequiredTrustLevels().size()]));
    result.setDefaultRequiredControlEntryChangeTrustLevel(entity.getDefaultRequiredControlEntryChangeTrustLevel());
    result.setPossibleRequiredControlEntryChangeTrustLevels(entity.getPossibleRequiredControlEntryChangeTrustLevels().toArray(new TrustLevel[entity.getPossibleRequiredControlEntryChangeTrustLevels().size()]));
    result.setOperation(entity.getOperation());
    result.setDefaultConsumerPermission(entity.getDefaultConsumerPermission());
    result.setPossibleConsumerPermissions(entity.getPossibleConsumerPermissions().toArray(new Permission[entity.getPossibleConsumerPermissions().size()]));
    return result;
}
Also used : MasterAccessControlEntry(joynr.infrastructure.DacTypes.MasterAccessControlEntry) TrustLevel(joynr.infrastructure.DacTypes.TrustLevel) Permission(joynr.infrastructure.DacTypes.Permission)

Example 2 with TrustLevel

use of joynr.infrastructure.DacTypes.TrustLevel in project joynr by bmwcarit.

the class DomainAccessControlStoreTest method setup.

@Before
public void setup() {
    // instantiate some template objects
    expectedUserDomainRoleEntry = new DomainRoleEntry(UID1, new String[0], Role.OWNER);
    expectedMasterAccessControlEntry = new MasterAccessControlEntry(UID1, DOMAIN1, INTERFACE1, TrustLevel.LOW, new TrustLevel[] { TrustLevel.MID, TrustLevel.LOW }, TrustLevel.LOW, new TrustLevel[] { TrustLevel.MID, TrustLevel.LOW }, OPERATION1, Permission.NO, new Permission[] { Permission.ASK, Permission.NO });
    expectedOwnerAccessControlEntry = new OwnerAccessControlEntry(UID1, DOMAIN1, INTERFACE1, TrustLevel.LOW, TrustLevel.LOW, OPERATION1, Permission.NO);
}
Also used : MasterAccessControlEntry(joynr.infrastructure.DacTypes.MasterAccessControlEntry) TrustLevel(joynr.infrastructure.DacTypes.TrustLevel) OwnerAccessControlEntry(joynr.infrastructure.DacTypes.OwnerAccessControlEntry) DomainRoleEntry(joynr.infrastructure.DacTypes.DomainRoleEntry) Permission(joynr.infrastructure.DacTypes.Permission) Before(org.junit.Before)

Example 3 with TrustLevel

use of joynr.infrastructure.DacTypes.TrustLevel in project joynr by bmwcarit.

the class ProvisionedDomainAccessControlStoreTest method setup.

@Before
public void setup() throws Exception {
    ObjectMapper objectMapper = new ObjectMapper();
    // instantiate some template objects
    expectedUserDomainRoleEntry = new DomainRoleEntry(UID1, new String[0], Role.OWNER);
    DomainRoleEntry[] provisionedDomainRoles = { expectedUserDomainRoleEntry };
    domainRoleEntryString = objectMapper.writeValueAsString(provisionedDomainRoles);
    expectedMasterAccessControlEntry = new MasterAccessControlEntry(UID1, DOMAIN1, INTERFACE1, TrustLevel.LOW, new TrustLevel[] { TrustLevel.MID, TrustLevel.LOW }, TrustLevel.LOW, new TrustLevel[] { TrustLevel.MID, TrustLevel.LOW }, OPERATION1, Permission.NO, new Permission[] { Permission.ASK, Permission.NO });
    MasterAccessControlEntry[] provisionedMasterAccessControlEntries = { expectedMasterAccessControlEntry };
    masterAccessControlEntryString = objectMapper.writeValueAsString(provisionedMasterAccessControlEntries);
}
Also used : MasterAccessControlEntry(joynr.infrastructure.DacTypes.MasterAccessControlEntry) TrustLevel(joynr.infrastructure.DacTypes.TrustLevel) DomainRoleEntry(joynr.infrastructure.DacTypes.DomainRoleEntry) Permission(joynr.infrastructure.DacTypes.Permission) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Before(org.junit.Before)

Example 4 with TrustLevel

use of joynr.infrastructure.DacTypes.TrustLevel in project joynr by bmwcarit.

the class MasterRegistrationControlEntryManager method mapEntityToJoynrType.

private MasterRegistrationControlEntry mapEntityToJoynrType(MasterRegistrationControlEntryEntity entity) {
    Set<TrustLevel> possibleRequiredTrustLevels = Sets.newHashSet(entity.getPossibleRequiredTrustLevels());
    Set<TrustLevel> possibleRequiredControlEntryChangeTrustLevels = Sets.newHashSet(entity.getPossibleRequiredControlEntryChangeTrustLevels());
    Set<Permission> possibleProviderPermissions = Sets.newHashSet(entity.getDefaultProviderPermission());
    MasterRegistrationControlEntry entry = new MasterRegistrationControlEntry(entity.getUserId(), entity.getDomain(), entity.getInterfaceName(), entity.getDefaultRequiredTrustLevel(), possibleRequiredTrustLevels.toArray(new TrustLevel[possibleRequiredTrustLevels.size()]), entity.getDefaultRequiredControlEntryChangeTrustLevel(), possibleRequiredControlEntryChangeTrustLevels.toArray(new TrustLevel[possibleRequiredControlEntryChangeTrustLevels.size()]), entity.getDefaultProviderPermission(), possibleProviderPermissions.toArray(new Permission[possibleProviderPermissions.size()]));
    return entry;
}
Also used : TrustLevel(joynr.infrastructure.DacTypes.TrustLevel) Permission(joynr.infrastructure.DacTypes.Permission) MasterRegistrationControlEntry(joynr.infrastructure.DacTypes.MasterRegistrationControlEntry)

Example 5 with TrustLevel

use of joynr.infrastructure.DacTypes.TrustLevel in project joynr by bmwcarit.

the class AceValidatorTest method setup.

@Before
public void setup() {
    masterAce = new MasterAccessControlEntry(null, null, null, TrustLevel.LOW, new TrustLevel[] { TrustLevel.MID, TrustLevel.LOW }, TrustLevel.LOW, new TrustLevel[] { TrustLevel.MID, TrustLevel.HIGH }, null, Permission.NO, new Permission[] { Permission.ASK, Permission.NO });
    mediatorAce = new MasterAccessControlEntry(null, null, null, TrustLevel.LOW, new TrustLevel[] { TrustLevel.MID, TrustLevel.LOW }, TrustLevel.LOW, new TrustLevel[] { TrustLevel.MID, TrustLevel.HIGH }, null, Permission.NO, new Permission[] { Permission.ASK, Permission.NO });
    ownerAce = new OwnerAccessControlEntry(null, null, null, TrustLevel.MID, TrustLevel.HIGH, null, Permission.ASK);
}
Also used : MasterAccessControlEntry(joynr.infrastructure.DacTypes.MasterAccessControlEntry) TrustLevel(joynr.infrastructure.DacTypes.TrustLevel) OwnerAccessControlEntry(joynr.infrastructure.DacTypes.OwnerAccessControlEntry) Permission(joynr.infrastructure.DacTypes.Permission) Before(org.junit.Before)

Aggregations

Permission (joynr.infrastructure.DacTypes.Permission)7 TrustLevel (joynr.infrastructure.DacTypes.TrustLevel)7 MasterAccessControlEntry (joynr.infrastructure.DacTypes.MasterAccessControlEntry)6 Before (org.junit.Before)5 DomainRoleEntry (joynr.infrastructure.DacTypes.DomainRoleEntry)4 OwnerAccessControlEntry (joynr.infrastructure.DacTypes.OwnerAccessControlEntry)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 DiscoveryQos (io.joynr.arbitration.DiscoveryQos)1 MessagingQos (io.joynr.messaging.MessagingQos)1 ProxyBuilderFactoryImpl (io.joynr.proxy.ProxyBuilderFactoryImpl)1 Set (java.util.Set)1 MasterRegistrationControlEntry (joynr.infrastructure.DacTypes.MasterRegistrationControlEntry)1 GlobalDiscoveryEntry (joynr.types.GlobalDiscoveryEntry)1