use of org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger in project qpid-broker-j by apache.
the class TerminusDurability method min.
public static TerminusDurability min(TerminusDurability durabilityA, TerminusDurability durabilityB) {
int durabilitAValue = durabilityA != null ? durabilityA._val.intValue() : 0;
int durabilityBValue = durabilityB != null ? durabilityB._val.intValue() : 0;
return TerminusDurability.valueOf(new UnsignedInteger(Math.min(durabilitAValue, durabilityBValue)));
}
use of org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger in project qpid-broker-j by apache.
the class Session_1_0Test method createAttach.
private Attach createAttach(final boolean durable, final String linkName, final String address, final Symbol destinationTypeCapability, final boolean isGlobal, final boolean isShared) {
Attach attach = new Attach();
Source source = new Source();
List<Symbol> capabilities = new ArrayList<>();
if (isGlobal) {
capabilities.add(Symbol.getSymbol("global"));
}
if (isShared) {
capabilities.add(Symbol.getSymbol("shared"));
}
capabilities.add(destinationTypeCapability);
source.setCapabilities(capabilities.toArray(new Symbol[capabilities.size()]));
if (durable) {
source.setDurable(TerminusDurability.CONFIGURATION);
source.setExpiryPolicy(TerminusExpiryPolicy.NEVER);
} else {
source.setDurable(TerminusDurability.NONE);
source.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH);
}
attach.setSource(source);
Target target = new Target();
attach.setTarget(target);
attach.setHandle(new UnsignedInteger(_handle++));
attach.setIncompleteUnsettled(false);
attach.setName(linkName);
attach.setRole(Role.RECEIVER);
source.setAddress(address);
return attach;
}
use of org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger in project qpid-broker-j by apache.
the class LinkStoreTestCase method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
_linkStore = createLinkStore();
_source = new Source();
_target = new Target();
_source.setAddress(ADDRESS);
_source.setCapabilities(new Symbol[] { Symbol.getSymbol(CAPABILITY) });
_source.setDefaultOutcome(new Rejected());
_source.setDistributionMode(StdDistMode.COPY);
_source.setDurable(TerminusDurability.UNSETTLED_STATE);
_source.setDynamic(Boolean.TRUE);
_source.setExpiryPolicy(TerminusExpiryPolicy.CONNECTION_CLOSE);
_source.setFilter(Collections.singletonMap(Symbol.valueOf("foo"), NoLocalFilter.INSTANCE));
_source.setOutcomes(new Accepted().getSymbol());
_source.setDynamicNodeProperties(Collections.singletonMap(Symbol.valueOf("dynamicProperty"), "dynamicPropertyValue"));
_source.setTimeout(new UnsignedInteger(1));
_target.setTimeout(new UnsignedInteger(2));
_target.setDynamicNodeProperties(Collections.singletonMap(Symbol.valueOf("targetDynamicProperty"), "targetDynamicPropertyValue"));
_target.setDynamic(Boolean.TRUE);
_target.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH);
_target.setAddress("bar");
_target.setCapabilities(new Symbol[] { Symbol.getSymbol(CAPABILITY) });
_target.setDurable(TerminusDurability.CONFIGURATION);
}
use of org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger in project qpid-broker-j by apache.
the class MessageConverter_1_0_to_v0_10 method getApplicationHeaders.
private Map<String, Object> getApplicationHeaders(final Message_1_0 serverMsg) {
final MessageMetaData_1_0.MessageHeader_1_0 origHeader = serverMsg.getMessageHeader();
final Map<String, Object> applicationProperties = serverMsg.getMessageHeader().getHeadersAsMap();
for (String key : applicationProperties.keySet()) {
ensureStr8("application-properties[\"" + key + "\"]", key);
}
Map<String, Object> appHeaders = new LinkedHashMap((Map<String, Object>) convertValue(applicationProperties));
if (origHeader.getSubject() != null) {
if (!appHeaders.containsKey("qpid.subject")) {
appHeaders.put("qpid.subject", origHeader.getSubject());
}
if (!appHeaders.containsKey("x-jms-type")) {
appHeaders.put("x-jms-type", origHeader.getSubject());
}
}
String groupId = getGroupId(serverMsg);
if (groupId != null && !appHeaders.containsKey("JMSXGroupID")) {
appHeaders.put("JMSXGroupID", groupId);
}
UnsignedInteger groupSequence = getGroupSequence(serverMsg);
if (groupSequence != null && !appHeaders.containsKey("JMSXGroupSeq")) {
appHeaders.put("JMSXGroupSeq", groupSequence.intValue());
}
return appHeaders;
}
use of org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger in project qpid-broker-j by apache.
the class Session_1_0 method detachLinks.
private void detachLinks() {
Collection<UnsignedInteger> handles = new ArrayList<>(_inputHandleToEndpoint.keySet());
for (UnsignedInteger handle : handles) {
Detach detach = new Detach();
detach.setClosed(false);
detach.setHandle(handle);
detach.setError(_sessionEndedLinkError);
detach(handle, detach);
}
}
Aggregations