Search in sources :

Example 16 with MasterAccessControlEntry

use of joynr.infrastructure.DacTypes.MasterAccessControlEntry 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 17 with MasterAccessControlEntry

use of joynr.infrastructure.DacTypes.MasterAccessControlEntry 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 18 with MasterAccessControlEntry

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

the class GlobalDomainAccessStoreAdminEhCache method getAllMasterAclEntries.

@Override
public List<MasterAccessControlEntry> getAllMasterAclEntries() {
    List<MasterAccessControlEntry> result = new ArrayList<MasterAccessControlEntry>();
    Cache aclCache = getCache(CacheId.MASTER_ACL);
    Map<Object, Element> aclMap = aclCache.getAll(aclCache.getKeys());
    Iterator<Map.Entry<Object, Element>> iterator = aclMap.entrySet().iterator();
    while (iterator.hasNext()) {
        Map.Entry<Object, Element> thisMapEntry = iterator.next();
        Element thisElement = thisMapEntry.getValue();
        MasterAccessControlEntry objectValue = getElementValue(thisElement);
        result.add(objectValue);
    }
    return result;
}
Also used : DomainRoleEntry(joynr.infrastructure.DacTypes.DomainRoleEntry) MasterAccessControlEntry(joynr.infrastructure.DacTypes.MasterAccessControlEntry) OwnerAccessControlEntry(joynr.infrastructure.DacTypes.OwnerAccessControlEntry) MasterAccessControlEntry(joynr.infrastructure.DacTypes.MasterAccessControlEntry) Element(net.sf.ehcache.Element) ArrayList(java.util.ArrayList) Map(java.util.Map) DomainAccessControlStoreEhCache(io.joynr.accesscontrol.DomainAccessControlStoreEhCache) Cache(net.sf.ehcache.Cache)

Example 19 with MasterAccessControlEntry

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

the class IltProviderApplication method provisionAccessControl.

private static void provisionAccessControl(Properties properties, String domain) throws Exception {
    ObjectMapper objectMapper = new ObjectMapper();
    objectMapper.enableDefaultTypingAsProperty(DefaultTyping.JAVA_LANG_OBJECT, "_typeName");
    MasterAccessControlEntry newMasterAccessControlEntry = new MasterAccessControlEntry("*", domain, ProviderAnnotations.getInterfaceName(IltProvider.class), TrustLevel.LOW, new TrustLevel[] { TrustLevel.LOW }, TrustLevel.LOW, new TrustLevel[] { TrustLevel.LOW }, "*", Permission.YES, new Permission[] { Permission.YES });
    MasterAccessControlEntry[] provisionedAccessControlEntries = { newMasterAccessControlEntry };
    String provisionedAccessControlEntriesAsJson = objectMapper.writeValueAsString(provisionedAccessControlEntries);
    properties.setProperty(StaticDomainAccessControlProvisioning.PROPERTY_PROVISIONED_MASTER_ACCESSCONTROLENTRIES, provisionedAccessControlEntriesAsJson);
}
Also used : MasterAccessControlEntry(joynr.infrastructure.DacTypes.MasterAccessControlEntry) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 20 with MasterAccessControlEntry

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

the class EchoProviderApplication method createAppConfig.

private static Properties createAppConfig() throws Exception {
    Properties appConfig = new Properties();
    ObjectMapper objectMapper = new ObjectMapper();
    objectMapper.enableDefaultTypingAsProperty(DefaultTyping.JAVA_LANG_OBJECT, "_typeName");
    MasterAccessControlEntry newMasterAccessControlEntry = new MasterAccessControlEntry("*", invocationParams.getDomain(), ProviderAnnotations.getInterfaceName(EchoProviderImpl.class), TrustLevel.LOW, new TrustLevel[] { TrustLevel.LOW }, TrustLevel.LOW, new TrustLevel[] { TrustLevel.LOW }, "*", Permission.YES, new Permission[] { Permission.YES });
    MasterAccessControlEntry[] provisionedAccessControlEntries = { newMasterAccessControlEntry };
    String provisionedAccessControlEntriesAsJson = objectMapper.writeValueAsString(provisionedAccessControlEntries);
    appConfig.setProperty(StaticDomainAccessControlProvisioning.PROPERTY_PROVISIONED_MASTER_ACCESSCONTROLENTRIES, provisionedAccessControlEntriesAsJson);
    return appConfig;
}
Also used : MasterAccessControlEntry(joynr.infrastructure.DacTypes.MasterAccessControlEntry) Properties(java.util.Properties) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

MasterAccessControlEntry (joynr.infrastructure.DacTypes.MasterAccessControlEntry)41 Test (org.junit.Test)14 OwnerAccessControlEntry (joynr.infrastructure.DacTypes.OwnerAccessControlEntry)9 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)8 DomainRoleEntry (joynr.infrastructure.DacTypes.DomainRoleEntry)7 Permission (joynr.infrastructure.DacTypes.Permission)6 TrustLevel (joynr.infrastructure.DacTypes.TrustLevel)6 Before (org.junit.Before)6 MasterAccessControlEntryEntity (io.joynr.accesscontrol.global.jee.persistence.MasterAccessControlEntryEntity)5 ArrayList (java.util.ArrayList)4 Query (javax.persistence.Query)3 DomainRoleEntryEntity (io.joynr.accesscontrol.global.jee.persistence.DomainRoleEntryEntity)2 UserDomainInterfaceOperationKey (io.joynr.accesscontrol.primarykey.UserDomainInterfaceOperationKey)2 DiscoveryQos (io.joynr.arbitration.DiscoveryQos)2 MessagingQos (io.joynr.messaging.MessagingQos)2 Promise (io.joynr.provider.Promise)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 DomainAccessControlStoreEhCache (io.joynr.accesscontrol.DomainAccessControlStoreEhCache)1 ControlEntryType (io.joynr.accesscontrol.global.jee.persistence.ControlEntryType)1 ProxyBuilderFactoryImpl (io.joynr.proxy.ProxyBuilderFactoryImpl)1