diff --git a/all/pom.xml b/all/pom.xml index c7e04726ad..dc170c6f67 100644 --- a/all/pom.xml +++ b/all/pom.xml @@ -704,18 +704,6 @@ - - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - default - none - - - - maven-checkstyle-plugin diff --git a/codec/src/test/resources/io/netty/handler/codec/xml/sample-04.xml b/codec/src/test/resources/io/netty/handler/codec/xml/sample-04.xml index 56c6ac3e93..8092d70bb5 100644 --- a/codec/src/test/resources/io/netty/handler/codec/xml/sample-04.xml +++ b/codec/src/test/resources/io/netty/handler/codec/xml/sample-04.xml @@ -293,49 +293,6 @@ 1024m - - - org.codehaus.mojo - animal-sniffer-maven-plugin - 1.15 - - - org.codehaus.mojo.signature - java16 - 1.1 - - - sun.misc.Unsafe - sun.misc.Cleaner - - java.util.zip.Deflater - - - java.nio.channels.DatagramChannel - java.nio.channels.MembershipKey - java.net.StandardProtocolFamily - - - java.nio.channels.AsynchronousChannel - java.nio.channels.AsynchronousSocketChannel - java.nio.channels.AsynchronousServerSocketChannel - java.nio.channels.AsynchronousChannelGroup - java.nio.channels.NetworkChannel - java.nio.channels.InterruptedByTimeoutException - java.net.StandardSocketOptions - java.net.SocketOption - - - - - process-classes - - check - - - - maven-checkstyle-plugin 2.12.1 diff --git a/docker/Dockerfile.centos b/docker/Dockerfile.centos index e6df940e0c..1998165803 100644 --- a/docker/Dockerfile.centos +++ b/docker/Dockerfile.centos @@ -18,7 +18,7 @@ RUN yum install -y \ tar \ wget -ARG java_version=1.8 +ARG java_version=11 ENV JAVA_VERSION $java_version # installing java with jabba RUN curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | JABBA_COMMAND="install $JAVA_VERSION -o /jdk" bash diff --git a/docker/Dockerfile.cross_compile_aarch64 b/docker/Dockerfile.cross_compile_aarch64 index 077e46262a..2ad81ae4b2 100644 --- a/docker/Dockerfile.cross_compile_aarch64 +++ b/docker/Dockerfile.cross_compile_aarch64 @@ -7,7 +7,7 @@ ENV GCC_VERSION $gcc_version RUN yum install -y wget tar git make redhat-lsb-core autoconf automake libtool glibc-devel libaio-devel openssl-devel apr-devel lksctp-tools # Install Java -RUN yum install -y java-1.8.0-openjdk-devel +RUN yum install -y java-11-openjdk-devel # Install aarch64 gcc toolchain RUN set -x && \ @@ -15,4 +15,4 @@ RUN set -x && \ tar xvf gcc-linaro-$GCC_VERSION-x86_64_aarch64-linux-gnu.tar.xz ENV PATH="/gcc-linaro-$GCC_VERSION-x86_64_aarch64-linux-gnu/bin:${PATH}" -ENV JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk/" +ENV JAVA_HOME="/usr/lib/jvm/java-11-openjdk/" diff --git a/docker/README.md b/docker/README.md index 378c673c84..815f03d99a 100644 --- a/docker/README.md +++ b/docker/README.md @@ -4,10 +4,10 @@ cd /path/to/netty/ ``` -## centos 6 with java 8 +## centos 6 with java 11 ``` -docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run test +docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run test ``` ## centos 7 with java 11 diff --git a/docker/docker-compose.centos-6.110.yaml b/docker/docker-compose.centos-6.110.yaml deleted file mode 100644 index 7a60f46e32..0000000000 --- a/docker/docker-compose.centos-6.110.yaml +++ /dev/null @@ -1,21 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: netty:centos-6-1.10 - build: - args: - centos_version : "6" - java_version : "zulu@1.10.0-2" - - test: - image: netty:centos-6-1.10 - test-leak: - image: netty:centos-6-1.10 - - test-boringssl-static: - image: netty:centos-6-1.10 - - shell: - image: netty:centos-6-1.10 diff --git a/docker/docker-compose.centos-6.18.yaml b/docker/docker-compose.centos-6.18.yaml deleted file mode 100644 index e8ba5d6165..0000000000 --- a/docker/docker-compose.centos-6.18.yaml +++ /dev/null @@ -1,22 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: netty:centos-6-1.8 - build: - args: - centos_version : "6" - java_version : "adopt@1.8.0-252" - - test: - image: netty:centos-6-1.8 - - test-leak: - image: netty:centos-6-1.8 - - test-boringssl-static: - image: netty:centos-6-1.8 - - shell: - image: netty:centos-6-1.8 diff --git a/docker/docker-compose.centos-6.19.yaml b/docker/docker-compose.centos-6.19.yaml deleted file mode 100644 index ee34c53ae2..0000000000 --- a/docker/docker-compose.centos-6.19.yaml +++ /dev/null @@ -1,22 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: netty:centos-6-1.9 - build: - args: - centos_version : "6" - java_version : "zulu@1.9.0-7" - - test: - image: netty:centos-6-1.9 - - test-leak: - image: netty:centos-6-1.9 - - test-boringssl-static: - image: netty:centos-6-1.9 - - shell: - image: netty:centos-6-1.9 diff --git a/docker/docker-compose.centos-6.graalvm18.yaml b/docker/docker-compose.centos-6.graalvm18.yaml deleted file mode 100644 index fb39d7c7de..0000000000 --- a/docker/docker-compose.centos-6.graalvm18.yaml +++ /dev/null @@ -1,22 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: netty:centos-6-1.8 - build: - args: - centos_version : "6" - java_version : "graalvm-ce-java8@20.1.0" - - test: - image: netty:centos-6-1.8 - - test-leak: - image: netty:centos-6-1.8 - - test-boringssl-static: - image: netty:centos-6-1.8 - - shell: - image: netty:centos-6-1.8 diff --git a/docker/docker-compose.centos-7.110.yaml b/docker/docker-compose.centos-7.110.yaml deleted file mode 100644 index 280ed73b96..0000000000 --- a/docker/docker-compose.centos-7.110.yaml +++ /dev/null @@ -1,22 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: netty:centos-7-1.10 - build: - args: - centos_version : "7" - java_version : "zulu@1.10.0-2" - - test: - image: netty:centos-7-1.10 - - test-leak: - image: netty:centos-7-1.10 - - test-boringssl-static: - image: netty:centos-7-1.10 - - shell: - image: netty:centos-7-1.10 diff --git a/docker/docker-compose.centos-7.18.yaml b/docker/docker-compose.centos-7.18.yaml deleted file mode 100644 index 07c3ec4e30..0000000000 --- a/docker/docker-compose.centos-7.18.yaml +++ /dev/null @@ -1,22 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: netty:centos-7-1.8 - build: - args: - centos_version : "7" - java_version : "adopt@1.8.0-252" - - test: - image: netty:centos-7-1.8 - - test-leak: - image: netty:centos-7-1.8 - - test-boringssl-static: - image: netty:centos-7-1.8 - - shell: - image: netty:centos-7-1.8 diff --git a/docker/docker-compose.centos-7.19.yaml b/docker/docker-compose.centos-7.19.yaml deleted file mode 100644 index d1b6acf634..0000000000 --- a/docker/docker-compose.centos-7.19.yaml +++ /dev/null @@ -1,22 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: netty:centos-7-1.9 - build: - args: - centos_version : "7" - java_version : "zulu@1.9.0-7" - - test: - image: netty:centos-7-1.9 - - test-leak: - image: netty:centos-7-1.9 - - test-boringssl-static: - image: netty:centos-7-1.9 - - shell: - image: netty:centos-7-1.9 diff --git a/handler-proxy/pom.xml b/handler-proxy/pom.xml index 951eb40c95..4aecbfed8b 100644 --- a/handler-proxy/pom.xml +++ b/handler-proxy/pom.xml @@ -76,6 +76,16 @@ org.mockito mockito-core + + org.bouncycastle + bcpkix-jdk15on + test + + + org.bouncycastle + bcprov-jdk15on + test + diff --git a/handler/src/main/java/io/netty/handler/ssl/util/OpenJdkSelfSignedCertGenerator.java b/handler/src/main/java/io/netty/handler/ssl/util/OpenJdkSelfSignedCertGenerator.java deleted file mode 100644 index 61e2ea963b..0000000000 --- a/handler/src/main/java/io/netty/handler/ssl/util/OpenJdkSelfSignedCertGenerator.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2014 The Netty Project - * - * The Netty Project 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 io.netty.handler.ssl.util; - -import sun.security.x509.AlgorithmId; -import sun.security.x509.CertificateAlgorithmId; -import sun.security.x509.CertificateIssuerName; -import sun.security.x509.CertificateSerialNumber; -import sun.security.x509.CertificateSubjectName; -import sun.security.x509.CertificateValidity; -import sun.security.x509.CertificateVersion; -import sun.security.x509.CertificateX509Key; -import sun.security.x509.X500Name; -import sun.security.x509.X509CertImpl; -import sun.security.x509.X509CertInfo; - -import java.util.Date; -import java.math.BigInteger; -import java.security.KeyPair; -import java.security.PrivateKey; -import java.security.SecureRandom; -import java.security.cert.CertificateException; - -import static io.netty.handler.ssl.util.SelfSignedCertificate.*; - -/** - * Generates a self-signed certificate using {@code sun.security.x509} package provided by OpenJDK. - */ -final class OpenJdkSelfSignedCertGenerator { - - static String[] generate(String fqdn, KeyPair keypair, SecureRandom random, Date notBefore, Date notAfter, - String algorithm) throws Exception { - PrivateKey key = keypair.getPrivate(); - - // Prepare the information required for generating an X.509 certificate. - X509CertInfo info = new X509CertInfo(); - X500Name owner = new X500Name("CN=" + fqdn); - info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3)); - info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(new BigInteger(64, random))); - try { - info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner)); - } catch (CertificateException ignore) { - info.set(X509CertInfo.SUBJECT, owner); - } - try { - info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner)); - } catch (CertificateException ignore) { - info.set(X509CertInfo.ISSUER, owner); - } - info.set(X509CertInfo.VALIDITY, new CertificateValidity(notBefore, notAfter)); - info.set(X509CertInfo.KEY, new CertificateX509Key(keypair.getPublic())); - info.set(X509CertInfo.ALGORITHM_ID, - // sha256WithRSAEncryption - new CertificateAlgorithmId(AlgorithmId.get("1.2.840.113549.1.1.11"))); - - // Sign the cert to identify the algorithm that's used. - X509CertImpl cert = new X509CertImpl(info); - cert.sign(key, algorithm.equalsIgnoreCase("EC") ? "SHA256withECDSA" : "SHA256withRSA"); - - // Update the algorithm and sign again. - info.set(CertificateAlgorithmId.NAME + '.' + CertificateAlgorithmId.ALGORITHM, cert.get(X509CertImpl.SIG_ALG)); - cert = new X509CertImpl(info); - cert.sign(key, algorithm.equalsIgnoreCase("EC") ? "SHA256withECDSA" : "SHA256withRSA"); - cert.verify(keypair.getPublic()); - - return newSelfSignedCertificate(fqdn, key, cert); - } - - private OpenJdkSelfSignedCertGenerator() { } -} diff --git a/handler/src/main/java/io/netty/handler/ssl/util/SelfSignedCertificate.java b/handler/src/main/java/io/netty/handler/ssl/util/SelfSignedCertificate.java index eb23ce3d68..d521858289 100644 --- a/handler/src/main/java/io/netty/handler/ssl/util/SelfSignedCertificate.java +++ b/handler/src/main/java/io/netty/handler/ssl/util/SelfSignedCertificate.java @@ -21,7 +21,6 @@ import io.netty.buffer.Unpooled; import io.netty.handler.codec.base64.Base64; import io.netty.util.CharsetUtil; import io.netty.util.internal.SystemPropertyUtil; -import io.netty.util.internal.ThrowableUtil; import io.netty.util.internal.logging.InternalLogger; import io.netty.util.internal.logging.InternalLoggerFactory; @@ -53,8 +52,8 @@ import java.util.Date; * {@link java.io.File#createTempFile(String, String)}, and they are deleted when the JVM exits using * {@link java.io.File#deleteOnExit()}. *

