Making all the things Package Private in the Java Client (#2945)
This commit is contained in:
parent
bfae012dd0
commit
9db1c2af1a
|
|
@ -8,7 +8,7 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class CallbackMap {
|
||||
class CallbackMap {
|
||||
private ConcurrentHashMap<String, List<ActionBase>> handlers = new ConcurrentHashMap<>();
|
||||
|
||||
public void put(String target, ActionBase action) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
public class CloseMessage extends HubMessage {
|
||||
class CloseMessage extends HubMessage {
|
||||
String error;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ package com.microsoft.aspnet.signalr;
|
|||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
public class HandshakeProtocol {
|
||||
class HandshakeProtocol {
|
||||
public static Gson gson = new Gson();
|
||||
private static final String RECORD_SEPARATOR = "\u001e";
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
public class HandshakeRequestMessage {
|
||||
class HandshakeRequestMessage {
|
||||
String protocol;
|
||||
int version;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
public class HandshakeResponseMessage {
|
||||
class HandshakeResponseMessage {
|
||||
public String error;
|
||||
|
||||
public HandshakeResponseMessage() {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ package com.microsoft.aspnet.signalr;
|
|||
/**
|
||||
* A base class for hub messages.
|
||||
*/
|
||||
public abstract class HubMessage {
|
||||
abstract class HubMessage {
|
||||
public abstract HubMessageType getMessageType();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ package com.microsoft.aspnet.signalr;
|
|||
/**
|
||||
* A protocol abstraction for communicating with SignalR hubs.
|
||||
*/
|
||||
public interface HubProtocol {
|
||||
interface HubProtocol {
|
||||
String getName();
|
||||
int getVersion();
|
||||
TransferFormat getTransferFormat();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
public class InvocationMessage extends HubMessage {
|
||||
class InvocationMessage extends HubMessage {
|
||||
int type = HubMessageType.INVOCATION.value;
|
||||
String invocationId;
|
||||
String target;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import com.google.gson.JsonElement;
|
|||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
public class JsonHubProtocol implements HubProtocol {
|
||||
class JsonHubProtocol implements HubProtocol {
|
||||
private final JsonParser jsonParser = new JsonParser();
|
||||
private final Gson gson = new Gson();
|
||||
private static final String RECORD_SEPARATOR = "\u001e";
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import okhttp3.Request;
|
|||
import okhttp3.RequestBody;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class Negotiate {
|
||||
class Negotiate {
|
||||
|
||||
public static NegotiateResponse processNegotiate(String url) throws IOException {
|
||||
return processNegotiate(url, null);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import com.google.gson.JsonArray;
|
|||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
public class NegotiateResponse {
|
||||
class NegotiateResponse {
|
||||
private String connectionId;
|
||||
private Set<String> availableTransports = new HashSet<>();
|
||||
private String redirectUrl;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
public class NullLogger implements Logger {
|
||||
class NullLogger implements Logger {
|
||||
@Override
|
||||
public void log(LogLevel logLevel, String message) { }
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
public interface OnReceiveCallBack {
|
||||
interface OnReceiveCallBack {
|
||||
void invoke(String message) throws Exception;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
public class PingMessage extends HubMessage {
|
||||
class PingMessage extends HubMessage {
|
||||
|
||||
int type = HubMessageType.PING.value;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
public interface Transport {
|
||||
interface Transport {
|
||||
void start() throws Exception;
|
||||
void send(String message) throws Exception;
|
||||
void setOnReceive(OnReceiveCallBack callback);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import java.util.Map;
|
|||
import org.java_websocket.client.WebSocketClient;
|
||||
import org.java_websocket.handshake.ServerHandshake;
|
||||
|
||||
public class WebSocketTransport implements Transport {
|
||||
class WebSocketTransport implements Transport {
|
||||
private WebSocketClient webSocketClient;
|
||||
private OnReceiveCallBack onReceiveCallBack;
|
||||
private URI url;
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
package com.microsoft.aspnet.signalr.test;
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.microsoft.aspnet.signalr.HandshakeProtocol;
|
||||
import com.microsoft.aspnet.signalr.HandshakeRequestMessage;
|
||||
import com.microsoft.aspnet.signalr.HandshakeResponseMessage;
|
||||
|
||||
public class HandshakeProtocolTest {
|
||||
|
||||
@Test
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
package com.microsoft.aspnet.signalr.test;
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
|
@ -12,7 +12,6 @@ import org.junit.Rule;
|
|||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import com.microsoft.aspnet.signalr.*;
|
||||
|
||||
public class HubConnectionTest {
|
||||
private static final String RECORD_SEPARATOR = "\u001e";
|
||||
|
|
@ -1,14 +1,12 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
package com.microsoft.aspnet.signalr.test;
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.microsoft.aspnet.signalr.HubException;
|
||||
|
||||
public class HubExceptionTest {
|
||||
@Test
|
||||
public void VeryHubExceptionMesssageIsSet() {
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
package com.microsoft.aspnet.signalr.test;
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
|
@ -10,7 +10,6 @@ import org.junit.Test;
|
|||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.microsoft.aspnet.signalr.*;
|
||||
|
||||
public class JsonHubProtocolTest {
|
||||
private JsonHubProtocol jsonHubProtocol = new JsonHubProtocol();
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
package com.microsoft.aspnet.signalr.test;
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.microsoft.aspnet.signalr.NegotiateResponse;
|
||||
|
||||
public class NegotiateResponseTest {
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
package com.microsoft.aspnet.signalr.test;
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
|
|
@ -12,7 +12,6 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
|
||||
import com.microsoft.aspnet.signalr.Negotiate;
|
||||
|
||||
@RunWith(Parameterized.class)
|
||||
public class ResolveNegotiateUrlTest {
|
||||
|
|
@ -1,16 +1,12 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
package com.microsoft.aspnet.signalr.test;
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import com.microsoft.aspnet.signalr.NullLogger;
|
||||
import com.microsoft.aspnet.signalr.Transport;
|
||||
import com.microsoft.aspnet.signalr.WebSocketTransport;
|
||||
|
||||
public class WebSocketTransportTest {
|
||||
|
||||
@Rule
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
package com.microsoft.aspnet.signalr.test;
|
||||
package com.microsoft.aspnet.signalr;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
|
@ -13,8 +13,6 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
|
||||
import com.microsoft.aspnet.signalr.NullLogger;
|
||||
import com.microsoft.aspnet.signalr.WebSocketTransport;
|
||||
|
||||
@RunWith(Parameterized.class)
|
||||
public class WebSocketTransportUrlFormatTest {
|
||||
Loading…
Reference in New Issue