aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/api/activity/model
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-09-04 13:52:10 +0300
committerGravatar Vitaly Takmazov2018-09-04 13:52:10 +0300
commita63800dd6c5f8551b7126be6d3557e90888f0703 (patch)
treed037c0498f3e2f38f6147f20717c27f68353bea5 /juick-server/src/main/java/com/juick/server/api/activity/model
parent2f1b853bc35f14ac61038b556d21e1d0190fee8a (diff)
outbox as OrderedCollection
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/api/activity/model')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java14
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/Article.java22
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/Create.java23
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/Link.java13
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollection.java23
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollectionPage.java26
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/Person.java10
7 files changed, 119 insertions, 12 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java b/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java
index bc682d2b..dcc94bf7 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java
@@ -4,9 +4,19 @@ import com.fasterxml.jackson.annotation.JsonProperty;
public abstract class ActivityObject {
- public abstract String getId();
+ private String id;
- public abstract String getType();
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getType() {
+ return getClass().getName();
+ }
@JsonProperty("@context")
public String getContext() {
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Article.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Article.java
new file mode 100644
index 00000000..e117475d
--- /dev/null
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Article.java
@@ -0,0 +1,22 @@
+package com.juick.server.api.activity.model;
+
+public class Article extends ActivityObject {
+ private String content;
+ private String attributedTo;
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public String getAttributedTo() {
+ return attributedTo;
+ }
+
+ public void setAttributedTo(String attributedTo) {
+ this.attributedTo = attributedTo;
+ }
+}
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Create.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Create.java
new file mode 100644
index 00000000..7b4e7b16
--- /dev/null
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Create.java
@@ -0,0 +1,23 @@
+package com.juick.server.api.activity.model;
+
+public class Create extends ActivityObject {
+
+ private Person actor;
+ private Article object;
+
+ public Person getActor() {
+ return actor;
+ }
+
+ public void setActor(Person actor) {
+ this.actor = actor;
+ }
+
+ public Article getObject() {
+ return object;
+ }
+
+ public void setObject(Article object) {
+ this.object = object;
+ }
+}
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Link.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Link.java
new file mode 100644
index 00000000..b57dabbe
--- /dev/null
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Link.java
@@ -0,0 +1,13 @@
+package com.juick.server.api.activity.model;
+
+public class Link extends ActivityObject {
+ private String href;
+
+ public String getHref() {
+ return href;
+ }
+
+ public void setHref(String href) {
+ this.href = href;
+ }
+}
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollection.java b/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollection.java
new file mode 100644
index 00000000..84654b19
--- /dev/null
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollection.java
@@ -0,0 +1,23 @@
+package com.juick.server.api.activity.model;
+
+public class OrderedCollection extends ActivityObject {
+
+ private int totalItems;
+
+ public int getTotalItems() {
+ return totalItems;
+ }
+
+ public void setTotalItems(int totalItems) {
+ this.totalItems = totalItems;
+ }
+ private OrderedCollectionPage first;
+
+ public OrderedCollectionPage getFirst() {
+ return first;
+ }
+
+ public void setFirst(OrderedCollectionPage first) {
+ this.first = first;
+ }
+}
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollectionPage.java b/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollectionPage.java
new file mode 100644
index 00000000..9e03cb79
--- /dev/null
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollectionPage.java
@@ -0,0 +1,26 @@
+package com.juick.server.api.activity.model;
+
+import java.util.List;
+
+public class OrderedCollectionPage extends ActivityObject {
+
+ private Link next;
+
+ private List<? extends ActivityObject> orderedItems;
+
+ public Link getNext() {
+ return next;
+ }
+
+ public void setNext(Link next) {
+ this.next = next;
+ }
+
+ public List<? extends ActivityObject> getOrderedItems() {
+ return orderedItems;
+ }
+
+ public void setOrderedItems(List<? extends ActivityObject> orderedItems) {
+ this.orderedItems = orderedItems;
+ }
+}
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java
index 031cd73b..7ec94c28 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java
@@ -2,17 +2,11 @@ package com.juick.server.api.activity.model;
public class Person extends ActivityObject {
- private String id;
private String name;
private String icon;
private String outbox;
@Override
- public String getId() {
- return id;
- }
-
- @Override
public String getType() {
return "Person";
}
@@ -40,8 +34,4 @@ public class Person extends ActivityObject {
public void setOutbox(String outbox) {
this.outbox = outbox;
}
-
- public void setId(String id) {
- this.id = id;
- }
}