Skip to content

Commit e6b2187

Browse files
author
Steven Cody
committed
updated to use lai-model 1.1.1 and lai-event 1.1.4
this will be a release of 1.0.9
1 parent 9b4e459 commit e6b2187

4 files changed

Lines changed: 29 additions & 28 deletions

File tree

pom.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>apereo</groupId>
77
<artifactId>data-loader-library</artifactId>
8-
<version>1.0.4</version>
8+
<version>1.0.9</version>
99
<packaging>jar</packaging>
1010

1111
<name>apereo-data-loader-library</name>
@@ -46,12 +46,12 @@
4646
<dependency>
4747
<groupId>apereo</groupId>
4848
<artifactId>lai-event</artifactId>
49-
<version>1.0.2</version>
49+
<version>1.1.4</version>
5050
</dependency>
5151
<dependency>
5252
<groupId>apereo</groupId>
5353
<artifactId>lai-model</artifactId>
54-
<version>1.0.4</version>
54+
<version>1.1.1</version>
5555
</dependency>
5656
<dependency>
5757
<groupId>com.google.code.gson</groupId>
@@ -92,4 +92,5 @@
9292
</plugins>
9393
</build>
9494

95+
<description>for use with Apereo LRW_Suite (or Shuhari) products. Mostly used for Data Loading (for the OpenDashboard)</description>
9596
</project>

src/main/java/unicon/matthews/dataloader/MatthewsClient.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
package unicon.matthews.dataloader;
55

6-
import java.time.LocalDateTime;
6+
import java.time.Instant;
77
import java.util.ArrayList;
88
import java.util.Collection;
99
import java.util.Collections;
@@ -19,14 +19,14 @@
1919
import org.springframework.web.client.RestClientException;
2020
import org.springframework.web.client.RestTemplate;
2121

22-
import unicon.matthews.caliper.Envelope;
23-
import unicon.matthews.caliper.Event;
24-
import unicon.matthews.entity.ClassMapping;
25-
import unicon.matthews.entity.DataSync;
26-
import unicon.matthews.entity.UserMapping;
27-
import unicon.matthews.oneroster.Enrollment;
28-
import unicon.matthews.oneroster.LineItem;
29-
import unicon.matthews.oneroster.User;
22+
import org.apereo.openlrw.caliper.Envelope;
23+
import org.apereo.openlrw.caliper.Event;
24+
import org.apereo.model.entity.ClassMapping;
25+
import org.apereo.model.entity.DataSync;
26+
import org.apereo.model.entity.UserMapping;
27+
import org.apereo.model.oneroster.Enrollment;
28+
import org.apereo.model.oneroster.LineItem;
29+
import org.apereo.model.oneroster.User;
3030

3131
import com.google.gson.JsonObject;
3232
import com.google.gson.JsonPrimitive;
@@ -184,8 +184,8 @@ public void postLineItem(LineItem lineItem) {
184184

185185
}
186186

187-
public void postClass(unicon.matthews.oneroster.Class klass) {
188-
HttpEntity<unicon.matthews.oneroster.Class> he = new HttpEntity<unicon.matthews.oneroster.Class>(klass, this.httpHeaders);
187+
public void postClass(org.apereo.model.oneroster.Class klass) {
188+
HttpEntity<org.apereo.model.oneroster.Class> he = new HttpEntity<org.apereo.model.oneroster.Class>(klass, this.httpHeaders);
189189

190190
String path = "/api/classes";
191191
String url = this.baseUrl + path;
@@ -194,8 +194,8 @@ public void postClass(unicon.matthews.oneroster.Class klass) {
194194
.exchange(url, HttpMethod.POST, he, JsonObject.class);
195195
}
196196

197-
public void postCourse(unicon.matthews.oneroster.Course course) {
198-
HttpEntity<unicon.matthews.oneroster.Course> he = new HttpEntity<unicon.matthews.oneroster.Course>(course, this.httpHeaders);
197+
public void postCourse(org.apereo.model.oneroster.Course course) {
198+
HttpEntity<org.apereo.model.oneroster.Course> he = new HttpEntity<org.apereo.model.oneroster.Course>(course, this.httpHeaders);
199199

200200
String path = "/api/courses";
201201
String url = this.baseUrl + path;
@@ -219,7 +219,7 @@ public void postEvent(Event event, String sensorName) {
219219
Envelope envelope
220220
= new Envelope.Builder()
221221
.withData(Collections.singletonList(event))
222-
.withSendTime(LocalDateTime.now())
222+
.withSendTime(Instant.now())
223223
.withSensor(sensorName)
224224
.build();
225225

@@ -236,7 +236,7 @@ public void postEvents(Collection<Event> events, String sensorName) {
236236
Envelope envelope
237237
= new Envelope.Builder()
238238
.withData(new ArrayList<>(events))
239-
.withSendTime(LocalDateTime.now())
239+
.withSendTime(Instant.now())
240240
.withSensor(sensorName)
241241
.build();
242242

@@ -260,7 +260,7 @@ public void postDataSync(DataSync dataSync) {
260260

261261
}
262262

263-
public DataSync getLatestDataSyncForType(unicon.matthews.entity.DataSync.DataSyncType dataSyncType) {
263+
public DataSync getLatestDataSyncForType(org.apereo.model.entity.DataSync.DataSyncType dataSyncType) {
264264
DataSync dataSync = null;
265265

266266
String path = "/api/sync/".concat(dataSyncType.toString()).concat("/latest");

src/main/java/unicon/matthews/dataloader/converter/Converter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package unicon.matthews.dataloader.converter;
22

3-
import unicon.matthews.caliper.Event;
3+
import org.apereo.openlrw.caliper.Event;
44

55
/**
66
* General interface for type converters. The Type parameters &lt;S, T &gt; will allow the converters to be type safe

src/main/java/unicon/matthews/dataloader/converter/EventBuilderUtils.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package unicon.matthews.dataloader.converter;
22

3-
import unicon.matthews.caliper.Agent;
4-
import unicon.matthews.caliper.Entity;
5-
import unicon.matthews.caliper.Event;
6-
import unicon.matthews.caliper.Group;
7-
import unicon.matthews.caliper.Membership;
3+
import org.apereo.openlrw.caliper.Agent;
4+
import org.apereo.openlrw.caliper.Entity;
5+
import org.apereo.openlrw.caliper.Event;
6+
import org.apereo.openlrw.caliper.Group;
7+
import org.apereo.openlrw.caliper.Membership;
88
import unicon.matthews.dataloader.util.Maps;
9-
import unicon.matthews.oneroster.Enrollment;
10-
import unicon.matthews.oneroster.User;
9+
import org.apereo.model.oneroster.Enrollment;
10+
import org.apereo.model.oneroster.User;
1111

1212
import java.util.Arrays;
1313
import java.util.UUID;
@@ -262,7 +262,7 @@ public static Group.Builder usingCourseSectionGroup(Enrollment enrollment) {
262262
.withType(CaliperV1p1Vocab.Entity.COURSE_SECTION)
263263
.withId(enrollment.getKlass().getSourcedId())
264264
.withExtensions(Maps.ofEntries(
265-
entry("context_type", enrollment.getKlass().getTitle()))); // TODO - optional and course title is likely wrong - but where do we find something else useful for it
265+
entry("context_type", enrollment.getKlass().getType()))); // TODO - optional and course title is likely wrong - but where do we find something else useful for it
266266
}
267267

268268
public static Membership.Builder usingMembership(Enrollment enrollment) {

0 commit comments

Comments
 (0)