本文整理了Java中org.apache.qpid.proton.amqp.messaging.Source.getFilter()
方法的一些代码示例,展示了Source.getFilter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Source.getFilter()
方法的具体详情如下:
包路径:org.apache.qpid.proton.amqp.messaging.Source
类名称:Source
方法名:getFilter
暂无
代码示例来源:origin: Azure/azure-service-bus-java
if(this.isSessionReceiver)
Map remoteSourceFilter = ((Source)this.receiveLink.getRemoteSource()).getFilter();
if(remoteSourceFilter != null && remoteSourceFilter.containsKey(ClientConstants.SESSION_FILTER))
代码示例来源:origin: org.apache.qpid/proton
public int size()
{
return _impl.getCapabilities() != null
? 11
: _impl.getOutcomes() != null
? 10
: _impl.getDefaultOutcome() != null
? 9
: _impl.getFilter() != null
? 8
: _impl.getDistributionMode() != null
? 7
: _impl.getDynamicNodeProperties() != null
? 6
: _impl.getDynamic()
? 5
: (_impl.getTimeout() != null && !_impl.getTimeout().equals(UnsignedInteger.ZERO))
? 4
: _impl.getExpiryPolicy() != TerminusExpiryPolicy.SESSION_END
? 3
: _impl.getDurable() != TerminusDurability.NONE
? 2
: _impl.getAddress() != null
? 1
: 0;
}
代码示例来源:origin: org.apache.qpid/proton-j-impl
public int size()
{
return _impl.getCapabilities() != null
? 11
: _impl.getOutcomes() != null
? 10
: _impl.getDefaultOutcome() != null
? 9
: _impl.getFilter() != null
? 8
: _impl.getDistributionMode() != null
? 7
: _impl.getDynamicNodeProperties() != null
? 6
: _impl.getDynamic()
? 5
: (_impl.getTimeout() != null && !_impl.getTimeout().equals(UnsignedInteger.ZERO))
? 4
: _impl.getExpiryPolicy() != TerminusExpiryPolicy.SESSION_END
? 3
: _impl.getDurable() != TerminusDurability.NONE
? 2
: _impl.getAddress() != null
? 1
: 0;
}
代码示例来源:origin: strimzi/strimzi-kafka-bridge
Map<Symbol, Object> filters = source.getFilter();
代码示例来源:origin: apache/activemq-artemis
@SuppressWarnings("unchecked")
@Override
public void inspectOpenedResource(Receiver receiver) {
if (receiver.getRemoteSource() == null) {
markAsInvalid("Link opened with null source.");
}
Source source = (Source) receiver.getRemoteSource();
Map<Symbol, Object> filters = source.getFilter();
if (findFilter(filters, AmqpUnknownFilterType.UNKNOWN_FILTER_IDS) != null) {
markAsInvalid("Broker should not return unsupported filter on attach.");
}
}
});
代码示例来源:origin: apache/activemq-artemis
@SuppressWarnings("unchecked")
@Override
public void inspectOpenedResource(Receiver receiver) {
if (receiver.getRemoteSource() == null) {
markAsInvalid("Link opened with null source.");
}
Source source = (Source) receiver.getRemoteSource();
Map<Symbol, Object> filters = source.getFilter();
if (findFilter(filters, AmqpUnknownFilterType.UNKNOWN_FILTER_IDS) != null) {
markAsInvalid("Broker should not return unsupported filter on attach.");
}
}
});
代码示例来源:origin: apache/activemq-artemis
@SuppressWarnings("unchecked")
@Override
public void inspectOpenedResource(Receiver receiver) {
if (receiver.getRemoteSource() == null) {
markAsInvalid("Link opened with null source.");
}
Source source = (Source) receiver.getRemoteSource();
Map<Symbol, Object> filters = source.getFilter();
if (findFilter(filters, AmqpSupport.JMS_SELECTOR_FILTER_IDS) == null) {
markAsInvalid("Broker should return selector filter on attach.");
}
}
});
代码示例来源:origin: apache/activemq-artemis
@SuppressWarnings("unchecked")
@Override
public void inspectOpenedResource(Receiver receiver) {
if (receiver.getRemoteSource() == null) {
markAsInvalid("Link opened with null source.");
}
Source source = (Source) receiver.getRemoteSource();
Map<Symbol, Object> filters = source.getFilter();
if (findFilter(filters, JMS_SELECTOR_FILTER_IDS) == null) {
markAsInvalid("Broker did not return the JMS Filter on Attach");
}
}
});
代码示例来源:origin: org.apache.qpid/proton-j
public Object get(final int index)
{
switch(index)
{
case 0:
return _impl.getAddress();
case 1:
return _impl.getDurable().getValue();
case 2:
return _impl.getExpiryPolicy().getPolicy();
case 3:
return _impl.getTimeout();
case 4:
return _impl.getDynamic();
case 5:
return _impl.getDynamicNodeProperties();
case 6:
return _impl.getDistributionMode();
case 7:
return _impl.getFilter();
case 8:
return _impl.getDefaultOutcome();
case 9:
return _impl.getOutcomes();
case 10:
return _impl.getCapabilities();
}
throw new IllegalStateException("Unknown index " + index);
}
代码示例来源:origin: apache/activemq-artemis
@SuppressWarnings("unchecked")
@Override
public void inspectOpenedResource(Receiver receiver) {
if (receiver.getRemoteSource() == null) {
markAsInvalid("Link opened with null source.");
}
Source source = (Source) receiver.getRemoteSource();
Map<Symbol, Object> filters = source.getFilter();
// Currently don't support noLocal on a Queue
if (findFilter(filters, NO_LOCAL_FILTER_IDS) != null) {
markAsInvalid("Broker did not return the NoLocal Filter on Attach");
}
}
});
代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot
public Object get(final int index)
{
switch(index)
{
case 0:
return _impl.getAddress();
case 1:
return _impl.getDurable().getValue();
case 2:
return _impl.getExpiryPolicy().getPolicy();
case 3:
return _impl.getTimeout();
case 4:
return _impl.getDynamic();
case 5:
return _impl.getDynamicNodeProperties();
case 6:
return _impl.getDistributionMode();
case 7:
return _impl.getFilter();
case 8:
return _impl.getDefaultOutcome();
case 9:
return _impl.getOutcomes();
case 10:
return _impl.getCapabilities();
}
throw new IllegalStateException("Unknown index " + index);
}
代码示例来源:origin: org.apache.qpid/proton-j-impl
public Object get(final int index)
{
switch(index)
{
case 0:
return _impl.getAddress();
case 1:
return _impl.getDurable().getValue();
case 2:
return _impl.getExpiryPolicy().getPolicy();
case 3:
return _impl.getTimeout();
case 4:
return _impl.getDynamic();
case 5:
return _impl.getDynamicNodeProperties();
case 6:
return _impl.getDistributionMode();
case 7:
return _impl.getFilter();
case 8:
return _impl.getDefaultOutcome();
case 9:
return _impl.getOutcomes();
case 10:
return _impl.getCapabilities();
}
throw new IllegalStateException("Unknown index " + index);
}
代码示例来源:origin: org.apache.qpid/proton
public Object get(final int index)
{
switch(index)
{
case 0:
return _impl.getAddress();
case 1:
return _impl.getDurable().getValue();
case 2:
return _impl.getExpiryPolicy().getPolicy();
case 3:
return _impl.getTimeout();
case 4:
return _impl.getDynamic();
case 5:
return _impl.getDynamicNodeProperties();
case 6:
return _impl.getDistributionMode();
case 7:
return _impl.getFilter();
case 8:
return _impl.getDefaultOutcome();
case 9:
return _impl.getOutcomes();
case 10:
return _impl.getCapabilities();
}
throw new IllegalStateException("Unknown index " + index);
}
代码示例来源:origin: org.apache.activemq/activemq-all
Map.Entry<Symbol, DescribedType> filter = findFilter(source.getFilter(), JMS_SELECTOR_FILTER_IDS);
if (filter != null) {
selector = filter.getValue().getDescribed().toString();
filter = findFilter(source.getFilter(), NO_LOCAL_FILTER_IDS);
if (filter != null) {
noLocal = true;
代码示例来源:origin: org.apache.qpid/proton-j
public int size()
{
return _impl.getCapabilities() != null
? 11
: _impl.getOutcomes() != null
? 10
: _impl.getDefaultOutcome() != null
? 9
: _impl.getFilter() != null
? 8
: _impl.getDistributionMode() != null
? 7
: _impl.getDynamicNodeProperties() != null
? 6
: _impl.getDynamic()
? 5
: (_impl.getTimeout() != null && !_impl.getTimeout().equals(UnsignedInteger.ZERO))
? 4
: _impl.getExpiryPolicy() != TerminusExpiryPolicy.SESSION_END
? 3
: _impl.getDurable() != TerminusDurability.NONE
? 2
: _impl.getAddress() != null
? 1
: 0;
}
代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot
public int size()
{
return _impl.getCapabilities() != null
? 11
: _impl.getOutcomes() != null
? 10
: _impl.getDefaultOutcome() != null
? 9
: _impl.getFilter() != null
? 8
: _impl.getDistributionMode() != null
? 7
: _impl.getDynamicNodeProperties() != null
? 6
: _impl.getDynamic()
? 5
: (_impl.getTimeout() != null && !_impl.getTimeout().equals(UnsignedInteger.ZERO))
? 4
: _impl.getExpiryPolicy() != TerminusExpiryPolicy.SESSION_END
? 3
: _impl.getDurable() != TerminusDurability.NONE
? 2
: _impl.getAddress() != null
? 1
: 0;
}
代码示例来源:origin: apache/activemq-artemis
@Test(timeout = 60000)
public void testLookupExistingSubscriptionWithSelector() throws Exception {
AmqpClient client = createAmqpClient();
AmqpConnection connection = addConnection(client.createConnection());
connection.setContainerId(getContainerID());
connection.connect();
AmqpSession session = connection.createSession();
AmqpReceiver receiver = session.createDurableReceiver(getTopicName(), getSubscriptionName(), SELECTOR_STRING, false);
receiver.detach();
receiver = session.lookupSubscription(getSubscriptionName());
assertNotNull(receiver);
Receiver protonReceiver = receiver.getReceiver();
assertNotNull(protonReceiver.getRemoteSource());
Source remoteSource = (Source) protonReceiver.getRemoteSource();
assertNotNull(remoteSource.getFilter());
assertFalse(remoteSource.getFilter().containsKey(NO_LOCAL_NAME));
assertTrue(remoteSource.getFilter().containsKey(JMS_SELECTOR_NAME));
String selector = (String) ((DescribedType) remoteSource.getFilter().get(JMS_SELECTOR_NAME)).getDescribed();
assertEquals(SELECTOR_STRING, selector);
assertEquals(TerminusExpiryPolicy.NEVER, remoteSource.getExpiryPolicy());
assertEquals(TerminusDurability.UNSETTLED_STATE, remoteSource.getDurable());
assertEquals(COPY, remoteSource.getDistributionMode());
receiver.close();
try {
receiver = session.lookupSubscription(getSubscriptionName());
fail("Should not be able to lookup the subscription");
} catch (Exception e) {
}
connection.close();
}
代码示例来源:origin: apache/activemq-artemis
@Test(timeout = 60000)
public void testLookupExistingSubscriptionWithSelectorAndNoLocal() throws Exception {
AmqpClient client = createAmqpClient();
AmqpConnection connection = addConnection(client.createConnection());
connection.setContainerId(getContainerID());
connection.connect();
AmqpSession session = connection.createSession();
AmqpReceiver receiver = session.createDurableReceiver(getTopicName(), getSubscriptionName(), SELECTOR_STRING, true);
receiver.detach();
receiver = session.lookupSubscription(getSubscriptionName());
assertNotNull(receiver);
Receiver protonReceiver = receiver.getReceiver();
assertNotNull(protonReceiver.getRemoteSource());
Source remoteSource = (Source) protonReceiver.getRemoteSource();
assertNotNull(remoteSource.getFilter());
assertTrue(remoteSource.getFilter().containsKey(NO_LOCAL_NAME));
assertTrue(remoteSource.getFilter().containsKey(JMS_SELECTOR_NAME));
String selector = (String) ((DescribedType) remoteSource.getFilter().get(JMS_SELECTOR_NAME)).getDescribed();
assertEquals(SELECTOR_STRING, selector);
assertEquals(TerminusExpiryPolicy.NEVER, remoteSource.getExpiryPolicy());
assertEquals(TerminusDurability.UNSETTLED_STATE, remoteSource.getDurable());
assertEquals(COPY, remoteSource.getDistributionMode());
receiver.close();
try {
receiver = session.lookupSubscription(getSubscriptionName());
fail("Should not be able to lookup the subscription");
} catch (Exception e) {
}
connection.close();
}
代码示例来源:origin: apache/activemq-artemis
@Test(timeout = 60000)
public void testLookupExistingSubscriptionWithNoLocal() throws Exception {
AmqpClient client = createAmqpClient();
AmqpConnection connection = addConnection(client.createConnection());
connection.setContainerId(getContainerID());
connection.connect();
AmqpSession session = connection.createSession();
AmqpReceiver receiver = session.createDurableReceiver(getTopicName(), getSubscriptionName(), null, true);
receiver.detach();
receiver = session.lookupSubscription(getSubscriptionName());
assertNotNull(receiver);
Receiver protonReceiver = receiver.getReceiver();
assertNotNull(protonReceiver.getRemoteSource());
Source remoteSource = (Source) protonReceiver.getRemoteSource();
assertNotNull(remoteSource.getFilter());
assertTrue(remoteSource.getFilter().containsKey(NO_LOCAL_NAME));
assertFalse(remoteSource.getFilter().containsKey(JMS_SELECTOR_NAME));
assertEquals(TerminusExpiryPolicy.NEVER, remoteSource.getExpiryPolicy());
assertEquals(TerminusDurability.UNSETTLED_STATE, remoteSource.getDurable());
assertEquals(COPY, remoteSource.getDistributionMode());
receiver.close();
try {
receiver = session.lookupSubscription(getSubscriptionName());
fail("Should not be able to lookup the subscription");
} catch (Exception e) {
}
connection.close();
}
代码示例来源:origin: apache/activemq-artemis
@Test(timeout = 60000)
public void testLookupExistingSubscription() throws Exception {
AmqpClient client = createAmqpClient();
AmqpConnection connection = addConnection(client.createConnection());
connection.setContainerId(getContainerID());
connection.connect();
AmqpSession session = connection.createSession();
AmqpReceiver receiver = session.createDurableReceiver(getTopicName(), getSubscriptionName());
receiver.detach();
receiver = session.lookupSubscription(getSubscriptionName());
assertNotNull(receiver);
Receiver protonReceiver = receiver.getReceiver();
assertNotNull(protonReceiver.getRemoteSource());
Source remoteSource = (Source) protonReceiver.getRemoteSource();
if (remoteSource.getFilter() != null) {
assertFalse(remoteSource.getFilter().containsKey(NO_LOCAL_NAME));
assertFalse(remoteSource.getFilter().containsKey(JMS_SELECTOR_NAME));
}
assertEquals(TerminusExpiryPolicy.NEVER, remoteSource.getExpiryPolicy());
assertEquals(TerminusDurability.UNSETTLED_STATE, remoteSource.getDurable());
assertEquals(COPY, remoteSource.getDistributionMode());
receiver.close();
try {
receiver = session.lookupSubscription(getSubscriptionName());
fail("Should not be able to lookup the subscription");
} catch (Exception e) {
}
connection.close();
}
内容来源于网络,如有侵权,请联系作者删除!