You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2017/01/09 15:24:48 UTC
[12/34] qpid-proton git commit: PROTON-1385: remove proton-j from the
existing repo, it now has its own repo at:
https://git-wip-us.apache.org/repos/asf/qpid-proton-j.git
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslImpl.java
deleted file mode 100644
index de99351..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslImpl.java
+++ /dev/null
@@ -1,271 +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.impl.ssl;
-
-import java.nio.ByteBuffer;
-
-import org.apache.qpid.proton.ProtonUnsupportedOperationException;
-import org.apache.qpid.proton.engine.Ssl;
-import org.apache.qpid.proton.engine.SslDomain;
-import org.apache.qpid.proton.engine.SslPeerDetails;
-import org.apache.qpid.proton.engine.Transport;
-import org.apache.qpid.proton.engine.TransportException;
-import org.apache.qpid.proton.engine.impl.PlainTransportWrapper;
-import org.apache.qpid.proton.engine.impl.TransportInput;
-import org.apache.qpid.proton.engine.impl.TransportLayer;
-import org.apache.qpid.proton.engine.impl.TransportOutput;
-import org.apache.qpid.proton.engine.impl.TransportWrapper;
-
-public class SslImpl implements Ssl, TransportLayer
-{
- private SslTransportWrapper _unsecureClientAwareTransportWrapper;
-
- private final SslDomain _domain;
- private final ProtonSslEngineProvider _protonSslEngineProvider;
-
- private final SslPeerDetails _peerDetails;
- private TransportException _initException;
-
- /**
- * @param domain must implement {@link org.apache.qpid.proton.engine.impl.ssl.ProtonSslEngineProvider}. This is not possible
- * enforce at the API level because {@link org.apache.qpid.proton.engine.impl.ssl.ProtonSslEngineProvider} is not part of the
- * public Proton API.
- */
- public SslImpl(SslDomain domain, SslPeerDetails peerDetails)
- {
- _domain = domain;
- _protonSslEngineProvider = (ProtonSslEngineProvider)domain;
- _peerDetails = peerDetails;
- }
-
- public TransportWrapper wrap(TransportInput inputProcessor, TransportOutput outputProcessor)
- {
- if (_unsecureClientAwareTransportWrapper != null)
- {
- throw new IllegalStateException("Transport already wrapped");
- }
-
- _unsecureClientAwareTransportWrapper = new UnsecureClientAwareTransportWrapper(inputProcessor, outputProcessor);
- return _unsecureClientAwareTransportWrapper;
- }
-
- @Override
- public String getCipherName()
- {
- if(_unsecureClientAwareTransportWrapper == null)
- {
- throw new IllegalStateException("Transport wrapper is uninitialised");
- }
-
- return _unsecureClientAwareTransportWrapper.getCipherName();
- }
-
- @Override
- public String getProtocolName()
- {
- if(_unsecureClientAwareTransportWrapper == null)
- {
- throw new IllegalStateException("Transport wrapper is uninitialised");
- }
-
- return _unsecureClientAwareTransportWrapper.getProtocolName();
- }
-
- private class UnsecureClientAwareTransportWrapper implements SslTransportWrapper
- {
- private final TransportInput _inputProcessor;
- private final TransportOutput _outputProcessor;
- private SslTransportWrapper _transportWrapper;
-
- private UnsecureClientAwareTransportWrapper(TransportInput inputProcessor,
- TransportOutput outputProcessor)
- {
- _inputProcessor = inputProcessor;
- _outputProcessor = outputProcessor;
- }
-
- @Override
- public int capacity()
- {
- initTransportWrapperOnFirstIO();
- if (_initException == null) {
- return _transportWrapper.capacity();
- } else {
- return Transport.END_OF_STREAM;
- }
- }
-
- @Override
- public int position()
- {
- initTransportWrapperOnFirstIO();
- if (_initException == null) {
- return _transportWrapper.position();
- } else {
- return Transport.END_OF_STREAM;
- }
- }
-
- @Override
- public ByteBuffer tail()
- {
- initTransportWrapperOnFirstIO();
- if (_initException == null) {
- return _transportWrapper.tail();
- } else {
- return null;
- }
- }
-
-
- @Override
- public void process() throws TransportException
- {
- initTransportWrapperOnFirstIO();
- if (_initException == null) {
- _transportWrapper.process();
- } else {
- throw new TransportException(_initException);
- }
- }
-
- @Override
- public void close_tail()
- {
- initTransportWrapperOnFirstIO();
- if (_initException == null) {
- _transportWrapper.close_tail();
- }
- }
-
- @Override
- public int pending()
- {
- initTransportWrapperOnFirstIO();
- if (_initException == null) {
- return _transportWrapper.pending();
- } else {
- throw new TransportException(_initException);
- }
- }
-
- @Override
- public ByteBuffer head()
- {
- initTransportWrapperOnFirstIO();
- if (_initException == null) {
- return _transportWrapper.head();
- } else {
- return null;
- }
- }
-
- @Override
- public void pop(int bytes)
- {
- initTransportWrapperOnFirstIO();
- if (_initException == null) {
- _transportWrapper.pop(bytes);
- }
- }
-
- @Override
- public void close_head()
- {
- initTransportWrapperOnFirstIO();
- if (_initException == null) {
- _transportWrapper.close_head();
- }
- }
-
- @Override
- public String getCipherName()
- {
- if (_transportWrapper == null)
- {
- return null;
- }
- else
- {
- return _transportWrapper.getCipherName();
- }
- }
-
- @Override
- public String getProtocolName()
- {
- if(_transportWrapper == null)
- {
- return null;
- }
- else
- {
- return _transportWrapper.getProtocolName();
- }
- }
-
- private void initTransportWrapperOnFirstIO()
- {
- try {
- if (_initException == null && _transportWrapper == null)
- {
- SslTransportWrapper sslTransportWrapper = new SimpleSslTransportWrapper
- (_protonSslEngineProvider.createSslEngine(_peerDetails),
- _inputProcessor, _outputProcessor);
-
- if (_domain.allowUnsecuredClient() && _domain.getMode() == SslDomain.Mode.SERVER)
- {
- TransportWrapper plainTransportWrapper = new PlainTransportWrapper
- (_outputProcessor, _inputProcessor);
- _transportWrapper = new SslHandshakeSniffingTransportWrapper
- (sslTransportWrapper, plainTransportWrapper);
- }
- else
- {
- _transportWrapper = sslTransportWrapper;
- }
- }
- } catch (TransportException e) {
- _initException = e;
- }
- }
- }
-
- /**
- * {@inheritDoc}
- * @throws ProtonUnsupportedOperationException
- */
- @Override
- public void setPeerHostname(String hostname)
- {
- throw new ProtonUnsupportedOperationException();
- }
-
- /**
- * {@inheritDoc}
- * @throws ProtonUnsupportedOperationException
- */
- @Override
- public String getPeerHostname()
- {
- throw new ProtonUnsupportedOperationException();
- }
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslPeerDetailsImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslPeerDetailsImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslPeerDetailsImpl.java
deleted file mode 100644
index cbd9755..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslPeerDetailsImpl.java
+++ /dev/null
@@ -1,50 +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.impl.ssl;
-
-import org.apache.qpid.proton.engine.ProtonJSslPeerDetails;
-
-
-public class SslPeerDetailsImpl implements ProtonJSslPeerDetails
-{
- private final String _hostname;
- private final int _port;
-
- /**
- * @deprecated This constructor's visibility will be reduced to the default scope in a future release.
- * Client code outside this module should use {@link org.apache.qpid.proton.engine.SslPeerDetails.Factory#create(String, int)} instead.
- */
- @Deprecated public SslPeerDetailsImpl(String hostname, int port)
- {
- _hostname = hostname;
- _port = port;
- }
-
- @Override
- public String getHostname()
- {
- return _hostname;
- }
-
- @Override
- public int getPort()
- {
- return _port;
- }
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslTransportWrapper.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslTransportWrapper.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslTransportWrapper.java
deleted file mode 100644
index 8b1f133..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SslTransportWrapper.java
+++ /dev/null
@@ -1,28 +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.impl.ssl;
-
-import org.apache.qpid.proton.engine.impl.TransportWrapper;
-
-public interface SslTransportWrapper extends TransportWrapper
-{
- String getCipherName();
- String getProtocolName();
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/framing/TransportFrame.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/framing/TransportFrame.java b/proton-j/src/main/java/org/apache/qpid/proton/framing/TransportFrame.java
deleted file mode 100644
index 624ac56..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/framing/TransportFrame.java
+++ /dev/null
@@ -1,65 +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.framing;
-
-import org.apache.qpid.proton.amqp.Binary;
-import org.apache.qpid.proton.amqp.transport.FrameBody;
-
-public class TransportFrame
-{
- private final int _channel;
- private final FrameBody _body;
- private final Binary _payload;
-
-
- public TransportFrame(final int channel,
- final FrameBody body,
- final Binary payload)
- {
- _payload = payload;
- _body = body;
- _channel = channel;
- }
-
- public int getChannel()
- {
- return _channel;
- }
-
- public FrameBody getBody()
- {
- return _body;
- }
-
- public Binary getPayload()
- {
- return _payload;
- }
-
- @Override
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("TransportFrame{ _channel=").append(_channel).append(", _body=").append(_body).append("}");
- return builder.toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/logging/LoggingProtocolTracer.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/logging/LoggingProtocolTracer.java b/proton-j/src/main/java/org/apache/qpid/proton/logging/LoggingProtocolTracer.java
deleted file mode 100644
index 7624b0b..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/logging/LoggingProtocolTracer.java
+++ /dev/null
@@ -1,61 +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.logging;
-
-import java.util.logging.Logger;
-
-import org.apache.qpid.proton.engine.impl.ProtocolTracer;
-import org.apache.qpid.proton.framing.TransportFrame;
-
-public class LoggingProtocolTracer implements ProtocolTracer
-{
- private static final String LOGGER_NAME_STEM = LoggingProtocolTracer.class.getName();
-
- private static final Logger RECEIVED_LOGGER = Logger.getLogger(LOGGER_NAME_STEM + ".received");
- private static final Logger SENT_LOGGER = Logger.getLogger(LOGGER_NAME_STEM + ".sent");
-
- private String _logMessagePrefix;
-
- public LoggingProtocolTracer()
- {
- this("Transport");
- }
-
- public LoggingProtocolTracer(String logMessagePrefix)
- {
- _logMessagePrefix = logMessagePrefix;
- }
-
- @Override
- public void receivedFrame(TransportFrame transportFrame)
- {
- RECEIVED_LOGGER.finer(_logMessagePrefix + " received frame: " + transportFrame);
- }
-
- @Override
- public void sentFrame(TransportFrame transportFrame)
- {
- SENT_LOGGER.finer(_logMessagePrefix + " writing frame: " + transportFrame);
- }
-
- public void setLogMessagePrefix(String logMessagePrefix)
- {
- _logMessagePrefix = logMessagePrefix;
- }
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/logging/ProtonLoggerFactory.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/logging/ProtonLoggerFactory.java b/proton-j/src/main/java/org/apache/qpid/proton/logging/ProtonLoggerFactory.java
deleted file mode 100644
index 890873a..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/logging/ProtonLoggerFactory.java
+++ /dev/null
@@ -1,35 +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.logging;
-
-import java.util.logging.Logger;
-
-/**
- * Thin convenience wrapper around {@link Logger}
- */
-public class ProtonLoggerFactory
-{
- /**
- * Returns a logger named using the fully qualified name of the supplied class.
- */
- public static Logger getLogger(Class<?> clazz)
- {
- return Logger.getLogger(clazz.getName());
- }
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/message/Message.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/message/Message.java b/proton-j/src/main/java/org/apache/qpid/proton/message/Message.java
deleted file mode 100644
index 41945fa..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/message/Message.java
+++ /dev/null
@@ -1,185 +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.message;
-
-import org.apache.qpid.proton.amqp.messaging.ApplicationProperties;
-import org.apache.qpid.proton.amqp.messaging.DeliveryAnnotations;
-import org.apache.qpid.proton.amqp.messaging.Footer;
-import org.apache.qpid.proton.amqp.messaging.Header;
-import org.apache.qpid.proton.amqp.messaging.MessageAnnotations;
-import org.apache.qpid.proton.amqp.messaging.Properties;
-import org.apache.qpid.proton.amqp.messaging.Section;
-
-import org.apache.qpid.proton.message.impl.MessageImpl;
-
-/**
- * Represents a Message within Proton.
- *
- * Create instances of Message using {@link Message.Factory}.
- *
- */
-public interface Message
-{
-
- public static final class Factory
- {
- public static Message create() {
- return new MessageImpl();
- }
-
- public static Message create(Header header,
- DeliveryAnnotations deliveryAnnotations,
- MessageAnnotations messageAnnotations,
- Properties properties,
- ApplicationProperties applicationProperties,
- Section body,
- Footer footer) {
- return new MessageImpl(header, deliveryAnnotations,
- messageAnnotations, properties,
- applicationProperties, body, footer);
- }
- }
-
-
- short DEFAULT_PRIORITY = 4;
-
- boolean isDurable();
-
- long getDeliveryCount();
-
- short getPriority();
-
- boolean isFirstAcquirer();
-
- long getTtl();
-
- void setDurable(boolean durable);
-
- void setTtl(long ttl);
-
- void setDeliveryCount(long deliveryCount);
-
- void setFirstAcquirer(boolean firstAcquirer);
-
- void setPriority(short priority);
-
- Object getMessageId();
-
- long getGroupSequence();
-
- String getReplyToGroupId();
-
-
- long getCreationTime();
-
- String getAddress();
-
- byte[] getUserId();
-
- String getReplyTo();
-
- String getGroupId();
-
- String getContentType();
-
- long getExpiryTime();
-
- Object getCorrelationId();
-
- String getContentEncoding();
-
- String getSubject();
-
- void setGroupSequence(long groupSequence);
-
- void setUserId(byte[] userId);
-
- void setCreationTime(long creationTime);
-
- void setSubject(String subject);
-
- void setGroupId(String groupId);
-
- void setAddress(String to);
-
- void setExpiryTime(long absoluteExpiryTime);
-
- void setReplyToGroupId(String replyToGroupId);
-
- void setContentEncoding(String contentEncoding);
-
- void setContentType(String contentType);
-
- void setReplyTo(String replyTo);
-
- void setCorrelationId(Object correlationId);
-
- void setMessageId(Object messageId);
-
- Header getHeader();
-
- DeliveryAnnotations getDeliveryAnnotations();
-
- MessageAnnotations getMessageAnnotations();
-
- Properties getProperties();
-
- ApplicationProperties getApplicationProperties();
-
- Section getBody();
-
- Footer getFooter();
-
- void setHeader(Header header);
-
- void setDeliveryAnnotations(DeliveryAnnotations deliveryAnnotations);
-
- void setMessageAnnotations(MessageAnnotations messageAnnotations);
-
- void setProperties(Properties properties);
-
- void setApplicationProperties(ApplicationProperties applicationProperties);
-
- void setBody(Section body);
-
- void setFooter(Footer footer);
-
- /**
- * TODO describe what happens if the data does not represent a complete message.
- * Currently this appears to leave the message in an unknown state.
- */
- int decode(byte[] data, int offset, int length);
-
- /**
- * Encodes up to {@code length} bytes of the message into the provided byte array,
- * starting at position {@code offset}.
- *
- * TODO describe what happens if length is smaller than the encoded form, Currently
- * Proton-J throws an exception. What does Proton-C do?
- *
- * @return the number of bytes written to the byte array
- */
- int encode(byte[] data, int offset, int length);
-
- void clear();
-
- MessageError getError();
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/message/MessageError.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/message/MessageError.java b/proton-j/src/main/java/org/apache/qpid/proton/message/MessageError.java
deleted file mode 100644
index 1b8e0af..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/message/MessageError.java
+++ /dev/null
@@ -1,27 +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.message;
-
-public enum MessageError
-{
- OK
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/message/ProtonJMessage.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/message/ProtonJMessage.java b/proton-j/src/main/java/org/apache/qpid/proton/message/ProtonJMessage.java
deleted file mode 100644
index b22ef2a..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/message/ProtonJMessage.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.message;
-
-import org.apache.qpid.proton.codec.WritableBuffer;
-import org.apache.qpid.proton.message.Message;
-
-public interface ProtonJMessage extends Message
-{
-
- int encode2(byte[] data, int offset, int length);
-
- int encode(WritableBuffer buffer);
-
-}
\ 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/message/impl/MessageImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/message/impl/MessageImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/message/impl/MessageImpl.java
deleted file mode 100644
index df6373f..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/message/impl/MessageImpl.java
+++ /dev/null
@@ -1,784 +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.message.impl;
-
-import java.nio.ByteBuffer;
-import java.util.Date;
-import org.apache.qpid.proton.amqp.Binary;
-import org.apache.qpid.proton.amqp.Symbol;
-import org.apache.qpid.proton.amqp.UnsignedByte;
-import org.apache.qpid.proton.amqp.UnsignedInteger;
-import org.apache.qpid.proton.amqp.messaging.*;
-import org.apache.qpid.proton.codec.*;
-import org.apache.qpid.proton.message.*;
-
-public class MessageImpl implements ProtonJMessage
-{
- private Header _header;
- private DeliveryAnnotations _deliveryAnnotations;
- private MessageAnnotations _messageAnnotations;
- private Properties _properties;
- private ApplicationProperties _applicationProperties;
- private Section _body;
- private Footer _footer;
-
- private static class EncoderDecoderPair {
- DecoderImpl decoder = new DecoderImpl();
- EncoderImpl encoder = new EncoderImpl(decoder);
- {
- AMQPDefinedTypes.registerAllTypes(decoder, encoder);
- }
- }
-
- private static final ThreadLocal<EncoderDecoderPair> tlsCodec = new ThreadLocal<EncoderDecoderPair>() {
- @Override protected EncoderDecoderPair initialValue() {
- return new EncoderDecoderPair();
- }
- };
-
- /**
- * @deprecated This constructor's visibility will be reduced to the default scope in a future release.
- * Client code outside this module should use {@link Message.Factory#create()} instead
- */
- @Deprecated public MessageImpl()
- {
- }
-
- /**
- * @deprecated This constructor's visibility will be reduced to the default scope in a future release.
- * Client code outside this module should instead use
- * {@link Message.Factory#create(Header, DeliveryAnnotations, MessageAnnotations, Properties, ApplicationProperties, Section, Footer)}
- */
- @Deprecated public MessageImpl(Header header, DeliveryAnnotations deliveryAnnotations, MessageAnnotations messageAnnotations,
- Properties properties, ApplicationProperties applicationProperties, Section body, Footer footer)
- {
- _header = header;
- _deliveryAnnotations = deliveryAnnotations;
- _messageAnnotations = messageAnnotations;
- _properties = properties;
- _applicationProperties = applicationProperties;
- _body = body;
- _footer = footer;
- }
-
- @Override
- public boolean isDurable()
- {
- return (_header == null || _header.getDurable() == null) ? false : _header.getDurable();
- }
-
-
- @Override
- public long getDeliveryCount()
- {
- return (_header == null || _header.getDeliveryCount() == null) ? 0l : _header.getDeliveryCount().longValue();
- }
-
-
- @Override
- public short getPriority()
- {
- return (_header == null || _header.getPriority() == null)
- ? DEFAULT_PRIORITY
- : _header.getPriority().shortValue();
- }
-
- @Override
- public boolean isFirstAcquirer()
- {
- return (_header == null || _header.getFirstAcquirer() == null) ? false : _header.getFirstAcquirer();
- }
-
- @Override
- public long getTtl()
- {
- return (_header == null || _header.getTtl() == null) ? 0l : _header.getTtl().longValue();
- }
-
- @Override
- public void setDurable(boolean durable)
- {
- if (_header == null)
- {
- if (durable)
- {
- _header = new Header();
- }
- else
- {
- return;
- }
- }
- _header.setDurable(durable);
- }
-
- @Override
- public void setTtl(long ttl)
- {
-
- if (_header == null)
- {
- if (ttl != 0l)
- {
- _header = new Header();
- }
- else
- {
- return;
- }
- }
- _header.setTtl(UnsignedInteger.valueOf(ttl));
- }
-
- @Override
- public void setDeliveryCount(long deliveryCount)
- {
- if (_header == null)
- {
- if (deliveryCount == 0l)
- {
- return;
- }
- _header = new Header();
- }
- _header.setDeliveryCount(UnsignedInteger.valueOf(deliveryCount));
- }
-
-
- @Override
- public void setFirstAcquirer(boolean firstAcquirer)
- {
-
- if (_header == null)
- {
- if (!firstAcquirer)
- {
- return;
- }
- _header = new Header();
- }
- _header.setFirstAcquirer(firstAcquirer);
- }
-
- @Override
- public void setPriority(short priority)
- {
-
- if (_header == null)
- {
- if (priority == DEFAULT_PRIORITY)
- {
- return;
- }
- _header = new Header();
- }
- _header.setPriority(UnsignedByte.valueOf((byte) priority));
- }
-
- @Override
- public Object getMessageId()
- {
- return _properties == null ? null : _properties.getMessageId();
- }
-
- @Override
- public long getGroupSequence()
- {
- return (_properties == null || _properties.getGroupSequence() == null) ? 0l : _properties.getGroupSequence().intValue();
- }
-
- @Override
- public String getReplyToGroupId()
- {
- return _properties == null ? null : _properties.getReplyToGroupId();
- }
-
- @Override
- public long getCreationTime()
- {
- return (_properties == null || _properties.getCreationTime() == null) ? 0l : _properties.getCreationTime().getTime();
- }
-
- @Override
- public String getAddress()
- {
- return _properties == null ? null : _properties.getTo();
- }
-
- @Override
- public byte[] getUserId()
- {
- if(_properties == null || _properties.getUserId() == null)
- {
- return null;
- }
- else
- {
- final Binary userId = _properties.getUserId();
- byte[] id = new byte[userId.getLength()];
- System.arraycopy(userId.getArray(),userId.getArrayOffset(),id,0,userId.getLength());
- return id;
- }
-
- }
-
- @Override
- public String getReplyTo()
- {
- return _properties == null ? null : _properties.getReplyTo();
- }
-
- @Override
- public String getGroupId()
- {
- return _properties == null ? null : _properties.getGroupId();
- }
-
- @Override
- public String getContentType()
- {
- return (_properties == null || _properties.getContentType() == null) ? null : _properties.getContentType().toString();
- }
-
- @Override
- public long getExpiryTime()
- {
- return (_properties == null || _properties.getAbsoluteExpiryTime() == null) ? 0l : _properties.getAbsoluteExpiryTime().getTime();
- }
-
- @Override
- public Object getCorrelationId()
- {
- return (_properties == null) ? null : _properties.getCorrelationId();
- }
-
- @Override
- public String getContentEncoding()
- {
- return (_properties == null || _properties.getContentEncoding() == null) ? null : _properties.getContentEncoding().toString();
- }
-
- @Override
- public String getSubject()
- {
- return _properties == null ? null : _properties.getSubject();
- }
-
- @Override
- public void setGroupSequence(long groupSequence)
- {
- if(_properties == null)
- {
- if(groupSequence == 0l)
- {
- return;
- }
- else
- {
- _properties = new Properties();
- }
- }
- _properties.setGroupSequence(UnsignedInteger.valueOf((int) groupSequence));
- }
-
- @Override
- public void setUserId(byte[] userId)
- {
- if(userId == null)
- {
- if(_properties != null)
- {
- _properties.setUserId(null);
- }
-
- }
- else
- {
- if(_properties == null)
- {
- _properties = new Properties();
- }
- byte[] id = new byte[userId.length];
- System.arraycopy(userId, 0, id,0, userId.length);
- _properties.setUserId(new Binary(id));
- }
- }
-
- @Override
- public void setCreationTime(long creationTime)
- {
- if(_properties == null)
- {
- if(creationTime == 0l)
- {
- return;
- }
- _properties = new Properties();
-
- }
- _properties.setCreationTime(new Date(creationTime));
- }
-
- @Override
- public void setSubject(String subject)
- {
- if(_properties == null)
- {
- if(subject == null)
- {
- return;
- }
- _properties = new Properties();
- }
- _properties.setSubject(subject);
- }
-
- @Override
- public void setGroupId(String groupId)
- {
- if(_properties == null)
- {
- if(groupId == null)
- {
- return;
- }
- _properties = new Properties();
- }
- _properties.setGroupId(groupId);
- }
-
- @Override
- public void setAddress(String to)
- {
- if(_properties == null)
- {
- if(to == null)
- {
- return;
- }
- _properties = new Properties();
- }
- _properties.setTo(to);
- }
-
- @Override
- public void setExpiryTime(long absoluteExpiryTime)
- {
- if(_properties == null)
- {
- if(absoluteExpiryTime == 0l)
- {
- return;
- }
- _properties = new Properties();
-
- }
- _properties.setAbsoluteExpiryTime(new Date(absoluteExpiryTime));
- }
-
- @Override
- public void setReplyToGroupId(String replyToGroupId)
- {
- if(_properties == null)
- {
- if(replyToGroupId == null)
- {
- return;
- }
- _properties = new Properties();
- }
- _properties.setReplyToGroupId(replyToGroupId);
- }
-
- @Override
- public void setContentEncoding(String contentEncoding)
- {
- if(_properties == null)
- {
- if(contentEncoding == null)
- {
- return;
- }
- _properties = new Properties();
- }
- _properties.setContentEncoding(Symbol.valueOf(contentEncoding));
- }
-
- @Override
- public void setContentType(String contentType)
- {
- if(_properties == null)
- {
- if(contentType == null)
- {
- return;
- }
- _properties = new Properties();
- }
- _properties.setContentType(Symbol.valueOf(contentType));
- }
-
- @Override
- public void setReplyTo(String replyTo)
- {
-
- if(_properties == null)
- {
- if(replyTo == null)
- {
- return;
- }
- _properties = new Properties();
- }
- _properties.setReplyTo(replyTo);
- }
-
- @Override
- public void setCorrelationId(Object correlationId)
- {
-
- if(_properties == null)
- {
- if(correlationId == null)
- {
- return;
- }
- _properties = new Properties();
- }
- _properties.setCorrelationId(correlationId);
- }
-
- @Override
- public void setMessageId(Object messageId)
- {
-
- if(_properties == null)
- {
- if(messageId == null)
- {
- return;
- }
- _properties = new Properties();
- }
- _properties.setMessageId(messageId);
- }
-
-
- @Override
- public Header getHeader()
- {
- return _header;
- }
-
- @Override
- public DeliveryAnnotations getDeliveryAnnotations()
- {
- return _deliveryAnnotations;
- }
-
- @Override
- public MessageAnnotations getMessageAnnotations()
- {
- return _messageAnnotations;
- }
-
- @Override
- public Properties getProperties()
- {
- return _properties;
- }
-
- @Override
- public ApplicationProperties getApplicationProperties()
- {
- return _applicationProperties;
- }
-
- @Override
- public Section getBody()
- {
- return _body;
- }
-
- @Override
- public Footer getFooter()
- {
- return _footer;
- }
-
- @Override
- public void setHeader(Header header)
- {
- _header = header;
- }
-
- @Override
- public void setDeliveryAnnotations(DeliveryAnnotations deliveryAnnotations)
- {
- _deliveryAnnotations = deliveryAnnotations;
- }
-
- @Override
- public void setMessageAnnotations(MessageAnnotations messageAnnotations)
- {
- _messageAnnotations = messageAnnotations;
- }
-
- @Override
- public void setProperties(Properties properties)
- {
- _properties = properties;
- }
-
- @Override
- public void setApplicationProperties(ApplicationProperties applicationProperties)
- {
- _applicationProperties = applicationProperties;
- }
-
- @Override
- public void setBody(Section body)
- {
- _body = body;
- }
-
- @Override
- public void setFooter(Footer footer)
- {
- _footer = footer;
- }
-
- @Override
- public int decode(byte[] data, int offset, int length)
- {
- final ByteBuffer buffer = ByteBuffer.wrap(data, offset, length);
- decode(buffer);
-
- return length-buffer.remaining();
- }
-
- public void decode(ByteBuffer buffer)
- {
- DecoderImpl decoder = tlsCodec.get().decoder;
- decoder.setByteBuffer(buffer);
-
- _header = null;
- _deliveryAnnotations = null;
- _messageAnnotations = null;
- _properties = null;
- _applicationProperties = null;
- _body = null;
- _footer = null;
- Section section = null;
-
- if(buffer.hasRemaining())
- {
- section = (Section) decoder.readObject();
- }
- if(section instanceof Header)
- {
- _header = (Header) section;
- if(buffer.hasRemaining())
- {
- section = (Section) decoder.readObject();
- }
- else
- {
- section = null;
- }
-
- }
- if(section instanceof DeliveryAnnotations)
- {
- _deliveryAnnotations = (DeliveryAnnotations) section;
-
- if(buffer.hasRemaining())
- {
- section = (Section) decoder.readObject();
- }
- else
- {
- section = null;
- }
-
- }
- if(section instanceof MessageAnnotations)
- {
- _messageAnnotations = (MessageAnnotations) section;
-
- if(buffer.hasRemaining())
- {
- section = (Section) decoder.readObject();
- }
- else
- {
- section = null;
- }
-
- }
- if(section instanceof Properties)
- {
- _properties = (Properties) section;
-
- if(buffer.hasRemaining())
- {
- section = (Section) decoder.readObject();
- }
- else
- {
- section = null;
- }
-
- }
- if(section instanceof ApplicationProperties)
- {
- _applicationProperties = (ApplicationProperties) section;
-
- if(buffer.hasRemaining())
- {
- section = (Section) decoder.readObject();
- }
- else
- {
- section = null;
- }
-
- }
- if(section != null && !(section instanceof Footer))
- {
- _body = section;
-
- if(buffer.hasRemaining())
- {
- section = (Section) decoder.readObject();
- }
- else
- {
- section = null;
- }
-
- }
- if(section instanceof Footer)
- {
- _footer = (Footer) section;
-
- }
-
- decoder.setByteBuffer(null);
- }
-
- @Override
- public int encode(byte[] data, int offset, int length)
- {
- ByteBuffer buffer = ByteBuffer.wrap(data, offset, length);
- return encode(new WritableBuffer.ByteBufferWrapper(buffer));
- }
-
- @Override
- public int encode2(byte[] data, int offset, int length)
- {
- ByteBuffer buffer = ByteBuffer.wrap(data, offset, length);
- WritableBuffer.ByteBufferWrapper first = new WritableBuffer.ByteBufferWrapper(buffer);
- DroppingWritableBuffer second = new DroppingWritableBuffer();
- CompositeWritableBuffer composite = new CompositeWritableBuffer(first, second);
- int start = composite.position();
- encode(composite);
- return composite.position() - start;
- }
-
- @Override
- public int encode(WritableBuffer buffer)
- {
- int length = buffer.remaining();
- EncoderImpl encoder = tlsCodec.get().encoder;
- encoder.setByteBuffer(buffer);
-
- if(getHeader() != null)
- {
- encoder.writeObject(getHeader());
- }
- if(getDeliveryAnnotations() != null)
- {
- encoder.writeObject(getDeliveryAnnotations());
- }
- if(getMessageAnnotations() != null)
- {
- encoder.writeObject(getMessageAnnotations());
- }
- if(getProperties() != null)
- {
- encoder.writeObject(getProperties());
- }
- if(getApplicationProperties() != null)
- {
- encoder.writeObject(getApplicationProperties());
- }
- if(getBody() != null)
- {
- encoder.writeObject(getBody());
- }
- if(getFooter() != null)
- {
- encoder.writeObject(getFooter());
- }
- encoder.setByteBuffer((WritableBuffer)null);
-
- return length - buffer.remaining();
- }
-
- @Override
- public void clear()
- {
- _body = null;
- }
-
- @Override
- public MessageError getError()
- {
- return MessageError.OK;
- }
-
- public String toString()
- {
- StringBuilder sb = new StringBuilder();
- sb.append("Message{");
- if (_header != null) {
- sb.append("header=");
- sb.append(_header);
- }
- if (_properties != null) {
- sb.append("properties=");
- sb.append(_properties);
- }
- if (_messageAnnotations != null) {
- sb.append("message_annotations=");
- sb.append(_messageAnnotations);
- }
- if (_body != null) {
- sb.append("body=");
- sb.append(_body);
- }
- sb.append("}");
- return sb.toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/messenger/Messenger.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/messenger/Messenger.java b/proton-j/src/main/java/org/apache/qpid/proton/messenger/Messenger.java
deleted file mode 100644
index bd19259..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/messenger/Messenger.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.messenger;
-
-import java.io.IOException;
-
-import org.apache.qpid.proton.TimeoutException;
-import org.apache.qpid.proton.message.Message;
-import org.apache.qpid.proton.messenger.impl.MessengerImpl;
-
-/**
- *
- * Messenger defines a high level interface for sending and receiving
- * messages. Every Messenger contains a single logical queue of
- * incoming messages and a single logical queue of outgoing
- * messages. These messages in these queues may be destined for, or
- * originate from, a variety of addresses.
- *
- * <h3>Address Syntax</h3>
- *
- * An address has the following form:
- *
- * [ amqp[s]:// ] [user[:password]@] domain [/[name]]
- *
- * Where domain can be one of:
- *
- * host | host:port | ip | ip:port | name
- *
- * The following are valid examples of addresses:
- *
- * - example.org
- * - example.org:1234
- * - amqp://example.org
- * - amqps://example.org
- * - example.org/incoming
- * - amqps://example.org/outgoing
- * - amqps://fred:trustno1@example.org
- * - 127.0.0.1:1234
- * - amqps://127.0.0.1:1234
- *
- * <h3>Sending & Receiving Messages</h3>
- *
- * The Messenger interface works in conjuction with the Message
- * class. The Message class is a mutable holder of message content.
- * The put method will encode the content in a given Message object
- * into the outgoing message queue leaving that Message object free
- * to be modified or discarded without having any impact on the
- * content in the outgoing queue.
- *
- * Similarly, the get method will decode the content in the incoming
- * message queue into the supplied Message object.
- *
- * @deprecated Messenger will be removed from upcoming proton-j releases.
-*/
-@Deprecated
-public interface Messenger
-{
-
- /**
- * @deprecated Messenger will be removed from upcoming proton-j releases.
- */
- @Deprecated
- public static final class Factory
- {
- public static Messenger create() {
- return new MessengerImpl();
- }
-
- public static Messenger create(String name) {
- return new MessengerImpl(name);
- }
- }
-
- /**
- * Flag for use with reject(), accept() and settle() methods.
- */
- static final int CUMULATIVE = 0x01;
-
- /**
- * Places the content contained in the message onto the outgoing
- * queue of the Messenger. This method will never block. The
- * send call may be used to block until the messages are
- * sent. Either a send() or a recv() call is neceesary at present
- * to cause the messages to actually be sent out.
- */
- void put(Message message) throws MessengerException;
-
- /**
- * Blocks until the outgoing queue is empty and, in the event that
- * an outgoing window has been set, until the messages in that
- * window have been received by the target to which they were
- * sent, or the operation times out. The timeout property
- * controls how long a Messenger will block before timing out.
- */
- void send() throws TimeoutException;
-
- void send(int n) throws TimeoutException;
-
- /**
- * Subscribes the Messenger to messages originating from the
- * specified source. The source is an address as specified in the
- * Messenger introduction with the following addition. If the
- * domain portion of the address begins with the '~' character,
- * the Messenger will interpret the domain as host/port, bind
- * to it, and listen for incoming messages. For example
- * "~0.0.0.0", "amqp://~0.0.0.0" will bind to any local interface
- * and listen for incoming messages.
- */
- void subscribe(String source) throws MessengerException;
- /**
- * Receives an arbitrary number of messages into the
- * incoming queue of the Messenger. This method will block until
- * at least one message is available or the operation times out.
- */
- void recv() throws TimeoutException;
- /**
- * Receives up to the specified number of messages into the
- * incoming queue of the Messenger. This method will block until
- * at least one message is available or the operation times out.
- */
- void recv(int count) throws TimeoutException;
- /**
- * Returns the capacity of the incoming message queue of
- * messenger. Note this count does not include those messages
- * already available on the incoming queue (see
- * incoming()). Rather it returns the number of incoming queue
- * entries available for receiving messages
- */
- int receiving();
- /**
- * Returns the message from the head of the incoming message
- * queue.
- */
- Message get();
-
- /**
- * Transitions the Messenger to an active state. A Messenger is
- * initially created in an inactive state. When inactive, a
- * Messenger will not send or receive messages from its internal
- * queues. A Messenger must be started before calling send() or
- * recv().
- */
- void start() throws IOException;
- /**
- * Transitions the Messenger to an inactive state. An inactive
- * Messenger will not send or receive messages from its internal
- * queues. A Messenger should be stopped before being discarded to
- * ensure a clean shutdown handshake occurs on any internally managed
- * connections.
- */
- void stop();
-
- boolean stopped();
-
- /** Sends or receives any outstanding messages queued for a
- * messenger. If timeout is zero, no blocking is done. A timeout
- * of -1 blocks forever, otherwise timeout is the maximum time (in
- * millisecs) to block. Returns True if work was performed.
- */
- boolean work(long timeout) throws TimeoutException;
-
- void interrupt();
-
- void setTimeout(long timeInMillis);
- long getTimeout();
-
- boolean isBlocking();
- void setBlocking(boolean b);
-
- /**
- * Returns a count of the messages currently on the outgoing queue
- * (i.e. those that have been put() but not yet actually sent
- * out).
- */
- int outgoing();
- /**
- * Returns a count of the messages available on the incoming
- * queue.
- */
- int incoming();
-
- int getIncomingWindow();
- void setIncomingWindow(int window);
-
- int getOutgoingWindow();
- void setOutgoingWindow(int window);
-
- /**
- * Returns a token which can be used to accept or reject the
- * message returned in the previous get() call.
- */
- Tracker incomingTracker();
- /**
- * Returns a token which can be used to track the status of the
- * message of the previous put() call.
- */
- Tracker outgoingTracker();
-
- /**
- * Rejects messages retrieved from the incoming message queue. The
- * tracker object for a message is obtained through a call to
- * incomingTracker() following a get(). If the flags argument
- * contains CUMULATIVE, then all message up to the one identified
- * by the tracker will be rejected.
- */
- void reject(Tracker tracker, int flags);
- /**
- * Accepts messages retrieved from the incoming message queue. The
- * tracker object for a message is obtained through a call to
- * incomingTracker() following a get(). If the flags argument
- * contains CUMULATIVE, then all message up to the one identified
- * by the tracker will be accepted.
- */
- void accept(Tracker tracker, int flags);
- void settle(Tracker tracker, int flags);
-
- /**
- * Gets the last known remote state of the delivery associated
- * with the given tracker.
- */
- Status getStatus(Tracker tracker);
-
- void route(String pattern, String address);
-
- void rewrite(String pattern, String address);
-
- /**
- * Set the path to the certificate file.
- */
- void setCertificate(String certificate);
-
- /**
- * Get the path to the certificate file.
- */
- String getCertificate();
-
- /**
- * Set the path to private key file.
- */
- void setPrivateKey(String privateKey);
-
- /**
- * Get the path to the private key file.
- */
- String getPrivateKey();
-
- /**
- * Set the password for private key file.
- */
- void setPassword(String password);
-
- /**
- * Get the password for the priate key file.
- */
- String getPassword();
-
- /**
- * Set the path to the trusted certificate database.
- */
- void setTrustedCertificates(String trusted);
-
- /**
- * Get the path to the trusted certificate database.
- */
- String getTrustedCertificates();
-
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/messenger/MessengerException.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/messenger/MessengerException.java b/proton-j/src/main/java/org/apache/qpid/proton/messenger/MessengerException.java
deleted file mode 100644
index c6f3570..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/messenger/MessengerException.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.messenger;
-
-import org.apache.qpid.proton.ProtonException;
-
-/**
- * @deprecated Messenger will be removed from upcoming proton-j releases.
- */
-@Deprecated
-public class MessengerException extends ProtonException
-{
- public MessengerException()
- {
- }
-
- public MessengerException(String message)
- {
- super(message);
- }
-
- public MessengerException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public MessengerException(Throwable cause)
- {
- super(cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/messenger/Status.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/messenger/Status.java b/proton-j/src/main/java/org/apache/qpid/proton/messenger/Status.java
deleted file mode 100644
index ae7ca95..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/messenger/Status.java
+++ /dev/null
@@ -1,37 +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.messenger;
-
-/**
- * @deprecated Messenger will be removed from upcoming proton-j releases.
- */
-@Deprecated
-public enum Status
-{
- UNKNOWN,
- PENDING,
- ACCEPTED,
- REJECTED,
- RELEASED,
- MODIFIED,
- ABORTED,
- SETTLED
-}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/messenger/Tracker.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/messenger/Tracker.java b/proton-j/src/main/java/org/apache/qpid/proton/messenger/Tracker.java
deleted file mode 100644
index 974b1b6..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/messenger/Tracker.java
+++ /dev/null
@@ -1,28 +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.messenger;
-
-/**
- * @deprecated Messenger will be removed from upcoming proton-j releases.
- */
-@Deprecated
-public interface Tracker { }
-
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ccdcf329/proton-j/src/main/java/org/apache/qpid/proton/messenger/impl/Address.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/messenger/impl/Address.java b/proton-j/src/main/java/org/apache/qpid/proton/messenger/impl/Address.java
deleted file mode 100644
index 27b0d39..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/messenger/impl/Address.java
+++ /dev/null
@@ -1,220 +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.messenger.impl;
-
-
-/**
- * Address
- *
- * @deprecated Messenger will be removed from upcoming proton-j releases.
- */
-public class Address
-{
-
- private String _address;
- private boolean _passive;
- private String _scheme;
- private String _user;
- private String _pass;
- private String _host;
- private String _port;
- private String _name;
-
- public void clear()
- {
- _passive = false;
- _scheme = null;
- _user = null;
- _pass = null;
- _host = null;
- _port = null;
- _name = null;
- }
-
- /**
- * @deprecated Messenger will be removed from upcoming proton-j releases.
- */
- public Address()
- {
- clear();
- }
-
- /**
- * @deprecated Messenger will be removed from upcoming proton-j releases.
- */
- public Address(String address)
- {
- clear();
- int start = 0;
- int schemeEnd = address.indexOf("://", start);
- if (schemeEnd >= 0) {
- _scheme = address.substring(start, schemeEnd);
- start = schemeEnd + 3;
- }
-
- String uphp;
- int slash = address.indexOf("/", start);
- if (slash >= 0) {
- uphp = address.substring(start, slash);
- _name = address.substring(slash + 1);
- } else {
- uphp = address.substring(start);
- }
-
- String hp;
- int at = uphp.indexOf('@');
- if (at >= 0) {
- String up = uphp.substring(0, at);
- hp = uphp.substring(at + 1);
-
- int colon = up.indexOf(':');
- if (colon >= 0) {
- _user = up.substring(0, colon);
- _pass = up.substring(colon + 1);
- } else {
- _user = up;
- }
- } else {
- hp = uphp;
- }
-
- if (hp.startsWith("[")) {
- int close = hp.indexOf(']');
- if (close >= 0) {
- _host = hp.substring(1, close);
- if (hp.substring(close + 1).startsWith(":")) {
- _port = hp.substring(close + 2);
- }
- }
- }
-
- if (_host == null) {
- int colon = hp.indexOf(':');
- if (colon >= 0) {
- _host = hp.substring(0, colon);
- _port = hp.substring(colon + 1);
- } else {
- _host = hp;
- }
- }
-
- if (_host.startsWith("~")) {
- _host = _host.substring(1);
- _passive = true;
- }
- }
-
- public String toString()
- {
- String str = new String();
- if (_scheme != null) str += _scheme + "://";
- if (_user != null) str += _user;
- if (_pass != null) str += ":" + _pass;
- if (_user != null || _pass != null) str += "@";
- if (_host != null) {
- if (_host.contains(":")) str += "[" + _host + "]";
- else str += _host;
- }
- if (_port != null) str += ":" + _port;
- if (_name != null) str += "/" + _name;
- return str;
- }
-
- public boolean isPassive()
- {
- return _passive;
- }
-
- public String getScheme()
- {
- return _scheme;
- }
-
- public String getUser()
- {
- return _user;
- }
-
- public String getPass()
- {
- return _pass;
- }
-
- public String getHost()
- {
- return _host;
- }
-
- public String getPort()
- {
- return _port;
- }
-
- public String getImpliedPort()
- {
- if (_port == null) {
- return getDefaultPort();
- } else {
- return getPort();
- }
- }
-
- public String getDefaultPort()
- {
- if ("amqps".equals(_scheme)) return "5671";
- else return "5672";
- }
-
- public String getName()
- {
- return _name;
- }
-
- public void setScheme(String scheme)
- {
- _scheme= scheme;
- }
-
- public void setUser(String user)
- {
- _user= user;
- }
-
- public void setPass(String pass)
- {
- _pass= pass;
- }
-
- public void setHost(String host)
- {
- _host= host;
- }
-
- public void setPort(String port)
- {
- _port= port;
- }
-
- public void setName(String name)
- {
- _name= name;
- }
-}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org