Search in sources :

Example 66 with Promise

use of io.joynr.provider.Promise in project joynr by bmwcarit.

the class RoutingProviderImpl method resolvedDeferred.

private Promise<DeferredVoid> resolvedDeferred() {
    final DeferredVoid deferred = new DeferredVoid();
    deferred.resolve();
    return new Promise<>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) DeferredVoid(io.joynr.provider.DeferredVoid)

Example 67 with Promise

use of io.joynr.provider.Promise in project joynr by bmwcarit.

the class SubscriptionTestsProviderImpl method getAttributeWithProviderRuntimeException.

@Override
public Promise<Deferred<Integer>> getAttributeWithProviderRuntimeException() {
    Deferred<Integer> deferred = new Deferred<Integer>();
    ProviderRuntimeException error = new ProviderRuntimeException(MESSAGE_PROVIDERRUNTIMEEXCEPTION);
    deferred.reject(error);
    return new Promise<Deferred<Integer>>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) Deferred(io.joynr.provider.Deferred) ProviderRuntimeException(joynr.exceptions.ProviderRuntimeException)

Example 68 with Promise

use of io.joynr.provider.Promise in project joynr by bmwcarit.

the class GlobalDomainAccessControlListEditorProviderImpl method removeOwnerAccessControlEntry.

@Override
public Promise<RemoveOwnerAccessControlEntryDeferred> removeOwnerAccessControlEntry(String uid, String domain, String interfaceName, String operation) {
    RemoveOwnerAccessControlEntryDeferred deferred = new RemoveOwnerAccessControlEntryDeferred();
    boolean removeSuccess = domainAccessStore.removeOwnerAccessControlEntry(uid, domain, interfaceName, operation);
    if (removeSuccess) {
        OwnerAccessControlEntry removedEntry = new OwnerAccessControlEntry(uid, domain, interfaceName, null, null, operation, null);
        domainAccessControllerProvider.fireOwnerAccessControlEntryChanged(ChangeType.REMOVE, removedEntry);
    }
    deferred.resolve(removeSuccess);
    return new Promise<RemoveOwnerAccessControlEntryDeferred>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) OwnerAccessControlEntry(joynr.infrastructure.DacTypes.OwnerAccessControlEntry)

Example 69 with Promise

use of io.joynr.provider.Promise in project joynr by bmwcarit.

the class GlobalDomainAccessControlListEditorProviderImpl method removeMediatorAccessControlEntry.

@Override
public Promise<RemoveMediatorAccessControlEntryDeferred> removeMediatorAccessControlEntry(String uid, String domain, String interfaceName, String operation) {
    RemoveMediatorAccessControlEntryDeferred deferred = new RemoveMediatorAccessControlEntryDeferred();
    boolean removeSuccess = domainAccessStore.removeMediatorAccessControlEntry(uid, domain, interfaceName, operation);
    if (removeSuccess) {
        MasterAccessControlEntry removedEntry = new MasterAccessControlEntry(uid, domain, interfaceName, null, null, null, null, operation, null, null);
        domainAccessControllerProvider.fireMediatorAccessControlEntryChanged(ChangeType.REMOVE, removedEntry);
    }
    deferred.resolve(removeSuccess);
    return new Promise<RemoveMediatorAccessControlEntryDeferred>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) MasterAccessControlEntry(joynr.infrastructure.DacTypes.MasterAccessControlEntry)

Example 70 with Promise

use of io.joynr.provider.Promise in project joynr by bmwcarit.

the class DummyCapabilitiesDirectory method lookup.

@Override
public Promise<Lookup2Deferred> lookup(String participantId) {
    Lookup2Deferred deferred = new Lookup2Deferred();
    DiscoveryEntryWithMetaInfo discoveryEntry = lookup(participantId, DiscoveryQos.NO_FILTER);
    deferred.resolve(discoveryEntry);
    return new Promise<Lookup2Deferred>(deferred);
}
Also used : Promise(io.joynr.provider.Promise) DiscoveryEntryWithMetaInfo(joynr.types.DiscoveryEntryWithMetaInfo)

Aggregations

Promise (io.joynr.provider.Promise)79 DeferredVoid (io.joynr.provider.DeferredVoid)36 ProviderRuntimeException (joynr.exceptions.ProviderRuntimeException)27 MapStringString (joynr.interlanguagetest.namedTypeCollection2.MapStringString)13 Method (java.lang.reflect.Method)9 ProviderWrapper (io.joynr.jeeintegration.ProviderWrapper)6 JoynrProvider (io.joynr.provider.JoynrProvider)6 Test (org.junit.Test)6 JoynrException (io.joynr.exceptions.JoynrException)5 Deferred (io.joynr.provider.Deferred)4 PromiseListener (io.joynr.provider.PromiseListener)4 ExtendedExtendedBaseStruct (joynr.interlanguagetest.namedTypeCollection2.ExtendedExtendedBaseStruct)4 GlobalDiscoveryEntry (joynr.types.GlobalDiscoveryEntry)4 StructWithStringArray (joynr.interlanguagetest.namedTypeCollection1.StructWithStringArray)3 ExtendedTypeCollectionEnumerationInTypeCollection (joynr.interlanguagetest.namedTypeCollection2.ExtendedTypeCollectionEnumerationInTypeCollection)3 DiscoveryEntry (joynr.types.DiscoveryEntry)3 DiscoveryEntryWithMetaInfo (joynr.types.DiscoveryEntryWithMetaInfo)3 DiscoveryQos (io.joynr.arbitration.DiscoveryQos)2 DiscoveryScope (io.joynr.arbitration.DiscoveryScope)2 ProviderContainer (io.joynr.provider.ProviderContainer)2