http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/EndpointState.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/EndpointState.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/EndpointState.java deleted file mode 100644 index c11da6c..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/EndpointState.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.apache.qpid.proton.engine; -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - - -/** - * Represents the state of a communication endpoint. - */ -public enum EndpointState -{ - UNINITIALIZED, - ACTIVE, - CLOSED; -}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/Engine.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/Engine.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/Engine.java deleted file mode 100644 index 3bd46ce..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/Engine.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - -/** - * Engine - * - */ - -public final class Engine -{ - - private Engine() - { - } - - public static Collector collector() - { - return Collector.Factory.create(); - } - - public static Connection connection() - { - return Connection.Factory.create(); - } - - public static Transport transport() - { - return Transport.Factory.create(); - } - - public static SslDomain sslDomain() - { - return SslDomain.Factory.create(); - } - - public static SslPeerDetails sslPeerDetails(String hostname, int port) - { - return SslPeerDetails.Factory.create(hostname, port); - } - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/Event.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/Event.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/Event.java deleted file mode 100644 index 5930d2c..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/Event.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - -import org.apache.qpid.proton.reactor.Reactor; -import org.apache.qpid.proton.reactor.Selectable; -import org.apache.qpid.proton.reactor.Task; - - -/** - * Event - * - */ - -public interface Event extends Extendable -{ - /** - * Event types built into the library. - */ - public enum Type implements EventType { - REACTOR_INIT, - REACTOR_QUIESCED, - REACTOR_FINAL, - - TIMER_TASK, - - CONNECTION_INIT, - CONNECTION_BOUND, - CONNECTION_UNBOUND, - CONNECTION_LOCAL_OPEN, - CONNECTION_REMOTE_OPEN, - CONNECTION_LOCAL_CLOSE, - CONNECTION_REMOTE_CLOSE, - CONNECTION_FINAL, - - SESSION_INIT, - SESSION_LOCAL_OPEN, - SESSION_REMOTE_OPEN, - SESSION_LOCAL_CLOSE, - SESSION_REMOTE_CLOSE, - SESSION_FINAL, - - LINK_INIT, - LINK_LOCAL_OPEN, - LINK_REMOTE_OPEN, - LINK_LOCAL_DETACH, - LINK_REMOTE_DETACH, - LINK_LOCAL_CLOSE, - LINK_REMOTE_CLOSE, - LINK_FLOW, - LINK_FINAL, - - DELIVERY, - - TRANSPORT, - TRANSPORT_ERROR, - TRANSPORT_HEAD_CLOSED, - TRANSPORT_TAIL_CLOSED, - TRANSPORT_CLOSED, - - SELECTABLE_INIT, - SELECTABLE_UPDATED, - SELECTABLE_READABLE, - SELECTABLE_WRITABLE, - SELECTABLE_EXPIRED, - SELECTABLE_ERROR, - SELECTABLE_FINAL, - - /** - * This value must never be used to generate an event, it's only used as - * a guard when casting custom EventTypes to core {@link Type} via - * {@link Event#getType()}. - */ - NON_CORE_EVENT { - @Override - public boolean isValid() { return false; } - }; - - @Override - public boolean isValid() { - return true; - } - } - - /** - * @return type of the event. The event type can be defined outside of the - * proton library. - */ - EventType getEventType(); - - /** - * A concrete event type of core events. - * - * @return type of the event for core events. For events generated by - * extensions a {@link Type#NON_CORE_EVENT} will be returned - */ - Type getType(); - - Object getContext(); - - /** - * The {@link Handler} at the root of the handler tree. - * <p> - * Set by the {@link Reactor} before dispatching the event. - * <p> - * @see #redispatch(EventType, Handler) - * @return The root handler - */ - Handler getRootHandler(); - - void dispatch(Handler handler) throws HandlerException; - - /** - * Synchronously redispatch the current event as a new {@link EventType} on the provided handler and it's children. - * <p> - * Note: the <code>redispatch()</code> will complete before children of the current handler have had the current event dispatched, see {@link #delegate()}. - * - * - * @param as_type Type of event to dispatch - * @param handler The handler where to start the dispatch. Use {@link #getRootHandler()} to redispatch the new event to all handlers in the tree. - * @throws HandlerException A wrapper exception of any unhandled exception thrown by <code>handler</code> - */ - void redispatch(EventType as_type, Handler handler) throws HandlerException; - - /** - * dispatch the event to all children of the handler. A handler can call - * this method explicitly to be able to do more processing after all child - * handlers have already processed the event. If handler does not invoke - * this method it is invoked implicitly by {@link #dispatch(Handler)} - * - * @throws HandlerException - */ - void delegate() throws HandlerException; - - Connection getConnection(); - - Session getSession(); - - Link getLink(); - - Sender getSender(); - - Receiver getReceiver(); - - Delivery getDelivery(); - - Transport getTransport(); - - Reactor getReactor(); - - Selectable getSelectable(); - - Task getTask(); - - Event copy(); - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/EventType.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/EventType.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/EventType.java deleted file mode 100644 index 68ec6e4..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/EventType.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - -/** - * Entry point for external libraries to add event types. Event types should be - * <code>final static</code> fields. EventType instances are compared by - * reference. - * <p> - * Event types are best described by an <code>enum</code> that implements the - * {@link EventType} interface, see {@link Event.Type}. - * - */ -public interface EventType { - - /** - * @return false if this particular EventType instance does not represent a - * real event type but a guard value, example: extra enum value for - * switch statements, see {@link Event.Type#NON_CORE_EVENT} - */ - public boolean isValid(); -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/Extendable.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/Extendable.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/Extendable.java deleted file mode 100644 index 14b9b2e..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/Extendable.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - - -/** - * Extendable - * - */ - -public interface Extendable -{ - - Record attachments(); - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/ExtendableAccessor.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/ExtendableAccessor.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/ExtendableAccessor.java deleted file mode 100644 index d2eee03..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/ExtendableAccessor.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - -/** - * A typesafe convenience class for associating additional data with {@link Extendable} classes. - * <p> - * An instance of <code>ExtendableAccessor</code> uses itself as the key in the {@link Extendable#attachments()} - * so it's best instantiated as a static final member. - * <pre><code> - * class Foo extends BaseHandler { - * private static ExtendableAccessor<Link, Bar> LINK_BAR = new ExtendableAccessor<>(Bar.class); - * void onLinkRemoteOpen(Event e) { - * Bar bar = LINK_BAR.get(e.getLink()); - * if (bar == null) { - * bar = new Bar(); - * LINK_BAR.set(e.getLink(), bar); - * } - * } - * } - * </code></pre> - * - * @param <E> An {@link Extendable} type where the data is to be stored - * @param <T> The type of the data to be stored - */ -public final class ExtendableAccessor<E extends Extendable, T> { - private final Class<T> klass; - public ExtendableAccessor(Class<T> klass) { - this.klass = klass; - } - - public T get(E e) { - return e.attachments().get(this, klass); - } - - public void set(E e, T value) { - e.attachments().set(this, klass, value); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/Handler.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/Handler.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/Handler.java deleted file mode 100644 index 3a8e5ae..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/Handler.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - -import java.util.Iterator; - - -/** - * Handler - * - */ - -public interface Handler -{ - /** - * Handle the event in this instance. This is the second half of - * {@link Event#dispatch(Handler)}. The method must invoke a concrete onXxx - * method for the given event, or invoke it's {@link #onUnhandled(Event)} - * method if the {@link EventType} of the event is not recognized by the - * handler. - * <p> - * <b>Note:</b> The handler is not supposed to invoke the - * {@link #handle(Event)} method on it's {@link #children()}, that is the - * responsibility of the {@link Event#dispatch(Handler)} - * - * @see BaseHandler - * @param e - * The event to handle - */ - void handle(Event e); - - void onUnhandled(Event e); - - void add(Handler child); - - Iterator<Handler> children(); -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/HandlerException.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/HandlerException.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/HandlerException.java deleted file mode 100644 index ca18d7c..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/HandlerException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.engine; - - -public class HandlerException extends RuntimeException { - - private static final long serialVersionUID = 5300211824119834005L; - - private final Handler handler; - - public HandlerException(Handler handler, Throwable cause) { - super(cause); - this.handler = handler; - } - - public Handler getHandler() { - return handler; - } -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/Link.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/Link.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/Link.java deleted file mode 100644 index 248c687..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/Link.java +++ /dev/null @@ -1,301 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - -import java.util.EnumSet; -import java.util.Map; - -import org.apache.qpid.proton.amqp.Symbol; -import org.apache.qpid.proton.amqp.transport.ReceiverSettleMode; -import org.apache.qpid.proton.amqp.transport.SenderSettleMode; -import org.apache.qpid.proton.amqp.transport.Source; -import org.apache.qpid.proton.amqp.transport.Target; - -/** - * Link - * - * The settlement mode defaults are: - * - * Sender settle mode - {@link SenderSettleMode#MIXED}. - * Receiver settle mode - {@link ReceiverSettleMode#FIRST} - * - * TODO describe the application's responsibility to honour settlement. - */ -public interface Link extends Endpoint -{ - - /** - * Returns the name of the link - * - * @return the link name - */ - String getName(); - - /** - * Create a delivery object based on the specified tag and adds it to the - * this link's delivery list and its connection work list. - * - * TODO to clarify - this adds the delivery to the connection list. It is not yet - * clear why this is done or if it is useful for the application to be able to discover - * newly created deliveries from the {@link Connection#getWorkHead()}. - * - * @param tag a tag for the delivery - * @return a new Delivery object - */ - public Delivery delivery(byte[] tag); - - /** - * Create a delivery object based on the specified tag. This form - * of the method is intended to allow the tag to be formed from a - * subsequence of the byte array passed in. This might allow more - * optimisation options in future but at present is not - * implemented. - * - * @param tag a tag for the delivery - * @param offset (currently ignored and must be 0) - * @param length (currently ignored and must be the length of the <code>tag</code> array - * @return a Delivery object - */ - public Delivery delivery(byte[] tag, int offset, int length); - - /** - * Returns the head delivery on the link. - */ - Delivery head(); - - /** - * Returns the current delivery - */ - Delivery current(); - - /** - * Attempts to advance the current delivery. Advances it to the next delivery if one exists, else null. - * - * The behaviour of this method is different for senders and receivers. - * - * @return true if it can advance, false if it cannot - * - * TODO document the meaning of the return value more fully. Currently Senderimpl only returns false if there is no current delivery - */ - boolean advance(); - - - Source getSource(); - Target getTarget(); - - /** - * Sets the source for this link. - * - * The initiator of the link must always provide a Source. - * - * An application responding to the creation of the link should perform an application - * specific lookup on the {@link #getRemoteSource()} to determine an actual Source. If it - * failed to determine an actual source, it should set null, and then go on to {@link #close()} - * the link. - * - * @see "AMQP Spec 1.0 section 2.6.3" - */ - void setSource(Source address); - - /** - * Expected to be used in a similar manner to {@link #setSource(Source)} - */ - void setTarget(Target address); - - /** - * @see #setSource(Source) - */ - Source getRemoteSource(); - - /** - * @see #setTarget(Target) - */ - Target getRemoteTarget(); - - public Link next(EnumSet<EndpointState> local, EnumSet<EndpointState> remote); - - /** - * Gets the credit balance for a link. - * - * Note that a sending link may still be used to send deliveries even if - * link credit is/reaches zero, however those deliveries will end up being - * {@link #getQueued() queued} by the link until enough credit is obtained - * from the receiver to send them over the wire. In this case the balance - * reported will go negative. - * - * @return the credit balance for the link - */ - public int getCredit(); - - /** - * Gets the number of queued messages for a link. - * - * Links may queue deliveries for a number of reasons, for example there may be insufficient - * {@link #getCredit() credit} to send them to the receiver, they may not have yet had a chance - * to be written to the wire, or the receiving application has simply not yet processed them. - * - * @return the queued message count for the link - */ - public int getQueued(); - - public int getUnsettled(); - - public Session getSession(); - - SenderSettleMode getSenderSettleMode(); - - /** - * Sets the sender settle mode. - * - * Should only be called during link set-up, i.e. before calling {@link #open()}. - * - * If this endpoint is the initiator of the link, this method can be used to set a value other than - * the default. - * - * If this endpoint is not the initiator, this method should be used to set a local value. According - * to the AMQP spec, the application may choose to accept the sender's suggestion - * (accessed by calling {@link #getRemoteSenderSettleMode()}) or choose another value. The value - * has no effect on Proton, but may be useful to the application at a later point. - * - * In order to be AMQP compliant the application is responsible for honouring the settlement mode. See {@link Link}. - */ - void setSenderSettleMode(SenderSettleMode senderSettleMode); - - /** - * @see #setSenderSettleMode(SenderSettleMode) - */ - SenderSettleMode getRemoteSenderSettleMode(); - - ReceiverSettleMode getReceiverSettleMode(); - - /** - * Sets the receiver settle mode. - * - * Used in analogous way to {@link #setSenderSettleMode(SenderSettleMode)} - */ - void setReceiverSettleMode(ReceiverSettleMode receiverSettleMode); - - /** - * @see #setReceiverSettleMode(ReceiverSettleMode) - */ - ReceiverSettleMode getRemoteReceiverSettleMode(); - - /** - * TODO should this be part of the interface? - */ - @Deprecated - void setRemoteSenderSettleMode(SenderSettleMode remoteSenderSettleMode); - - /** - * Gets the local link properties. - * - * @see #setProperties(Map) - */ - Map<Symbol, Object> getProperties(); - - /** - * Sets the local link properties, to be conveyed to the peer via the Attach frame when - * attaching the link to the session. - * - * Must be called during link setup, i.e. before calling the {@link #open()} method. - */ - void setProperties(Map<Symbol, Object> properties); - - /** - * Gets the remote link properties, as conveyed from the peer via the Attach frame - * when attaching the link to the session. - * - * @return the properties Map conveyed by the peer, or null if there was none. - */ - Map<Symbol, Object> getRemoteProperties(); - - public int drained(); - - /** - * Returns a [locally generated] view of credit at the remote peer by considering the - * current link {@link #getCredit() credit} count as well as the effect of - * any locally {@link #getQueued() queued} messages. - * - * @return view of effective remote credit - */ - public int getRemoteCredit(); - - public boolean getDrain(); - - public void detach(); - public boolean detached(); - - /** - * Sets the local link offered capabilities, to be conveyed to the peer via the Attach frame - * when attaching the link to the session. - * - * Must be called during link setup, i.e. before calling the {@link #open()} method. - * - * @param offeredCapabilities - * the offered capabilities array to send, or null for none. - */ - public void setOfferedCapabilities(Symbol[] offeredCapabilities); - - /** - * Gets the local link offered capabilities. - * - * @return the offered capabilities array, or null if none was set. - * - * @see #setOfferedCapabilities(Symbol[]) - */ - Symbol[] getOfferedCapabilities(); - - /** - * Gets the remote link offered capabilities, as conveyed from the peer via the Attach frame - * when attaching the link to the session. - * - * @return the offered capabilities array conveyed by the peer, or null if there was none. - */ - Symbol[] getRemoteOfferedCapabilities(); - - /** - * Sets the local link desired capabilities, to be conveyed to the peer via the Attach frame - * when attaching the link to the session. - * - * Must be called during link setup, i.e. before calling the {@link #open()} method. - * - * @param desiredCapabilities - * the desired capabilities array to send, or null for none. - */ - public void setDesiredCapabilities(Symbol[] desiredCapabilities); - - /** - * Gets the local link desired capabilities. - * - * @return the desired capabilities array, or null if none was set. - * - * @see #setDesiredCapabilities(Symbol[]) - */ - Symbol[] getDesiredCapabilities(); - - /** - * Gets the remote link desired capabilities, as conveyed from the peer via the Attach frame - * when attaching the link to the session. - * - * @return the desired capabilities array conveyed by the peer, or null if there was none. - */ - Symbol[] getRemoteDesiredCapabilities(); -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJConnection.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJConnection.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJConnection.java deleted file mode 100644 index bf44a3c..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJConnection.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.qpid.proton.engine; - -import org.apache.qpid.proton.engine.Connection; - -/** - * Extends {@link Connection} with functionality that is specific to proton-j - */ -public interface ProtonJConnection extends Connection, ProtonJEndpoint -{ - void setLocalContainerId(String localContainerId); - - @Override - ProtonJSession session(); - - int getMaxChannels(); -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJEndpoint.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJEndpoint.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJEndpoint.java deleted file mode 100644 index accc7e3..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJEndpoint.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - -import org.apache.qpid.proton.engine.Endpoint; - -public interface ProtonJEndpoint extends Endpoint -{ -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJSession.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJSession.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJSession.java deleted file mode 100644 index f939d93..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJSession.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.qpid.proton.engine; - -import org.apache.qpid.proton.engine.Sender; -import org.apache.qpid.proton.engine.Session; - -/** - * Extends {@link Session} with functionality that is specific to proton-j - */ -public interface ProtonJSession extends Session, ProtonJEndpoint -{ - Sender sender(String name); -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJSslDomain.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJSslDomain.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJSslDomain.java deleted file mode 100644 index e1960fc..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJSslDomain.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.qpid.proton.engine; - -import org.apache.qpid.proton.engine.SslDomain; - -/** - * Extends {@link SslDomain} with functionality that is specific to proton-j - */ -public interface ProtonJSslDomain extends SslDomain -{ - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJSslPeerDetails.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJSslPeerDetails.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJSslPeerDetails.java deleted file mode 100644 index ea5aae8..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJSslPeerDetails.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.qpid.proton.engine; - -import org.apache.qpid.proton.engine.SslPeerDetails; - -/** - * Extends {@link SslPeerDetails} with functionality specific to proton-j - */ -public interface ProtonJSslPeerDetails extends SslPeerDetails -{ - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJTransport.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJTransport.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJTransport.java deleted file mode 100644 index 8bd24b3..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/ProtonJTransport.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.qpid.proton.engine; - -import org.apache.qpid.proton.engine.Transport; -import org.apache.qpid.proton.engine.impl.ProtocolTracer; - -/** - * Extends {@link Transport} with functionality that is specific to proton-j - */ -public interface ProtonJTransport extends Transport -{ - void setProtocolTracer(ProtocolTracer protocolTracer); - - ProtocolTracer getProtocolTracer(); -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/Receiver.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/Receiver.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/Receiver.java deleted file mode 100644 index f9d718f..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/Receiver.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - -import org.apache.qpid.proton.codec.WritableBuffer; - -/** - * Receiver - * - */ -public interface Receiver extends Link -{ - - /** - * Adds the specified number of credits. - * - * The number of link credits initialises to zero. It is the application's responsibility to call - * this method to allow the receiver to receive {@code credits} more deliveries. - */ - public void flow(int credits); - - /** - * Receive message data for the current delivery. - * - * If the caller takes all the bytes the Receiver currently has for this delivery then it is removed from - * the Connection's work list. - * - * Before considering a delivery to be complete, the caller should examine {@link Delivery#isPartial()}. If - * the delivery is partial, the caller should call {@link #recv(byte[], int, int)} again to receive - * the additional bytes once the Delivery appears again on the Connection work-list. - * - * TODO might the flags other than IO_WORK in DeliveryImpl also prevent the work list being pruned? - * e.g. what if a slow JMS consumer receives a disposition frame containing state=RELEASED? This is not IO_WORK. - * - * @param bytes the destination array where the message data is written - * @param offset index in the array to start writing data at - * @param size the maximum number of bytes to write - * - * @return number of bytes written. -1 if there are no more bytes for the current delivery. - * - * @see #current() - */ - public int recv(byte[] bytes, int offset, int size); - - /** - * Receive message data for the current delivery. - * - * @param buffer the buffer to write the message data. - * - * @return number of bytes written. -1 if there are no more bytes for the current delivery. - */ - public int recv(WritableBuffer buffer); - - public void drain(int credit); - - /** - * {@inheritDoc} - * - * TODO document what this method conceptually does and when you should use it. - */ - @Override - public boolean advance(); - - public boolean draining(); - - public void setDrain(boolean drain); - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/Record.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/Record.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/Record.java deleted file mode 100644 index e97948d..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/Record.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - - -/** - * Record - * - */ - -public interface Record -{ - - <T> T get(Object key, Class<T> klass); - <T> void set(Object key, Class<T> klass, T value); - void clear(); - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/RecordAccessor.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/RecordAccessor.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/RecordAccessor.java deleted file mode 100644 index 4896b21..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/RecordAccessor.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - -public interface RecordAccessor<T> { - public T get(Record r); - public void set(Record r, T value); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/Sasl.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/Sasl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/Sasl.java deleted file mode 100644 index 08929e8..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/Sasl.java +++ /dev/null @@ -1,180 +0,0 @@ -package org.apache.qpid.proton.engine; -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - - -public interface Sasl -{ - public enum SaslState - { - /** Pending configuration by application */ - PN_SASL_CONF, - /** Pending SASL Init */ - PN_SASL_IDLE, - /** negotiation in progress */ - PN_SASL_STEP, - /** negotiation completed successfully */ - PN_SASL_PASS, - /** negotiation failed */ - PN_SASL_FAIL - } - - public enum SaslOutcome - { - /** negotiation not completed */ - PN_SASL_NONE((byte)-1), - /** authentication succeeded */ - PN_SASL_OK((byte)0), - /** failed due to bad credentials */ - PN_SASL_AUTH((byte)1), - /** failed due to a system error */ - PN_SASL_SYS((byte)2), - /** failed due to unrecoverable error */ - PN_SASL_PERM((byte)3), - PN_SASL_TEMP((byte)4), - PN_SASL_SKIPPED((byte)5); - - private final byte _code; - - /** failed due to transient error */ - - SaslOutcome(byte code) - { - _code = code; - } - - public byte getCode() - { - return _code; - } - } - - public static SaslOutcome PN_SASL_NONE = SaslOutcome.PN_SASL_NONE; - public static SaslOutcome PN_SASL_OK = SaslOutcome.PN_SASL_OK; - public static SaslOutcome PN_SASL_AUTH = SaslOutcome.PN_SASL_AUTH; - public static SaslOutcome PN_SASL_SYS = SaslOutcome.PN_SASL_SYS; - public static SaslOutcome PN_SASL_PERM = SaslOutcome.PN_SASL_PERM; - public static SaslOutcome PN_SASL_TEMP = SaslOutcome.PN_SASL_TEMP; - public static SaslOutcome PN_SASL_SKIPPED = SaslOutcome.PN_SASL_SKIPPED; - - /** - * Access the current state of the layer. - * - * @return The state of the sasl layer. - */ - SaslState getState(); - - /** - * Set the acceptable SASL mechanisms for the layer. - * - * @param mechanisms a list of acceptable SASL mechanisms - */ - void setMechanisms(String... mechanisms); - - /** - * Retrieve the list of SASL mechanisms provided by the remote. - * - * @return the SASL mechanisms advertised by the remote - */ - String[] getRemoteMechanisms(); - - /** - * Set the remote hostname to indicate the host being connected to when - * sending a SaslInit to the server. - */ - void setRemoteHostname(String hostname); - - /** - * Retrieve the hostname indicated by the client when sending its SaslInit. - * - * @return the hostname indicated by the remote client, or null if none specified. - */ - String getHostname(); - - /** - * Determine the size of the bytes available via recv(). - * - * Returns the size in bytes available via recv(). - * - * @return The number of bytes available, zero if no available data. - */ - int pending(); - - /** - * Read challenge/response data sent from the peer. - * - * Use pending to determine the size of the data. - * - * @param bytes written with up to size bytes of inbound data. - * @param offset the offset in the array to begin writing at - * @param size maximum number of bytes that bytes can accept. - * @return The number of bytes written to bytes, or an error code if {@literal < 0}. - */ - int recv(byte[] bytes, int offset, int size); - - /** - * Send challenge or response data to the peer. - * - * @param bytes The challenge/response data. - * @param offset the point within the array at which the data starts at - * @param size The number of data octets in bytes. - * @return The number of octets read from bytes, or an error code if {@literal < 0} - */ - int send(byte[] bytes, int offset, int size); - - - /** - * Set the outcome of SASL negotiation - * - * Used by the server to set the result of the negotiation process. - * - * @param outcome the outcome of the SASL negotiation - */ - void done(SaslOutcome outcome); - - - /** - * Configure the SASL layer to use the "PLAIN" mechanism. - * - * A utility function to configure a simple client SASL layer using - * PLAIN authentication. - * - * @param username credential for the PLAIN authentication - * mechanism - * @param password credential for the PLAIN authentication - * mechanism - */ - void plain(String username, String password); - - /** - * Retrieve the outcome of SASL negotiation. - */ - SaslOutcome getOutcome(); - - void client(); - void server(); - - /** - * Set whether servers may accept incoming connections - * that skip the SASL layer negotiation. - */ - void allowSkip(boolean allowSkip); -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/Sender.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/Sender.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/Sender.java deleted file mode 100644 index 159d5c3..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/Sender.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - -import org.apache.qpid.proton.codec.ReadableBuffer; - -/** - * Sender - * - */ -public interface Sender extends Link -{ - - /** - * indicates pending deliveries - * - * @param credits the number of pending deliveries - */ - //TODO is this absolute or cumulative? - public void offer(int credits); - - /** - * Sends some data for the current delivery. The application may call this method multiple - * times for the same delivery. - * - * @param bytes the byte array containing the data to be sent. - * @param offset the offset into the given array to start reading. - * @param length the number of bytes to read from the given byte array. - * - * @return the number of bytes accepted - * - * TODO Proton-j current copies all the bytes it has been given so the return value will always be - * length. Should this be changed? How does Proton-c behave? What should the application do if - * the number of bytes accepted is smaller than length. - */ - public int send(byte[] bytes, int offset, int length); - - /** - * Sends some data for the current delivery. The application may call this method multiple - * times for the same delivery. - * - * @param buffer the buffer to read the data from. - * - * @return the number of bytes read from the provided buffer. - */ - public int send(ReadableBuffer buffer); - - /** - * Abort the current delivery. - * - * Note "pn_link_abort" is commented out in the .h - */ - public void abort(); - - /** - * {@inheritDoc} - * - * Informs the sender that all the bytes of the current {@link Delivery} have been written. - * The application must call this method in order for the delivery to be considered complete. - * - * @see #send(byte[], int, int) - * - * TODO fully state the rules regarding when you have to call this method, what happens if you don't call it - * before creating another delivery etc. - */ - @Override - public boolean advance(); - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/Session.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/Session.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/Session.java deleted file mode 100644 index 1a28c26..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/Session.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - -import java.util.EnumSet; -import java.util.Map; - -import org.apache.qpid.proton.amqp.Symbol; - - -/** - * Session - * - * Note that session level flow control is handled internally by Proton. - */ -public interface Session extends Endpoint -{ - /** - * Returns a newly created sender endpoint - */ - public Sender sender(String name); - - /** - * Returns a newly created receiver endpoint - */ - public Receiver receiver(String name); - - public Session next(EnumSet<EndpointState> local, EnumSet<EndpointState> remote); - - public Connection getConnection(); - - public int getIncomingCapacity(); - - public void setIncomingCapacity(int bytes); - - public int getIncomingBytes(); - - public int getOutgoingBytes(); - - public long getOutgoingWindow(); - - /** - * Sets the outgoing window size. - * - * @param outgoingWindowSize the outgoing window size - */ - public void setOutgoingWindow(long outgoingWindowSize); - - /** - * Sets the local session properties, to be conveyed to the peer via the Begin frame when - * attaching the session to the session. - * - * Must be called during session setup, i.e. before calling the {@link #open()} method. - * - * @param properties - * the properties map to send, or null for none. - */ - void setProperties(Map<Symbol, Object> properties); - - /** - * Gets the local session properties. - * - * @return the properties map, or null if none was set. - * - * @see #setProperties(Map) - */ - Map<Symbol, Object> getProperties(); - - /** - * Gets the remote session properties, as conveyed from the peer via the Begin frame - * when opening the session. - * - * @return the properties Map conveyed by the peer, or null if there was none. - */ - Map<Symbol, Object> getRemoteProperties(); - - /** - * Sets the local session offered capabilities, to be conveyed to the peer via the Begin frame - * when opening the session. - * - * Must be called during session setup, i.e. before calling the {@link #open()} method. - * - * @param offeredCapabilities - * the offered capabilities array to send, or null for none. - */ - public void setOfferedCapabilities(Symbol[] offeredCapabilities); - - /** - * Gets the local session offered capabilities. - * - * @return the offered capabilities array, or null if none was set. - * - * @see #setOfferedCapabilities(Symbol[]) - */ - Symbol[] getOfferedCapabilities(); - - /** - * Gets the remote session offered capabilities, as conveyed from the peer via the Begin frame - * when opening the session. - * - * @return the offered capabilities array conveyed by the peer, or null if there was none. - */ - Symbol[] getRemoteOfferedCapabilities(); - - /** - * Sets the local session desired capabilities, to be conveyed to the peer via the Begin frame - * when opening the session. - * - * Must be called during session setup, i.e. before calling the {@link #open()} method. - * - * @param desiredCapabilities - * the desired capabilities array to send, or null for none. - */ - public void setDesiredCapabilities(Symbol[] desiredCapabilities); - - /** - * Gets the local session desired capabilities. - * - * @return the desired capabilities array, or null if none was set. - * - * @see #setDesiredCapabilities(Symbol[]) - */ - Symbol[] getDesiredCapabilities(); - - /** - * Gets the remote session desired capabilities, as conveyed from the peer via the Begin frame - * when opening the session. - * - * @return the desired capabilities array conveyed by the peer, or null if there was none. - */ - Symbol[] getRemoteDesiredCapabilities(); -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/Ssl.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/Ssl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/Ssl.java deleted file mode 100644 index 8d3bab7..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/Ssl.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - -/** - * I represent the details of a particular SSL session. - */ -public interface Ssl -{ - /** - * Get the name of the Cipher that is currently in use. - * - * Gets a text description of the cipher that is currently active, or returns null if SSL - * is not active (no cipher). Note that the cipher in use may change over time due to - * renegotiation or other changes to the SSL state. - * - * @return the name of the cipher in use, or null if none - */ - String getCipherName(); - - /** - * Get the name of the SSL protocol that is currently in use. - * - * Gets a text description of the SSL protocol that is currently active, or null if SSL - * is not active. Note that the protocol may change over time due to renegotiation. - * - * @return the name of the protocol in use, or null if none - */ - String getProtocolName(); - - void setPeerHostname(String hostname); - - String getPeerHostname(); -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/SslDomain.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/SslDomain.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/SslDomain.java deleted file mode 100644 index 24b101c..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/SslDomain.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.qpid.proton.engine; - -import org.apache.qpid.proton.engine.impl.ssl.SslDomainImpl; - -/** - * I store the details used to create SSL sessions. - */ -public interface SslDomain -{ - - public static final class Factory - { - public static SslDomain create() { - return new SslDomainImpl(); - } - } - - /** - * Determines whether the endpoint acts as a client or server. - */ - public enum Mode - { - /** Local connection endpoint is an SSL client */ - CLIENT, - - /** Local connection endpoint is an SSL server */ - SERVER - } - - /** - * Determines the level of peer validation. - * - * {@link #ANONYMOUS_PEER} is configured by default. - */ - public enum VerifyMode - { - /** - * will only connect to those peers that provide a valid identifying certificate signed - * by a trusted CA and are using an authenticated cipher - */ - VERIFY_PEER, - VERIFY_PEER_NAME, - /** - * does not require a valid certificate, and permits use of ciphers that - * do not provide authentication - */ - ANONYMOUS_PEER, - } - - /** - * Initialize the ssl domain object. - * - * An SSL object be either an SSL server or an SSL client. It cannot be both. Those - * transports that will be used to accept incoming connection requests must be configured - * as an SSL server. Those transports that will be used to initiate outbound connections - * must be configured as an SSL client. - * - */ - void init(Mode mode); - - Mode getMode(); - - /** - * Set the certificate that identifies the local node to the remote. - * - * This certificate establishes the identity for the local node. It will be sent to the - * remote if the remote needs to verify the identity of this node. This may be used for - * both SSL servers and SSL clients (if client authentication is required by the server). - * - * @param certificateFile path to file/database containing the identifying - * certificate. - * @param privateKeyFile path to file/database containing the private key used to - * sign the certificate - * @param password the password used to sign the key, else null if key is not - * protected. - */ - void setCredentials(String certificateFile, String privateKeyFile, String password); - - String getPrivateKeyFile(); - - String getPrivateKeyPassword(); - - String getCertificateFile(); - - /** - * Configure the set of trusted CA certificates used by this node to verify peers. - * - * If the local SSL client/server needs to verify the identity of the remote, it must - * validate the signature of the remote's certificate. This function sets the database of - * trusted CAs that will be used to verify the signature of the remote's certificate. - * - * @param certificateDb database of trusted CAs, used to authenticate the peer. - */ - void setTrustedCaDb(String certificateDb); - - String getTrustedCaDb(); - - /** - * Configure the level of verification used on the peer certificate. - * - * This method controls how the peer's certificate is validated, if at all. By default, - * neither servers nor clients attempt to verify their peers ({@link VerifyMode#ANONYMOUS_PEER}). - * Once certificates and trusted CAs are configured, peer verification can be enabled. - * - * In order to verify a peer, a trusted CA must be configured. See - * {@link #setTrustedCaDb(String)}. - * - * NOTE: Servers must provide their own certificate when verifying a peer. See - * {@link #setCredentials(String, String, String)}). - * - * @param mode the level of validation to apply to the peer - */ - void setPeerAuthentication(VerifyMode mode); - - VerifyMode getPeerAuthentication(); - - /** - * Permit a server to accept connection requests from non-SSL clients. - * - * This configures the server to "sniff" the incoming client data stream, and dynamically - * determine whether SSL/TLS is being used. This option is disabled by default: only - * clients using SSL/TLS are accepted. - */ - void allowUnsecuredClient(boolean allowUnsecured); - - boolean allowUnsecuredClient(); -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/SslPeerDetails.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/SslPeerDetails.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/SslPeerDetails.java deleted file mode 100644 index 5b318fe..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/SslPeerDetails.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.qpid.proton.engine; - -import org.apache.qpid.proton.engine.impl.ssl.SslPeerDetailsImpl; - -/** - * The details of the remote peer involved in an SSL session. - * - * Used when creating an SSL session to hint that the underlying SSL implementation - * should attempt to resume a previous session if one exists for the same peer details, - * e.g. using session identifiers (http://tools.ietf.org/html/rfc5246) or session tickets - * (http://tools.ietf.org/html/rfc5077). - */ -public interface SslPeerDetails -{ - - public static final class Factory - { - public static SslPeerDetails create(String hostname, int port) { - return new SslPeerDetailsImpl(hostname, port); - } - } - - String getHostname(); - int getPort(); -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/Transport.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/Transport.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/Transport.java deleted file mode 100644 index 5d8b79d..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/Transport.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - -import java.nio.ByteBuffer; - -import org.apache.qpid.proton.amqp.transport.ErrorCondition; -import org.apache.qpid.proton.engine.impl.TransportImpl; - - -/** - * <p> - * Operates on the entities in the associated {@link Connection} - * by accepting and producing binary AMQP output, potentially - * layered within SASL and/or SSL. - * </p> - * <p> - * After a connection is bound with {@link #bind(Connection)}, the methods for accepting and producing - * output are typically repeatedly called. See the specific methods for details of their legal usage. - * </p> - * <p> - * <strong>Processing the input data received from another AMQP container.</strong> - * </p> - * <ol> - * <li>{@link #getInputBuffer()} </li> - * <li>Write data into input buffer</li> - * <li>{@link #processInput()}</li> - * <li>Check the result, e.g. by calling {@link TransportResult#checkIsOk()}</li> - * </ol> - * <p> - * <strong>Getting the output data to send to another AMQP container:</strong> - * </p> - * <ol> - * <li>{@link #getOutputBuffer()} </li> - * <li>Read output from output buffer</li> - * <li>{@link #outputConsumed()}</li> - * </ol> - * - * <p>The following methods on the byte buffers returned by {@link #getInputBuffer()} and {@link #getOutputBuffer()} - * must not be called: - * </p> - * <ol> - * <li> {@link ByteBuffer#clear()} </li> - * <li> {@link ByteBuffer#compact()} </li> - * <li> {@link ByteBuffer#flip()} </li> - * <li> {@link ByteBuffer#mark()} </li> - * </ol> - */ -public interface Transport extends Endpoint -{ - - public static final class Factory - { - public static Transport create() { - return new TransportImpl(); - } - } - - public static final int TRACE_OFF = 0; - public static final int TRACE_RAW = 1; - public static final int TRACE_FRM = 2; - public static final int TRACE_DRV = 4; - - public static final int DEFAULT_MAX_FRAME_SIZE = -1; - - /** the lower bound for the agreed maximum frame size (in bytes). */ - public int MIN_MAX_FRAME_SIZE = 512; - public int SESSION_WINDOW = 16*1024; - public int END_OF_STREAM = -1; - - public void trace(int levels); - - public void bind(Connection connection); - public void unbind(); - - public int capacity(); - public ByteBuffer tail(); - public void process() throws TransportException; - public void close_tail(); - - - public int pending(); - public ByteBuffer head(); - public void pop(int bytes); - public void close_head(); - - public boolean isClosed(); - - /** - * Processes the provided input. - * - * @param bytes input bytes for consumption - * @param offset the offset within bytes where input begins - * @param size the number of bytes available for input - * - * @return the number of bytes consumed - * @throws TransportException if the input is invalid, if the transport is already in an error state, - * or if the input is empty (unless the remote connection is already closed) - * @deprecated use {@link #getInputBuffer()} and {@link #processInput()} instead. - */ - @Deprecated - public int input(byte[] bytes, int offset, int size); - - /** - * Get a buffer that can be used to write input data into the transport. - * Once the client has finished putting into the input buffer, {@link #processInput()} - * must be called. - * - * Successive calls to this method are not guaranteed to return the same object. - * Once {@link #processInput()} is called the buffer must not be used. - * - * @throws TransportException if the transport is already in an invalid state - */ - ByteBuffer getInputBuffer(); - - /** - * Tell the transport to process the data written to the input buffer. - * - * If the returned result indicates failure, the transport will not accept any more input. - * Specifically, any subsequent {@link #processInput()} calls on this object will - * throw an exception. - * - * @return the result of processing the data, which indicates success or failure. - * @see #getInputBuffer() - */ - TransportResult processInput(); - - /** - * Has the transport produce up to size bytes placing the result - * into dest beginning at position offset. - * - * @param dest array for output bytes - * @param offset the offset within bytes where output begins - * @param size the maximum number of bytes to be output - * - * @return the number of bytes written - * @deprecated use {@link #getOutputBuffer()} and {@link #outputConsumed()} instead - */ - @Deprecated - public int output(byte[] dest, int offset, int size); - - /** - * Get a read-only byte buffer containing the transport's pending output. - * Once the client has finished getting from the output buffer, {@link #outputConsumed()} - * must be called. - * - * Successive calls to this method are not guaranteed to return the same object. - * Once {@link #outputConsumed()} is called the buffer must not be used. - * - * If the transport's state changes AFTER calling this method, this will not be - * reflected in the output buffer. - */ - ByteBuffer getOutputBuffer(); - - /** - * Informs the transport that the output buffer returned by {@link #getOutputBuffer()} - * is finished with, allowing implementation-dependent steps to be performed such as - * reclaiming buffer space. - */ - void outputConsumed(); - - /** - * Signal the transport to expect SASL frames used to establish a SASL layer prior to - * performing the AMQP protocol version negotiation. This must first be performed before - * the transport is used for processing. Subsequent invocations will return the same - * {@link Sasl} object. - * - * @throws IllegalStateException if transport processing has already begun prior to initial invocation - */ - Sasl sasl() throws IllegalStateException; - - /** - * Wrap this transport's output and input to apply SSL encryption and decryption respectively. - * - * This method is expected to be called at most once. A subsequent invocation will return the same - * {@link Ssl} object, regardless of the parameters supplied. - * - * @param sslDomain the SSL settings to use - * @param sslPeerDetails may be null, in which case SSL session resume will not be attempted - * @return an {@link Ssl} object representing the SSL session. - */ - Ssl ssl(SslDomain sslDomain, SslPeerDetails sslPeerDetails); - - /** - * As per {@link #ssl(SslDomain, SslPeerDetails)} but no attempt is made to resume a previous SSL session. - */ - Ssl ssl(SslDomain sslDomain); - - - /** - * Get the maximum frame size for the transport - * - * @return the maximum frame size - */ - int getMaxFrameSize(); - - void setMaxFrameSize(int size); - - int getRemoteMaxFrameSize(); - - /** - * Gets the local channel-max value to be advertised to the remote peer - * - * @return the local channel-max value - * @see #setChannelMax(int) - */ - int getChannelMax(); - - /** - * Set the local value of channel-max, to be advertised to the peer on the - * <a href="http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-open"> - * Open frame</a> emitted by the transport. - * - * The remote peers advertised channel-max can be observed using {@link #getRemoteChannelMax()}. - * - * @param channelMax the local channel-max to advertise to the peer, in range [0 - 2^16). - * @throws IllegalArgumentException if the value supplied is outside range [0 - 2^16). - */ - void setChannelMax(int channelMax); - - /** - * Gets the remote value of channel-max, as advertised by the peer on its - * <a href="http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-open"> - * Open frame</a>. - * - * The local peers advertised channel-max can be observed using {@link #getChannelMax()}. - * - * @return the remote channel-max value - */ - int getRemoteChannelMax(); - - ErrorCondition getCondition(); - - /** - * - * @param timeout local idle timeout in milliseconds - */ - void setIdleTimeout(int timeout); - /** - * - * @return local idle timeout in milliseconds - */ - int getIdleTimeout(); - /** - * - * @return remote idle timeout in milliseconds - */ - int getRemoteIdleTimeout(); - - long tick(long now); - - long getFramesInput(); - - long getFramesOutput(); - - /** - * Configure whether a synthetic Flow event should be emitted when messages are sent, - * reflecting a change in the credit level on the link that may prompt other action. - * - * Defaults to true. - * - * @param emitFlowEventOnSend true if a flow event should be emitted, false otherwise - */ - void setEmitFlowEventOnSend(boolean emitFlowEventOnSend); - - boolean isEmitFlowEventOnSend(); -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/TransportException.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/TransportException.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/TransportException.java deleted file mode 100644 index c4955b4..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/TransportException.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package org.apache.qpid.proton.engine; - -import java.util.IllegalFormatException; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.apache.qpid.proton.ProtonException; - -public class TransportException extends ProtonException -{ - - private static final Logger LOGGER = Logger.getLogger(TransportException.class.getName()); - - public TransportException() - { - } - - public TransportException(String message) - { - super(message); - } - - public TransportException(String message, Throwable cause) - { - super(message, cause); - } - - public TransportException(Throwable cause) - { - super(cause); - } - - private static String format(String format, Object ... args) - { - try - { - return String.format(format, args); - } - catch(IllegalFormatException e) - { - LOGGER.log(Level.SEVERE, "Formating error in string " + format, e); - return format; - } - } - - public TransportException(String format, Object ... args) - { - this(format(format, args)); - } - -} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/TransportResult.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/TransportResult.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/TransportResult.java deleted file mode 100644 index a484ce7..0000000 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/TransportResult.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.proton.engine; - -public interface TransportResult -{ - enum Status - { - OK, - ERROR - } - - Status getStatus(); - - String getErrorDescription(); - - Exception getException(); - - /** - * @throws TransportException if the result's state is not ok. - */ - void checkIsOk(); - - boolean isOk(); - -} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
