aboutsummaryrefslogtreecommitdiff
path: root/juick-server-core/src/main/java/com/juick/server
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server-core/src/main/java/com/juick/server')
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/AnonymousUser.java139
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/ApplicationStatus.java52
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/Auth.java39
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/NotifyOpts.java51
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/PrivacyOpts.java46
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/PrivateChats.java39
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/ResponseReply.java89
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/TagStats.java46
-rw-r--r--juick-server-core/src/main/java/com/juick/server/helpers/UserInfo.java60
-rw-r--r--juick-server-core/src/main/java/com/juick/server/util/HashUtils.java36
-rw-r--r--juick-server-core/src/main/java/com/juick/server/util/TagUtils.java42
11 files changed, 0 insertions, 639 deletions
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/AnonymousUser.java b/juick-server-core/src/main/java/com/juick/server/helpers/AnonymousUser.java
deleted file mode 100644
index 122bbe29..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/AnonymousUser.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-import com.juick.User;
-
-/**
- * Created by aalexeev on 12/11/16.
- */
-public final class AnonymousUser extends User {
- public static final AnonymousUser INSTANCE = new AnonymousUser();
-
- private AnonymousUser() {
- super.setUid(getUid());
- super.setName(getName());
- super.setAvatar(getAvatar());
- super.setFullName(getFullName());
- super.setMessagesCount(getMessagesCount());
- super.setAuthHash(getAuthHash());
- super.setBanned(isBanned());
- super.setCredentials(getCredentials());
- super.setLang(getLang());
- }
-
- @Override
- public boolean equals(Object obj) {
- return obj == this || obj instanceof AnonymousUser;
- }
-
- @Override
- public int getUid() {
- return 0;
- }
-
- @Override
- public String getName() {
- return "Anonymous";
- }
-
- @Override
- public String getFullName() {
- return getName();
- }
-
- @Override
- public String getAuthHash() {
- return null;
- }
-
- @Override
- public Integer getUnreadCount() {
- return 0;
- }
-
- @Override
- public boolean isBanned() {
- return false;
- }
-
- @Override
- public Object getAvatar() {
- return null;
- }
-
- @Override
- public String getCredentials() {
- return null;
- }
-
- @Override
- public String getLang() {
- return "__";
- }
-
- @Override
- public int getMessagesCount() {
- return 0;
- }
-
- @Override
- public boolean isAnonymous() {
- return true;
- }
-
- @Override
- public void setUid(int uid) {
- }
-
- @Override
- public void setName(String name) {
- }
-
- @Override
- public void setFullName(String fullName) {
- }
-
- @Override
- public void setAuthHash(String authHash) {
- }
-
- @Override
- public void setUnreadCount(Integer count) {
- }
-
- @Override
- public void setBanned(boolean banned) {
- }
-
- @Override
- public void setAvatar(Object avatar) {
- }
-
- @Override
- public void setCredentials(String credentials) {
- }
-
- @Override
- public void setLang(String lang) {
- }
-
- @Override
- public void setMessagesCount(int messagesCount) {
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/ApplicationStatus.java b/juick-server-core/src/main/java/com/juick/server/helpers/ApplicationStatus.java
deleted file mode 100644
index 8f57b2a6..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/ApplicationStatus.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-/**
- * Created by vt on 03/09/16.
- */
-public class ApplicationStatus {
- private boolean connected;
- private boolean crosspostEnabled;
-
- @Override
- public String toString() {
- return new ToStringBuilder(this)
- .append("connected", connected)
- .append("crosspostEnabled", crosspostEnabled)
- .toString();
- }
-
- public boolean isConnected() {
- return connected;
- }
-
- public void setConnected(boolean connected) {
- this.connected = connected;
- }
-
- public boolean isCrosspostEnabled() {
- return crosspostEnabled;
- }
-
- public void setCrosspostEnabled(boolean crosspostEnabled) {
- this.crosspostEnabled = crosspostEnabled;
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/Auth.java b/juick-server-core/src/main/java/com/juick/server/helpers/Auth.java
deleted file mode 100644
index d01efadd..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/Auth.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-/**
- * Created by vt on 09/02/16.
- */
-public class Auth {
- private String account;
- private String authCode;
-
- public Auth(String account, String authCode) {
- this.account = account;
- this.authCode = authCode;
- }
-
- public String getAccount() {
- return account;
- }
-
- public String getAuthCode() {
- return authCode;
- }
-} \ No newline at end of file
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/NotifyOpts.java b/juick-server-core/src/main/java/com/juick/server/helpers/NotifyOpts.java
deleted file mode 100644
index 0e49a424..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/NotifyOpts.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-/**
- * Created by vt on 03/09/16.
- */
-public class NotifyOpts {
- private boolean repliesEnabled;
- private boolean subscriptionsEnabled;
- private boolean recommendationsEnabled;
-
- public boolean isRepliesEnabled() {
- return repliesEnabled;
- }
-
- public void setRepliesEnabled(boolean repliesEnabled) {
- this.repliesEnabled = repliesEnabled;
- }
-
- public boolean isSubscriptionsEnabled() {
- return subscriptionsEnabled;
- }
-
- public void setSubscriptionsEnabled(boolean subscriptionsEnabled) {
- this.subscriptionsEnabled = subscriptionsEnabled;
- }
-
- public boolean isRecommendationsEnabled() {
- return recommendationsEnabled;
- }
-
- public void setRecommendationsEnabled(boolean recommendationsEnabled) {
- this.recommendationsEnabled = recommendationsEnabled;
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/PrivacyOpts.java b/juick-server-core/src/main/java/com/juick/server/helpers/PrivacyOpts.java
deleted file mode 100644
index 86281d4a..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/PrivacyOpts.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-/**
- * Created by vt on 16/01/16.
- */
-public class PrivacyOpts {
- private int uid;
- private int privacy;
-
- public PrivacyOpts() {
-
- }
-
- public int getUid() {
- return uid;
- }
-
- public void setUid(int uid) {
- this.uid = uid;
- }
-
- public int getPrivacy() {
- return privacy;
- }
-
- public void setPrivacy(int privacy) {
- this.privacy = privacy;
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/PrivateChats.java b/juick-server-core/src/main/java/com/juick/server/helpers/PrivateChats.java
deleted file mode 100644
index 6e446f98..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/PrivateChats.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.juick.User;
-
-import java.util.List;
-
-/**
- * Created by vt on 24/11/2016.
- */
-public class PrivateChats {
- private List<User> users;
-
- @JsonProperty("pms")
- public List<User> getUsers() {
- return users;
- }
-
- public void setUsers(List<User> users) {
- this.users = users;
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/ResponseReply.java b/juick-server-core/src/main/java/com/juick/server/helpers/ResponseReply.java
deleted file mode 100644
index 91ba2b8a..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/ResponseReply.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-import java.util.Date;
-
-/**
- * Created by vitalyster on 13.12.2016.
- */
-public class ResponseReply {
- private String muname;
- private int mid;
- private int rid;
- private String uname;
- private String description;
- private Date pubDate;
- private String attachmentType;
-
- public String getMuname() {
- return muname;
- }
-
- public void setMuname(String muname) {
- this.muname = muname;
- }
-
- public int getMid() {
- return mid;
- }
-
- public void setMid(int mid) {
- this.mid = mid;
- }
-
- public int getRid() {
- return rid;
- }
-
- public void setRid(int rid) {
- this.rid = rid;
- }
-
- public String getUname() {
- return uname;
- }
-
- public void setUname(String uname) {
- this.uname = uname;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public Date getPubDate() {
- return pubDate;
- }
-
- public void setPubDate(Date pubDate) {
- this.pubDate = pubDate;
- }
-
- public String getAttachmentType() {
- return attachmentType;
- }
-
- public void setAttachmentType(String attachmentType) {
- this.attachmentType = attachmentType;
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/TagStats.java b/juick-server-core/src/main/java/com/juick/server/helpers/TagStats.java
deleted file mode 100644
index ab24983f..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/TagStats.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.juick.Tag;
-
-/**
- * Created by vitalyster on 01.12.2016.
- */
-public class TagStats {
- private Tag tag;
- private int usageCount;
-
- public Tag getTag() {
- return tag;
- }
-
- public void setTag(Tag tag) {
- this.tag = tag;
- }
-
- @JsonProperty("messages")
- public int getUsageCount() {
- return usageCount;
- }
-
- public void setUsageCount(int usageCount) {
- this.usageCount = usageCount;
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/helpers/UserInfo.java b/juick-server-core/src/main/java/com/juick/server/helpers/UserInfo.java
deleted file mode 100644
index 284cd2e8..00000000
--- a/juick-server-core/src/main/java/com/juick/server/helpers/UserInfo.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.helpers;
-
-/**
- * Created by vt on 03/09/16.
- */
-public class UserInfo {
- private String fullName;
- private String country;
- private String url;
- private String description;
-
- public String getFullName() {
- return fullName;
- }
-
- public void setFullName(String fullName) {
- this.fullName = fullName;
- }
-
- public String getCountry() {
- return country;
- }
-
- public void setCountry(String country) {
- this.country = country;
- }
-
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/util/HashUtils.java b/juick-server-core/src/main/java/com/juick/server/util/HashUtils.java
deleted file mode 100644
index b4500457..00000000
--- a/juick-server-core/src/main/java/com/juick/server/util/HashUtils.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.util;
-
-import java.util.Random;
-
-/**
- * Created by vitalyster on 29.06.2017.
- */
-public class HashUtils {
- private static final String ABCDEF = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- public static String generateHash(final int len) {
- Random rnd = new Random();
- StringBuilder sb = new StringBuilder(len);
- for (int i = 0; i < len; i++) {
- sb.append(ABCDEF.charAt(rnd.nextInt(ABCDEF.length())));
- }
- return sb.toString();
- }
-}
diff --git a/juick-server-core/src/main/java/com/juick/server/util/TagUtils.java b/juick-server-core/src/main/java/com/juick/server/util/TagUtils.java
deleted file mode 100644
index 9edeab32..00000000
--- a/juick-server-core/src/main/java/com/juick/server/util/TagUtils.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.server.util;
-
-import com.juick.Tag;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * Created by aalexeev on 11/13/16.
- */
-public class TagUtils {
- private TagUtils() {
- throw new IllegalStateException();
- }
-
- public static String toString(final List<Tag> tags) {
- if (CollectionUtils.isEmpty(tags))
- return StringUtils.EMPTY;
-
- return tags.stream().map(t -> " *" + t.getName())
- .collect(Collectors.joining());
- }
-}