use of io.joynr.messaging.MessagingQos in project joynr by bmwcarit.
the class PublicationManagerImpl method handleBroadcastSubscriptionRequest.
private void handleBroadcastSubscriptionRequest(String proxyParticipantId, String providerParticipantId, BroadcastSubscriptionRequest subscriptionRequest, ProviderContainer providerContainer) {
logger.trace("adding broadcast publication: {}", subscriptionRequest);
BroadcastListener broadcastListener = new BroadcastListenerImpl(subscriptionRequest.getSubscriptionId(), this);
String broadcastName = subscriptionRequest.getSubscribedToName();
providerContainer.getSubscriptionPublisher().registerBroadcastListener(broadcastName, broadcastListener);
unregisterBroadcastListeners.put(subscriptionRequest.getSubscriptionId(), new UnregisterBroadcastListener(providerContainer.getSubscriptionPublisher(), broadcastName, broadcastListener));
final String subscriptionId = subscriptionRequest.getSubscriptionId();
SubscriptionQos subscriptionQos = subscriptionRequest.getQos();
MessagingQos messagingQos = createMessagingQos(subscriptionQos);
SubscriptionReply subscriptionReply = new SubscriptionReply(subscriptionId);
dispatcher.sendSubscriptionReply(providerParticipantId, proxyParticipantId, subscriptionReply, messagingQos);
}
use of io.joynr.messaging.MessagingQos in project joynr by bmwcarit.
the class PublicationManagerImpl method multicastOccurred.
@Override
public void multicastOccurred(String providerParticipantId, String multicastName, String[] partitions, Object... values) {
logger.trace("Multicast occurred for {} / {} / {} / {}", providerParticipantId, multicastName, Arrays.toString(partitions), Arrays.toString(values));
String multicastId = MulticastIdUtil.createMulticastId(providerParticipantId, multicastName, partitions);
MulticastPublication multicastPublication = new MulticastPublication(Arrays.asList(values), multicastId);
MessagingQos messagingQos = new MessagingQos();
dispatcher.sendMulticast(providerParticipantId, multicastPublication, messagingQos);
}
use of io.joynr.messaging.MessagingQos in project joynr by bmwcarit.
the class DispatcherImpl method sendReply.
public void sendReply(final String fromParticipantId, final String toParticipantId, Reply reply, final long expiryDateMs, Map<String, String> customHeaders, final boolean compress) throws IOException {
MessagingQos messagingQos = new MessagingQos(expiryDateMs);
messagingQos.getCustomMessageHeaders().putAll(customHeaders);
messagingQos.setCompress(compress);
MutableMessage message = messageFactory.createReply(fromParticipantId, toParticipantId, reply, messagingQos);
messageSender.sendMessage(message);
}
use of io.joynr.messaging.MessagingQos in project joynr by bmwcarit.
the class GlobalCapabilitiesDirectoryClient method getProxy.
private GlobalCapabilitiesDirectoryProxy getProxy(long ttl) {
ProxyBuilder<GlobalCapabilitiesDirectoryProxy> capabilitiesProxyBuilder = proxyBuilderFactory.get(domain, GlobalCapabilitiesDirectoryProxy.class);
MessagingQos messagingQos = new MessagingQos(ttl);
return capabilitiesProxyBuilder.setDiscoveryQos(discoveryQos).setMessagingQos(messagingQos).build();
}
use of io.joynr.messaging.MessagingQos in project joynr by bmwcarit.
the class SubscriptionManagerImpl method unregisterSubscription.
@Override
public void unregisterSubscription(String fromParticipantId, Set<DiscoveryEntryWithMetaInfo> toDiscoveryEntries, String subscriptionId, MessagingQos qosSettings) {
PubSubState subscriptionState = subscriptionStates.get(subscriptionId);
if (subscriptionState != null) {
logger.trace("Called unregister / unsubscribe on subscription id= " + subscriptionId);
removeSubscription(subscriptionId);
} else {
logger.trace("Called unregister on a non/no longer existent subscription, used id= " + subscriptionId);
}
SubscriptionStop subscriptionStop = new SubscriptionStop(subscriptionId);
dispatcher.sendSubscriptionStop(fromParticipantId, toDiscoveryEntries, subscriptionStop, new MessagingQos(qosSettings));
}
Aggregations