Skip to content

Commit 3875fe8

Browse files
committed
Added dataset support, updated dependency versions, jars
Added dataset support, updated dependency versions, jars
1 parent 39c2f2c commit 3875fe8

File tree

5 files changed

+175
-16
lines changed

5 files changed

+175
-16
lines changed

pom.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.jkoolcloud.client.api</groupId>
66
<artifactId>jkool-client-api</artifactId>
7-
<version>0.2.1</version>
7+
<version>0.2.2</version>
88
<packaging>jar</packaging>
99

1010
<name>jkool-client-api</name>
@@ -66,60 +66,60 @@
6666
<dependency>
6767
<groupId>commons-io</groupId>
6868
<artifactId>commons-io</artifactId>
69-
<version>2.1</version>
69+
<version>2.6</version>
7070
</dependency>
7171
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
7272
<dependency>
7373
<groupId>commons-logging</groupId>
7474
<artifactId>commons-logging</artifactId>
75-
<version>1.1.3</version>
75+
<version>1.2</version>
7676
</dependency>
7777
<!-- https://mvnrepository.com/artifact/commons-net/commons-net -->
7878
<dependency>
7979
<groupId>commons-net</groupId>
8080
<artifactId>commons-net</artifactId>
81-
<version>3.3</version>
81+
<version>3.6</version>
8282
</dependency>
8383
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
8484
<dependency>
8585
<groupId>org.apache.httpcomponents</groupId>
8686
<artifactId>httpclient</artifactId>
87-
<version>4.5.6</version>
87+
<version>4.5.9</version>
8888
</dependency>
8989
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-joda -->
9090
<dependency>
9191
<groupId>com.fasterxml.jackson.datatype</groupId>
9292
<artifactId>jackson-datatype-joda</artifactId>
93-
<version>2.4.2</version>
93+
<version>2.9.9</version>
9494
</dependency>
9595
<!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
9696
<dependency>
9797
<groupId>joda-time</groupId>
9898
<artifactId>joda-time</artifactId>
99-
<version>2.3</version>
99+
<version>2.10.3</version>
100100
</dependency>
101101
<!-- https://mvnrepository.com/artifact/org.jboss.resteasy/resteasy-client -->
102102
<dependency>
103103
<groupId>org.jboss.resteasy</groupId>
104104
<artifactId>resteasy-client</artifactId>
105-
<version>3.0.9.Final</version>
105+
<version>3.0.26.Final</version>
106106
</dependency>
107107
<!-- https://mvnrepository.com/artifact/io.swagger/swagger-annotations -->
108108
<dependency>
109109
<groupId>io.swagger</groupId>
110110
<artifactId>swagger-annotations</artifactId>
111-
<version>1.5.0</version>
111+
<version>1.5.22</version>
112112
</dependency>
113113
<dependency>
114114
<groupId>org.glassfish.tyrus</groupId>
115115
<artifactId>tyrus-container-grizzly-client</artifactId>
116-
<version>1.8.3</version>
116+
<version>1.15</version>
117117
</dependency>
118118
<!-- https://mvnrepository.com/artifact/org.glassfish/javax.json -->
119119
<dependency>
120120
<groupId>org.glassfish</groupId>
121121
<artifactId>javax.json</artifactId>
122-
<version>1.0.4</version>
122+
<version>1.1.4</version>
123123
</dependency>
124124
</dependencies>
125125

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
/*
2+
* Copyright 2014-2018 JKOOL, LLC.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.jkoolcloud.client.api.model;
17+
18+
import java.util.Date;
19+
import java.util.List;
20+
21+
public class Dataset extends Snapshot {
22+
23+
/**
24+
* Create a Dataset
25+
*
26+
* @param category
27+
* dataset category
28+
* @param name
29+
* associated with the dataset
30+
*/
31+
public Dataset(String category, String name) {
32+
super(category, name);
33+
this.type = EventTypes.DATASET;
34+
}
35+
36+
/**
37+
* Create a dataset
38+
*
39+
* @param category
40+
* dataset category
41+
* @param name
42+
* associated with the dataset
43+
* @param timeMs
44+
* timestamp associated with the entity
45+
*/
46+
public Dataset(String category, String name, long timeMs) {
47+
super(category, name, timeMs);
48+
this.type = EventTypes.DATASET;
49+
}
50+
51+
/**
52+
* Create a dataset
53+
*
54+
* @param category
55+
* dataset category
56+
* @param name
57+
* associated with the dataset
58+
* @param props
59+
* a variable list of properties
60+
*/
61+
public Dataset(String category, String name, List<Property> props) {
62+
this(category, name, System.currentTimeMillis());
63+
addProperty(props);
64+
}
65+
66+
/**
67+
* Create a dataset
68+
*
69+
* @param category
70+
* dataset category
71+
* @param name
72+
* associated with the dataset
73+
* @param props
74+
* a variable list of properties
75+
*/
76+
public Dataset(String category, String name, Property... props) {
77+
this(category, name, System.currentTimeMillis());
78+
addProperty(props);
79+
}
80+
81+
/**
82+
* Create a dataset
83+
*
84+
* @param category
85+
* dataset category
86+
* @param name
87+
* associated with the dataset
88+
* @param timeMs
89+
* timestamp associated with the entity
90+
* @param props
91+
* list of properties
92+
*/
93+
public Dataset(String category, String name, long timeMs, List<Property> props) {
94+
this(category, name, timeMs);
95+
addProperty(props);
96+
}
97+
98+
/**
99+
* Create a dataset
100+
*
101+
* @param category
102+
* dataset category
103+
* @param name
104+
* associated with the dataset
105+
* @param timeMs
106+
* timestamp associated with the entity
107+
* @param props
108+
* a variable list of properties
109+
*/
110+
public Dataset(String category, String name, long timeMs, Property... props) {
111+
this(category, name, timeMs);
112+
addProperty(props);
113+
}
114+
115+
/**
116+
* Create a dataset
117+
*
118+
* @param category
119+
* dataset category
120+
* @param name
121+
* associated with the dataset
122+
* @param time
123+
* timestamp associated with the entity
124+
* @param props
125+
* a list of properties
126+
*/
127+
public Dataset(String category, String name, Date time, List<Property> props) {
128+
this(category, name, time.getTime());
129+
addProperty(props);
130+
}
131+
132+
/**
133+
* Create a dataset
134+
*
135+
* @param category
136+
* dataset category
137+
* @param name
138+
* associated with the dataset
139+
* @param time
140+
* timestamp associated with the entity
141+
* @param props
142+
* a variable list of properties
143+
*/
144+
public Dataset(String category, String name, Date time, Property... props) {
145+
this(category, name, time.getTime());
146+
addProperty(props);
147+
}
148+
149+
@Override
150+
public String toString() {
151+
StringBuilder sb = new StringBuilder();
152+
sb.append("class Dataset {\n");
153+
sb.append(" type: ").append(this.getType()).append("\n");
154+
sb.append(" category: ").append(this.getCategory()).append("\n");
155+
sb.append(" name: ").append(this.getName()).append("\n");
156+
sb.append(" timeUsec: ").append(this.getTimeUsec()).append("\n");
157+
sb.append(" properties: ").append(this.getProperties()).append("\n");
158+
sb.append("}\n");
159+
return sb.toString();
160+
}
161+
}

