Skip to content

Commit

Permalink
Huge cleanup, ready for release
Browse files Browse the repository at this point in the history
  • Loading branch information
forresthopkinsa committed Sep 19, 2017
1 parent f948c53 commit 24da370
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 33 deletions.
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
/.idea/misc.xml
/.idea/modules.xml
/.idea/vcs.xml
.idea
.DS_Store
/build
/captures
/captures
18 changes: 9 additions & 9 deletions example-client/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ua.naiksoftware.stompclientexample">
package="ua.naiksoftware.stompclientexample">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="ua.naiksoftware.stompclientexample.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.junit.Test;

import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;

/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
Expand Down
5 changes: 2 additions & 3 deletions lib/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ua.naiksoftware.stomp">
<manifest package="ua.naiksoftware.stomp">

<application/>
<application />

</manifest>
24 changes: 12 additions & 12 deletions lib/src/main/java/ua/naiksoftware/stomp/Stomp.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

/**
* Supported overlays:
* - org.java_websocket.WebSocket ('org.java-websocket:Java-WebSocket:1.3.2')
* - okhttp3.WebSocket ('com.squareup.okhttp3:okhttp:3.8.1')
*
* You can add own relay, just implement ConnectionProvider for you stomp transport,
* such as web socket.
*
* - org.java_websocket.WebSocket ('org.java-websocket:Java-WebSocket:1.3.2')
* - okhttp3.WebSocket ('com.squareup.okhttp3:okhttp:3.8.1')
* <p>
* You can add own relay, just implement ConnectionProvider for you stomp transport,
* such as web socket.
* <p>
* Created by naik on 05.05.16.
*/
public class Stomp {
Expand All @@ -25,9 +25,8 @@ public static StompClient over(@NonNull ConnectionProvider connectionProvider, S
}

/**
*
* @param connectionProvider connectionProvider method
* @param uri URI to connect
* @param uri URI to connect
* @param connectHttpHeaders HTTP headers, will be passed with handshake query, may be null
* @return StompClient for receiving and sending messages. Call #StompClient.connect
*/
Expand All @@ -38,13 +37,14 @@ public static StompClient over(@NonNull ConnectionProvider connectionProvider, S
/**
* {@code webSocketClient} can accept the following type of clients:
* <ul>
* <li>{@code org.java_websocket.WebSocket}: cannot accept an existing client</li>
* <li>{@code okhttp3.WebSocket}: can accept a non-null instance of {@code okhttp3.OkHttpClient}</li>
* <li>{@code org.java_websocket.WebSocket}: cannot accept an existing client</li>
* <li>{@code okhttp3.WebSocket}: can accept a non-null instance of {@code okhttp3.OkHttpClient}</li>
* </ul>
*
* @param connectionProvider connectionProvider method
* @param uri URI to connect
* @param uri URI to connect
* @param connectHttpHeaders HTTP headers, will be passed with handshake query, may be null
* @param okHttpClient Existing client that will be used to open the WebSocket connection, may be null to use default client
* @param okHttpClient Existing client that will be used to open the WebSocket connection, may be null to use default client
* @return StompClient for receiving and sending messages. Call #StompClient.connect
*/
public static StompClient over(@NonNull ConnectionProvider connectionProvider, String uri, @Nullable Map<String, String> connectHttpHeaders, @Nullable OkHttpClient okHttpClient) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class WebSocketsConnectionProvider extends AbstractConnectionProvider {

/**
* Support UIR scheme ws://host:port/path
*
* @param connectHttpHeaders may be null
*/
WebSocketsConnectionProvider(String uri, @Nullable Map<String, String> connectHttpHeaders) {
Expand Down Expand Up @@ -97,7 +98,7 @@ public void onError(Exception ex) {
}
};

if(mUri.startsWith("wss")) {
if (mUri.startsWith("wss")) {
try {
SSLContext sc = SSLContext.getInstance("TLS");
sc.init(null, null, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.junit.Test;

import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;

/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
Expand Down

0 comments on commit 24da370

Please sign in to comment.