Search in sources :

Example 26 with UnsignedInteger

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)));
}
Also used : UnsignedInteger(org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger)

Example 27 with UnsignedInteger

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;
}
Also used : Target(org.apache.qpid.server.protocol.v1_0.type.messaging.Target) Attach(org.apache.qpid.server.protocol.v1_0.type.transport.Attach) Symbol(org.apache.qpid.server.protocol.v1_0.type.Symbol) ArrayList(java.util.ArrayList) UnsignedInteger(org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger) Source(org.apache.qpid.server.protocol.v1_0.type.messaging.Source)

Example 28 with UnsignedInteger

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);
}
Also used : Target(org.apache.qpid.server.protocol.v1_0.type.messaging.Target) Rejected(org.apache.qpid.server.protocol.v1_0.type.messaging.Rejected) UnsignedInteger(org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger) Source(org.apache.qpid.server.protocol.v1_0.type.messaging.Source) Accepted(org.apache.qpid.server.protocol.v1_0.type.messaging.Accepted)

Example 29 with UnsignedInteger

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;
}
Also used : MessageMetaData_1_0(org.apache.qpid.server.protocol.v1_0.MessageMetaData_1_0) UnsignedInteger(org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger) LinkedHashMap(java.util.LinkedHashMap)

Example 30 with UnsignedInteger

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);
    }
}
Also used : ArrayList(java.util.ArrayList) UnsignedInteger(org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger) Detach(org.apache.qpid.server.protocol.v1_0.type.transport.Detach)

Aggregations

UnsignedInteger (org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger)57 FrameTransport (org.apache.qpid.tests.protocol.v1_0.FrameTransport)35 Test (org.junit.Test)35 Interaction (org.apache.qpid.tests.protocol.v1_0.Interaction)33 SpecificationTest (org.apache.qpid.tests.protocol.SpecificationTest)29 Attach (org.apache.qpid.server.protocol.v1_0.type.transport.Attach)25 Disposition (org.apache.qpid.server.protocol.v1_0.type.transport.Disposition)20 Binary (org.apache.qpid.server.protocol.v1_0.type.Binary)18 Flow (org.apache.qpid.server.protocol.v1_0.type.transport.Flow)17 Open (org.apache.qpid.server.protocol.v1_0.type.transport.Open)14 InteractionTransactionalState (org.apache.qpid.tests.protocol.v1_0.InteractionTransactionalState)13 Error (org.apache.qpid.server.protocol.v1_0.type.transport.Error)12 AmqpError (org.apache.qpid.server.protocol.v1_0.type.transport.AmqpError)11 Begin (org.apache.qpid.server.protocol.v1_0.type.transport.Begin)11 QpidByteBuffer (org.apache.qpid.server.bytebuffer.QpidByteBuffer)9 DeliveryState (org.apache.qpid.server.protocol.v1_0.type.DeliveryState)8 TransactionError (org.apache.qpid.server.protocol.v1_0.type.transaction.TransactionError)7 InetSocketAddress (java.net.InetSocketAddress)6 Detach (org.apache.qpid.server.protocol.v1_0.type.transport.Detach)6 Transfer (org.apache.qpid.server.protocol.v1_0.type.transport.Transfer)6