- * At first, this method tries to use OpenJDK's X.509 implementation (the {@code sun.security.x509} package). - * If it fails, it tries to use Bouncy Castle as a fallback. + * The certificate is generated using Bouncy Castle, which is an + * optional dependency of Netty. *

*/ public final class SelfSignedCertificate { @@ -235,22 +234,13 @@ public final class SelfSignedCertificate { String[] paths; try { - // Try the OpenJDK's proprietary implementation. - paths = OpenJdkSelfSignedCertGenerator.generate(fqdn, keypair, random, notBefore, notAfter, algorithm); - } catch (Throwable t) { - logger.debug("Failed to generate a self-signed X.509 certificate using sun.security.x509:", t); - try { - // Try Bouncy Castle if the current JVM didn't have sun.security.x509. - paths = BouncyCastleSelfSignedCertGenerator.generate( - fqdn, keypair, random, notBefore, notAfter, algorithm); - } catch (Throwable t2) { - logger.debug("Failed to generate a self-signed X.509 certificate using Bouncy Castle:", t2); - final CertificateException certificateException = new CertificateException( - "No provider succeeded to generate a self-signed certificate. " + - "See debug log for the root cause.", t2); - ThrowableUtil.addSuppressed(certificateException, t); - throw certificateException; - } + paths = BouncyCastleSelfSignedCertGenerator.generate( + fqdn, keypair, random, notBefore, notAfter, algorithm); + } catch (Throwable throwable) { + logger.debug("Failed to generate a self-signed X.509 certificate using Bouncy Castle:", throwable); + throw new CertificateException( + "No provider succeeded to generate a self-signed certificate. " + + "See debug log for the root cause.", throwable); } certificate = new File(paths[0]); diff --git a/pom.xml b/pom.xml index 8d950f9126..61da86df5f 100644 --- a/pom.xml +++ b/pom.xml @@ -199,45 +199,6 @@ - - - java10 - - 10 - - - - - --illegal-access=deny --add-modules java.xml.bind ${argLine.java9.extras} - - - true - - 3.0.0-M3 - - 2.0.5.Final - - - - - - java9 - - - - --illegal-access=deny --add-modules java.xml.bind ${argLine.java9.extras} - - - - true - - 3.0.0-M1 - - - 9 - - - boringssl @@ -290,12 +251,12 @@ - jdk8 + relaxjavadoc - [1.8,) + [11,) - + false @@ -319,8 +280,8 @@ - 1.8 - 1.8 + 11 + 11 ${project.build.directory}/dev-tools UTF-8 UTF-8 @@ -353,6 +314,7 @@ conscrypt-openjdk-uber 2.4.0 + 1.66 ${os.detected.name}-${os.detected.arch} ${project.basedir}/../common/src/test/resources/logback-test.xml debug @@ -483,14 +445,13 @@ org.bouncycastle bcpkix-jdk15on - 1.65 + ${bouncycastle.version} compile true @@ -502,7 +463,7 @@ org.bouncycastle bcprov-jdk15on - 1.54 + ${bouncycastle.version} compile true @@ -773,9 +734,9 @@ - + - [1.8.0,) + [11.0.0,) [3.1.1,) @@ -796,10 +757,11 @@ maven-compiler-plugin 3.8.0 - 1.8 + 11 true ${maven.compiler.source} ${maven.compiler.target} + ${maven.compiler.target} true true true @@ -820,41 +782,6 @@
- - - org.codehaus.mojo - animal-sniffer-maven-plugin - 1.16 - - - org.codehaus.mojo.signature - java18 - 1.0 - - - - java.lang.invoke.MethodHandle - sun.misc.Unsafe - sun.misc.Cleaner - sun.nio.ch.DirectBuffer - - - io.netty.util.internal.SuppressJava6Requirement - - - - - process-classes - - check - - - - maven-checkstyle-plugin 3.1.0 diff --git a/tarball/pom.xml b/tarball/pom.xml index 2bbd0613f7..13b80423ec 100644 --- a/tarball/pom.xml +++ b/tarball/pom.xml @@ -62,17 +62,6 @@ - - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - default - none - - - maven-checkstyle-plugin diff --git a/testsuite/pom.xml b/testsuite/pom.xml index 168aa2acf3..d9b0b4b7ce 100644 --- a/testsuite/pom.xml +++ b/testsuite/pom.xml @@ -94,6 +94,16 @@ logback-classic compile + + org.bouncycastle + bcpkix-jdk15on + runtime + + + org.bouncycastle + bcprov-jdk15on + runtime + diff --git a/transport-blockhound-tests/pom.xml b/transport-blockhound-tests/pom.xml index cce1a9114c..de4608bf1d 100644 --- a/transport-blockhound-tests/pom.xml +++ b/transport-blockhound-tests/pom.xml @@ -53,8 +53,8 @@ - 1.8 - 1.8 + 11 + 11 --add-exports java.base/sun.security.x509=ALL-UNNAMED true diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/AbstractNotificationHandler.java b/transport-sctp/src/main/java/com/sun/nio/sctp/AbstractNotificationHandler.java deleted file mode 100644 index 09d01f254a..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/AbstractNotificationHandler.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -@SuppressWarnings("all") -public class AbstractNotificationHandler implements NotificationHandler { - static { - UnsupportedOperatingSystemException.raise(); - } - - public HandlerResult handleNotification(AssociationChangeNotification notification, Object o) { - return null; - } - - public HandlerResult handleNotification(Notification notification, Object o) { - return null; - } - - public HandlerResult handleNotification(PeerAddressChangeNotification notification, Object o) { - return null; - } - - public HandlerResult handleNotification(SendFailedNotification notification, Object o) { - return null; - } - - public HandlerResult handleNotification(ShutdownNotification notification, Object o) { - return null; - } -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/Association.java b/transport-sctp/src/main/java/com/sun/nio/sctp/Association.java deleted file mode 100644 index e190295f5e..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/Association.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -public class Association { - static { - UnsupportedOperatingSystemException.raise(); - } -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/AssociationChangeNotification.java b/transport-sctp/src/main/java/com/sun/nio/sctp/AssociationChangeNotification.java deleted file mode 100644 index 8b8098c851..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/AssociationChangeNotification.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -public abstract class AssociationChangeNotification implements Notification { - static { - UnsupportedOperatingSystemException.raise(); - } -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/HandlerResult.java b/transport-sctp/src/main/java/com/sun/nio/sctp/HandlerResult.java deleted file mode 100644 index 226021419c..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/HandlerResult.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -public enum HandlerResult { - CONTINUE, RETURN -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/MessageInfo.java b/transport-sctp/src/main/java/com/sun/nio/sctp/MessageInfo.java deleted file mode 100644 index 1f7eaccbd0..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/MessageInfo.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -import java.net.SocketAddress; - -public abstract class MessageInfo { - static { - UnsupportedOperatingSystemException.raise(); - } - - public static MessageInfo createOutgoing(Association association, SocketAddress address, int streamNumber) { - return null; - } - - public abstract SocketAddress address(); - public abstract int streamNumber(); - public abstract MessageInfo streamNumber(int streamNumber); - public abstract int payloadProtocolID(); - public abstract MessageInfo payloadProtocolID(int ppid); - public abstract boolean isComplete(); - public abstract boolean isUnordered(); - public abstract MessageInfo unordered(boolean b); - -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/Notification.java b/transport-sctp/src/main/java/com/sun/nio/sctp/Notification.java deleted file mode 100644 index 32f1a809c9..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/Notification.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -public interface Notification { - Association association(); -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/NotificationHandler.java b/transport-sctp/src/main/java/com/sun/nio/sctp/NotificationHandler.java deleted file mode 100644 index 1b86c0c57e..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/NotificationHandler.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -public interface NotificationHandler { -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/PeerAddressChangeNotification.java b/transport-sctp/src/main/java/com/sun/nio/sctp/PeerAddressChangeNotification.java deleted file mode 100644 index 7c61551edb..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/PeerAddressChangeNotification.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -public abstract class PeerAddressChangeNotification implements Notification { - static { - UnsupportedOperatingSystemException.raise(); - } -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/SctpChannel.java b/transport-sctp/src/main/java/com/sun/nio/sctp/SctpChannel.java deleted file mode 100644 index 8545ecd7ef..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/SctpChannel.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -import java.io.IOException; -import java.net.InetAddress; -import java.net.SocketAddress; -import java.nio.ByteBuffer; -import java.nio.channels.spi.AbstractSelectableChannel; -import java.nio.channels.spi.SelectorProvider; -import java.util.Set; - -@SuppressWarnings("all") -public abstract class SctpChannel extends AbstractSelectableChannel { - static { - UnsupportedOperatingSystemException.raise(); - } - - public static SctpChannel open() throws IOException { - return null; - } - - protected SctpChannel(SelectorProvider provider) { - super(provider); - } - - public abstract T getOption(SctpSocketOption name) throws IOException; - public abstract SctpChannel setOption(SctpSocketOption name, T value) throws IOException; - - public abstract Set getAllLocalAddresses() throws IOException; - public abstract Set getRemoteAddresses() throws IOException; - - public abstract Association association() throws IOException; - public abstract SctpChannel bind(SocketAddress local) throws IOException; - public abstract boolean connect(SocketAddress remote) throws IOException; - public abstract boolean finishConnect() throws IOException; - - public abstract SctpChannel bindAddress(InetAddress inetAddress) throws IOException; - public abstract SctpChannel unbindAddress(InetAddress inetAddress) throws IOException; - - public abstract MessageInfo receive(ByteBuffer dst, T attachment, NotificationHandler handler) throws IOException; - public abstract int send(ByteBuffer src, MessageInfo messageInfo) throws IOException; - - public abstract Set> supportedOptions(); -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/SctpServerChannel.java b/transport-sctp/src/main/java/com/sun/nio/sctp/SctpServerChannel.java deleted file mode 100644 index 4c2da8ee9e..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/SctpServerChannel.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -import java.io.IOException; -import java.net.InetAddress; -import java.net.SocketAddress; -import java.nio.channels.spi.AbstractSelectableChannel; -import java.nio.channels.spi.SelectorProvider; -import java.util.Set; - -@SuppressWarnings("all") -public abstract class SctpServerChannel extends AbstractSelectableChannel { - static { - UnsupportedOperatingSystemException.raise(); - } - - public static SctpServerChannel open() throws IOException { - return null; - } - - protected SctpServerChannel(SelectorProvider provider) { - super(provider); - } - - public abstract T getOption(SctpSocketOption name) throws IOException; - public abstract SctpServerChannel setOption(SctpSocketOption name, T value) throws IOException; - - public abstract Set getAllLocalAddresses() throws IOException; - - public abstract SctpServerChannel bind(SocketAddress local) throws IOException; - public abstract SctpServerChannel bind(SocketAddress local, int backlog) throws IOException; - - public abstract SctpServerChannel bindAddress(InetAddress inetAddress) throws IOException; - public abstract SctpServerChannel unbindAddress(InetAddress inetAddress) throws IOException; - - public abstract SctpChannel accept() throws IOException; -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/SctpSocketOption.java b/transport-sctp/src/main/java/com/sun/nio/sctp/SctpSocketOption.java deleted file mode 100644 index 66ca504ceb..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/SctpSocketOption.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -public interface SctpSocketOption { - String name(); - Class type(); -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/SctpStandardSocketOptions.java b/transport-sctp/src/main/java/com/sun/nio/sctp/SctpStandardSocketOptions.java deleted file mode 100644 index 234eb9f58e..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/SctpStandardSocketOptions.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -import java.net.SocketAddress; - -@SuppressWarnings("all") -public class SctpStandardSocketOptions { - static { - UnsupportedOperatingSystemException.raise(); - } - - public static final SctpSocketOption SCTP_DISABLE_FRAGMENTS = null; - public static final SctpSocketOption SCTP_EXPLICIT_COMPLETE = null; - public static final SctpSocketOption SCTP_FRAGMENT_INTERLEAVE = null; - public static final SctpSocketOption SCTP_INIT_MAXSTREAMS = null; - public static final SctpSocketOption SCTP_NODELAY = null; - public static final SctpSocketOption SCTP_PRIMARY_ADDR = null; - public static final SctpSocketOption SCTP_SET_PEER_PRIMARY_ADDR = null; - public static final SctpSocketOption SO_LINGER = null; - public static final SctpSocketOption SO_RCVBUF = null; - public static final SctpSocketOption SO_SNDBUF = null; - - public static class InitMaxStreams { - - public static InitMaxStreams create(int i, int i1) { - return null; - } - - public int maxInStreams() { - return 0; - } - - public int maxOutStreams() { - return 0; - } - - } -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/SendFailedNotification.java b/transport-sctp/src/main/java/com/sun/nio/sctp/SendFailedNotification.java deleted file mode 100644 index 47bbe89ad9..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/SendFailedNotification.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -public abstract class SendFailedNotification implements Notification { - static { - UnsupportedOperatingSystemException.raise(); - } -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/ShutdownNotification.java b/transport-sctp/src/main/java/com/sun/nio/sctp/ShutdownNotification.java deleted file mode 100644 index d0f408c2da..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/ShutdownNotification.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -public abstract class ShutdownNotification implements Notification { - static { - UnsupportedOperatingSystemException.raise(); - } -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/UnsupportedOperatingSystemException.java b/transport-sctp/src/main/java/com/sun/nio/sctp/UnsupportedOperatingSystemException.java deleted file mode 100644 index 16fb81295f..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/UnsupportedOperatingSystemException.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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 com.sun.nio.sctp; - -public class UnsupportedOperatingSystemException extends RuntimeException { - - private static final long serialVersionUID = -221782446524784377L; - - public static void raise() { - throw new UnsupportedOperatingSystemException(); - } - - public UnsupportedOperatingSystemException() { - } - - public UnsupportedOperatingSystemException(String message) { - super(message); - } - - public UnsupportedOperatingSystemException(String message, Throwable cause) { - super(message, cause); - } - - public UnsupportedOperatingSystemException(Throwable cause) { - super(cause); - } -} diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/package-info.java b/transport-sctp/src/main/java/com/sun/nio/sctp/package-info.java deleted file mode 100644 index beefdb38ca..0000000000 --- a/transport-sctp/src/main/java/com/sun/nio/sctp/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2011 The Netty Project - * - * The Netty Project 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. - */ - -/** - * This package is only included to let SCTP also compile on non-unix operation systems. - * - * This will not get included in the generated jar! - */ -package com.sun.nio.sctp; diff --git a/transport-sctp/src/main/java/io/netty/channel/sctp/SctpNotificationHandler.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpNotificationHandler.java index f4720fb7f2..592b023d4e 100644 --- a/transport-sctp/src/main/java/io/netty/channel/sctp/SctpNotificationHandler.java +++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpNotificationHandler.java @@ -27,7 +27,6 @@ import com.sun.nio.sctp.ShutdownNotification; import io.netty.channel.ChannelPipeline; - /** * {@link AbstractNotificationHandler} implementation which will handle all {@link Notification}s by trigger a * {@link Notification} user event in the {@link ChannelPipeline} of a {@link SctpChannel}.