Skip to content

Commit

Permalink
Added dataset support, updated dependency versions, jars
Browse files Browse the repository at this point in the history
Added dataset support, updated  dependency versions, jars
  • Loading branch information
amavashev committed Jul 23, 2019
1 parent 39c2f2c commit 3875fe8
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 16 deletions.
22 changes: 11 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.jkoolcloud.client.api</groupId>
<artifactId>jkool-client-api</artifactId>
<version>0.2.1</version>
<version>0.2.2</version>
<packaging>jar</packaging>

<name>jkool-client-api</name>
Expand Down Expand Up @@ -66,60 +66,60 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.1</version>
<version>2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
<version>1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-net/commons-net -->
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.3</version>
<version>3.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.6</version>
<version>4.5.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-joda -->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>2.4.2</version>
<version>2.9.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.3</version>
<version>2.10.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.resteasy/resteasy-client -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.9.Final</version>
<version>3.0.26.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.swagger/swagger-annotations -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.0</version>
<version>1.5.22</version>
</dependency>
<dependency>
<groupId>org.glassfish.tyrus</groupId>
<artifactId>tyrus-container-grizzly-client</artifactId>
<version>1.8.3</version>
<version>1.15</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish/javax.json -->
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.0.4</version>
<version>1.1.4</version>
</dependency>
</dependencies>

Expand Down
161 changes: 161 additions & 0 deletions src/main/java/com/jkoolcloud/client/api/model/Dataset.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
/*
* Copyright 2014-2018 JKOOL, LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jkoolcloud.client.api.model;

import java.util.Date;
import java.util.List;

public class Dataset extends Snapshot {

/**
* Create a Dataset
*
* @param category
* dataset category
* @param name
* associated with the dataset
*/
public Dataset(String category, String name) {
super(category, name);
this.type = EventTypes.DATASET;
}

/**
* Create a dataset
*
* @param category
* dataset category
* @param name
* associated with the dataset
* @param timeMs
* timestamp associated with the entity
*/
public Dataset(String category, String name, long timeMs) {
super(category, name, timeMs);
this.type = EventTypes.DATASET;
}

/**
* Create a dataset
*
* @param category
* dataset category
* @param name
* associated with the dataset
* @param props
* a variable list of properties
*/
public Dataset(String category, String name, List<Property> props) {
this(category, name, System.currentTimeMillis());
addProperty(props);
}

/**
* Create a dataset
*
* @param category
* dataset category
* @param name
* associated with the dataset
* @param props
* a variable list of properties
*/
public Dataset(String category, String name, Property... props) {
this(category, name, System.currentTimeMillis());
addProperty(props);
}

/**
* Create a dataset
*
* @param category
* dataset category
* @param name
* associated with the dataset
* @param timeMs
* timestamp associated with the entity
* @param props
* list of properties
*/
public Dataset(String category, String name, long timeMs, List<Property> props) {
this(category, name, timeMs);
addProperty(props);
}

/**
* Create a dataset
*
* @param category
* dataset category
* @param name
* associated with the dataset
* @param timeMs
* timestamp associated with the entity
* @param props
* a variable list of properties
*/
public Dataset(String category, String name, long timeMs, Property... props) {
this(category, name, timeMs);
addProperty(props);
}

/**
* Create a dataset
*
* @param category
* dataset category
* @param name
* associated with the dataset
* @param time
* timestamp associated with the entity
* @param props
* a list of properties
*/
public Dataset(String category, String name, Date time, List<Property> props) {
this(category, name, time.getTime());
addProperty(props);
}

/**
* Create a dataset
*
* @param category
* dataset category
* @param name
* associated with the dataset
* @param time
* timestamp associated with the entity
* @param props
* a variable list of properties
*/
public Dataset(String category, String name, Date time, Property... props) {
this(category, name, time.getTime());
addProperty(props);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Dataset {\n");
sb.append(" type: ").append(this.getType()).append("\n");
sb.append(" category: ").append(this.getCategory()).append("\n");
sb.append(" name: ").append(this.getName()).append("\n");
sb.append(" timeUsec: ").append(this.getTimeUsec()).append("\n");
sb.append(" properties: ").append(this.getProperties()).append("\n");
sb.append("}\n");
return sb.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
* @author cathy
*/
public enum EventTypes {
OTHER, NOOP, CALL, ACTIVITY, EVENT, SNAPSHOT, START, STOP, OPEN, CLOSE, SEND, RECEIVE, INQUIRE, SET, BROWSE, ADD, UPDATE, REMOVE, CLEAR, DATAGRAM
OTHER, NOOP, CALL, ACTIVITY, EVENT, SNAPSHOT, START, STOP, OPEN, CLOSE, SEND, RECEIVE, INQUIRE, SET, BROWSE, ADD, UPDATE, REMOVE, CLEAR, LOG, DATASET
}
3 changes: 2 additions & 1 deletion src/main/java/com/jkoolcloud/client/api/model/Snapshot.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public class Snapshot implements Validated {
private String name;
private long timeUsec;
private List<Property> properties = new ArrayList<Property>();
private EventTypes type = EventTypes.SNAPSHOT;

protected EventTypes type = EventTypes.SNAPSHOT;

/**
* Create a snapshot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
*/
public interface JKWSHandler {
void onMessage(JKWSClient client, String message);

void onOpen(JKWSClient client, Session userSession);

void onClose(JKWSClient client, Session userSession, CloseReason reason);

void onError(JKWSClient client, Session userSession, Throwable ex);
}

0 comments on commit 3875fe8

Please sign in to comment.