Search in sources :

Example 1 with LdacMediatorAccessControlEntryChangedBroadcastListener

use of io.joynr.accesscontrol.broadcastlistener.LdacMediatorAccessControlEntryChangedBroadcastListener in project joynr by bmwcarit.

the class LocalDomainAccessControllerImpl method subscribeForAceChange.

private AceSubscription subscribeForAceChange(String domain, String interfaceName) {
    long wsbExpiryDate = System.currentTimeMillis() + QOS_DURATION_MS;
    MulticastSubscriptionQos broadcastSubscriptionQos = new MulticastSubscriptionQos();
    broadcastSubscriptionQos.setExpiryDateMs(wsbExpiryDate);
    Future<String> mastersubscriptionId = globalDomainAccessControllerClient.subscribeToMasterAccessControlEntryChangedBroadcast(new LdacMasterAccessControlEntryChangedBroadcastListener(localDomainAccessStore), broadcastSubscriptionQos, SINGLE_LEVEL_WILDCARD, sanitiseForPartition(domain), sanitiseForPartition(interfaceName));
    Future<String> mediatorsubscriptionId = globalDomainAccessControllerClient.subscribeToMediatorAccessControlEntryChangedBroadcast(new LdacMediatorAccessControlEntryChangedBroadcastListener(localDomainAccessStore), broadcastSubscriptionQos, SINGLE_LEVEL_WILDCARD, sanitiseForPartition(domain), sanitiseForPartition(interfaceName));
    Future<String> ownersubscriptionId = globalDomainAccessControllerClient.subscribeToOwnerAccessControlEntryChangedBroadcast(new LdacOwnerAccessControlEntryChangedBroadcastListener(localDomainAccessStore), broadcastSubscriptionQos, SINGLE_LEVEL_WILDCARD, sanitiseForPartition(domain), sanitiseForPartition(interfaceName));
    return new AceSubscription(mastersubscriptionId, mediatorsubscriptionId, ownersubscriptionId);
}
Also used : LdacOwnerAccessControlEntryChangedBroadcastListener(io.joynr.accesscontrol.broadcastlistener.LdacOwnerAccessControlEntryChangedBroadcastListener) LdacMasterAccessControlEntryChangedBroadcastListener(io.joynr.accesscontrol.broadcastlistener.LdacMasterAccessControlEntryChangedBroadcastListener) LdacMediatorAccessControlEntryChangedBroadcastListener(io.joynr.accesscontrol.broadcastlistener.LdacMediatorAccessControlEntryChangedBroadcastListener) MulticastSubscriptionQos(joynr.MulticastSubscriptionQos)

Example 2 with LdacMediatorAccessControlEntryChangedBroadcastListener

use of io.joynr.accesscontrol.broadcastlistener.LdacMediatorAccessControlEntryChangedBroadcastListener in project joynr by bmwcarit.

the class GdacBroadcastListenerTest method testMediatorAceChangedListenerForRemoveAce.

@Test
public void testMediatorAceChangedListenerForRemoveAce() {
    LdacMediatorAccessControlEntryChangedBroadcastListener dreChangedListener = new LdacMediatorAccessControlEntryChangedBroadcastListener(domainAccessControlStore);
    dreChangedListener.onReceive(ChangeType.REMOVE, masterAce);
    verify(domainAccessControlStore).removeMediatorAccessControlEntry(masterAce.getUid(), masterAce.getDomain(), masterAce.getInterfaceName(), masterAce.getOperation());
}
Also used : LdacMediatorAccessControlEntryChangedBroadcastListener(io.joynr.accesscontrol.broadcastlistener.LdacMediatorAccessControlEntryChangedBroadcastListener) Test(org.junit.Test)

Example 3 with LdacMediatorAccessControlEntryChangedBroadcastListener

use of io.joynr.accesscontrol.broadcastlistener.LdacMediatorAccessControlEntryChangedBroadcastListener in project joynr by bmwcarit.

the class GdacBroadcastListenerTest method testMediatorAceChangedListenerForUpdateAce.

@Test
public void testMediatorAceChangedListenerForUpdateAce() {
    LdacMediatorAccessControlEntryChangedBroadcastListener dreChangedListener = new LdacMediatorAccessControlEntryChangedBroadcastListener(domainAccessControlStore);
    dreChangedListener.onReceive(ChangeType.UPDATE, masterAce);
    verify(domainAccessControlStore).updateMediatorAccessControlEntry(eq(masterAce));
}
Also used : LdacMediatorAccessControlEntryChangedBroadcastListener(io.joynr.accesscontrol.broadcastlistener.LdacMediatorAccessControlEntryChangedBroadcastListener) Test(org.junit.Test)

Aggregations

LdacMediatorAccessControlEntryChangedBroadcastListener (io.joynr.accesscontrol.broadcastlistener.LdacMediatorAccessControlEntryChangedBroadcastListener)3 Test (org.junit.Test)2 LdacMasterAccessControlEntryChangedBroadcastListener (io.joynr.accesscontrol.broadcastlistener.LdacMasterAccessControlEntryChangedBroadcastListener)1 LdacOwnerAccessControlEntryChangedBroadcastListener (io.joynr.accesscontrol.broadcastlistener.LdacOwnerAccessControlEntryChangedBroadcastListener)1 MulticastSubscriptionQos (joynr.MulticastSubscriptionQos)1