src/main/java/com/jkoolcloud/client/api/model/EventTypes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
* @author cathy
2222
*/
2323
public enum EventTypes {
24-
OTHER, NOOP, CALL, ACTIVITY, EVENT, SNAPSHOT, START, STOP, OPEN, CLOSE, SEND, RECEIVE, INQUIRE, SET, BROWSE, ADD, UPDATE, REMOVE, CLEAR, DATAGRAM
24+
OTHER, NOOP, CALL, ACTIVITY, EVENT, SNAPSHOT, START, STOP, OPEN, CLOSE, SEND, RECEIVE, INQUIRE, SET, BROWSE, ADD, UPDATE, REMOVE, CLEAR, LOG, DATASET
2525
}

src/main/java/com/jkoolcloud/client/api/model/Snapshot.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public class Snapshot implements Validated {
3737
private String name;
3838
private long timeUsec;
3939
private List<Property> properties = new ArrayList<Property>();
40-
private EventTypes type = EventTypes.SNAPSHOT;
40+
41+
protected EventTypes type = EventTypes.SNAPSHOT;
4142

4243
/**
4344
* Create a snapshot

src/main/java/com/jkoolcloud/client/api/service/JKWSHandler.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@
2626
*/
2727
public interface JKWSHandler {
2828
void onMessage(JKWSClient client, String message);
29-
3029
void onOpen(JKWSClient client, Session userSession);
31-
3230
void onClose(JKWSClient client, Session userSession, CloseReason reason);
33-
3431
void onError(JKWSClient client, Session userSession, Throwable ex);
3532
}

0 commit comments

Comments
 (0)