From b9f47eb1170c1b10bbd936bd253e57e665dcdbe0 Mon Sep 17 00:00:00 2001 From: marci4 Date: Fri, 2 Jun 2017 15:37:34 +0200 Subject: [PATCH 1/3] Fixed some javadoc errors --- .../java/org/java_websocket/AbstractWebSocket.java | 2 +- src/main/java/org/java_websocket/SSLSocketChannel.java | 4 ++-- .../java/org/java_websocket/framing/CloseFrame.java | 10 +++++++++- .../java/org/java_websocket/framing/ControlFrame.java | 1 + .../java/org/java_websocket/framing/DataFrame.java | 1 + .../org/java_websocket/framing/FramedataImpl1.java | 2 +- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/java_websocket/AbstractWebSocket.java b/src/main/java/org/java_websocket/AbstractWebSocket.java index d07b328cd..b95babaf9 100644 --- a/src/main/java/org/java_websocket/AbstractWebSocket.java +++ b/src/main/java/org/java_websocket/AbstractWebSocket.java @@ -42,7 +42,7 @@ public int getConnectionLostTimeout() { /** * Setter for the interval checking for lost connections - * A value >= 0 results in the check to be deactivated + * A value lower or equal 0 results in the check to be deactivated * * @param connectionLostTimeout the interval in seconds */ diff --git a/src/main/java/org/java_websocket/SSLSocketChannel.java b/src/main/java/org/java_websocket/SSLSocketChannel.java index b2157fd13..27260626c 100644 --- a/src/main/java/org/java_websocket/SSLSocketChannel.java +++ b/src/main/java/org/java_websocket/SSLSocketChannel.java @@ -18,12 +18,12 @@ /** * A class that represents an SSL/TLS peer, and can be extended to create a client or a server. - *

+ * * It makes use of the JSSE framework, and specifically the {@link SSLEngine} logic, which * is described by Oracle as "an advanced API, not appropriate for casual use", since * it requires the user to implement much of the communication establishment procedure himself. * More information about it can be found here: http://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide.html#SSLEngine - *

+ * * {@link SSLSocketChannel} implements the handshake protocol, required to establish a connection between two peers, * which is common for both client and server and provides the abstract {@link SSLSocketChannel#read(ByteBuffer)} and * {@link SSLSocketChannel#write(ByteBuffer)} (String)} methods, that need to be implemented by the specific SSL/TLS peer diff --git a/src/main/java/org/java_websocket/framing/CloseFrame.java b/src/main/java/org/java_websocket/framing/CloseFrame.java index 3ac8d65e9..086e84815 100644 --- a/src/main/java/org/java_websocket/framing/CloseFrame.java +++ b/src/main/java/org/java_websocket/framing/CloseFrame.java @@ -133,7 +133,11 @@ public CloseFrame() { setCode(CloseFrame.NORMAL); } - public void setCode(int code) { + /** + * Set the close code for this close frame + * @param code the close code + */ + public void setCode(int code) { this.code = code; // CloseFrame.TLS_ERROR is not allowed to be transfered over the wire if (code == CloseFrame.TLS_ERROR) { @@ -143,6 +147,10 @@ public void setCode(int code) { updatePayload(); } + /** + * Set the close reason for this close frame + * @param reason the reason code + */ public void setReason(String reason) { if (reason == null) { reason = ""; diff --git a/src/main/java/org/java_websocket/framing/ControlFrame.java b/src/main/java/org/java_websocket/framing/ControlFrame.java index 9f8a15a49..75220b94d 100644 --- a/src/main/java/org/java_websocket/framing/ControlFrame.java +++ b/src/main/java/org/java_websocket/framing/ControlFrame.java @@ -10,6 +10,7 @@ public abstract class ControlFrame extends FramedataImpl1 { /** * Class to represent a control frame + * @param opcode the opcode to use */ public ControlFrame( Opcode opcode ) { super( opcode ); diff --git a/src/main/java/org/java_websocket/framing/DataFrame.java b/src/main/java/org/java_websocket/framing/DataFrame.java index c37966ed2..440f2f806 100644 --- a/src/main/java/org/java_websocket/framing/DataFrame.java +++ b/src/main/java/org/java_websocket/framing/DataFrame.java @@ -9,6 +9,7 @@ public abstract class DataFrame extends FramedataImpl1 { /** * Class to represent a data frame + * @param opcode the opcode to use */ public DataFrame(Opcode opcode) { super(opcode); diff --git a/src/main/java/org/java_websocket/framing/FramedataImpl1.java b/src/main/java/org/java_websocket/framing/FramedataImpl1.java index f4c006361..195051319 100644 --- a/src/main/java/org/java_websocket/framing/FramedataImpl1.java +++ b/src/main/java/org/java_websocket/framing/FramedataImpl1.java @@ -46,7 +46,7 @@ public abstract class FramedataImpl1 implements Framedata { /** * Check if the frame is valid due to specification * - * @throws InvalidDataException + * @throws InvalidDataException thrown if the frame is not a valid frame */ public abstract void isValid() throws InvalidDataException; From 3e848529347c010e6ee293bf724c6dd3432ed91c Mon Sep 17 00:00:00 2001 From: Marcel Prestel Date: Fri, 2 Jun 2017 16:59:39 +0200 Subject: [PATCH 2/3] In preparation for 1.3.4 release --- README.markdown | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/README.markdown b/README.markdown index 4f84f36e2..154a07b00 100644 --- a/README.markdown +++ b/README.markdown @@ -1,7 +1,7 @@ Java WebSockets =============== -[![Build Status](https://travis-ci.org/marci4/Java-WebSocket-Dev.svg?branch=master)](https://travis-ci.org/marci4/Java-WebSocket-Dev) [![Clojars Project](https://img.shields.io/clojars/v/org.java-websocket/java-websocket.svg)](https://clojars.org/org.java-websocket/java-websocket) - +[![Build Status](https://travis-ci.org/marci4/Java-WebSocket-Dev.svg?branch=master)](https://travis-ci.org/marci4/Java-WebSocket-Dev) +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.java-websocket/Java-WebSocket/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.java-websocket/Java-WebSocket) This repository contains a barebones WebSocket server and client implementation written in 100% Java. The underlying classes are implemented `java.nio`, which allows for a @@ -36,37 +36,30 @@ will create the javadoc of this library at ```doc/``` and build the library itse The ant targets are: ```compile```, ```jar```, ```doc``` and ```clean``` ### Maven -To use maven add this repository to your pom.xml: -```xml - - clojars.org - http://clojars.org/repo - -``` -Also add this dependency to your pom.xml: +To use maven add this dependency to your pom.xml: ```xml org.java-websocket - java-websocket - 1.3.3 + Java-WebSocket + 1.3.4 ``` ### Gradle -To use Gradle add this repository to your repositories list : +To use Gradle add the maven central repository to your repositories list : ```xml -maven { url "http://clojars.org/repo" } +mavenCentral() ``` Then you can just add the latest version to your build. ```xml -compile "org.java-websocket:java-websocket:1.3.3" +compile "org.java-websocket:Java-WebSocket:1.3.4" ``` ### Leiningen ``` bash -[org.java-websocket/java-websocket "1.3.3"] +[org.java-websocket/java-websocket "1.3.4"] ``` Running the Examples From ae3c088fef1f71e9fdca3b43c72f6da0a4d090dc Mon Sep 17 00:00:00 2001 From: marci4 Date: Fri, 2 Jun 2017 17:06:03 +0200 Subject: [PATCH 3/3] Update to 1.3.4 --- build.gradle | 2 +- pom.xml | 111 +++++++++++++++++++++++++++------------------------ project.clj | 2 +- 3 files changed, 60 insertions(+), 55 deletions(-) diff --git a/build.gradle b/build.gradle index e87c0c07a..b555ddca0 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ repositories { } group = 'org.java_websocket' -version = '1.3.3' +version = '1.3.4' sourceCompatibility = 1.6 targetCompatibility = 1.6 diff --git a/pom.xml b/pom.xml index 88a3ed965..673ed574c 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,10 @@ 4.0.0 org.java-websocket - java-websocket + Java-WebSocket jar - 1.3.3 - java-websocket + 1.3.4 + Java-WebSocket A barebones WebSocket client and server implementation written 100% in Java https://github.com/TooTallNate/Java-WebSocket @@ -16,60 +16,68 @@ https://github.com/TooTallNate/Java-WebSocket + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + - src\main\java - test - - - resources - - - - - resources - - - target - target\classes - + src/main/java + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + true + + ossrh + https://oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + + attach-javadocs + + jar + + + + + - - - central - https://repo1.maven.org/maven2/ - - false - - - true - - - - clojars - https://clojars.org/repo/ - - true - - - true - - - - - - - + + + junit + junit + 4.11 + test + + Nathan Rajlich https://github.com/TooTallNate nathan@tootallnate.net - - David Rohmer - https://github.com/Davidiusdadi - rohmer.david@gmail.com - Marcel Prestel https://github.com/marci4 @@ -78,7 +86,4 @@ - + diff --git a/project.clj b/project.clj index 0b3b30468..2509b59d5 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject org.java-websocket/java-websocket "1.3.3" +(defproject org.java-websocket/java-websocket "1.3.4" :description "A barebones WebSocket client and server implementation written 100% in Java" :url "https://github.com/TooTallNate/Java-WebSocket" :scm {:name "git"