Skip to content

Commit eb7020b

Browse files
author
chengyitian
committed
AJ-642: add check for EventClient subscribe 'tableName' and 'actionName' param;
1 parent a8a396e commit eb7020b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/com/xxdb/streaming/cep/EventClient.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.xxdb.DBConnection;
44
import com.xxdb.comm.ErrorCodeInfo;
55
import com.xxdb.data.Entity;
6+
import com.xxdb.data.Utils;
67
import com.xxdb.streaming.client.AbstractClient;
78
import com.xxdb.streaming.client.IMessage;
89
import com.xxdb.streaming.client.MessageHandler;
@@ -26,6 +27,12 @@ public EventClient(List<EventScheme> eventSchemes, List<String> eventTimeKeys, L
2627
}
2728

2829
public void subscribe(String host, int port, String tableName, String actionName, MessageHandler handler, long offset, boolean reconnect, String userName, String password) throws IOException {
30+
if (Utils.isEmpty(tableName))
31+
throw new IllegalArgumentException("EventClient subscribe 'tableName' param cannot be null or empty.");
32+
33+
if (Utils.isEmpty(actionName))
34+
actionName = DEFAULT_ACTION_NAME;
35+
2936
BlockingQueue<List<IMessage>> queue = subscribeInternal(host, port, tableName, actionName, handler, offset, reconnect, null, null, false, userName, password, false);
3037
if (queue == null) {
3138
System.err.println("Subscription already made, handler loop not created.");

0 commit comments

Comments
 (0)