diff --git a/application/src/main/java/de/bstly/we/Application.java b/application/src/main/java/de/bstly/we/Application.java index 06be6e4..874019e 100755 --- a/application/src/main/java/de/bstly/we/Application.java +++ b/application/src/main/java/de/bstly/we/Application.java @@ -15,25 +15,23 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer import org.springframework.scheduling.annotation.EnableScheduling; /** - * - * @author _bastler@bstly.de - * + * The Class Application. */ @SpringBootApplication @EnableScheduling public class Application extends SpringBootServletInitializer { + /** - * @param args + * The main method. + * + * @param args the arguments */ public static void main(String[] args) { SpringApplication.run(Application.class, args); } /* - * - * @see - * org.springframework.boot.web.servlet.support.SpringBootServletInitializer# - * onStartup(javax.servlet.ServletContext) + * @see org.springframework.boot.web.servlet.support.SpringBootServletInitializer#onStartup(javax.servlet.ServletContext) */ @Override public void onStartup(ServletContext servletContext) throws ServletException { diff --git a/core/src/main/java/de/bstly/we/CoreConfiguration.java b/core/src/main/java/de/bstly/we/CoreConfiguration.java index dd8eedd..2048cbe 100644 --- a/core/src/main/java/de/bstly/we/CoreConfiguration.java +++ b/core/src/main/java/de/bstly/we/CoreConfiguration.java @@ -12,9 +12,7 @@ import org.springframework.context.annotation.Configuration; import com.querydsl.jpa.impl.JPAQueryFactory; /** - * - * @author _bastler@bstly.de - * + * The Class CoreConfiguration. */ @Configuration public class CoreConfiguration { @@ -22,6 +20,11 @@ public class CoreConfiguration { @Autowired private EntityManager em; + /** + * Jpa query factory. + * + * @return the JPA query factory + */ @Bean public JPAQueryFactory jpaQueryFactory() { return new JPAQueryFactory(em); diff --git a/core/src/main/java/de/bstly/we/businesslogic/PermissionManager.java b/core/src/main/java/de/bstly/we/businesslogic/PermissionManager.java index 0c44eec..d6a4c7f 100755 --- a/core/src/main/java/de/bstly/we/businesslogic/PermissionManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/PermissionManager.java @@ -25,9 +25,7 @@ import de.bstly.we.model.UserData; import de.bstly.we.repository.PermissionRepository; /** - * - * @author _bastler@bstly.de - * + * The Class PermissionManager. */ @Component public class PermissionManager implements UserDataProvider { @@ -41,10 +39,11 @@ public class PermissionManager implements UserDataProvider { DateTimeFormatter pretixOffsetDateTime = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ssx"); /** - * - * @param target - * @param name - * @return + * Gets the. + * + * @param target the target + * @param name the name + * @return the list */ public List get(Long target, String name) { if (target != null) { @@ -55,9 +54,10 @@ public class PermissionManager implements UserDataProvider { } /** - * - * @param target - * @return + * Gets the all by target. + * + * @param target the target + * @return the all by target */ public List getAllByTarget(Long target) { if (target != null) { @@ -67,9 +67,10 @@ public class PermissionManager implements UserDataProvider { } /** - * - * @param target - * @return + * Gets the not expires by target. + * + * @param target the target + * @return the not expires by target */ public List getNotExpiresByTarget(Long target) { if (target != null) { @@ -81,9 +82,10 @@ public class PermissionManager implements UserDataProvider { } /** - * - * @param name - * @return + * Gets the not expires by name. + * + * @param name the name + * @return the not expires by name */ public List getNotExpiresByName(String name) { if (name != null) { @@ -95,9 +97,10 @@ public class PermissionManager implements UserDataProvider { } /** - * - * @param target - * @return + * Gets the not expires by target ignore start. + * + * @param target the target + * @return the not expires by target ignore start */ public List getNotExpiresByTargetIgnoreStart(Long target) { if (target != null) { @@ -108,9 +111,10 @@ public class PermissionManager implements UserDataProvider { } /** - * - * @param target - * @return + * Checks if is full user. + * + * @param target the target + * @return true, if is full user */ public boolean isFullUser(Long target) { return permissionRepository.exists(qPermission.target.eq(target) @@ -119,10 +123,11 @@ public class PermissionManager implements UserDataProvider { } /** - * - * @param target - * @param name - * @return + * Checks for permission. + * + * @param target the target + * @param name the name + * @return true, if successful */ public boolean hasPermission(Long target, String name) { if (!Permissions.ROLE_ADMIN.equals(name) && hasPermission(target, Permissions.ROLE_ADMIN)) { @@ -136,12 +141,14 @@ public class PermissionManager implements UserDataProvider { } /** - * - * @param target - * @param name - * @param addon - * @param expires - * @return + * Creates the. + * + * @param target the target + * @param name the name + * @param addon the addon + * @param starts the starts + * @param expires the expires + * @return the permission */ public Permission create(Long target, String name, boolean addon, Instant starts, Instant expires) { @@ -156,9 +163,10 @@ public class PermissionManager implements UserDataProvider { } /** - * - * @param permission - * @return + * Update. + * + * @param permission the permission + * @return the permission */ public Permission update(Permission permission) { Assert.isTrue( @@ -175,10 +183,11 @@ public class PermissionManager implements UserDataProvider { } /** - * - * @param name - * @param clone - * @return + * Clone. + * + * @param name the name + * @param clone the clone + * @return the list */ public List clone(String name, String clone) { List permissions = Lists.newArrayList(); @@ -197,9 +206,10 @@ public class PermissionManager implements UserDataProvider { } /** - * - * @param target - * @param name + * Delete. + * + * @param target the target + * @param name the name */ public void delete(Long target, String name) { Assert.isTrue( @@ -212,26 +222,30 @@ public class PermissionManager implements UserDataProvider { } /** - * - * @param target + * Delete all. + * + * @param target the target */ public void deleteAll(Long target) { permissionRepository.deleteAll(permissionRepository.findAll(qPermission.target.eq(target))); } /** - * - * @param name + * Delete all. + * + * @param name the name */ public void deleteAll(String name) { permissionRepository.deleteAll(permissionRepository.findAll(qPermission.name.eq(name))); } /** - * - * @param target - * @param item - * @param answers + * Apply item. + * + * @param target the target + * @param item the item + * @param answers the answers + * @param start the start */ public void applyItem(Long target, Integer item, JsonArray answers, Instant start) { for (Permission permission : getForItem(target, item, answers, start)) { @@ -240,11 +254,13 @@ public class PermissionManager implements UserDataProvider { } /** - * - * @param target - * @param item - * @param answers - * @return + * Gets the for item. + * + * @param target the target + * @param item the item + * @param answers the answers + * @param start the start + * @return the for item */ public List getForItem(Long target, Integer item, JsonArray answers, Instant start) { diff --git a/core/src/main/java/de/bstly/we/businesslogic/PermissionMappingManager.java b/core/src/main/java/de/bstly/we/businesslogic/PermissionMappingManager.java index 86f39a7..3d37d4c 100755 --- a/core/src/main/java/de/bstly/we/businesslogic/PermissionMappingManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/PermissionMappingManager.java @@ -21,9 +21,7 @@ import de.bstly.we.model.QPermissionMapping; import de.bstly.we.repository.PermissionMappingRepository; /** - * - * @author _bastler@bstly.de - * + * The Class PermissionMappingManager. */ @Component public class PermissionMappingManager { @@ -33,9 +31,10 @@ public class PermissionMappingManager { private QPermissionMapping qPermissionMapping = QPermissionMapping.permissionMapping; /** - * - * @param item - * @return + * Gets the all by item. + * + * @param item the item + * @return the all by item */ public List getAllByItem(Integer item) { return Lists.newArrayList( @@ -43,9 +42,10 @@ public class PermissionMappingManager { } /** - * - * @param name - * @return + * Gets the all by name. + * + * @param name the name + * @return the all by name */ public List getAllByName(String name) { return Lists.newArrayList( @@ -53,19 +53,21 @@ public class PermissionMappingManager { } /** - * - * @param item - * @return + * Exists. + * + * @param item the item + * @return true, if successful */ public boolean exists(Integer item) { return permissionMappingRepository.exists(qPermissionMapping.item.eq(item)); } /** - * - * @param item - * @param name - * @return + * Exists. + * + * @param item the item + * @param name the name + * @return true, if successful */ public boolean exists(Integer item, String name) { return permissionMappingRepository.exists( @@ -73,14 +75,18 @@ public class PermissionMappingManager { } /** - * - * @param item - * @param names - * @param lifetime - * @param lifetimeUnit - * @param addon - * @param product - * @return + * Creates the. + * + * @param item the item + * @param names the names + * @param lifetime the lifetime + * @param lifetimeUnit the lifetime unit + * @param lifetimeRound the lifetime round + * @param addon the addon + * @param product the product + * @param startsQuestion the starts question + * @param expiresQuestion the expires question + * @return the permission mapping */ public PermissionMapping create(Integer item, Set names, Long lifetime, ChronoUnit lifetimeUnit, boolean lifetimeRound, boolean addon, String product, @@ -103,18 +109,19 @@ public class PermissionMappingManager { } /** - * - * @param permissionMapping - * @return + * Update. + * + * @param permissionMapping the permission mapping + * @return the permission mapping */ public PermissionMapping update(PermissionMapping permissionMapping) { return permissionMappingRepository.save(permissionMapping); } /** - * - * @param item - * @param name + * Delete. + * + * @param id the id */ public void delete(Long id) { Assert.isTrue(permissionMappingRepository.existsById(id), @@ -124,12 +131,13 @@ public class PermissionMappingManager { } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { Sort sort = descending ? Sort.by(sortBy).descending() : Sort.by(sortBy).ascending(); diff --git a/core/src/main/java/de/bstly/we/businesslogic/Permissions.java b/core/src/main/java/de/bstly/we/businesslogic/Permissions.java index c1a1853..a7b7941 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/Permissions.java +++ b/core/src/main/java/de/bstly/we/businesslogic/Permissions.java @@ -4,8 +4,7 @@ package de.bstly.we.businesslogic; /** - * @author _bastler@bstly.de - * + * The Interface Permissions. */ public interface Permissions { diff --git a/core/src/main/java/de/bstly/we/businesslogic/PretixItemStatus.java b/core/src/main/java/de/bstly/we/businesslogic/PretixItemStatus.java index 2d838f8..c4eab51 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/PretixItemStatus.java +++ b/core/src/main/java/de/bstly/we/businesslogic/PretixItemStatus.java @@ -4,8 +4,7 @@ package de.bstly.we.businesslogic; /** - * @author _bastler@bstly.de - * + * The Enum PretixItemStatus. */ public enum PretixItemStatus { ERROR, NOT_FOUND, PENDING, PAID, EXPIRED, CANCELED, REDEEMED diff --git a/core/src/main/java/de/bstly/we/businesslogic/PretixManager.java b/core/src/main/java/de/bstly/we/businesslogic/PretixManager.java index 7b56970..631ca5b 100755 --- a/core/src/main/java/de/bstly/we/businesslogic/PretixManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/PretixManager.java @@ -26,9 +26,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; /** - * - * @author _bastler@bstly.de - * + * The Class PretixManager. */ @Component public class PretixManager implements SmartInitializingSingleton { @@ -77,6 +75,9 @@ public class PretixManager implements SmartInitializingSingleton { public static final String SYSTEM_PROPERTY_PRETIX_ORDER_TESTMODE = "pretix.order.testmode"; public static final String SYSTEM_PROPERTY_PRETIX_ORDER_SIMULATE = "pretix.order.simulate"; + /** + * The Enum ITEM_STATUS. + */ public enum ITEM_STATUS { ERROR, NOT_FOUND, PENDING, PAID, EXPIRED, CANCELED, REDEEMED } @@ -90,9 +91,9 @@ public class PretixManager implements SmartInitializingSingleton { private int quotaAddons; protected WebClient webClient; + /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() + * @see org.springframework.beans.factory.SmartInitializingSingleton#afterSingletonsInstantiated() */ @Override public void afterSingletonsInstantiated() { @@ -139,7 +140,7 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * + * Builds the web client. */ public void buildWebClient() { host = systemPropertyManager.get(SYSTEM_PROPERTY_PRETIX_HOST); @@ -156,9 +157,10 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param secret - * @return + * Gets the item status. + * + * @param secret the secret + * @return the item status */ public ITEM_STATUS getItemStatus(String secret) { try { @@ -189,9 +191,10 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param secret - * @return + * Gets the check in item by secret. + * + * @param secret the secret + * @return the check in item by secret */ public JsonObject getCheckInItemBySecret(String secret) { MultiValueMap queryParams = new LinkedMultiValueMap(); @@ -210,9 +213,10 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param code - * @return + * Gets the order. + * + * @param code the code + * @return the order */ public JsonObject getOrder(String code) { return request( @@ -221,9 +225,10 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param secret - * @return + * Gets the order by secret. + * + * @param secret the secret + * @return the order by secret */ public JsonObject getOrderBySecret(String secret) { MultiValueMap queryParams = new LinkedMultiValueMap(); @@ -245,9 +250,10 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param order - * @return + * Creates the order. + * + * @param order the order + * @return the json object */ public JsonObject createOrder(JsonObject order) { return request(String.format("/api/v1/organizers/%s/events/%s/orders/", organizer, event), @@ -255,9 +261,11 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param order - * @return + * Extend order. + * + * @param code the code + * @param expire the expire + * @return the json object */ public JsonObject extendOrder(String code, JsonObject expire) { return request(String.format("/api/v1/organizers/%s/events/%s/orders/%s/extend/", organizer, @@ -265,8 +273,9 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param code + * Send email. + * + * @param code the code */ public void sendEmail(String code) { request(String.format("/api/v1/organizers/%s/events/%s/orders/%s/resend_link/", organizer, @@ -274,9 +283,10 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param secret - * @return + * Gets the last payment date by secret. + * + * @param secret the secret + * @return the last payment date by secret */ public Instant getLastPaymentDateBySecret(String secret) { MultiValueMap queryParams = new LinkedMultiValueMap(); @@ -296,9 +306,10 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param secret - * @return + * Gets the last payment date for order. + * + * @param order the order + * @return the last payment date for order */ public Instant getLastPaymentDateForOrder(String order) { JsonArray paymentResults = request( @@ -324,9 +335,10 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param secret - * @return + * Gets the check in item by item. + * + * @param item the item + * @return the check in item by item */ public JsonObject getCheckInItemByItem(Integer item) { MultiValueMap queryParams = new LinkedMultiValueMap(); @@ -345,9 +357,10 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param secret - * @return + * Redeem item. + * + * @param secret the secret + * @return the json object */ public JsonObject redeemItem(String secret) { if (getItemStatus(secret) == ITEM_STATUS.PAID) { @@ -358,9 +371,10 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param idOrSecret - * @return + * Gets the check in positions. + * + * @param idOrSecret the id or secret + * @return the check in positions */ public JsonObject getCheckInPositions(String idOrSecret) { return request( @@ -370,9 +384,10 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param idOrSecret - * @return + * Redeem. + * + * @param idOrSecret the id or secret + * @return the json object */ public JsonObject redeem(String idOrSecret) { return request(String.format( @@ -381,25 +396,28 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @return + * Creates the registration voucher. + * + * @return the json object */ public JsonObject createRegistrationVoucher() { return createVoucher(quotaRegistration); } /** - * - * @return + * Creates the add on voucher. + * + * @return the json object */ public JsonObject createAddOnVoucher() { return createVoucher(quotaAddons); } /** - * - * @param quotaId - * @return + * Creates the voucher. + * + * @param quotaId the quota id + * @return the json object */ public JsonObject createVoucher(int quotaId) { JsonObject voucher = new JsonObject(); @@ -411,9 +429,10 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param secret - * @return + * Gets the item. + * + * @param item the item + * @return the item */ public JsonObject getItem(Integer item) { return request( @@ -421,6 +440,12 @@ public class PretixManager implements SmartInitializingSingleton { HttpMethod.GET).getAsJsonObject(); } + /** + * Gets the variations. + * + * @param item the item + * @return the variations + */ public JsonArray getVariations(Integer item) { return request(String.format("/api/v1/organizers/%s/events/%s/items/%s/variations/", organizer, event, item), HttpMethod.GET).getAsJsonObject() @@ -428,10 +453,11 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param item - * @param variationId - * @param variation + * Update variation. + * + * @param item the item + * @param variationId the variation id + * @param variation the variation */ public void updateVariation(Integer item, Integer variationId, JsonObject variation) { request(String.format("/api/v1/organizers/%s/events/%s/items/%s/variations/%s/", organizer, @@ -439,9 +465,10 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param item - * @param variation + * Delete variation. + * + * @param item the item + * @param variation the variation */ public void deleteVariation(Integer item, Integer variation) { request(String.format("/api/v1/organizers/%s/events/%s/items/%s/variations/%s/", organizer, @@ -449,8 +476,9 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param item + * Delete variations. + * + * @param item the item */ public void deleteVariations(Integer item) { for (JsonElement variationElement : getVariations(item)) { @@ -460,21 +488,23 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param path - * @param method - * @return + * Request. + * + * @param path the path + * @param method the method + * @return the json element */ public JsonElement request(String path, HttpMethod method) { return request(path, method, null, new LinkedMultiValueMap()); } /** - * - * @param path - * @param method - * @param queryParameters - * @return + * Request. + * + * @param path the path + * @param method the method + * @param queryParameters the query parameters + * @return the json element */ public JsonElement request(String path, HttpMethod method, MultiValueMap queryParameters) { @@ -482,23 +512,25 @@ public class PretixManager implements SmartInitializingSingleton { } /** - * - * @param path - * @param method - * @param queryParameters - * @return + * Request. + * + * @param path the path + * @param method the method + * @param payload the payload + * @return the json element */ public JsonElement request(String path, HttpMethod method, JsonElement payload) { return request(path, method, payload, new LinkedMultiValueMap()); } /** - * - * @param path - * @param payload - * @param method - * @param queryParameters - * @return + * Request. + * + * @param path the path + * @param method the method + * @param payload the payload + * @param queryParameters the query parameters + * @return the json element */ public JsonElement request(String path, HttpMethod method, JsonElement payload, MultiValueMap queryParameters) { @@ -519,6 +551,8 @@ public class PretixManager implements SmartInitializingSingleton { } /** + * Gets the organizer. + * * @return the organizer */ public String getOrganizer() { @@ -526,6 +560,8 @@ public class PretixManager implements SmartInitializingSingleton { } /** + * Gets the event. + * * @return the event */ public String getEvent() { @@ -533,6 +569,8 @@ public class PretixManager implements SmartInitializingSingleton { } /** + * Gets the checkinlist. + * * @return the checkinlist */ public String getCheckinlist() { diff --git a/core/src/main/java/de/bstly/we/businesslogic/QuotaManager.java b/core/src/main/java/de/bstly/we/businesslogic/QuotaManager.java index c2c566e..b807938 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/QuotaManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/QuotaManager.java @@ -18,9 +18,7 @@ import de.bstly.we.model.UserData; import de.bstly.we.repository.QuotaRepository; /** - * - * @author _bastler@bstly.de - * + * The Class QuotaManager. */ @Component public class QuotaManager implements UserDataProvider { @@ -32,10 +30,11 @@ public class QuotaManager implements UserDataProvider { private QQuota qQuota = QQuota.quota; /** - * - * @param target - * @param name - * @return + * Gets the. + * + * @param target the target + * @param name the name + * @return the quota */ public Quota get(Long target, String name) { if (target != null && name != null) { @@ -46,18 +45,20 @@ public class QuotaManager implements UserDataProvider { } /** - * - * @param name - * @return + * Gets the all by name. + * + * @param name the name + * @return the all by name */ public List getAllByName(String name) { return Lists.newArrayList(quotaRepository.findAll(qQuota.name.eq(name))); } /** - * - * @param target - * @return + * Gets the all by target. + * + * @param target the target + * @return the all by target */ public List getAllByTarget(Long target) { if (target != null) { @@ -67,9 +68,10 @@ public class QuotaManager implements UserDataProvider { } /** - * - * @param target - * @return + * Gets the not expires by target. + * + * @param target the target + * @return the not expires by target */ public List getNotExpiresByTarget(Long target) { if (target != null) { @@ -80,10 +82,11 @@ public class QuotaManager implements UserDataProvider { } /** - * - * @param target - * @param name - * @return + * Checks for quota. + * + * @param target the target + * @param name the name + * @return true, if successful */ public boolean hasQuota(Long target, String name) { return target != null && quotaRepository @@ -91,13 +94,14 @@ public class QuotaManager implements UserDataProvider { } /** - * - * @param target - * @param name - * @param addon - * @param value - * @param unit - * @return + * Creates the. + * + * @param target the target + * @param name the name + * @param value the value + * @param unit the unit + * @param disposable the disposable + * @return the quota */ public Quota create(Long target, String name, long value, String unit, boolean disposable) { Quota newQuota = new Quota(); @@ -111,9 +115,10 @@ public class QuotaManager implements UserDataProvider { } /** - * - * @param quota - * @return + * Update. + * + * @param quota the quota + * @return the quota */ public Quota update(Quota quota) { Assert.isTrue( @@ -131,10 +136,12 @@ public class QuotaManager implements UserDataProvider { } /** - * - * @param name - * @param clone - * @return + * Clone. + * + * @param name the name + * @param clone the clone + * @param value the value + * @return the list */ public List clone(String name, String clone, long value) { List quotas = Lists.newArrayList(); @@ -151,9 +158,10 @@ public class QuotaManager implements UserDataProvider { } /** - * - * @param target - * @param name + * Delete. + * + * @param target the target + * @param name the name */ public void delete(Long target, String name) { Assert.isTrue(quotaRepository.exists(qQuota.target.eq(target).and(qQuota.name.eq(name))), @@ -164,25 +172,28 @@ public class QuotaManager implements UserDataProvider { } /** - * - * @param target + * Delete all. + * + * @param target the target */ public void deleteAll(Long target) { quotaRepository.deleteAll(quotaRepository.findAll(qQuota.target.eq(target))); } /** - * - * @param name + * Delete all. + * + * @param name the name */ public void deleteAll(String name) { quotaRepository.deleteAll(quotaRepository.findAll(qQuota.name.eq(name))); } /** - * - * @param target - * @param item + * Apply item. + * + * @param target the target + * @param item the item */ public void applyItem(Long target, Integer item) { for (QuotaMapping quotaMapping : quotaMappingManager.getAllByItem(item)) { diff --git a/core/src/main/java/de/bstly/we/businesslogic/QuotaMappingManager.java b/core/src/main/java/de/bstly/we/businesslogic/QuotaMappingManager.java index ea01998..f21b754 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/QuotaMappingManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/QuotaMappingManager.java @@ -20,9 +20,7 @@ import de.bstly.we.model.QuotaMapping; import de.bstly.we.repository.QuotaMappingRepository; /** - * - * @author _bastler@bstly.de - * + * The Class QuotaMappingManager. */ @Component public class QuotaMappingManager { @@ -32,9 +30,10 @@ public class QuotaMappingManager { private QQuotaMapping qQuotaMapping = QQuotaMapping.quotaMapping; /** - * - * @param item - * @return + * Gets the all by item. + * + * @param item the item + * @return the all by item */ public List getAllByItem(Integer item) { return Lists @@ -42,19 +41,21 @@ public class QuotaMappingManager { } /** - * - * @param item - * @return + * Exists. + * + * @param item the item + * @return true, if successful */ public boolean exists(Integer item) { return quotaMappingRepository.exists(qQuotaMapping.items.contains(item)); } /** - * - * @param item - * @param name - * @return + * Exists. + * + * @param item the item + * @param name the name + * @return true, if successful */ public boolean exists(Integer item, String name) { return quotaMappingRepository @@ -62,11 +63,16 @@ public class QuotaMappingManager { } /** - * - * @param item - * @param quota - * @param lifetime - * @return + * Creates the. + * + * @param items the items + * @param name the name + * @param value the value + * @param unit the unit + * @param append the append + * @param products the products + * @param disposable the disposable + * @return the quota mapping */ public QuotaMapping create(Set items, String name, long value, String unit, boolean append, Set products, boolean disposable) { @@ -86,9 +92,10 @@ public class QuotaMappingManager { } /** - * - * @param quotaMapping - * @return + * Update. + * + * @param quotaMapping the quota mapping + * @return the quota mapping */ public QuotaMapping update(QuotaMapping quotaMapping) { Assert.isTrue( @@ -108,9 +115,9 @@ public class QuotaMappingManager { } /** - * - * @param item - * @param name + * Delete. + * + * @param id the id */ public void delete(Long id) { Assert.isTrue(quotaMappingRepository.existsById(id), @@ -119,12 +126,13 @@ public class QuotaMappingManager { } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { Sort sort = descending ? Sort.by(sortBy).descending() : Sort.by(sortBy).ascending(); diff --git a/core/src/main/java/de/bstly/we/businesslogic/Quotas.java b/core/src/main/java/de/bstly/we/businesslogic/Quotas.java index 1b76356..b7a3ead 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/Quotas.java +++ b/core/src/main/java/de/bstly/we/businesslogic/Quotas.java @@ -4,12 +4,10 @@ package de.bstly.we.businesslogic; /** - * @author _bastler@bstly.de - * + * The Interface Quotas. */ public interface Quotas { - public static final String REGISTRATION_VOUCHERS = "registration_vouchers"; public static final String ALIAS_CREATION = "alias_creation"; } diff --git a/core/src/main/java/de/bstly/we/businesslogic/Setup.java b/core/src/main/java/de/bstly/we/businesslogic/Setup.java index f5a0385..3fc8415 100755 --- a/core/src/main/java/de/bstly/we/businesslogic/Setup.java +++ b/core/src/main/java/de/bstly/we/businesslogic/Setup.java @@ -29,9 +29,7 @@ import de.bstly.we.model.User; import de.bstly.we.model.UserStatus; /** - * - * @author _bastler@bstly.de - * + * The Class Setup. */ @Component public class Setup implements SmartInitializingSingleton { @@ -54,9 +52,9 @@ public class Setup implements SmartInitializingSingleton { private Logger logger = LoggerFactory.getLogger(Setup.class); + /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() + * @see org.springframework.beans.factory.SmartInitializingSingleton#afterSingletonsInstantiated() */ @Override public void afterSingletonsInstantiated() { diff --git a/core/src/main/java/de/bstly/we/businesslogic/SystemProfileFieldManager.java b/core/src/main/java/de/bstly/we/businesslogic/SystemProfileFieldManager.java index bcdb3cb..6544992 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/SystemProfileFieldManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/SystemProfileFieldManager.java @@ -13,8 +13,7 @@ import de.bstly.we.model.SystemProfileField; import de.bstly.we.repository.SystemProfileFieldRepository; /** - * @author _bastler@bstly.de - * + * The Class SystemProfileFieldManager. */ @Component public class SystemProfileFieldManager { @@ -23,30 +22,33 @@ public class SystemProfileFieldManager { private SystemProfileFieldRepository systemProfileFieldRepository; /** - * - * @param systemProfileField - * @return + * Save. + * + * @param systemProfileField the system profile field + * @return the system profile field */ public SystemProfileField save(SystemProfileField systemProfileField) { return systemProfileFieldRepository.save(systemProfileField); } /** - * - * @param name - * @return + * Gets the. + * + * @param name the name + * @return the system profile field */ public SystemProfileField get(String name) { return systemProfileFieldRepository.findById(name).orElse(null); } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { Sort sort = descending ? Sort.by(sortBy).descending() : Sort.by(sortBy).ascending(); @@ -54,8 +56,9 @@ public class SystemProfileFieldManager { } /** - * - * @param name + * Delete. + * + * @param name the name */ public void delete(String name) { systemProfileFieldRepository.deleteById(name); diff --git a/core/src/main/java/de/bstly/we/businesslogic/SystemPropertyManager.java b/core/src/main/java/de/bstly/we/businesslogic/SystemPropertyManager.java index 2b0f319..0efb4ff 100755 --- a/core/src/main/java/de/bstly/we/businesslogic/SystemPropertyManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/SystemPropertyManager.java @@ -11,9 +11,7 @@ import de.bstly.we.model.SystemProperty; import de.bstly.we.repository.SystemPropertyRepository; /** - * - * @author _bastler@bstly.de - * + * The Class SystemPropertyManager. */ @Component public class SystemPropertyManager { @@ -22,94 +20,104 @@ public class SystemPropertyManager { private SystemPropertyRepository systemPropertyRepository; /** - * - * @param key - * @return + * Checks for. + * + * @param key the key + * @return true, if successful */ public boolean has(String key) { return systemPropertyRepository.existsById(key); } /** - * - * @param key - * @return + * Gets the. + * + * @param key the key + * @return the string */ public String get(String key) { return systemPropertyRepository.findById(key).orElse(new SystemProperty()).getValue(); } /** - * - * @param key - * @param defaultValue - * @return + * Gets the. + * + * @param key the key + * @param defaultValue the default value + * @return the string */ public String get(String key, String defaultValue) { return systemPropertyRepository.findById(key).orElse(new SystemProperty(key, defaultValue)).getValue(); } /** - * - * @param key - * @return + * Gets the boolean. + * + * @param key the key + * @return the boolean */ public boolean getBoolean(String key) { return getBoolean(key, false); } /** - * - * @param key - * @param defaultValue - * @return + * Gets the boolean. + * + * @param key the key + * @param defaultValue the default value + * @return the boolean */ public boolean getBoolean(String key, boolean defaultValue) { return Boolean.valueOf(get(key, String.valueOf(defaultValue))); } /** - * - * @param key - * @return + * Gets the integer. + * + * @param key the key + * @return the integer */ public int getInteger(String key) { return getInteger(key, 0); } /** - * - * @param key - * @param defaultValue - * @return + * Gets the integer. + * + * @param key the key + * @param defaultValue the default value + * @return the integer */ public int getInteger(String key, int defaultValue) { return Integer.valueOf(get(key, String.valueOf(defaultValue))); } /** - * - * @param key - * @return + * Gets the long. + * + * @param key the key + * @return the long */ public long getLong(String key) { return getLong(key, 0L); } /** - * - * @param key - * @param defaultValue - * @return + * Gets the long. + * + * @param key the key + * @param defaultValue the default value + * @return the long */ public long getLong(String key, long defaultValue) { return Long.valueOf(get(key, String.valueOf(defaultValue))); } /** - * - * @param key - * @param value + * Adds the. + * + * @param key the key + * @param value the value */ public void add(String key, String value) { Assert.isTrue(!systemPropertyRepository.existsById(key), @@ -118,9 +126,10 @@ public class SystemPropertyManager { } /** - * - * @param key - * @param value + * Update. + * + * @param key the key + * @param value the value */ public void update(String key, String value) { Assert.isTrue(systemPropertyRepository.existsById(key), diff --git a/core/src/main/java/de/bstly/we/businesslogic/UserAliasManager.java b/core/src/main/java/de/bstly/we/businesslogic/UserAliasManager.java index bab0c57..bdfed30 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/UserAliasManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/UserAliasManager.java @@ -20,8 +20,7 @@ import de.bstly.we.model.UserData; import de.bstly.we.repository.UserAliasRepository; /** - * @author _bastler@bstly.de - * + * The Class UserAliasManager. */ @Component public class UserAliasManager implements UserDataProvider { @@ -33,18 +32,20 @@ public class UserAliasManager implements UserDataProvider { private QUserAlias qUserAlias = QUserAlias.userAlias; /** - * - * @param id - * @return + * Gets the. + * + * @param id the id + * @return the user alias */ public UserAlias get(Long id) { return userAliasRepository.findById(id).orElse(null); } /** - * - * @param userAlias - * @return + * Save. + * + * @param userAlias the user alias + * @return the user alias */ public UserAlias save(UserAlias userAlias) { Assert.notNull(userAlias.getAlias(), "No alias defined!"); @@ -54,26 +55,29 @@ public class UserAliasManager implements UserDataProvider { } /** - * - * @param alias - * @return + * Gets the by alias. + * + * @param alias the alias + * @return the by alias */ public UserAlias getByAlias(String alias) { return userAliasRepository.findOne(qUserAlias.alias.eq(alias)).orElse(null); } /** - * - * @param userId - * @return + * Gets the all by target. + * + * @param userId the user id + * @return the all by target */ public List getAllByTarget(Long userId) { return Lists.newArrayList(userAliasRepository.findAll(qUserAlias.target.eq(userId))); } /** - * - * @param id + * Delete. + * + * @param id the id */ public void delete(Long id) { UserAlias userAlias = get(id); @@ -83,12 +87,13 @@ public class UserAliasManager implements UserDataProvider { } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { Sort sort = descending ? Sort.by(sortBy).descending() : Sort.by(sortBy).ascending(); diff --git a/core/src/main/java/de/bstly/we/businesslogic/UserDataManager.java b/core/src/main/java/de/bstly/we/businesslogic/UserDataManager.java index 218fdf8..377cc13 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/UserDataManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/UserDataManager.java @@ -32,8 +32,7 @@ import de.bstly.we.model.UserStatus; import de.bstly.we.repository.UserRepository; /** - * @author _bastler@bstly.de - * + * The Class UserDataManager. */ @Component public class UserDataManager implements SmartInitializingSingleton { @@ -61,9 +60,9 @@ public class UserDataManager implements SmartInitializingSingleton { private List providers; private Gson gson = new Gson(); + /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() + * @see org.springframework.beans.factory.SmartInitializingSingleton#afterSingletonsInstantiated() */ @Override public void afterSingletonsInstantiated() { @@ -75,7 +74,7 @@ public class UserDataManager implements SmartInitializingSingleton { } /** - * + * Purge. */ @Scheduled(cron = "${we.bstly.userdata.cron:0 0 0 * * * }") public void purge() { @@ -114,8 +113,10 @@ public class UserDataManager implements SmartInitializingSingleton { } /** - * - * @param username + * Purge. + * + * @param user the user + * @param dry the dry */ public void purge(User user, boolean dry) { Long userId = user.getId(); @@ -161,9 +162,10 @@ public class UserDataManager implements SmartInitializingSingleton { } /** - * - * @param userId - * @return + * Gets the. + * + * @param userId the user id + * @return the map */ public Map> get(Long userId) { Map> userData = Maps.newHashMap(); diff --git a/core/src/main/java/de/bstly/we/businesslogic/UserDataProvider.java b/core/src/main/java/de/bstly/we/businesslogic/UserDataProvider.java index 1a5a462..967b1c6 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/UserDataProvider.java +++ b/core/src/main/java/de/bstly/we/businesslogic/UserDataProvider.java @@ -8,28 +8,29 @@ import java.util.List; import de.bstly.we.model.UserData; /** - * @author _bastler@bstly.de - * + * The Interface UserDataProvider. */ public interface UserDataProvider { /** - * - * @return + * Gets the id. + * + * @return the id */ String getId(); /** - * - * @param userId - * @return + * Gets the user data. + * + * @param userId the user id + * @return the user data */ List getUserData(Long userId); /** - * - * @param userId - * @return + * Purge user data. + * + * @param userId the user id */ void purgeUserData(Long userId); diff --git a/core/src/main/java/de/bstly/we/businesslogic/UserDomainManager.java b/core/src/main/java/de/bstly/we/businesslogic/UserDomainManager.java index b0758b9..50b0f80 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/UserDomainManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/UserDomainManager.java @@ -30,8 +30,7 @@ import de.bstly.we.model.UserDomain; import de.bstly.we.repository.UserDomainRepository; /** - * @author _bastler@bstly.de - * + * The Class UserDomainManager. */ @Component public class UserDomainManager implements UserDataProvider { @@ -47,7 +46,7 @@ public class UserDomainManager implements UserDataProvider { private InitialDirContext dirContext; /** - * + * Instantiates a new user domain manager. */ public UserDomainManager() { Hashtable env = new Hashtable(); @@ -63,18 +62,20 @@ public class UserDomainManager implements UserDataProvider { } /** - * - * @param id - * @return + * Gets the. + * + * @param id the id + * @return the user domain */ public UserDomain get(Long id) { return userDomainRepository.findById(id).orElse(null); } /** - * - * @param userDomain - * @return + * Save. + * + * @param userDomain the user domain + * @return the user domain */ public UserDomain save(UserDomain userDomain) { Assert.notNull(userDomain.getDomain(), "No domain defined!"); @@ -84,26 +85,29 @@ public class UserDomainManager implements UserDataProvider { } /** - * - * @param domain - * @return + * Gets the by domain. + * + * @param domain the domain + * @return the by domain */ public UserDomain getByDomain(String domain) { return userDomainRepository.findOne(qUserDomain.domain.eq(domain)).orElse(null); } /** - * - * @param userId - * @return + * Gets the all by target. + * + * @param userId the user id + * @return the all by target */ public List getAllByTarget(Long userId) { return Lists.newArrayList(userDomainRepository.findAll(qUserDomain.target.eq(userId))); } /** - * - * @param id + * Delete. + * + * @param id the id */ public void delete(Long id) { UserDomain userDomain = get(id); @@ -113,12 +117,13 @@ public class UserDomainManager implements UserDataProvider { } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { Sort sort = descending ? Sort.by(sortBy).descending() : Sort.by(sortBy).ascending(); @@ -126,7 +131,7 @@ public class UserDomainManager implements UserDataProvider { } /** - * + * Validate. */ @Scheduled(cron = "0 */15 * * * *") public void validate() { @@ -149,9 +154,11 @@ public class UserDomainManager implements UserDataProvider { } /** - * - * @param userDomain - * @throws NamingException + * Validate. + * + * @param userDomain the user domain + * @return true, if successful + * @throws NamingException the naming exception */ public boolean validate(UserDomain userDomain) throws NamingException { Attributes attributes = dirContext.getAttributes("_bstly." + userDomain.getDomain(), diff --git a/core/src/main/java/de/bstly/we/businesslogic/UserManager.java b/core/src/main/java/de/bstly/we/businesslogic/UserManager.java index ab92bcb..aec80ae 100755 --- a/core/src/main/java/de/bstly/we/businesslogic/UserManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/UserManager.java @@ -37,9 +37,7 @@ import de.bstly.we.model.UserStatus; import de.bstly.we.repository.UserRepository; /** - * - * @author _bastler@bstly.de - * + * The Class UserManager. */ @Component public class UserManager implements UserDataProvider { @@ -63,34 +61,40 @@ public class UserManager implements UserDataProvider { private String userEmailDomain; /** - * @param id - * @return + * Gets the. + * + * @param id the id + * @return the user */ public User get(Long id) { return userRepository.findById(id).orElse(null); } /** - * - * @param username - * @return + * Gets the by username. + * + * @param username the username + * @return the by username */ public User getByUsername(String username) { return userRepository.findOne(qUser.username.equalsIgnoreCase(username)).orElse(null); } /** - * - * @param resetToken - * @return + * Gets the by reset token. + * + * @param resetToken the reset token + * @return the by reset token */ public User getByResetToken(String resetToken) { return userRepository.findOne(qUser.resetToken.eq(resetToken)).orElse(null); } /** - * @param id - * @return + * Gets the password hash. + * + * @param id the id + * @return the password hash */ public String getPasswordHash(Long id) { Assert.isTrue(userRepository.existsById(id), "User with id '" + id + "' not exists!"); @@ -98,9 +102,11 @@ public class UserManager implements UserDataProvider { } /** - * - * @param id - * @param passwordHash + * Sets the password. + * + * @param id the id + * @param password the password + * @return the user */ public User setPassword(Long id, String password) { Assert.isTrue(userRepository.existsById(id), "User with id '" + id + "' not exists!"); @@ -110,12 +116,12 @@ public class UserManager implements UserDataProvider { } /** - * - * @param username - * @param email - * @param password - * @param publicKey - * @return + * Creates the. + * + * @param username the username + * @param password the password + * @param status the status + * @return the user */ public User create(String username, String password, UserStatus status) { Assert.isTrue(!userRepository.exists(qUser.username.equalsIgnoreCase(username)), @@ -134,12 +140,13 @@ public class UserManager implements UserDataProvider { } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { Sort sort = descending ? Sort.by(sortBy).descending() : Sort.by(sortBy).ascending(); @@ -147,8 +154,10 @@ public class UserManager implements UserDataProvider { } /** - * @param user - * @return + * Update. + * + * @param user the user + * @return the user */ public User update(User user) { Assert.isTrue(userRepository.existsById(user.getId()), @@ -168,8 +177,9 @@ public class UserManager implements UserDataProvider { } /** - * - * @param user + * Delete. + * + * @param user the user */ public void delete(User user) { Assert.isTrue(userRepository.existsById(user.getId()), @@ -186,18 +196,20 @@ public class UserManager implements UserDataProvider { } /** - * - * @param username - * @return + * Gets the bstly email. + * + * @param username the username + * @return the bstly email */ public String getBstlyEmail(String username) { return username + "@" + userEmailDomain; } /** - * - * @param username - * @param publicKey + * Write public key. + * + * @param username the username + * @param publicKey the public key */ public void writePublicKey(String username, String publicKey) { if (StringUtils.hasText(publicKey)) { @@ -225,17 +237,20 @@ public class UserManager implements UserDataProvider { } /** - * - * @param username - * @return + * Gets the public key path. + * + * @param username the username + * @return the public key path */ public String getPublicKeyPath(String username) { return userDataDirectory + username + File.separator + "public.key"; } /** - * @param user - * @param outputStream + * Password reset. + * + * @param user the user + * @param outputStream the output stream */ public void passwordReset(User user, ServletOutputStream outputStream) { String resetToken = RandomStringUtils.random(64, true, true); @@ -278,8 +293,9 @@ public class UserManager implements UserDataProvider { } /** - * - * @param user + * Delete sessions for user. + * + * @param user the user */ protected void deleteSessionsForUser(User user) { Map usersSessions = sessionRepository diff --git a/core/src/main/java/de/bstly/we/businesslogic/UserProfileFieldManager.java b/core/src/main/java/de/bstly/we/businesslogic/UserProfileFieldManager.java index 3503be4..02fc2e4 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/UserProfileFieldManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/UserProfileFieldManager.java @@ -19,8 +19,7 @@ import de.bstly.we.model.Visibility; import de.bstly.we.repository.UserProfileFieldRepository; /** - * @author _bastler@bstly.de - * + * The Class UserProfileFieldManager. */ @Component public class UserProfileFieldManager implements UserDataProvider { @@ -30,10 +29,11 @@ public class UserProfileFieldManager implements UserDataProvider { private QUserProfileField qUserProfileField = QUserProfileField.userProfileField; /** - * - * @param target - * @param name - * @return + * Gets the. + * + * @param target the target + * @param name the name + * @return the user profile field */ public UserProfileField get(Long target, String name) { return userProfileFieldRepository @@ -42,9 +42,10 @@ public class UserProfileFieldManager implements UserDataProvider { } /** - * - * @param target - * @return + * Gets the all by target. + * + * @param target the target + * @return the all by target */ public List getAllByTarget(Long target) { return Lists.newArrayList(userProfileFieldRepository.findAll( @@ -52,9 +53,11 @@ public class UserProfileFieldManager implements UserDataProvider { } /** - * - * @param target - * @return + * Gets the by target filtered. + * + * @param target the target + * @param names the names + * @return the by target filtered */ public List getByTargetFiltered(Long target, List names) { return Lists.newArrayList(userProfileFieldRepository.findAll( @@ -63,10 +66,11 @@ public class UserProfileFieldManager implements UserDataProvider { } /** - * - * @param target - * @param visibilities - * @return + * Gets the all by target and visibilities. + * + * @param target the target + * @param visibilities the visibilities + * @return the all by target and visibilities */ public List getAllByTargetAndVisibilities(Long target, List visibilities) { @@ -77,18 +81,20 @@ public class UserProfileFieldManager implements UserDataProvider { } /** - * - * @param userProfileField - * @return + * Save. + * + * @param userProfileField the user profile field + * @return the user profile field */ public UserProfileField save(UserProfileField userProfileField) { return userProfileFieldRepository.save(userProfileField); } /** - * - * @param target - * @param name + * Delete. + * + * @param target the target + * @param name the name */ public void delete(Long target, String name) { Assert.isTrue( @@ -102,8 +108,9 @@ public class UserProfileFieldManager implements UserDataProvider { } /** - * - * @param target + * Delete all. + * + * @param target the target */ public void deleteAll(Long target) { userProfileFieldRepository diff --git a/core/src/main/java/de/bstly/we/businesslogic/UserProfileFields.java b/core/src/main/java/de/bstly/we/businesslogic/UserProfileFields.java index 99a0da1..3ad3e54 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/UserProfileFields.java +++ b/core/src/main/java/de/bstly/we/businesslogic/UserProfileFields.java @@ -4,8 +4,7 @@ package de.bstly.we.businesslogic; /** - * @author _bastler@bstly.de - * + * The Interface UserProfileFields. */ public interface UserProfileFields { diff --git a/core/src/main/java/de/bstly/we/businesslogic/UserTotpManager.java b/core/src/main/java/de/bstly/we/businesslogic/UserTotpManager.java index 7e987e0..c1fd743 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/UserTotpManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/UserTotpManager.java @@ -23,8 +23,7 @@ import dev.samstevens.totp.recovery.RecoveryCodeGenerator; import dev.samstevens.totp.secret.SecretGenerator; /** - * @author _bastler@bstly.de - * + * The Class UserTotpManager. */ @Component public class UserTotpManager implements SecondFactorProvider { @@ -51,21 +50,18 @@ public class UserTotpManager implements SecondFactorProvider { return "totp"; } + /* - * @see - * de.bstly.we.security.businesslogic.SecondFactorProvider#supports(java.lang. - * String) + * @see de.bstly.we.security.businesslogic.SecondFactorProvider#supports(java.lang.String) */ @Override public boolean supports(String provider) { return getId().equals(provider); } + /* - * - * @see - * de.bstly.we.security.businesslogic.SecondFactorProvider#isEnabled(java.lang. - * Long) + * @see de.bstly.we.security.businesslogic.SecondFactorProvider#isEnabled(java.lang.Long) */ @Override public boolean isEnabled(Long userId) { @@ -74,10 +70,7 @@ public class UserTotpManager implements SecondFactorProvider { } /* - * - * @see - * de.bstly.we.security.businesslogic.SecondFactorProvider#validate(java.lang. - * Long, java.lang.String) + * @see de.bstly.we.security.businesslogic.SecondFactorProvider#validate(java.lang.Long, java.lang.String) */ @Override public boolean validate(Long userId, String code) { @@ -90,20 +83,18 @@ public class UserTotpManager implements SecondFactorProvider { return false; } + /* - * @see - * de.bstly.we.security.businesslogic.SecondFactorProvider#getForUser(java.lang. - * Long) + * @see de.bstly.we.security.businesslogic.SecondFactorProvider#get(java.lang.Long) */ @Override public UserTotp get(Long userId) { return userTotpRepository.findOne(qUserTotp.target.eq(userId)).orElse(null); } + /* - * @see - * de.bstly.we.security.businesslogic.SecondFactorProvider#createByUser(java. - * lang.Long) + * @see de.bstly.we.security.businesslogic.SecondFactorProvider#create(java.lang.Long) */ @Override public UserTotp create(Long userId) { @@ -123,10 +114,9 @@ public class UserTotpManager implements SecondFactorProvider { return userTotpRepository.findOne(qUserTotp.target.eq(userId)).orElse(null); } + /* - * @see - * de.bstly.we.security.businesslogic.SecondFactorProvider#enableByUser(java. - * lang.Long, java.lang.String) + * @see de.bstly.we.security.businesslogic.SecondFactorProvider#enable(java.lang.Long, java.lang.String) */ @Override public boolean enable(Long userId, String code) { @@ -140,10 +130,9 @@ public class UserTotpManager implements SecondFactorProvider { return false; } + /* - * @see - * de.bstly.we.security.businesslogic.SecondFactorProvider#deleteByUser(java. - * lang.Long) + * @see de.bstly.we.security.businesslogic.SecondFactorProvider#delete(java.lang.Long) */ @Override public void delete(Long userId) { diff --git a/core/src/main/java/de/bstly/we/businesslogic/VoucherMappingManager.java b/core/src/main/java/de/bstly/we/businesslogic/VoucherMappingManager.java new file mode 100644 index 0000000..06e970a --- /dev/null +++ b/core/src/main/java/de/bstly/we/businesslogic/VoucherMappingManager.java @@ -0,0 +1,161 @@ +/** + * + */ +package de.bstly.we.businesslogic; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Component; +import org.springframework.util.Assert; +import org.springframework.util.StringUtils; + +import com.beust.jcommander.internal.Lists; + +import de.bstly.we.model.QVoucherMapping; +import de.bstly.we.model.Quota; +import de.bstly.we.model.VoucherMapping; +import de.bstly.we.repository.VoucherMappingRepository; + +/** + * The Class VoucherMappingManager. + */ +@Component +public class VoucherMappingManager { + + @Autowired + private VoucherMappingRepository voucherMappingRepository; + @Autowired + private QuotaManager quotaManager; + @Autowired + private PermissionManager permissionManager; + @Autowired + private PretixManager pretixManager; + private QVoucherMapping qVocherMapping = QVoucherMapping.voucherMapping; + + /** + * Exists. + * + * @param name the name + * @return true, if successful + */ + public boolean exists(String name) { + return voucherMappingRepository.exists(qVocherMapping.name.eq(name)); + } + + /** + * Gets the. + * + * @param name the name + * @return the voucher mapping + */ + public VoucherMapping get(String name) { + return voucherMappingRepository.findOne(qVocherMapping.name.eq(name)).orElse(null); + } + + /** + * Creates the. + * + * @param name the name + * @param voucher the voucher + * @param quota the quota + * @param isFree the is free + * @return the voucher mapping + */ + public VoucherMapping create(String name, int voucher, String quota, boolean isFree) { + Assert.isTrue(!exists(name), "QuotaMapping for voucher '" + + voucher + + "' with '" + + name + + "' already exists!"); + + VoucherMapping voucherMapping = new VoucherMapping(); + voucherMapping.setName(name); + voucherMapping.setVoucher(voucher); + voucherMapping.setQuota(quota); + voucherMapping.setFree(isFree); + return voucherMappingRepository.save(voucherMapping); + } + + /** + * Update. + * + * @param voucherMapping the voucher mapping + * @return the voucher mapping + */ + public VoucherMapping update(VoucherMapping voucherMapping) { + Assert.isTrue( + voucherMapping.getId() != null + && voucherMappingRepository.existsById(voucherMapping.getId()), + "VoucherMapping '" + + voucherMapping.getId() + + "' does not exists!"); + + return voucherMappingRepository.save(voucherMapping); + } + + /** + * Delete. + * + * @param id the id + */ + public void delete(Long id) { + Assert.isTrue(voucherMappingRepository.existsById(id), "VoucherMapping '" + + id + + "' does not exists!"); + voucherMappingRepository.deleteById(id); + } + + /** + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page + */ + public Page get(int page, int size, String sortBy, boolean descending) { + Sort sort = descending ? Sort.by(sortBy).descending() : Sort.by(sortBy).ascending(); + return voucherMappingRepository.findAll(PageRequest.of(page, size, sort)); + } + + /** + * Gets the for user. + * + * @param userId the user id + * @return the for user + */ + public List getForUser(Long userId) { + List voucherMappings = Lists.newArrayList(); + if (permissionManager.isFullUser(userId)) { + for (VoucherMapping voucherMapping : voucherMappingRepository.findAll()) { + if (voucherMapping.isFree()) { + voucherMappings.add(voucherMapping); + } else if (StringUtils.hasText(voucherMapping.getQuota())) { + Quota quota = quotaManager.get(userId, voucherMapping.getQuota()); + if (quota != null && quota.getValue() >= 1) { + + voucherMappings.add(voucherMapping); + } + } + } + } + + return voucherMappings; + } + + /** + * Creates the voucher. + * + * @param voucher the voucher + * @return the string + */ + public String createVoucher(int voucher) { + return pretixManager.createVoucher(voucher).get("code").getAsString(); + } + +} diff --git a/core/src/main/java/de/bstly/we/businesslogic/support/AbstractModelEventListener.java b/core/src/main/java/de/bstly/we/businesslogic/support/AbstractModelEventListener.java index 4b165c9..65d35d9 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/support/AbstractModelEventListener.java +++ b/core/src/main/java/de/bstly/we/businesslogic/support/AbstractModelEventListener.java @@ -20,8 +20,15 @@ import de.bstly.we.event.AbstractModelEventType; import de.bstly.we.model.AbstractModel; /** - * @author Lurkars + * The listener interface for receiving abstractModelEvent events. + * The class that is interested in processing a abstractModelEvent + * event implements this interface, and the object created + * with that class is registered with a component using the + * component's addAbstractModelEventListener method. When + * the abstractModelEvent event occurs, that object's appropriate + * method is invoked. * + * @see AbstractModelEventEvent */ @Component public class AbstractModelEventListener { @@ -29,36 +36,71 @@ public class AbstractModelEventListener { @Autowired private ApplicationEventPublisher applicationEventPublisher; + /** + * Pre persist. + * + * @param model the model + */ @PrePersist private void prePersist(AbstractModel model) { applicationEventPublisher.publishEvent(new AbstractModelEvent(AbstractModelEventType.PRE_PERSIST, model)); } + /** + * Pre update. + * + * @param model the model + */ @PreUpdate private void preUpdate(AbstractModel model) { applicationEventPublisher.publishEvent(new AbstractModelEvent(AbstractModelEventType.PRE_UPDATE, model)); } + /** + * Pre remove. + * + * @param model the model + */ @PreRemove private void preRemove(AbstractModel model) { applicationEventPublisher.publishEvent(new AbstractModelEvent(AbstractModelEventType.PRE_REMOVE, model)); } + /** + * Post persist. + * + * @param model the model + */ @PostPersist private void postPersist(AbstractModel model) { applicationEventPublisher.publishEvent(new AbstractModelEvent(AbstractModelEventType.POST_PERSIST, model)); } + /** + * Post update. + * + * @param model the model + */ @PostUpdate private void postUpdate(AbstractModel model) { applicationEventPublisher.publishEvent(new AbstractModelEvent(AbstractModelEventType.POST_UPDATE, model)); } + /** + * Post remove. + * + * @param model the model + */ @PostRemove private void postRemove(AbstractModel model) { applicationEventPublisher.publishEvent(new AbstractModelEvent(AbstractModelEventType.POST_REMOVE, model)); } + /** + * Post load. + * + * @param model the model + */ @PostLoad private void postLoad(AbstractModel model) { applicationEventPublisher.publishEvent(new AbstractModelEvent(AbstractModelEventType.POST_LOAD, model)); diff --git a/core/src/main/java/de/bstly/we/businesslogic/support/InstantHelper.java b/core/src/main/java/de/bstly/we/businesslogic/support/InstantHelper.java index 1056b4f..ead9e03 100644 --- a/core/src/main/java/de/bstly/we/businesslogic/support/InstantHelper.java +++ b/core/src/main/java/de/bstly/we/businesslogic/support/InstantHelper.java @@ -12,48 +12,51 @@ import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalUnit; /** - * @author _bastler@bstly.de - * + * The Class InstantHelper. */ public class InstantHelper { /** - * - * @param instant - * @param amount - * @return + * Plus. + * + * @param instant the instant + * @param amount the amount + * @return the instant */ public static Instant plus(Instant instant, TemporalAmount amount) { return ZonedDateTime.ofInstant(instant, ZoneOffset.UTC).plus(amount).toInstant(); } /** - * - * @param instant - * @param amountToAdd - * @param unit - * @return + * Plus. + * + * @param instant the instant + * @param amountToAdd the amount to add + * @param unit the unit + * @return the instant */ public static Instant plus(Instant instant, long amountToAdd, TemporalUnit unit) { return ZonedDateTime.ofInstant(instant, ZoneOffset.UTC).plus(amountToAdd, unit).toInstant(); } /** - * - * @param instant - * @param amount - * @return + * Minus. + * + * @param instant the instant + * @param amount the amount + * @return the instant */ public static Instant minus(Instant instant, TemporalAmount amount) { return ZonedDateTime.ofInstant(instant, ZoneOffset.UTC).minus(amount).toInstant(); } /** - * - * @param instant - * @param amountToAdd - * @param unit - * @return + * Minus. + * + * @param instant the instant + * @param amountToAdd the amount to add + * @param unit the unit + * @return the instant */ public static Instant minus(Instant instant, long amountToAdd, TemporalUnit unit) { return ZonedDateTime.ofInstant(instant, ZoneOffset.UTC).minus(amountToAdd, unit) @@ -61,10 +64,11 @@ public class InstantHelper { } /** - * - * @param instant - * @param unit - * @return + * Truncate. + * + * @param instant the instant + * @param unit the unit + * @return the instant */ public static Instant truncate(Instant instant, TemporalUnit unit) { if (ChronoUnit.YEARS.equals(unit)) { diff --git a/core/src/main/java/de/bstly/we/controller/Authentication2FAController.java b/core/src/main/java/de/bstly/we/controller/Authentication2FAController.java index fefa0a0..7476c42 100644 --- a/core/src/main/java/de/bstly/we/controller/Authentication2FAController.java +++ b/core/src/main/java/de/bstly/we/controller/Authentication2FAController.java @@ -31,9 +31,7 @@ import de.bstly.we.security.businesslogic.SecondFactorRequestProvider; import de.bstly.we.security.model.LocalUserDetails; /** - * - * @author _bastler@bstly.de - * + * The Class Authentication2FAController. */ @RestController @RequestMapping("/auth/2fa") @@ -43,8 +41,9 @@ public class Authentication2FAController extends BaseController { private SecondFactorProviderManager secondFactorProviderManager; /** - * - * @return + * Gets the pre authentication id. + * + * @return the pre authentication id */ protected Long getPreAuthenticationId() { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); @@ -56,8 +55,9 @@ public class Authentication2FAController extends BaseController { } /** - * - * @return + * Gets the enabled. + * + * @return the enabled */ @GetMapping public List getEnabled() { @@ -77,8 +77,9 @@ public class Authentication2FAController extends BaseController { } /** - * - * @return + * Gets the available. + * + * @return the available */ @GetMapping("/available") public List getAvailable() { @@ -103,8 +104,9 @@ public class Authentication2FAController extends BaseController { } /** - * - * @return + * Checks if is second factor enabled. + * + * @param providerId the provider id */ @PreAuthorize("authentication.authenticated") @GetMapping("/{id}") @@ -121,7 +123,9 @@ public class Authentication2FAController extends BaseController { } /** - * + * Request second factor mail. + * + * @param providerId the provider id */ @PreAuthorize("hasRole('ROLE_PRE_AUTH_USER')") @PostMapping("/{id}") @@ -146,8 +150,10 @@ public class Authentication2FAController extends BaseController { } /** - * - * @return + * Creates the second factor. + * + * @param providerId the provider id + * @return the second factor */ @PreAuthorize("authentication.authenticated") @PutMapping("/{id}") @@ -166,8 +172,10 @@ public class Authentication2FAController extends BaseController { } /** - * - * @return + * Enable second factor. + * + * @param providerId the provider id + * @param token the token */ @PreAuthorize("authentication.authenticated") @PatchMapping("/{id}") @@ -185,7 +193,9 @@ public class Authentication2FAController extends BaseController { } /** - * + * Removes the second factor mail. + * + * @param providerId the provider id */ @PreAuthorize("authentication.authenticated") @DeleteMapping("/{id}") diff --git a/core/src/main/java/de/bstly/we/controller/AuthenticationController.java b/core/src/main/java/de/bstly/we/controller/AuthenticationController.java index 38d3ced..525ff3e 100755 --- a/core/src/main/java/de/bstly/we/controller/AuthenticationController.java +++ b/core/src/main/java/de/bstly/we/controller/AuthenticationController.java @@ -30,9 +30,7 @@ import de.bstly.we.controller.validation.PasswordModelValidator; import de.bstly.we.model.User; /** - * - * @author _bastler@bstly.de - * + * The Class AuthenticationController. */ @RestController @RequestMapping("/auth") @@ -44,8 +42,9 @@ public class AuthenticationController extends BaseController { private PasswordModelValidator passwordModelValidator; /** - * - * @return + * Me. + * + * @return the authentication */ @GetMapping("/me") public Authentication me() { @@ -54,11 +53,12 @@ public class AuthenticationController extends BaseController { } /** - * - * @param username - * @param req - * @param resp - * @throws IOException + * Password request. + * + * @param username the username + * @param req the req + * @param resp the resp + * @throws IOException Signals that an I/O exception has occurred. */ @PreAuthorize("isAnonymous()") @PostMapping("/password/request") @@ -75,10 +75,11 @@ public class AuthenticationController extends BaseController { } /** - * - * @param passwordResetModel - * @param req - * @param resp + * Password reset. + * + * @param passwordResetModel the password reset model + * @param req the req + * @param resp the resp */ @PreAuthorize("isAnonymous()") @PostMapping("/password/reset") diff --git a/core/src/main/java/de/bstly/we/controller/BaseController.java b/core/src/main/java/de/bstly/we/controller/BaseController.java index c96f506..f79e918 100755 --- a/core/src/main/java/de/bstly/we/controller/BaseController.java +++ b/core/src/main/java/de/bstly/we/controller/BaseController.java @@ -9,15 +9,14 @@ import org.springframework.security.core.context.SecurityContextHolder; import de.bstly.we.security.model.LocalUserDetails; /** - * - * @author _bastler@bstly.de - * + * The Class BaseController. */ public class BaseController { /** - * - * @return + * Gets the current user id. + * + * @return the current user id */ public Long getCurrentUserId() { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); diff --git a/core/src/main/java/de/bstly/we/controller/ItemController.java b/core/src/main/java/de/bstly/we/controller/ItemController.java index 71d5db4..3320cf5 100755 --- a/core/src/main/java/de/bstly/we/controller/ItemController.java +++ b/core/src/main/java/de/bstly/we/controller/ItemController.java @@ -34,9 +34,7 @@ import de.bstly.we.controller.support.TokenSessionManager; import de.bstly.we.model.User; /** - * - * @author _bastler@bstly.de - * + * The Class ItemController. */ @RestController @RequestMapping("/items") @@ -50,7 +48,10 @@ public class ItemController extends BaseController { private UserManager userManager; /** - * + * Gets the items. + * + * @param session the session + * @return the items */ @GetMapping public Set getItems(HttpSession session) { @@ -77,8 +78,10 @@ public class ItemController extends BaseController { } /** - * - * @param secret + * Adds the item. + * + * @param secret the secret + * @param session the session */ @PutMapping("") public void addItem(@RequestBody String secret, HttpSession session) { @@ -94,8 +97,10 @@ public class ItemController extends BaseController { } /** - * - * @param secret + * Removes the item. + * + * @param secret the secret + * @param session the session */ @DeleteMapping public void removeItem(@RequestBody String secret, HttpSession session) { @@ -103,8 +108,10 @@ public class ItemController extends BaseController { } /** - * - * @return + * Redeem. + * + * @param session the session + * @return the item result model */ @PreAuthorize("isAuthenticated()") @PostMapping @@ -121,9 +128,10 @@ public class ItemController extends BaseController { } /** - * - * @param username - * @param session + * Redeem for user. + * + * @param username the username + * @param session the session */ @PreAuthorize("isAuthenticated()") @PostMapping("/{username}") diff --git a/core/src/main/java/de/bstly/we/controller/PermissionController.java b/core/src/main/java/de/bstly/we/controller/PermissionController.java index 1bbd261..e112715 100644 --- a/core/src/main/java/de/bstly/we/controller/PermissionController.java +++ b/core/src/main/java/de/bstly/we/controller/PermissionController.java @@ -19,9 +19,7 @@ import de.bstly.we.controller.support.TokenSessionManager; import de.bstly.we.model.Permission; /** - * - * @author _bastler@bstly.de - * + * The Class PermissionController. */ @RestController @RequestMapping("/permissions") @@ -33,8 +31,9 @@ public class PermissionController extends BaseController { private TokenSessionManager tokenSessionManager; /** - * - * @return + * Gets the permissions. + * + * @return the permissions */ @GetMapping public List getPermissions() { @@ -46,8 +45,10 @@ public class PermissionController extends BaseController { } /** - * - * @return + * Gets the new permissions. + * + * @param session the session + * @return the new permissions */ @GetMapping("/new") public List getNewPermissions(HttpSession session) { @@ -66,8 +67,9 @@ public class PermissionController extends BaseController { } /** - * - * @return + * Gets the all permissions. + * + * @return the all permissions */ @GetMapping("/all") public List getAllPermissions() { diff --git a/core/src/main/java/de/bstly/we/controller/PermissionManagementController.java b/core/src/main/java/de/bstly/we/controller/PermissionManagementController.java index 25a9959..6223f45 100644 --- a/core/src/main/java/de/bstly/we/controller/PermissionManagementController.java +++ b/core/src/main/java/de/bstly/we/controller/PermissionManagementController.java @@ -24,9 +24,7 @@ import de.bstly.we.model.Permission; import de.bstly.we.model.User; /** - * - * @author _bastler@bstly.de - * + * The Class PermissionManagementController. */ @RestController @RequestMapping("/permissions/manage") @@ -38,9 +36,10 @@ public class PermissionManagementController extends BaseController { private UserManager userManager; /** - * - * @param username - * @return + * Gets the permissions for user. + * + * @param username the username + * @return the permissions for user */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/{username}") @@ -55,9 +54,10 @@ public class PermissionManagementController extends BaseController { } /** - * - * @param username - * @return + * Gets the all permissions for user. + * + * @param username the username + * @return the all permissions for user */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/{username}/all") @@ -72,9 +72,10 @@ public class PermissionManagementController extends BaseController { } /** - * - * @param permission - * @return + * Creates the permission. + * + * @param permission the permission + * @return the permission */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -84,9 +85,10 @@ public class PermissionManagementController extends BaseController { } /** - * - * @param permission - * @return + * Update permission. + * + * @param permission the permission + * @return the permission */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PatchMapping @@ -99,10 +101,11 @@ public class PermissionManagementController extends BaseController { } /** - * - * @param name - * @param clone - * @return + * Clone. + * + * @param name the name + * @param clone the clone + * @return the list */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/{name}/clone/{clone}") @@ -116,8 +119,9 @@ public class PermissionManagementController extends BaseController { } /** - * - * @param permission + * Delete permission. + * + * @param permission the permission */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping @@ -131,8 +135,9 @@ public class PermissionManagementController extends BaseController { } /** - * - * @param target + * Delete all. + * + * @param target the target */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/{target}") @@ -141,8 +146,9 @@ public class PermissionManagementController extends BaseController { } /** - * - * @param name + * Delete all by name. + * + * @param name the name */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/byname/{name}") diff --git a/core/src/main/java/de/bstly/we/controller/PermissionMappingController.java b/core/src/main/java/de/bstly/we/controller/PermissionMappingController.java index 6dcd116..741403d 100644 --- a/core/src/main/java/de/bstly/we/controller/PermissionMappingController.java +++ b/core/src/main/java/de/bstly/we/controller/PermissionMappingController.java @@ -29,9 +29,7 @@ import de.bstly.we.controller.validation.PermissionMappingValidator; import de.bstly.we.model.PermissionMapping; /** - * - * @author _bastler@bstly.de - * + * The Class PermissionMappingController. */ @RestController @RequestMapping("/permissions/mappings") @@ -43,10 +41,11 @@ public class PermissionMappingController extends BaseController { private PermissionMappingValidator permissionMappingValidator; /** - * - * @param pageParameter - * @param sizeParameter - * @return + * Gets the permission mappings. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @return the permission mappings */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -57,9 +56,10 @@ public class PermissionMappingController extends BaseController { } /** - * - * @param permissionMapping - * @return + * Creates the. + * + * @param permissionMapping the permission mapping + * @return the permission mapping */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -78,9 +78,10 @@ public class PermissionMappingController extends BaseController { } /** - * - * @param permissionMappings - * @return + * Creates the list. + * + * @param permissionMappings the permission mappings + * @return the list */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/list") @@ -104,9 +105,10 @@ public class PermissionMappingController extends BaseController { } /** - * - * @param permissionMapping - * @return + * Update. + * + * @param permissionMapping the permission mapping + * @return the permission mapping */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PatchMapping @@ -120,9 +122,10 @@ public class PermissionMappingController extends BaseController { } /** - * - * @param permissionMappings - * @return + * Update list. + * + * @param permissionMappings the permission mappings + * @return the list */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PatchMapping("/list") @@ -141,8 +144,9 @@ public class PermissionMappingController extends BaseController { } /** - * - * @param permissionMapping + * Delete. + * + * @param permissionMapping the permission mapping */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping diff --git a/core/src/main/java/de/bstly/we/controller/PretixApiController.java b/core/src/main/java/de/bstly/we/controller/PretixApiController.java index da85c16..8f92ae8 100755 --- a/core/src/main/java/de/bstly/we/controller/PretixApiController.java +++ b/core/src/main/java/de/bstly/we/controller/PretixApiController.java @@ -27,9 +27,7 @@ import de.bstly.we.controller.model.PretixRequest; import de.bstly.we.controller.support.EntityResponseStatusException; /** - * - * @author _bastler@bstly.de - * + * The Class PretixApiController. */ @RestController @RequestMapping("/pretix") @@ -40,11 +38,12 @@ public class PretixApiController extends BaseController { private Gson gson = new Gson(); /** - * - * @param pretixRequest - * @return - * @throws IOException - * @throws JsonIOException + * Debug. + * + * @param pretixRequest the pretix request + * @param response the response + * @throws JsonIOException the json IO exception + * @throws IOException Signals that an I/O exception has occurred. */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/debug") diff --git a/core/src/main/java/de/bstly/we/controller/QuotaController.java b/core/src/main/java/de/bstly/we/controller/QuotaController.java index 5ef7968..85c1b96 100644 --- a/core/src/main/java/de/bstly/we/controller/QuotaController.java +++ b/core/src/main/java/de/bstly/we/controller/QuotaController.java @@ -20,9 +20,7 @@ import de.bstly.we.model.Quota; import de.bstly.we.model.QuotaMapping; /** - * - * @author _bastler@bstly.de - * + * The Class QuotaController. */ @RestController @RequestMapping("/quotas") @@ -34,8 +32,9 @@ public class QuotaController extends BaseController { private TokenSessionManager tokenSessionManager; /** - * - * @return + * Gets the quotas. + * + * @return the quotas */ @GetMapping public List getQuotas() { @@ -47,8 +46,10 @@ public class QuotaController extends BaseController { } /** - * - * @return + * Gets the new quotas. + * + * @param session the session + * @return the new quotas */ @GetMapping("/new") public List getNewQuotas(HttpSession session) { @@ -99,8 +100,9 @@ public class QuotaController extends BaseController { } /** - * - * @return + * Gets the all quotas. + * + * @return the all quotas */ @GetMapping("/all") public List getAllQuotas() { diff --git a/core/src/main/java/de/bstly/we/controller/QuotaManagementController.java b/core/src/main/java/de/bstly/we/controller/QuotaManagementController.java index 8b18a40..3f522b6 100644 --- a/core/src/main/java/de/bstly/we/controller/QuotaManagementController.java +++ b/core/src/main/java/de/bstly/we/controller/QuotaManagementController.java @@ -26,9 +26,7 @@ import de.bstly.we.model.Quota; import de.bstly.we.model.User; /** - * - * @author _bastler@bstly.de - * + * The Class QuotaManagementController. */ @RestController @RequestMapping("/quotas/manage") @@ -40,9 +38,10 @@ public class QuotaManagementController extends BaseController { private UserManager userManager; /** - * - * @param username - * @return + * Gets the quotas for user. + * + * @param username the username + * @return the quotas for user */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/{username}") @@ -57,9 +56,10 @@ public class QuotaManagementController extends BaseController { } /** - * - * @param username - * @return + * Gets the all quotas for user. + * + * @param username the username + * @return the all quotas for user */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/{username}/all") @@ -74,9 +74,10 @@ public class QuotaManagementController extends BaseController { } /** - * - * @param name - * @return + * Gets the quotas by name. + * + * @param name the name + * @return the quotas by name */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/byname/{name}") @@ -85,9 +86,10 @@ public class QuotaManagementController extends BaseController { } /** - * - * @param quota - * @return + * Creates the quota. + * + * @param quota the quota + * @return the quota */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -101,9 +103,10 @@ public class QuotaManagementController extends BaseController { } /** - * - * @param quota - * @return + * Update quota. + * + * @param quota the quota + * @return the quota */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PatchMapping @@ -116,9 +119,10 @@ public class QuotaManagementController extends BaseController { } /** - * - * @param quotas - * @return + * Update quota list. + * + * @param quotas the quotas + * @return the list */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PatchMapping("/list") @@ -137,10 +141,12 @@ public class QuotaManagementController extends BaseController { } /** - * - * @param name - * @param clone - * @return + * Clone. + * + * @param name the name + * @param clone the clone + * @param value the value + * @return the list */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/{name}/clone/{clone}") @@ -154,8 +160,9 @@ public class QuotaManagementController extends BaseController { } /** - * - * @param quota + * Delete quota. + * + * @param quota the quota */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping @@ -168,8 +175,9 @@ public class QuotaManagementController extends BaseController { } /** - * - * @param target + * Delete all. + * + * @param target the target */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/{target}") @@ -178,8 +186,9 @@ public class QuotaManagementController extends BaseController { } /** - * - * @param name + * Delete all by name. + * + * @param name the name */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/byname/{name}") diff --git a/core/src/main/java/de/bstly/we/controller/QuotaMappingController.java b/core/src/main/java/de/bstly/we/controller/QuotaMappingController.java index 3e7bde0..aa19e92 100644 --- a/core/src/main/java/de/bstly/we/controller/QuotaMappingController.java +++ b/core/src/main/java/de/bstly/we/controller/QuotaMappingController.java @@ -29,9 +29,7 @@ import de.bstly.we.controller.validation.QuotaMappingValidator; import de.bstly.we.model.QuotaMapping; /** - * - * @author _bastler@bstly.de - * + * The Class QuotaMappingController. */ @RestController @RequestMapping("/quotas/mappings") @@ -43,10 +41,11 @@ public class QuotaMappingController extends BaseController { private QuotaMappingValidator quotaMappingValidator; /** - * - * @param pageParameter - * @param sizeParameter - * @return + * Gets the quota mappings. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @return the quota mappings */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -58,9 +57,10 @@ public class QuotaMappingController extends BaseController { } /** - * - * @param userModel - * @return + * Creates the. + * + * @param quotaMapping the quota mapping + * @return the quota mapping */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -80,9 +80,10 @@ public class QuotaMappingController extends BaseController { } /** - * - * @param userModel - * @return + * Creates the list. + * + * @param quotaMappings the quota mappings + * @return the list */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/list") @@ -106,9 +107,10 @@ public class QuotaMappingController extends BaseController { } /** - * - * @param userModel - * @return + * Update. + * + * @param quotaMapping the quota mapping + * @return the quota mapping */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PatchMapping @@ -124,9 +126,9 @@ public class QuotaMappingController extends BaseController { } /** - * - * @param userModel - * @return + * Delete. + * + * @param quotaMapping the quota mapping */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping diff --git a/core/src/main/java/de/bstly/we/controller/SystemController.java b/core/src/main/java/de/bstly/we/controller/SystemController.java index 793c5e8..12761ab 100644 --- a/core/src/main/java/de/bstly/we/controller/SystemController.java +++ b/core/src/main/java/de/bstly/we/controller/SystemController.java @@ -26,9 +26,7 @@ import de.bstly.we.model.SystemProperty; import de.bstly.we.repository.SystemPropertyRepository; /** - * - * @author _bastler@bstly.de - * + * The Class SystemController. */ @RestController @RequestMapping("/system") @@ -40,7 +38,7 @@ public class SystemController extends BaseController { private PretixManager pretixManager; /** - * + * Update pretix client. */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/pretix") @@ -49,10 +47,11 @@ public class SystemController extends BaseController { } /** - * - * @param pageParameter - * @param sizeParameter - * @return + * Gets the properties. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @return the properties */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/properties") @@ -65,9 +64,10 @@ public class SystemController extends BaseController { } /** - * - * @param key - * @return + * Gets the property. + * + * @param key the key + * @return the property */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/properties/{key}") @@ -80,9 +80,10 @@ public class SystemController extends BaseController { } /** - * - * @param systemProperty - * @return + * Creates the or update. + * + * @param systemProperty the system property + * @return the system property */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/properties") @@ -91,9 +92,9 @@ public class SystemController extends BaseController { } /** - * - * @param key - * @return + * Delete property. + * + * @param key the key */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/properties/{key}") diff --git a/core/src/main/java/de/bstly/we/controller/SystemProfileFieldController.java b/core/src/main/java/de/bstly/we/controller/SystemProfileFieldController.java index 34f16d1..20e9b11 100644 --- a/core/src/main/java/de/bstly/we/controller/SystemProfileFieldController.java +++ b/core/src/main/java/de/bstly/we/controller/SystemProfileFieldController.java @@ -26,8 +26,7 @@ import de.bstly.we.controller.support.EntityResponseStatusException; import de.bstly.we.model.SystemProfileField; /** - * @author _bastler@bstly.de - * + * The Class SystemProfileFieldController. */ @RestController @RequestMapping("/profiles/system") @@ -37,10 +36,11 @@ public class SystemProfileFieldController extends BaseController { private SystemProfileFieldManager systemProfileFieldManager; /** - * - * @param pageParameter - * @param sizeParameter - * @return + * Gets the. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @return the page */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -51,9 +51,10 @@ public class SystemProfileFieldController extends BaseController { } /** - * - * @param name - * @return + * Gets the by name. + * + * @param name the name + * @return the by name */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/{name}") @@ -68,9 +69,10 @@ public class SystemProfileFieldController extends BaseController { } /** - * - * @param systemProfileField - * @return + * Update. + * + * @param systemProfileField the system profile field + * @return the system profile field */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -79,9 +81,10 @@ public class SystemProfileFieldController extends BaseController { } /** - * - * @param systemProfileField - * @return + * Update list. + * + * @param systemProfileFields the system profile fields + * @return the list */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/list") @@ -97,8 +100,9 @@ public class SystemProfileFieldController extends BaseController { } /** - * - * @param name + * Delete by name. + * + * @param name the name */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/{name}") diff --git a/core/src/main/java/de/bstly/we/controller/UserAliasController.java b/core/src/main/java/de/bstly/we/controller/UserAliasController.java index f151a9a..07916c0 100644 --- a/core/src/main/java/de/bstly/we/controller/UserAliasController.java +++ b/core/src/main/java/de/bstly/we/controller/UserAliasController.java @@ -29,8 +29,7 @@ import de.bstly.we.model.Quota; import de.bstly.we.model.UserAlias; /** - * @author _bastler@bstly.de - * + * The Class UserAliasController. */ @RestController @RequestMapping("/users/aliases") @@ -46,9 +45,10 @@ public class UserAliasController extends BaseController { private PermissionManager permissionManager; /** - * - * @param alias - * @return + * Creates the alias. + * + * @param userAlias the user alias + * @return the user alias */ @PreAuthorize("isAuthenticated()") @PostMapping @@ -78,9 +78,10 @@ public class UserAliasController extends BaseController { } /** - * - * @param alias - * @return + * Update alias. + * + * @param userAlias the user alias + * @return the user alias */ @PreAuthorize("isAuthenticated()") @PatchMapping @@ -105,8 +106,9 @@ public class UserAliasController extends BaseController { } /** - * - * @return + * Gets the aliases. + * + * @return the aliases */ @PreAuthorize("isAuthenticated()") @GetMapping @@ -115,8 +117,9 @@ public class UserAliasController extends BaseController { } /** - * - * @param id + * Delete alias. + * + * @param id the id */ @PreAuthorize("isAuthenticated()") @DeleteMapping("/{id}") diff --git a/core/src/main/java/de/bstly/we/controller/UserAliasManagementController.java b/core/src/main/java/de/bstly/we/controller/UserAliasManagementController.java index 3bc4d99..2efd72a 100644 --- a/core/src/main/java/de/bstly/we/controller/UserAliasManagementController.java +++ b/core/src/main/java/de/bstly/we/controller/UserAliasManagementController.java @@ -29,8 +29,7 @@ import de.bstly.we.model.User; import de.bstly.we.model.UserAlias; /** - * @author _bastler@bstly.de - * + * The Class UserAliasManagementController. */ @RestController @RequestMapping("/users/aliases/manage") @@ -44,8 +43,11 @@ public class UserAliasManagementController extends BaseController { private UserAliasValidator userAliasValidator; /** - * - * @return + * Gets the aliases. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @return the aliases */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -55,8 +57,10 @@ public class UserAliasManagementController extends BaseController { } /** - * - * @return + * Gets the aliases for user. + * + * @param username the username + * @return the aliases for user */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/{username}") @@ -71,9 +75,10 @@ public class UserAliasManagementController extends BaseController { } /** - * - * @param alias - * @return + * Creates the or update alias. + * + * @param userAlias the user alias + * @return the user alias */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -89,8 +94,9 @@ public class UserAliasManagementController extends BaseController { } /** - * - * @param id + * Delete alias. + * + * @param id the id */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/{id}") diff --git a/core/src/main/java/de/bstly/we/controller/UserController.java b/core/src/main/java/de/bstly/we/controller/UserController.java index 0a5a903..0ad42d8 100755 --- a/core/src/main/java/de/bstly/we/controller/UserController.java +++ b/core/src/main/java/de/bstly/we/controller/UserController.java @@ -43,9 +43,7 @@ import de.bstly.we.model.Visibility; import de.bstly.we.model.UserStatus; /** - * - * @author _bastler@bstly.de - * + * The Class UserController. */ @RestController @RequestMapping("/users") @@ -73,8 +71,9 @@ public class UserController extends BaseController { private PasswordEncoder passwordEncoder; /** - * - * @return + * Gets the. + * + * @return the user model */ @PreAuthorize("isAuthenticated()") @GetMapping @@ -87,10 +86,11 @@ public class UserController extends BaseController { } /** - * - * @param userModel - * @param session - * @return + * Check model. + * + * @param userModel the user model + * @param session the session + * @return the user model */ @PostMapping("/model") public UserModel checkModel(@RequestBody UserModel userModel, HttpSession session) { @@ -105,10 +105,11 @@ public class UserController extends BaseController { } /** - * - * @param userModel - * @param session - * @return + * Register. + * + * @param userModel the user model + * @param session the session + * @return the user model */ @PreAuthorize("isAnonymous()") @PostMapping @@ -197,8 +198,9 @@ public class UserController extends BaseController { } /** - * - * @param passwordModel + * Change password. + * + * @param passwordModel the password model */ @PreAuthorize("isAuthenticated()") @PatchMapping("/password") @@ -223,8 +225,9 @@ public class UserController extends BaseController { } /** - * - * @param userModel + * Update. + * + * @param userModel the user model */ @PreAuthorize("isAuthenticated()") @PatchMapping diff --git a/core/src/main/java/de/bstly/we/controller/UserDomainController.java b/core/src/main/java/de/bstly/we/controller/UserDomainController.java index 539fa2c..45d6cb8 100644 --- a/core/src/main/java/de/bstly/we/controller/UserDomainController.java +++ b/core/src/main/java/de/bstly/we/controller/UserDomainController.java @@ -28,8 +28,7 @@ import de.bstly.we.model.UserDomain; import de.bstly.we.model.Visibility; /** - * @author _bastler@bstly.de - * + * The Class UserDomainController. */ @RestController @RequestMapping("/users/domains") @@ -43,9 +42,10 @@ public class UserDomainController extends BaseController { private PermissionManager permissionManager; /** - * - * @param userDomain - * @return + * Creates the domain. + * + * @param userDomain the user domain + * @return the user domain */ @PreAuthorize("isAuthenticated()") @PostMapping @@ -75,9 +75,10 @@ public class UserDomainController extends BaseController { } /** - * - * @param userDomain - * @return + * Update domain. + * + * @param userDomain the user domain + * @return the user domain */ @PreAuthorize("isAuthenticated()") @PatchMapping @@ -102,8 +103,9 @@ public class UserDomainController extends BaseController { } /** - * - * @return + * Gets the domains. + * + * @return the domains */ @PreAuthorize("isAuthenticated()") @GetMapping @@ -112,8 +114,9 @@ public class UserDomainController extends BaseController { } /** - * - * @param id + * Delete domain. + * + * @param id the id */ @PreAuthorize("isAuthenticated()") @DeleteMapping("/{id}") diff --git a/core/src/main/java/de/bstly/we/controller/UserDomainManagementController.java b/core/src/main/java/de/bstly/we/controller/UserDomainManagementController.java index 7c6256f..591c9f7 100644 --- a/core/src/main/java/de/bstly/we/controller/UserDomainManagementController.java +++ b/core/src/main/java/de/bstly/we/controller/UserDomainManagementController.java @@ -33,8 +33,7 @@ import de.bstly.we.model.UserDomain; import de.bstly.we.model.Visibility; /** - * @author _bastler@bstly.de - * + * The Class UserDomainManagementController. */ @RestController @RequestMapping("/users/domains/manage") @@ -48,8 +47,11 @@ public class UserDomainManagementController extends BaseController { private UserDomainValidator userDomainValidator; /** - * - * @return + * Gets the domains. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @return the domains */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -59,8 +61,10 @@ public class UserDomainManagementController extends BaseController { } /** - * - * @return + * Gets the domains for user. + * + * @param username the username + * @return the domains for user */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/{username}") @@ -75,9 +79,10 @@ public class UserDomainManagementController extends BaseController { } /** - * - * @param alias - * @return + * Creates the or update domain. + * + * @param userDomain the user domain + * @return the user domain */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -103,8 +108,9 @@ public class UserDomainManagementController extends BaseController { } /** - * - * @param id + * Delete domain. + * + * @param id the id */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/{id}") @@ -117,8 +123,9 @@ public class UserDomainManagementController extends BaseController { } /** - * - * @param id + * Validate. + * + * @param id the id */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/validate/{id}") diff --git a/core/src/main/java/de/bstly/we/controller/UserManagementController.java b/core/src/main/java/de/bstly/we/controller/UserManagementController.java index 6a76848..dbb7928 100644 --- a/core/src/main/java/de/bstly/we/controller/UserManagementController.java +++ b/core/src/main/java/de/bstly/we/controller/UserManagementController.java @@ -46,9 +46,7 @@ import de.bstly.we.model.UserStatus; import de.bstly.we.model.Visibility; /** - * - * @author _bastler@bstly.de - * + * The Class UserManagementController. */ @RestController @RequestMapping("/users/manage") @@ -72,10 +70,11 @@ public class UserManagementController extends BaseController { private UserDataManager userDataManager; /** - * - * @param pageParameter - * @param sizeParameter - * @return + * Gets the users. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @return the users */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -85,9 +84,10 @@ public class UserManagementController extends BaseController { } /** - * - * @param username - * @return + * Gets the user by username. + * + * @param username the username + * @return the user by username */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/{username}") @@ -102,9 +102,10 @@ public class UserManagementController extends BaseController { } /** - * - * @param userModel - * @return + * Creates the. + * + * @param userModel the user model + * @return the user */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -180,9 +181,10 @@ public class UserManagementController extends BaseController { } /** - * - * @param user - * @return + * Update. + * + * @param user the user + * @return the user */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PatchMapping @@ -191,8 +193,9 @@ public class UserManagementController extends BaseController { } /** - * - * @param username + * Delete user by username. + * + * @param username the username */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/{username}") @@ -207,7 +210,10 @@ public class UserManagementController extends BaseController { } /** - * + * Purge. + * + * @param username the username + * @param dry the dry */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/purge") diff --git a/core/src/main/java/de/bstly/we/controller/UserProfileFieldController.java b/core/src/main/java/de/bstly/we/controller/UserProfileFieldController.java index 512c2ad..263e7b4 100644 --- a/core/src/main/java/de/bstly/we/controller/UserProfileFieldController.java +++ b/core/src/main/java/de/bstly/we/controller/UserProfileFieldController.java @@ -37,8 +37,7 @@ import de.bstly.we.model.UserProfileField; import de.bstly.we.model.Visibility; /** - * @author _bastler@bstly.de - * + * The Class UserProfileFieldController. */ @RestController @RequestMapping("/profiles") @@ -56,8 +55,10 @@ public class UserProfileFieldController extends BaseController { private PermissionManager permissionManager; /** - * - * @return + * Gets the. + * + * @param filter the filter + * @return the list */ @PreAuthorize("isAuthenticated()") @GetMapping @@ -71,8 +72,10 @@ public class UserProfileFieldController extends BaseController { } /** - * - * @return + * Gets the field. + * + * @param name the name + * @return the field */ @PreAuthorize("isAuthenticated()") @GetMapping("/field/{name}") @@ -87,8 +90,10 @@ public class UserProfileFieldController extends BaseController { } /** - * - * @return + * Gets the for user. + * + * @param username the username + * @return the for user */ @GetMapping("/{username}") public ProfileModel getForUser(@PathVariable("username") String username) { @@ -170,8 +175,11 @@ public class UserProfileFieldController extends BaseController { } /** - * - * @return + * Gets the field for user. + * + * @param username the username + * @param name the name + * @return the field for user */ @GetMapping("/{username}/field/{name}") public UserProfileField getFieldForUser(@PathVariable("username") String username, @@ -204,9 +212,10 @@ public class UserProfileFieldController extends BaseController { } /** - * - * @param userProfileField - * @return + * Creates the orupdate. + * + * @param userProfileField the user profile field + * @return the user profile field */ @PreAuthorize("isAuthenticated()") @PostMapping @@ -257,8 +266,9 @@ public class UserProfileFieldController extends BaseController { } /** - * - * @param name + * Delete. + * + * @param name the name */ @PreAuthorize("isAuthenticated()") @DeleteMapping("/{name}") @@ -271,7 +281,7 @@ public class UserProfileFieldController extends BaseController { } /** - * + * Throttle forbidden. */ protected void throttleForbidden() { try { diff --git a/core/src/main/java/de/bstly/we/controller/VoucherController.java b/core/src/main/java/de/bstly/we/controller/VoucherController.java index 7551677..17988db 100644 --- a/core/src/main/java/de/bstly/we/controller/VoucherController.java +++ b/core/src/main/java/de/bstly/we/controller/VoucherController.java @@ -3,24 +3,28 @@ */ package de.bstly.we.controller; +import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import com.beust.jcommander.internal.Lists; + import de.bstly.we.businesslogic.PermissionManager; -import de.bstly.we.businesslogic.PretixManager; import de.bstly.we.businesslogic.QuotaManager; -import de.bstly.we.businesslogic.Quotas; +import de.bstly.we.businesslogic.VoucherMappingManager; import de.bstly.we.controller.support.EntityResponseStatusException; import de.bstly.we.model.Quota; +import de.bstly.we.model.VoucherMapping; /** - * - * @author _bastler@bstly.de - * + * The Class VoucherController. */ @RestController @RequestMapping("/vouchers") @@ -29,47 +33,72 @@ public class VoucherController extends BaseController { @Autowired private QuotaManager quotaManager; @Autowired - private PretixManager pretixManager; + private VoucherMappingManager voucherMappingManager; @Autowired private PermissionManager permissionManager; /** - * - * @return + * Available. + * + * @return the list */ @PreAuthorize("isAuthenticated()") - @PostMapping("/registration") - public String getRegistrationVoucher() { - Quota registrationVouchers = quotaManager.get(getCurrentUserId(), - Quotas.REGISTRATION_VOUCHERS); - if (registrationVouchers == null || registrationVouchers.getValue() < 1) { - throw new EntityResponseStatusException(HttpStatus.CONFLICT); - } - + @GetMapping() + public List available() { if (!permissionManager.isFullUser(getCurrentUserId())) { throw new EntityResponseStatusException(HttpStatus.FORBIDDEN); } - - String result = pretixManager.createRegistrationVoucher().get("code").getAsString(); - registrationVouchers.setValue(registrationVouchers.getValue() - 1); - quotaManager.update(registrationVouchers); + List available = Lists.newArrayList(); + + for (VoucherMapping voucherMapping : voucherMappingManager.getForUser(getCurrentUserId())) { + available.add(voucherMapping.getName()); + } + + return available; + } + + /** + * Gets the voucher. + * + * @param name the name + * @return the voucher + */ + @PreAuthorize("isAuthenticated()") + @PostMapping("/{name}") + public String getVoucher(@PathVariable("name") String name) { + if (!permissionManager.isFullUser(getCurrentUserId())) { + throw new EntityResponseStatusException(HttpStatus.FORBIDDEN); + } + + VoucherMapping voucherMapping = voucherMappingManager.get(name); + + if (voucherMapping == null) { + throw new EntityResponseStatusException(HttpStatus.FORBIDDEN); + } + + Quota quota = null; + + if (!voucherMapping.isFree()) { + quota = quotaManager.get(getCurrentUserId(), voucherMapping.getQuota()); + if (quota == null || quota.getValue() < 1) { + throw new EntityResponseStatusException(HttpStatus.CONFLICT); + } + } + + String result = ""; + try { + result = voucherMappingManager.createVoucher(voucherMapping.getVoucher()); + } catch (Exception e) { + throw new EntityResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR); + } + + if (quota != null) { + quota.setValue(quota.getValue() - 1); + quotaManager.update(quota); + } return result; } - /** - * - * @return - */ - @PreAuthorize("isAuthenticated()") - @PostMapping("/addon") - public String getAddonVoucher() { - if (!permissionManager.isFullUser(getCurrentUserId())) { - throw new EntityResponseStatusException(HttpStatus.FORBIDDEN); - } - - return pretixManager.createAddOnVoucher().get("code").getAsString(); - } - } diff --git a/core/src/main/java/de/bstly/we/controller/VoucherMappingController.java b/core/src/main/java/de/bstly/we/controller/VoucherMappingController.java new file mode 100644 index 0000000..36ce9d1 --- /dev/null +++ b/core/src/main/java/de/bstly/we/controller/VoucherMappingController.java @@ -0,0 +1,137 @@ +/** + * + */ +package de.bstly.we.controller; + +import java.util.List; +import java.util.Optional; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.http.HttpStatus; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.Errors; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.google.common.collect.Lists; + +import de.bstly.we.businesslogic.VoucherMappingManager; +import de.bstly.we.controller.support.EntityResponseStatusException; +import de.bstly.we.controller.support.RequestBodyErrors; +import de.bstly.we.controller.validation.VoucherMappingValidator; +import de.bstly.we.model.VoucherMapping; + +/** + * The Class VoucherMappingController. + */ +@RestController +@RequestMapping("/vouchers/mappings") +public class VoucherMappingController extends BaseController { + + @Autowired + private VoucherMappingManager voucherMappingManager; + @Autowired + private VoucherMappingValidator voucherMappingValidator; + + /** + * Gets the voucher mappings. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @return the voucher mappings + */ + @PreAuthorize("hasRole('ROLE_ADMIN')") + @GetMapping + public Page getVoucherMappings( + @RequestParam("page") Optional pageParameter, + @RequestParam("size") Optional sizeParameter) { + return voucherMappingManager.get(pageParameter.orElse(0), sizeParameter.orElse(10), "name", + true); + } + + /** + * Creates the. + * + * @param voucherMapping the voucher mapping + * @return the voucher mapping + */ + @PreAuthorize("hasRole('ROLE_ADMIN')") + @PostMapping + public VoucherMapping create(@RequestBody VoucherMapping voucherMapping) { + + Errors errors = new RequestBodyErrors(voucherMapping); + + voucherMappingValidator.validate(voucherMapping, errors); + + if (errors.hasErrors()) { + throw new EntityResponseStatusException(errors.getAllErrors(), HttpStatus.CONFLICT); + } + + return voucherMappingManager.create(voucherMapping.getName(), voucherMapping.getVoucher(), + voucherMapping.getQuota(), voucherMapping.isFree()); + } + + /** + * Creates the list. + * + * @param voucherMappings the voucher mappings + * @return the list + */ + @PreAuthorize("hasRole('ROLE_ADMIN')") + @PostMapping("/list") + public List createList(@RequestBody List voucherMappings) { + List result = Lists.newArrayList(); + + for (VoucherMapping voucherMapping : voucherMappings) { + Errors errors = new RequestBodyErrors(voucherMapping); + + voucherMappingValidator.validate(voucherMapping, errors); + + if (errors.hasErrors()) { + throw new EntityResponseStatusException(errors.getAllErrors(), HttpStatus.CONFLICT); + } + + result.add(voucherMappingManager.create(voucherMapping.getName(), + voucherMapping.getVoucher(), voucherMapping.getQuota(), + voucherMapping.isFree())); + } + return result; + } + + /** + * Update. + * + * @param voucherMapping the voucher mapping + * @return the voucher mapping + */ + @PreAuthorize("hasRole('ROLE_ADMIN')") + @PatchMapping + public VoucherMapping update(@RequestBody VoucherMapping voucherMapping) { + + Errors errors = new RequestBodyErrors(voucherMapping); + + if (errors.hasErrors()) { + throw new EntityResponseStatusException(errors.getAllErrors(), HttpStatus.CONFLICT); + } + + return voucherMappingManager.update(voucherMapping); + } + + /** + * Delete. + * + * @param voucherMapping the voucher mapping + */ + @PreAuthorize("hasRole('ROLE_ADMIN')") + @DeleteMapping + public void delete(@RequestBody VoucherMapping voucherMapping) { + voucherMappingManager.delete(voucherMapping.getId()); + } +} diff --git a/core/src/main/java/de/bstly/we/controller/debug/MigrationController.java b/core/src/main/java/de/bstly/we/controller/debug/MigrationController.java index 09baff3..b143778 100644 --- a/core/src/main/java/de/bstly/we/controller/debug/MigrationController.java +++ b/core/src/main/java/de/bstly/we/controller/debug/MigrationController.java @@ -22,8 +22,7 @@ import de.bstly.we.model.User; import de.bstly.we.repository.UserRepository; /** - * @author _bastler@bstly.de - * + * The Class MigrationController. */ @RestController @RequestMapping("/migration") @@ -35,7 +34,7 @@ public class MigrationController extends BaseController { private FindByIndexNameSessionRepository sessionRepository; /** - * + * Delete all sessions. */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/sessions") diff --git a/core/src/main/java/de/bstly/we/controller/model/ItemModel.java b/core/src/main/java/de/bstly/we/controller/model/ItemModel.java index fa02541..a57f15d 100644 --- a/core/src/main/java/de/bstly/we/controller/model/ItemModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/ItemModel.java @@ -6,8 +6,7 @@ package de.bstly.we.controller.model; import java.util.Map; /** - * @author _bastler@bstly.de - * + * The Class ItemModel. */ public class ItemModel { @@ -15,6 +14,8 @@ public class ItemModel { private String secret; /** + * Gets the name. + * * @return the name */ public Map getName() { @@ -22,13 +23,17 @@ public class ItemModel { } /** - * @param name the name to set + * Sets the name. + * + * @param name the name */ public void setName(Map name) { this.name = name; } /** + * Gets the secret. + * * @return the secret */ public String getSecret() { @@ -36,7 +41,9 @@ public class ItemModel { } /** - * @param secret the secret to set + * Sets the secret. + * + * @param secret the new secret */ public void setSecret(String secret) { this.secret = secret; diff --git a/core/src/main/java/de/bstly/we/controller/model/ItemResultModel.java b/core/src/main/java/de/bstly/we/controller/model/ItemResultModel.java index 51454e4..5b8cff6 100644 --- a/core/src/main/java/de/bstly/we/controller/model/ItemResultModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/ItemResultModel.java @@ -9,8 +9,7 @@ import de.bstly.we.model.PermissionMapping; import de.bstly.we.model.QuotaMapping; /** - * @author _bastler@bstly.de - * + * The Class ItemResultModel. */ public class ItemResultModel { @@ -18,28 +17,36 @@ public class ItemResultModel { private List quotaMappings; /** - * @return the permissionMappings + * Gets the permission mappings. + * + * @return the permission mappings */ public List getPermissionMappings() { return permissionMappings; } /** - * @param permissionMappings the permissionMappings to set + * Sets the permission mappings. + * + * @param permissionMappings the new permission mappings */ public void setPermissionMappings(List permissionMappings) { this.permissionMappings = permissionMappings; } /** - * @return the quotaMappings + * Gets the quota mappings. + * + * @return the quota mappings */ public List getQuotaMappings() { return quotaMappings; } /** - * @param quotaMappings the quotaMappings to set + * Sets the quota mappings. + * + * @param quotaMappings the new quota mappings */ public void setQuotaMappings(List quotaMappings) { this.quotaMappings = quotaMappings; diff --git a/core/src/main/java/de/bstly/we/controller/model/LoginModel.java b/core/src/main/java/de/bstly/we/controller/model/LoginModel.java index 197a02d..2424de3 100755 --- a/core/src/main/java/de/bstly/we/controller/model/LoginModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/LoginModel.java @@ -4,9 +4,7 @@ package de.bstly.we.controller.model; /** - * - * @author _bastler@bstly.de - * + * The Class LoginModel. */ public class LoginModel { @@ -14,6 +12,8 @@ public class LoginModel { private String password; /** + * Gets the username. + * * @return the username */ public String getUsername() { @@ -21,13 +21,17 @@ public class LoginModel { } /** - * @param username the username to set + * Sets the username. + * + * @param username the new username */ public void setUsername(String username) { this.username = username; } /** + * Gets the password. + * * @return the password */ public String getPassword() { @@ -35,7 +39,9 @@ public class LoginModel { } /** - * @param password the password to set + * Sets the password. + * + * @param password the new password */ public void setPassword(String password) { this.password = password; diff --git a/core/src/main/java/de/bstly/we/controller/model/PagesResult.java b/core/src/main/java/de/bstly/we/controller/model/PagesResult.java index 3546f8d..f471b50 100644 --- a/core/src/main/java/de/bstly/we/controller/model/PagesResult.java +++ b/core/src/main/java/de/bstly/we/controller/model/PagesResult.java @@ -6,8 +6,9 @@ package de.bstly.we.controller.model; import java.util.List; /** - * @author _bastler@bstly.de + * The Class PagesResult. * + * @param the generic type */ public class PagesResult { @@ -18,6 +19,8 @@ public class PagesResult { private int totalPages; /** + * Gets the result. + * * @return the result */ public List getResult() { @@ -25,13 +28,17 @@ public class PagesResult { } /** - * @param result the result to set + * Sets the result. + * + * @param result the new result */ public void setResult(List result) { this.result = result; } /** + * Gets the size. + * * @return the size */ public int getSize() { @@ -39,13 +46,17 @@ public class PagesResult { } /** - * @param size the size to set + * Sets the size. + * + * @param size the new size */ public void setSize(int size) { this.size = size; } /** + * Gets the page. + * * @return the page */ public int getPage() { @@ -53,35 +64,45 @@ public class PagesResult { } /** - * @param page the page to set + * Sets the page. + * + * @param page the new page */ public void setPage(int page) { this.page = page; } /** - * @return the totalElements + * Gets the total elements. + * + * @return the total elements */ public int getTotalElements() { return totalElements; } /** - * @param totalElements the totalElements to set + * Sets the total elements. + * + * @param totalElements the new total elements */ public void setTotalElements(int totalElements) { this.totalElements = totalElements; } /** - * @return the totalPages + * Gets the total pages. + * + * @return the total pages */ public int getTotalPages() { return totalPages; } /** - * @param totalPages the totalPages to set + * Sets the total pages. + * + * @param totalPages the new total pages */ public void setTotalPages(int totalPages) { this.totalPages = totalPages; diff --git a/core/src/main/java/de/bstly/we/controller/model/PasswordModel.java b/core/src/main/java/de/bstly/we/controller/model/PasswordModel.java index b4d43a1..13d6507 100755 --- a/core/src/main/java/de/bstly/we/controller/model/PasswordModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/PasswordModel.java @@ -4,9 +4,7 @@ package de.bstly.we.controller.model; /** - * - * @author _bastler@bstly.de - * + * The Class PasswordModel. */ public class PasswordModel { @@ -15,6 +13,8 @@ public class PasswordModel { private String password2; /** + * Gets the old. + * * @return the old */ public String getOld() { @@ -22,13 +22,17 @@ public class PasswordModel { } /** - * @param old the old to set + * Sets the old. + * + * @param old the new old */ public void setOld(String old) { this.old = old; } /** + * Gets the password. + * * @return the password */ public String getPassword() { @@ -36,21 +40,27 @@ public class PasswordModel { } /** - * @param password the password to set + * Sets the password. + * + * @param password the new password */ public void setPassword(String password) { this.password = password; } /** - * @return the password2 + * Gets the password 2. + * + * @return the password 2 */ public String getPassword2() { return password2; } /** - * @param password2 the password2 to set + * Sets the password 2. + * + * @param password2 the new password 2 */ public void setPassword2(String password2) { this.password2 = password2; diff --git a/core/src/main/java/de/bstly/we/controller/model/PasswordResetModel.java b/core/src/main/java/de/bstly/we/controller/model/PasswordResetModel.java index d218422..9b8b997 100644 --- a/core/src/main/java/de/bstly/we/controller/model/PasswordResetModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/PasswordResetModel.java @@ -4,14 +4,15 @@ package de.bstly.we.controller.model; /** - * @author _bastler@bstly.de - * + * The Class PasswordResetModel. */ public class PasswordResetModel extends PasswordModel { private String token; /** + * Gets the token. + * * @return the token */ public String getToken() { @@ -19,7 +20,9 @@ public class PasswordResetModel extends PasswordModel { } /** - * @param token the token to set + * Sets the token. + * + * @param token the new token */ public void setToken(String token) { this.token = token; diff --git a/core/src/main/java/de/bstly/we/controller/model/PretixRequest.java b/core/src/main/java/de/bstly/we/controller/model/PretixRequest.java index fddb906..6379e63 100644 --- a/core/src/main/java/de/bstly/we/controller/model/PretixRequest.java +++ b/core/src/main/java/de/bstly/we/controller/model/PretixRequest.java @@ -8,9 +8,7 @@ import java.util.Map; import org.springframework.http.HttpMethod; /** - * - * @author _bastler@bstly.de - * + * The Class PretixRequest. */ public class PretixRequest { @@ -20,6 +18,8 @@ public class PretixRequest { private Object payload; /** + * Gets the path. + * * @return the path */ public String getPath() { @@ -27,13 +27,17 @@ public class PretixRequest { } /** - * @param path the path to set + * Sets the path. + * + * @param path the new path */ public void setPath(String path) { this.path = path; } /** + * Gets the method. + * * @return the method */ public HttpMethod getMethod() { @@ -41,27 +45,35 @@ public class PretixRequest { } /** - * @param method the method to set + * Sets the method. + * + * @param method the new method */ public void setMethod(HttpMethod method) { this.method = method; } /** - * @return the queryParameters + * Gets the query parameters. + * + * @return the query parameters */ public Map getQueryParameters() { return queryParameters; } /** - * @param queryParameters the queryParameters to set + * Sets the query parameters. + * + * @param queryParameters the query parameters */ public void setQueryParameters(Map queryParameters) { this.queryParameters = queryParameters; } /** + * Gets the payload. + * * @return the payload */ public Object getPayload() { @@ -69,7 +81,9 @@ public class PretixRequest { } /** - * @param payload the payload to set + * Sets the payload. + * + * @param payload the new payload */ public void setPayload(Object payload) { this.payload = payload; diff --git a/core/src/main/java/de/bstly/we/controller/model/ProfileModel.java b/core/src/main/java/de/bstly/we/controller/model/ProfileModel.java index 2dc9a72..8c6aa43 100644 --- a/core/src/main/java/de/bstly/we/controller/model/ProfileModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/ProfileModel.java @@ -8,8 +8,7 @@ import java.util.List; import de.bstly.we.model.UserProfileField; /** - * @author _bastler@bstly.de - * + * The Class ProfileModel. */ public class ProfileModel { @@ -18,6 +17,8 @@ public class ProfileModel { private List profileFields; /** + * Gets the username. + * * @return the username */ public String getUsername() { @@ -25,13 +26,17 @@ public class ProfileModel { } /** - * @param username the username to set + * Sets the username. + * + * @param username the new username */ public void setUsername(String username) { this.username = username; } /** + * Gets the aliases. + * * @return the aliases */ public List getAliases() { @@ -39,21 +44,27 @@ public class ProfileModel { } /** - * @param aliases the aliases to set + * Sets the aliases. + * + * @param aliases the new aliases */ public void setAliases(List aliases) { this.aliases = aliases; } /** - * @return the profileFields + * Gets the profile fields. + * + * @return the profile fields */ public List getProfileFields() { return profileFields; } /** - * @param profileFields the profileFields to set + * Sets the profile fields. + * + * @param profileFields the new profile fields */ public void setProfileFields(List profileFields) { this.profileFields = profileFields; diff --git a/core/src/main/java/de/bstly/we/controller/model/SecondFactorProviderModel.java b/core/src/main/java/de/bstly/we/controller/model/SecondFactorProviderModel.java index 59f7aa4..005216d 100644 --- a/core/src/main/java/de/bstly/we/controller/model/SecondFactorProviderModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/SecondFactorProviderModel.java @@ -4,8 +4,7 @@ package de.bstly.we.controller.model; /** - * @author _bastler@bstly.de - * + * The Class SecondFactorProviderModel. */ public class SecondFactorProviderModel { @@ -13,8 +12,10 @@ public class SecondFactorProviderModel { private boolean request; /** - * @param provider - * @param request + * Instantiates a new second factor provider model. + * + * @param id the id + * @param request the request */ public SecondFactorProviderModel(String id, boolean request) { super(); @@ -23,6 +24,8 @@ public class SecondFactorProviderModel { } /** + * Gets the id. + * * @return the id */ public String getId() { @@ -30,21 +33,27 @@ public class SecondFactorProviderModel { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(String id) { this.id = id; } /** - * @return the request + * Checks if is request. + * + * @return true, if is request */ public boolean isRequest() { return request; } /** - * @param request the request to set + * Sets the request. + * + * @param request the new request */ public void setRequest(boolean request) { this.request = request; diff --git a/core/src/main/java/de/bstly/we/controller/model/UserModel.java b/core/src/main/java/de/bstly/we/controller/model/UserModel.java index ae4b426..a5e4b3a 100755 --- a/core/src/main/java/de/bstly/we/controller/model/UserModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/UserModel.java @@ -13,9 +13,7 @@ import de.bstly.we.model.UserProfileField; import de.bstly.we.model.UserStatus; /** - * - * @author _bastler@bstly.de - * + * The Class UserModel. */ public class UserModel extends PasswordModel { @@ -29,6 +27,8 @@ public class UserModel extends PasswordModel { private List profileFields; /** + * Gets the username. + * * @return the username */ public String getUsername() { @@ -36,13 +36,17 @@ public class UserModel extends PasswordModel { } /** - * @param username the username to set + * Sets the username. + * + * @param username the new username */ public void setUsername(String username) { this.username = username; } /** + * Gets the permissions. + * * @return the permissions */ public List getPermissions() { @@ -50,27 +54,35 @@ public class UserModel extends PasswordModel { } /** - * @param permissions the permissions to set + * Sets the permissions. + * + * @param permissions the new permissions */ public void setPermissions(List permissions) { this.permissions = permissions; } /** - * @return the permissionMappings + * Gets the permission mappings. + * + * @return the permission mappings */ public List getPermissionMappings() { return permissionMappings; } /** - * @param permissionMappings the permissionMappings to set + * Sets the permission mappings. + * + * @param permissionMappings the new permission mappings */ public void setPermissionMappings(List permissionMappings) { this.permissionMappings = permissionMappings; } /** + * Gets the quotas. + * * @return the quotas */ public List getQuotas() { @@ -78,27 +90,35 @@ public class UserModel extends PasswordModel { } /** - * @param quotas the quotas to set + * Sets the quotas. + * + * @param quotas the new quotas */ public void setQuotas(List quotas) { this.quotas = quotas; } /** - * @return the quotaMappings + * Gets the quota mappings. + * + * @return the quota mappings */ public List getQuotaMappings() { return quotaMappings; } /** - * @param quotaMappings the quotaMappings to set + * Sets the quota mappings. + * + * @param quotaMappings the new quota mappings */ public void setQuotaMappings(List quotaMappings) { this.quotaMappings = quotaMappings; } /** + * Gets the status. + * * @return the status */ public UserStatus getStatus() { @@ -106,13 +126,17 @@ public class UserModel extends PasswordModel { } /** - * @param status the status to set + * Sets the status. + * + * @param status the new status */ public void setStatus(UserStatus status) { this.status = status; } /** + * Gets the token. + * * @return the token */ public String getToken() { @@ -120,21 +144,27 @@ public class UserModel extends PasswordModel { } /** - * @param token the token to set + * Sets the token. + * + * @param token the new token */ public void setToken(String token) { this.token = token; } /** - * @return the profileFields + * Gets the profile fields. + * + * @return the profile fields */ public List getProfileFields() { return profileFields; } /** - * @param profileFields the profileFields to set + * Sets the profile fields. + * + * @param profileFields the new profile fields */ public void setProfileFields(List profileFields) { this.profileFields = profileFields; diff --git a/core/src/main/java/de/bstly/we/controller/support/ControllerExceptionHandler.java b/core/src/main/java/de/bstly/we/controller/support/ControllerExceptionHandler.java index 4ac80f9..98d9f94 100644 --- a/core/src/main/java/de/bstly/we/controller/support/ControllerExceptionHandler.java +++ b/core/src/main/java/de/bstly/we/controller/support/ControllerExceptionHandler.java @@ -11,18 +11,17 @@ import org.springframework.web.context.request.WebRequest; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; /** - * - * @author _bastler@bstly.de - * + * The Class ControllerExceptionHandler. */ @ControllerAdvice public class ControllerExceptionHandler extends ResponseEntityExceptionHandler { /** - * - * @param exception - * @param request - * @return + * Handle response entity status exception. + * + * @param exception the exception + * @param request the request + * @return the response entity */ @ExceptionHandler(value = { EntityResponseStatusException.class }) protected ResponseEntity handleResponseEntityStatusException(RuntimeException exception, diff --git a/core/src/main/java/de/bstly/we/controller/support/EntityResponseStatusException.java b/core/src/main/java/de/bstly/we/controller/support/EntityResponseStatusException.java index 0ce309a..da6dd7e 100644 --- a/core/src/main/java/de/bstly/we/controller/support/EntityResponseStatusException.java +++ b/core/src/main/java/de/bstly/we/controller/support/EntityResponseStatusException.java @@ -11,9 +11,7 @@ import org.springframework.http.HttpStatus; import org.springframework.util.Assert; /** - * - * @author _bastler@bstly.de - * + * The Class EntityResponseStatusException. */ public class EntityResponseStatusException extends NestedRuntimeException { @@ -28,27 +26,30 @@ public class EntityResponseStatusException extends NestedRuntimeException { private final Object body; /** - * - * @param status + * Instantiates a new entity response status exception. + * + * @param status the status */ public EntityResponseStatusException(HttpStatus status) { this(null, status); } /** - * - * @param body - * @param status + * Instantiates a new entity response status exception. + * + * @param body the body + * @param status the status */ public EntityResponseStatusException(@Nullable Object body, HttpStatus status) { this(body, status, null); } /** - * - * @param body - * @param status - * @param cause + * Instantiates a new entity response status exception. + * + * @param body the body + * @param status the status + * @param cause the cause */ public EntityResponseStatusException(@Nullable Object body, HttpStatus status, @Nullable Throwable cause) { super(null, cause); @@ -58,25 +59,26 @@ public class EntityResponseStatusException extends NestedRuntimeException { } /** - * - * @return + * Gets the status. + * + * @return the status */ public HttpStatus getStatus() { return this.status; } /** - * - * @return + * Gets the body. + * + * @return the body */ @Nullable public Object getBody() { return this.body; } - /** - * - * @return + /* + * @see org.springframework.core.NestedRuntimeException#getMessage() */ @Override public String getMessage() { diff --git a/core/src/main/java/de/bstly/we/controller/support/JsonStringBodyControllerAdvice.java b/core/src/main/java/de/bstly/we/controller/support/JsonStringBodyControllerAdvice.java index 84cb13d..8a139de 100644 --- a/core/src/main/java/de/bstly/we/controller/support/JsonStringBodyControllerAdvice.java +++ b/core/src/main/java/de/bstly/we/controller/support/JsonStringBodyControllerAdvice.java @@ -22,18 +22,16 @@ import com.google.gson.Gson; import com.google.gson.JsonPrimitive; /** - * @author _bastler@bstly.de - * + * The Class JsonStringBodyControllerAdvice. */ @ControllerAdvice public class JsonStringBodyControllerAdvice implements RequestBodyAdvice, ResponseBodyAdvice { private Gson gson = new Gson(); + /* - * @see org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice# - * supports(org.springframework.core.MethodParameter, java.lang.reflect.Type, - * java.lang.Class) + * @see org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice#supports(org.springframework.core.MethodParameter, java.lang.reflect.Type, java.lang.Class) */ @Override public boolean supports(MethodParameter methodParameter, Type targetType, @@ -42,10 +40,7 @@ public class JsonStringBodyControllerAdvice implements RequestBodyAdvice, Respon } /* - * @see org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice# - * beforeBodyRead(org.springframework.http.HttpInputMessage, - * org.springframework.core.MethodParameter, java.lang.reflect.Type, - * java.lang.Class) + * @see org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice#beforeBodyRead(org.springframework.http.HttpInputMessage, org.springframework.core.MethodParameter, java.lang.reflect.Type, java.lang.Class) */ @Override public HttpInputMessage beforeBodyRead(HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, @@ -53,11 +48,9 @@ public class JsonStringBodyControllerAdvice implements RequestBodyAdvice, Respon return inputMessage; } + /* - * @see org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice# - * afterBodyRead(java.lang.Object, org.springframework.http.HttpInputMessage, - * org.springframework.core.MethodParameter, java.lang.reflect.Type, - * java.lang.Class) + * @see org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice#afterBodyRead(java.lang.Object, org.springframework.http.HttpInputMessage, org.springframework.core.MethodParameter, java.lang.reflect.Type, java.lang.Class) */ @Override public Object afterBodyRead(Object body, HttpInputMessage inputMessage, MethodParameter parameter, Type targetType, @@ -66,11 +59,9 @@ public class JsonStringBodyControllerAdvice implements RequestBodyAdvice, Respon return body; } + /* - * @see org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice# - * handleEmptyBody(java.lang.Object, org.springframework.http.HttpInputMessage, - * org.springframework.core.MethodParameter, java.lang.reflect.Type, - * java.lang.Class) + * @see org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice#handleEmptyBody(java.lang.Object, org.springframework.http.HttpInputMessage, org.springframework.core.MethodParameter, java.lang.reflect.Type, java.lang.Class) */ @Override public Object handleEmptyBody(Object body, HttpInputMessage inputMessage, MethodParameter parameter, @@ -78,23 +69,18 @@ public class JsonStringBodyControllerAdvice implements RequestBodyAdvice, Respon return body; } + /* - * @see - * org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice# - * supports(org.springframework.core.MethodParameter, java.lang.Class) + * @see org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice#supports(org.springframework.core.MethodParameter, java.lang.Class) */ @Override public boolean supports(MethodParameter returnType, Class> converterType) { return converterType == StringHttpMessageConverter.class; } + /* - * @see - * org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice# - * beforeBodyWrite(java.lang.Object, org.springframework.core.MethodParameter, - * org.springframework.http.MediaType, java.lang.Class, - * org.springframework.http.server.ServerHttpRequest, - * org.springframework.http.server.ServerHttpResponse) + * @see org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice#beforeBodyWrite(java.lang.Object, org.springframework.core.MethodParameter, org.springframework.http.MediaType, java.lang.Class, org.springframework.http.server.ServerHttpRequest, org.springframework.http.server.ServerHttpResponse) */ @Override public String beforeBodyWrite(String body, MethodParameter returnType, MediaType selectedContentType, diff --git a/core/src/main/java/de/bstly/we/controller/support/RequestBodyErrors.java b/core/src/main/java/de/bstly/we/controller/support/RequestBodyErrors.java index a0a2488..b9a8f26 100644 --- a/core/src/main/java/de/bstly/we/controller/support/RequestBodyErrors.java +++ b/core/src/main/java/de/bstly/we/controller/support/RequestBodyErrors.java @@ -7,9 +7,7 @@ import org.springframework.lang.Nullable; import org.springframework.validation.AbstractBindingResult; /** - * - * @author _bastler@bstly.de - * + * The Class RequestBodyErrors. */ @SuppressWarnings("serial") public class RequestBodyErrors extends AbstractBindingResult { @@ -18,9 +16,9 @@ public class RequestBodyErrors extends AbstractBindingResult { private final Object target; /** - * - * @param target - * @param objectName + * Instantiates a new request body errors. + * + * @param target the target */ public RequestBodyErrors(@Nullable Object target) { super("request-body"); @@ -35,10 +33,9 @@ public class RequestBodyErrors extends AbstractBindingResult { return target; } + /* - * @see - * org.springframework.validation.AbstractBindingResult#getActualFieldValue(java - * .lang.String) + * @see org.springframework.validation.AbstractBindingResult#getActualFieldValue(java.lang.String) */ @Override protected Object getActualFieldValue(String field) { diff --git a/core/src/main/java/de/bstly/we/controller/support/TokenSessionManager.java b/core/src/main/java/de/bstly/we/controller/support/TokenSessionManager.java index 58c90fa..29ee8fa 100644 --- a/core/src/main/java/de/bstly/we/controller/support/TokenSessionManager.java +++ b/core/src/main/java/de/bstly/we/controller/support/TokenSessionManager.java @@ -32,9 +32,7 @@ import de.bstly.we.security.model.LocalUserDetails; import de.bstly.we.security.token.LocalAnonymousAuthenticationToken; /** - * - * @author _bastler@bstly.de - * + * The Class TokenSessionManager. */ @Component public class TokenSessionManager { @@ -53,10 +51,11 @@ public class TokenSessionManager { private PretixManager pretixManager; /** - * - * @param userId - * @param token - * @return + * Gets the permission mappings for token. + * + * @param userId the user id + * @param token the token + * @return the permission mappings for token */ public List getPermissionMappingsForToken(Long userId, String token) { List permissionMappings = Lists.newArrayList(); @@ -76,10 +75,11 @@ public class TokenSessionManager { } /** - * - * @param userId - * @param token - * @return + * Gets the permissions for token. + * + * @param userId the user id + * @param token the token + * @return the permissions for token */ public List getPermissionsForToken(Long userId, String token) { List permissions = Lists.newArrayList(); @@ -109,10 +109,11 @@ public class TokenSessionManager { } /** - * - * @param userId - * @param token - * @return + * Gets the quota mappings for token. + * + * @param userId the user id + * @param token the token + * @return the quota mappings for token */ public List getQuotaMappingsForToken(Long userId, String token) { List quotaMappings = Lists.newArrayList(); @@ -132,10 +133,11 @@ public class TokenSessionManager { } /** - * - * @param userId - * @param tokens - * @return + * Apply tokens. + * + * @param userId the user id + * @param tokens the tokens + * @return the item result model */ public ItemResultModel applyTokens(Long userId, Set tokens) { ItemResultModel itemResultModel = new ItemResultModel(); @@ -173,9 +175,10 @@ public class TokenSessionManager { } /** - * - * @param session - * @return + * Gets the token from session. + * + * @param session the session + * @return the token from session */ public Set getTokenFromSession(HttpSession session) { @@ -195,9 +198,10 @@ public class TokenSessionManager { } /** - * - * @param secret - * @return + * Adds the token to session. + * + * @param secret the secret + * @param session the session */ public void addTokenToSession(String secret, HttpSession session) { @@ -220,9 +224,10 @@ public class TokenSessionManager { } /** - * - * @param secret - * @return + * Removes the token from session. + * + * @param secret the secret + * @param session the session */ public void removeTokenFromSession(String secret, HttpSession session) { String tokens = ""; @@ -245,19 +250,20 @@ public class TokenSessionManager { } /** - * - * @param secret - * @return + * Removes the tokens from session. + * + * @param session the session */ public void removeTokensFromSession(HttpSession session) { session.setAttribute(HTTP_SESSION_ATTRIBUTE_TOKENS, null); } /** - * - * @param auth - * @param details - * @return + * Creates the new auth. + * + * @param auth the auth + * @param details the details + * @return the authentication */ protected Authentication createNewAuth(Authentication auth, LocalUserDetails details) { Authentication newAuth = null; diff --git a/core/src/main/java/de/bstly/we/controller/validation/PasswordModelValidator.java b/core/src/main/java/de/bstly/we/controller/validation/PasswordModelValidator.java index 2d3c44a..34283d2 100755 --- a/core/src/main/java/de/bstly/we/controller/validation/PasswordModelValidator.java +++ b/core/src/main/java/de/bstly/we/controller/validation/PasswordModelValidator.java @@ -24,9 +24,7 @@ import de.bstly.we.businesslogic.SystemPropertyManager; import de.bstly.we.controller.model.PasswordModel; /** - * - * @author _bastler@bstly.de - * + * The Class PasswordModelValidator. */ @Component public class PasswordModelValidator implements Validator { @@ -48,10 +46,9 @@ public class PasswordModelValidator implements Validator { return clazz.isAssignableFrom(PasswordModel.class); } + /* - * - * @see org.springframework.validation.Validator#validate(java.lang.Object, - * org.springframework.validation.Errors) + * @see org.springframework.validation.Validator#validate(java.lang.Object, org.springframework.validation.Errors) */ @Override public void validate(Object target, Errors errors) { diff --git a/core/src/main/java/de/bstly/we/controller/validation/PermissionMappingValidator.java b/core/src/main/java/de/bstly/we/controller/validation/PermissionMappingValidator.java index ef209ac..8a6343d 100755 --- a/core/src/main/java/de/bstly/we/controller/validation/PermissionMappingValidator.java +++ b/core/src/main/java/de/bstly/we/controller/validation/PermissionMappingValidator.java @@ -12,9 +12,7 @@ import de.bstly.we.businesslogic.PermissionMappingManager; import de.bstly.we.model.PermissionMapping; /** - * - * @author _bastler@bstly.de - * + * The Class PermissionMappingValidator. */ @Component public class PermissionMappingValidator implements Validator { diff --git a/core/src/main/java/de/bstly/we/controller/validation/QuotaMappingValidator.java b/core/src/main/java/de/bstly/we/controller/validation/QuotaMappingValidator.java index bd5c9bc..fd644db 100644 --- a/core/src/main/java/de/bstly/we/controller/validation/QuotaMappingValidator.java +++ b/core/src/main/java/de/bstly/we/controller/validation/QuotaMappingValidator.java @@ -12,9 +12,7 @@ import de.bstly.we.businesslogic.QuotaMappingManager; import de.bstly.we.model.QuotaMapping; /** - * - * @author _bastler@bstly.de - * + * The Class QuotaMappingValidator. */ @Component public class QuotaMappingValidator implements Validator { diff --git a/core/src/main/java/de/bstly/we/controller/validation/UserAliasValidator.java b/core/src/main/java/de/bstly/we/controller/validation/UserAliasValidator.java index 2ca6848..8f3092f 100644 --- a/core/src/main/java/de/bstly/we/controller/validation/UserAliasValidator.java +++ b/core/src/main/java/de/bstly/we/controller/validation/UserAliasValidator.java @@ -12,8 +12,7 @@ import org.springframework.validation.Validator; import de.bstly.we.model.UserAlias; /** - * @author _bastler@bstly.de - * + * The Class UserAliasValidator. */ @Component public class UserAliasValidator implements Validator { diff --git a/core/src/main/java/de/bstly/we/controller/validation/UserDomainValidator.java b/core/src/main/java/de/bstly/we/controller/validation/UserDomainValidator.java index 480cc72..ee375ba 100644 --- a/core/src/main/java/de/bstly/we/controller/validation/UserDomainValidator.java +++ b/core/src/main/java/de/bstly/we/controller/validation/UserDomainValidator.java @@ -14,8 +14,7 @@ import de.bstly.we.businesslogic.UserDomainManager; import de.bstly.we.model.UserDomain; /** - * @author _bastler@bstly.de - * + * The Class UserDomainValidator. */ @Component public class UserDomainValidator implements Validator { diff --git a/core/src/main/java/de/bstly/we/controller/validation/UserModelValidator.java b/core/src/main/java/de/bstly/we/controller/validation/UserModelValidator.java index e7870a5..344a12f 100755 --- a/core/src/main/java/de/bstly/we/controller/validation/UserModelValidator.java +++ b/core/src/main/java/de/bstly/we/controller/validation/UserModelValidator.java @@ -15,9 +15,7 @@ import de.bstly.we.businesslogic.UserManager; import de.bstly.we.controller.model.UserModel; /** - * - * @author _bastler@bstly.de - * + * The Class UserModelValidator. */ @Component public class UserModelValidator implements Validator { @@ -59,10 +57,11 @@ public class UserModelValidator implements Validator { } /** - * - * @param username - * @param field - * @param errors + * Validate username. + * + * @param username the username + * @param field the field + * @param errors the errors */ public void validateUsername(String username, String field, Errors errors) { for (String systemUsername : systemPropertyManager.get(RESERVED_USERNAMES, "").split(",")) { diff --git a/core/src/main/java/de/bstly/we/controller/validation/UserProfileFieldValidator.java b/core/src/main/java/de/bstly/we/controller/validation/UserProfileFieldValidator.java index 4dd29d3..8ebbe21 100644 --- a/core/src/main/java/de/bstly/we/controller/validation/UserProfileFieldValidator.java +++ b/core/src/main/java/de/bstly/we/controller/validation/UserProfileFieldValidator.java @@ -26,8 +26,7 @@ import de.bstly.we.model.UserProfileField; import de.bstly.we.repository.UserProfileFieldRepository; /** - * @author _bastler@bstly.de - * + * The Class UserProfileFieldValidator. */ @Component public class UserProfileFieldValidator implements Validator { diff --git a/core/src/main/java/de/bstly/we/controller/validation/VoucherMappingValidator.java b/core/src/main/java/de/bstly/we/controller/validation/VoucherMappingValidator.java new file mode 100644 index 0000000..05a3496 --- /dev/null +++ b/core/src/main/java/de/bstly/we/controller/validation/VoucherMappingValidator.java @@ -0,0 +1,56 @@ +/** + * + */ +package de.bstly.we.controller.validation; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; +import org.springframework.validation.Errors; +import org.springframework.validation.Validator; + +import de.bstly.we.businesslogic.VoucherMappingManager; +import de.bstly.we.model.VoucherMapping; + +/** + * The Class VoucherMappingValidator. + */ +@Component +public class VoucherMappingValidator implements Validator { + + @Autowired + private VoucherMappingManager voucherMappingManager; + + /* + * @see org.springframework.validation.Validator#supports(java.lang.Class) + */ + @Override + public boolean supports(Class clazz) { + return clazz.isAssignableFrom(VoucherMapping.class); + } + + /* + * + * @see org.springframework.validation.Validator#validate(java.lang.Object, + * org.springframework.validation.Errors) + */ + @Override + public void validate(Object target, Errors errors) { + VoucherMapping voucherMapping = (VoucherMapping) target; + + if (!StringUtils.hasText(voucherMapping.getName())) { + errors.rejectValue("name", "REQUIRED"); + } else { + VoucherMapping other = voucherMappingManager.get(voucherMapping.getName()); + + if (other != null && !other.getId().equals(voucherMapping.getId())) { + errors.rejectValue("name", "ALREADY_EXISTS"); + } + } + + if (voucherMapping.getVoucher() <= 0) { + errors.rejectValue("value", "TOO_SHORT"); + } + } + +} diff --git a/core/src/main/java/de/bstly/we/event/AbstractModelEvent.java b/core/src/main/java/de/bstly/we/event/AbstractModelEvent.java index 9d53da0..c4477ae 100644 --- a/core/src/main/java/de/bstly/we/event/AbstractModelEvent.java +++ b/core/src/main/java/de/bstly/we/event/AbstractModelEvent.java @@ -8,8 +8,7 @@ import org.springframework.context.ApplicationEvent; import de.bstly.we.model.AbstractModel; /** - * @author Lurkars - * + * The Class AbstractModelEvent. */ public class AbstractModelEvent extends ApplicationEvent { @@ -22,9 +21,10 @@ public class AbstractModelEvent extends ApplicationEvent { private AbstractModel model; /** - * - * @param type - * @param model + * Instantiates a new abstract model event. + * + * @param type the type + * @param model the model */ public AbstractModelEvent(AbstractModelEventType type, AbstractModel model) { super(model); @@ -33,6 +33,8 @@ public class AbstractModelEvent extends ApplicationEvent { } /** + * Gets the type. + * * @return the type */ public AbstractModelEventType getType() { @@ -40,13 +42,17 @@ public class AbstractModelEvent extends ApplicationEvent { } /** - * @param type the type to set + * Sets the type. + * + * @param type the new type */ public void setType(AbstractModelEventType type) { this.type = type; } /** + * Gets the model. + * * @return the model */ public AbstractModel getModel() { @@ -54,7 +60,9 @@ public class AbstractModelEvent extends ApplicationEvent { } /** - * @param model the model to set + * Sets the model. + * + * @param model the new model */ public void setModel(AbstractModel model) { this.model = model; diff --git a/core/src/main/java/de/bstly/we/event/AbstractModelEventType.java b/core/src/main/java/de/bstly/we/event/AbstractModelEventType.java index edb72dd..66a0a29 100644 --- a/core/src/main/java/de/bstly/we/event/AbstractModelEventType.java +++ b/core/src/main/java/de/bstly/we/event/AbstractModelEventType.java @@ -4,8 +4,7 @@ package de.bstly.we.event; /** - * @author Lurkars - * + * The Enum AbstractModelEventType. */ public enum AbstractModelEventType { diff --git a/core/src/main/java/de/bstly/we/model/AbstractModel.java b/core/src/main/java/de/bstly/we/model/AbstractModel.java index 26b5b3f..e4c9475 100644 --- a/core/src/main/java/de/bstly/we/model/AbstractModel.java +++ b/core/src/main/java/de/bstly/we/model/AbstractModel.java @@ -4,8 +4,7 @@ package de.bstly.we.model; /** - * @author Lurkars - * + * The Interface AbstractModel. */ public interface AbstractModel { diff --git a/core/src/main/java/de/bstly/we/model/Permission.java b/core/src/main/java/de/bstly/we/model/Permission.java index d660064..d22c80a 100755 --- a/core/src/main/java/de/bstly/we/model/Permission.java +++ b/core/src/main/java/de/bstly/we/model/Permission.java @@ -13,9 +13,7 @@ import javax.persistence.Id; import javax.persistence.Table; /** - * - * @author _bastler@bstly.de - * + * The Class Permission. */ @Entity @Table(name = "permissions") @@ -37,6 +35,8 @@ public class Permission implements UserData { private Instant expires; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -44,13 +44,17 @@ public class Permission implements UserData { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** + * Gets the name. + * * @return the name */ public String getName() { @@ -58,13 +62,17 @@ public class Permission implements UserData { } /** - * @param name the name to set + * Sets the name. + * + * @param name the new name */ public void setName(String name) { this.name = name; } /** + * Gets the target. + * * @return the target */ public Long getTarget() { @@ -72,27 +80,35 @@ public class Permission implements UserData { } /** - * @param target the target to set + * Sets the target. + * + * @param target the new target */ public void setTarget(Long target) { this.target = target; } /** - * @return the addon + * Checks if is addon. + * + * @return true, if is addon */ public boolean isAddon() { return addon; } /** - * @param addon the addon to set + * Sets the addon. + * + * @param addon the new addon */ public void setAddon(boolean addon) { this.addon = addon; } /** + * Gets the starts. + * * @return the starts */ public Instant getStarts() { @@ -100,13 +116,17 @@ public class Permission implements UserData { } /** - * @param starts the starts to set + * Sets the starts. + * + * @param starts the new starts */ public void setStarts(Instant starts) { this.starts = starts; } /** + * Gets the expires. + * * @return the expires */ public Instant getExpires() { @@ -114,7 +134,9 @@ public class Permission implements UserData { } /** - * @param expires the expires to set + * Sets the expires. + * + * @param expires the new expires */ public void setExpires(Instant expires) { this.expires = expires; diff --git a/core/src/main/java/de/bstly/we/model/PermissionMapping.java b/core/src/main/java/de/bstly/we/model/PermissionMapping.java index cb9052f..6f94a47 100755 --- a/core/src/main/java/de/bstly/we/model/PermissionMapping.java +++ b/core/src/main/java/de/bstly/we/model/PermissionMapping.java @@ -22,9 +22,7 @@ import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollectionOption; /** - * - * @author _bastler@bstly.de - * + * The Class PermissionMapping. */ @Entity @Table(name = "permission_mappings") @@ -59,6 +57,8 @@ public class PermissionMapping { private String expiresQuestion; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -66,13 +66,17 @@ public class PermissionMapping { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** + * Gets the product. + * * @return the product */ public String getProduct() { @@ -80,13 +84,17 @@ public class PermissionMapping { } /** - * @param product the product to set + * Sets the product. + * + * @param product the new product */ public void setProduct(String product) { this.product = product; } /** + * Gets the item. + * * @return the item */ public Integer getItem() { @@ -94,13 +102,17 @@ public class PermissionMapping { } /** - * @param item the item to set + * Sets the item. + * + * @param item the new item */ public void setItem(Integer item) { this.item = item; } /** + * Gets the names. + * * @return the names */ public Set getNames() { @@ -108,27 +120,35 @@ public class PermissionMapping { } /** - * @param names the names to set + * Sets the names. + * + * @param names the new names */ public void setNames(Set names) { this.names = names; } /** - * @return the addon + * Checks if is addon. + * + * @return true, if is addon */ public boolean isAddon() { return addon; } /** - * @param addon the addon to set + * Sets the addon. + * + * @param addon the new addon */ public void setAddon(boolean addon) { this.addon = addon; } /** + * Gets the lifetime. + * * @return the lifetime */ public Long getLifetime() { @@ -136,75 +156,103 @@ public class PermissionMapping { } /** - * @param lifetime the lifetime to set + * Sets the lifetime. + * + * @param lifetime the new lifetime */ public void setLifetime(Long lifetime) { this.lifetime = lifetime; } /** - * @return the lifetimeUnit + * Gets the lifetime unit. + * + * @return the lifetime unit */ public ChronoUnit getLifetimeUnit() { return lifetimeUnit; } /** - * @param lifetimeUnit the lifetimeUnit to set + * Sets the lifetime unit. + * + * @param lifetimeUnit the new lifetime unit */ public void setLifetimeUnit(ChronoUnit lifetimeUnit) { this.lifetimeUnit = lifetimeUnit; } /** - * @return the lifetimeRound + * Checks if is lifetime round. + * + * @return true, if is lifetime round */ public boolean isLifetimeRound() { return lifetimeRound; } /** - * @param lifetimeRound the lifetimeRound to set + * Sets the lifetime round. + * + * @param lifetimeRound the new lifetime round */ public void setLifetimeRound(boolean lifetimeRound) { this.lifetimeRound = lifetimeRound; } /** - * @return the startsQuestion + * Gets the starts question. + * + * @return the starts question */ public String getStartsQuestion() { return startsQuestion; } /** - * @param startsQuestion the startsQuestion to set + * Sets the starts question. + * + * @param startsQuestion the new starts question */ public void setStartsQuestion(String startsQuestion) { this.startsQuestion = startsQuestion; } /** - * @return the expiresQuestion + * Gets the expires question. + * + * @return the expires question */ public String getExpiresQuestion() { return expiresQuestion; } /** - * @param expiresQuestion the expiresQuestion to set + * Sets the expires question. + * + * @param expiresQuestion the new expires question */ public void setExpiresQuestion(String expiresQuestion) { this.expiresQuestion = expiresQuestion; } + /** + * The Class ChronoUnitConverter. + */ @Converter public static class ChronoUnitConverter implements AttributeConverter { + + /* + * @see javax.persistence.AttributeConverter#convertToDatabaseColumn(java.lang.Object) + */ @Override public String convertToDatabaseColumn(ChronoUnit chronoUnit) { return chronoUnit.name(); } + /* + * @see javax.persistence.AttributeConverter#convertToEntityAttribute(java.lang.Object) + */ @Override public ChronoUnit convertToEntityAttribute(String value) { return ChronoUnit.valueOf(value); diff --git a/core/src/main/java/de/bstly/we/model/PersistentLogin.java b/core/src/main/java/de/bstly/we/model/PersistentLogin.java index 9b11991..b493931 100644 --- a/core/src/main/java/de/bstly/we/model/PersistentLogin.java +++ b/core/src/main/java/de/bstly/we/model/PersistentLogin.java @@ -11,9 +11,7 @@ import javax.persistence.Id; import javax.persistence.Table; /** - * - * @author _bastler@bstly.de - * + * The Class PersistentLogin. */ @Entity @Table(name = "persistent_logins") @@ -30,6 +28,8 @@ public class PersistentLogin { private Instant last_used; /** + * Gets the username. + * * @return the username */ public String getUsername() { @@ -37,13 +37,17 @@ public class PersistentLogin { } /** - * @param username the username to set + * Sets the username. + * + * @param username the new username */ public void setUsername(String username) { this.username = username; } /** + * Gets the series. + * * @return the series */ public String getSeries() { @@ -51,13 +55,17 @@ public class PersistentLogin { } /** - * @param series the series to set + * Sets the series. + * + * @param series the new series */ public void setSeries(String series) { this.series = series; } /** + * Gets the token. + * * @return the token */ public String getToken() { @@ -65,21 +73,27 @@ public class PersistentLogin { } /** - * @param token the token to set + * Sets the token. + * + * @param token the new token */ public void setToken(String token) { this.token = token; } /** - * @return the last_used + * Gets the last used. + * + * @return the last used */ public Instant getLast_used() { return last_used; } /** - * @param last_used the last_used to set + * Sets the last used. + * + * @param last_used the new last used */ public void setLast_used(Instant last_used) { this.last_used = last_used; diff --git a/core/src/main/java/de/bstly/we/model/ProfileFieldType.java b/core/src/main/java/de/bstly/we/model/ProfileFieldType.java index 5d84936..1b67991 100644 --- a/core/src/main/java/de/bstly/we/model/ProfileFieldType.java +++ b/core/src/main/java/de/bstly/we/model/ProfileFieldType.java @@ -4,8 +4,7 @@ package de.bstly.we.model; /** - * @author _bastler@bstly.de - * + * The Enum ProfileFieldType. */ public enum ProfileFieldType { diff --git a/core/src/main/java/de/bstly/we/model/Quota.java b/core/src/main/java/de/bstly/we/model/Quota.java index 0b9a7c2..b9c4edc 100644 --- a/core/src/main/java/de/bstly/we/model/Quota.java +++ b/core/src/main/java/de/bstly/we/model/Quota.java @@ -11,8 +11,7 @@ import javax.persistence.Id; import javax.persistence.Table; /** - * @author _bastler@bstly.de - * + * The Class Quota. */ @Entity @Table(name = "quotas") @@ -34,6 +33,8 @@ public class Quota implements UserData { private boolean disposable; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -41,13 +42,17 @@ public class Quota implements UserData { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** + * Gets the target. + * * @return the target */ public Long getTarget() { @@ -55,13 +60,17 @@ public class Quota implements UserData { } /** - * @param target the target to set + * Sets the target. + * + * @param target the new target */ public void setTarget(Long target) { this.target = target; } /** + * Gets the name. + * * @return the name */ public String getName() { @@ -69,13 +78,17 @@ public class Quota implements UserData { } /** - * @param name the name to set + * Sets the name. + * + * @param name the new name */ public void setName(String name) { this.name = name; } /** + * Gets the value. + * * @return the value */ public long getValue() { @@ -83,13 +96,17 @@ public class Quota implements UserData { } /** - * @param value the value to set + * Sets the value. + * + * @param value the new value */ public void setValue(long value) { this.value = value; } /** + * Gets the unit. + * * @return the unit */ public String getUnit() { @@ -97,21 +114,27 @@ public class Quota implements UserData { } /** - * @param unit the unit to set + * Sets the unit. + * + * @param unit the new unit */ public void setUnit(String unit) { this.unit = unit; } /** - * @return the disposable + * Checks if is disposable. + * + * @return true, if is disposable */ public boolean isDisposable() { return disposable; } /** - * @param disposable the disposable to set + * Sets the disposable. + * + * @param disposable the new disposable */ public void setDisposable(boolean disposable) { this.disposable = disposable; diff --git a/core/src/main/java/de/bstly/we/model/QuotaMapping.java b/core/src/main/java/de/bstly/we/model/QuotaMapping.java index 08a621a..b2cdba2 100644 --- a/core/src/main/java/de/bstly/we/model/QuotaMapping.java +++ b/core/src/main/java/de/bstly/we/model/QuotaMapping.java @@ -18,9 +18,7 @@ import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollectionOption; /** - * - * @author _bastler@bstly.de - * + * The Class QuotaMapping. */ @Entity @Table(name = "quota_mappings") @@ -50,6 +48,8 @@ public class QuotaMapping { private boolean disposable; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -57,13 +57,17 @@ public class QuotaMapping { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** + * Gets the products. + * * @return the products */ public Set getProducts() { @@ -71,13 +75,17 @@ public class QuotaMapping { } /** - * @param products the products to set + * Sets the products. + * + * @param products the new products */ public void setProducts(Set products) { this.products = products; } /** + * Gets the items. + * * @return the items */ public Set getItems() { @@ -85,13 +93,17 @@ public class QuotaMapping { } /** - * @param items the items to set + * Sets the items. + * + * @param items the new items */ public void setItems(Set items) { this.items = items; } /** + * Gets the name. + * * @return the name */ public String getName() { @@ -99,13 +111,17 @@ public class QuotaMapping { } /** - * @param name the name to set + * Sets the name. + * + * @param name the new name */ public void setName(String name) { this.name = name; } /** + * Gets the value. + * * @return the value */ public long getValue() { @@ -113,13 +129,17 @@ public class QuotaMapping { } /** - * @param value the value to set + * Sets the value. + * + * @param value the new value */ public void setValue(long value) { this.value = value; } /** + * Gets the unit. + * * @return the unit */ public String getUnit() { @@ -127,35 +147,45 @@ public class QuotaMapping { } /** - * @param unit the unit to set + * Sets the unit. + * + * @param unit the new unit */ public void setUnit(String unit) { this.unit = unit; } /** - * @return the append + * Checks if is append. + * + * @return true, if is append */ public boolean isAppend() { return append; } /** - * @param append the append to set + * Sets the append. + * + * @param append the new append */ public void setAppend(boolean append) { this.append = append; } /** - * @return the disposable + * Checks if is disposable. + * + * @return true, if is disposable */ public boolean isDisposable() { return disposable; } /** - * @param disposable the disposable to set + * Sets the disposable. + * + * @param disposable the new disposable */ public void setDisposable(boolean disposable) { this.disposable = disposable; diff --git a/core/src/main/java/de/bstly/we/model/SecondFactor.java b/core/src/main/java/de/bstly/we/model/SecondFactor.java index 51bc455..f9378ac 100644 --- a/core/src/main/java/de/bstly/we/model/SecondFactor.java +++ b/core/src/main/java/de/bstly/we/model/SecondFactor.java @@ -4,8 +4,7 @@ package de.bstly.we.model; /** - * @author _bastler@bstly.de - * + * The Interface SecondFactor. */ public interface SecondFactor extends UserData { diff --git a/core/src/main/java/de/bstly/we/model/SystemProfileField.java b/core/src/main/java/de/bstly/we/model/SystemProfileField.java index 2b644ba..9a37561 100644 --- a/core/src/main/java/de/bstly/we/model/SystemProfileField.java +++ b/core/src/main/java/de/bstly/we/model/SystemProfileField.java @@ -9,8 +9,7 @@ import javax.persistence.Id; import javax.persistence.Table; /** - * @author _bastler@bstly.de - * + * The Class SystemProfileField. */ @Entity @Table(name = "system_profile_fields") @@ -25,6 +24,8 @@ public class SystemProfileField { private boolean uniqueValue; /** + * Gets the name. + * * @return the name */ public String getName() { @@ -32,13 +33,17 @@ public class SystemProfileField { } /** - * @param name the name to set + * Sets the name. + * + * @param name the new name */ public void setName(String name) { this.name = name; } /** + * Gets the type. + * * @return the type */ public ProfileFieldType getType() { @@ -46,21 +51,27 @@ public class SystemProfileField { } /** - * @param type the type to set + * Sets the type. + * + * @param type the new type */ public void setType(ProfileFieldType type) { this.type = type; } /** - * @return the uniqueValue + * Checks if is unique value. + * + * @return true, if is unique value */ public boolean isUniqueValue() { return uniqueValue; } /** - * @param uniqueValue the uniqueValue to set + * Sets the unique value. + * + * @param uniqueValue the new unique value */ public void setUniqueValue(boolean uniqueValue) { this.uniqueValue = uniqueValue; diff --git a/core/src/main/java/de/bstly/we/model/SystemProperty.java b/core/src/main/java/de/bstly/we/model/SystemProperty.java index 3de74dc..8ef67b3 100755 --- a/core/src/main/java/de/bstly/we/model/SystemProperty.java +++ b/core/src/main/java/de/bstly/we/model/SystemProperty.java @@ -10,9 +10,7 @@ import javax.persistence.Lob; import javax.persistence.Table; /** - * - * @author _bastler@bstly.de - * + * The Class SystemProperty. */ @Entity @Table(name = "system_properties") @@ -26,15 +24,17 @@ public class SystemProperty { private String value; /** - * + * Instantiates a new system property. */ public SystemProperty() { super(); } /** - * @param key - * @param value + * Instantiates a new system property. + * + * @param key the key + * @param value the value */ public SystemProperty(String key, String value) { super(); @@ -43,6 +43,8 @@ public class SystemProperty { } /** + * Gets the key. + * * @return the key */ public String getKey() { @@ -50,13 +52,17 @@ public class SystemProperty { } /** - * @param key the key to set + * Sets the key. + * + * @param key the new key */ public void setKey(String key) { this.key = key; } /** + * Gets the value. + * * @return the value */ public String getValue() { @@ -64,7 +70,9 @@ public class SystemProperty { } /** - * @param value the value to set + * Sets the value. + * + * @param value the new value */ public void setValue(String value) { this.value = value; diff --git a/core/src/main/java/de/bstly/we/model/User.java b/core/src/main/java/de/bstly/we/model/User.java index 376bd14..97cda11 100755 --- a/core/src/main/java/de/bstly/we/model/User.java +++ b/core/src/main/java/de/bstly/we/model/User.java @@ -14,9 +14,7 @@ import javax.persistence.UniqueConstraint; import com.fasterxml.jackson.annotation.JsonIgnore; /** - * - * @author _bastler@bstly.de - * + * The Class User. */ @Entity @Table(name = "users", uniqueConstraints = @UniqueConstraint(columnNames = { "username" })) @@ -43,6 +41,8 @@ public class User implements UserData { private String resetToken; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -50,13 +50,17 @@ public class User implements UserData { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** + * Gets the username. + * * @return the username */ public String getUsername() { @@ -64,55 +68,71 @@ public class User implements UserData { } /** - * @param username the username to set + * Sets the username. + * + * @param username the new username */ public void setUsername(String username) { this.username = username; } /** - * @return the passwordHash + * Gets the password hash. + * + * @return the password hash */ public String getPasswordHash() { return passwordHash; } /** - * @param passwordHash the passwordHash to set + * Sets the password hash. + * + * @param passwordHash the new password hash */ public void setPasswordHash(String passwordHash) { this.passwordHash = passwordHash; } /** - * @return the disabled + * Checks if is disabled. + * + * @return true, if is disabled */ public boolean isDisabled() { return disabled; } /** - * @param disabled the disabled to set + * Sets the disabled. + * + * @param disabled the new disabled */ public void setDisabled(boolean disabled) { this.disabled = disabled; } /** - * @return the locked + * Checks if is locked. + * + * @return true, if is locked */ public boolean isLocked() { return locked; } /** - * @param locked the locked to set + * Sets the locked. + * + * @param locked the new locked */ public void setLocked(boolean locked) { this.locked = locked; } /** + * Gets the status. + * * @return the status */ public UserStatus getStatus() { @@ -120,13 +140,17 @@ public class User implements UserData { } /** - * @param status the status to set + * Sets the status. + * + * @param status the new status */ public void setStatus(UserStatus status) { this.status = status; } /** + * Gets the secret. + * * @return the secret */ public String getSecret() { @@ -134,21 +158,27 @@ public class User implements UserData { } /** - * @param secret the secret to set + * Sets the secret. + * + * @param secret the new secret */ public void setSecret(String secret) { this.secret = secret; } /** - * @return the resetToken + * Gets the reset token. + * + * @return the reset token */ public String getResetToken() { return resetToken; } /** - * @param resetToken the resetToken to set + * Sets the reset token. + * + * @param resetToken the new reset token */ public void setResetToken(String resetToken) { this.resetToken = resetToken; diff --git a/core/src/main/java/de/bstly/we/model/UserAlias.java b/core/src/main/java/de/bstly/we/model/UserAlias.java index 55d63ba..a98b674 100644 --- a/core/src/main/java/de/bstly/we/model/UserAlias.java +++ b/core/src/main/java/de/bstly/we/model/UserAlias.java @@ -12,8 +12,7 @@ import javax.persistence.Table; import javax.persistence.UniqueConstraint; /** - * @author _bastler@bstly.de - * + * The Class UserAlias. */ @Entity @Table(name = "aliases", uniqueConstraints = @UniqueConstraint(columnNames = { "alias" })) @@ -31,6 +30,8 @@ public class UserAlias implements UserData { private Visibility visibility = Visibility.PROTECTED; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -38,13 +39,17 @@ public class UserAlias implements UserData { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** + * Gets the target. + * * @return the target */ public Long getTarget() { @@ -52,13 +57,17 @@ public class UserAlias implements UserData { } /** - * @param target the target to set + * Sets the target. + * + * @param target the new target */ public void setTarget(Long target) { this.target = target; } /** + * Gets the alias. + * * @return the alias */ public String getAlias() { @@ -66,13 +75,17 @@ public class UserAlias implements UserData { } /** - * @param alias the alias to set + * Sets the alias. + * + * @param alias the new alias */ public void setAlias(String alias) { this.alias = alias; } /** + * Gets the visibility. + * * @return the visibility */ public Visibility getVisibility() { @@ -80,7 +93,9 @@ public class UserAlias implements UserData { } /** - * @param visibility the visibility to set + * Sets the visibility. + * + * @param visibility the new visibility */ public void setVisibility(Visibility visibility) { this.visibility = visibility; diff --git a/core/src/main/java/de/bstly/we/model/UserData.java b/core/src/main/java/de/bstly/we/model/UserData.java index 19af100..5425440 100644 --- a/core/src/main/java/de/bstly/we/model/UserData.java +++ b/core/src/main/java/de/bstly/we/model/UserData.java @@ -4,8 +4,7 @@ package de.bstly.we.model; /** - * @author _bastler@bstly.de - * + * The Interface UserData. */ public interface UserData { diff --git a/core/src/main/java/de/bstly/we/model/UserDomain.java b/core/src/main/java/de/bstly/we/model/UserDomain.java index cb96817..b763f45 100644 --- a/core/src/main/java/de/bstly/we/model/UserDomain.java +++ b/core/src/main/java/de/bstly/we/model/UserDomain.java @@ -12,8 +12,7 @@ import javax.persistence.Table; import javax.persistence.UniqueConstraint; /** - * @author _bastler@bstly.de - * + * The Class UserDomain. */ @Entity @Table(name = "domains", uniqueConstraints = @UniqueConstraint(columnNames = { "domain" })) @@ -35,6 +34,8 @@ public class UserDomain implements UserData { private boolean validated; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -42,13 +43,17 @@ public class UserDomain implements UserData { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** + * Gets the target. + * * @return the target */ public Long getTarget() { @@ -56,13 +61,17 @@ public class UserDomain implements UserData { } /** - * @param target the target to set + * Sets the target. + * + * @param target the new target */ public void setTarget(Long target) { this.target = target; } /** + * Gets the domain. + * * @return the domain */ public String getDomain() { @@ -70,13 +79,17 @@ public class UserDomain implements UserData { } /** - * @param domain the domain to set + * Sets the domain. + * + * @param domain the new domain */ public void setDomain(String domain) { this.domain = domain; } /** + * Gets the visibility. + * * @return the visibility */ public Visibility getVisibility() { @@ -84,13 +97,17 @@ public class UserDomain implements UserData { } /** - * @param visibility the visibility to set + * Sets the visibility. + * + * @param visibility the new visibility */ public void setVisibility(Visibility visibility) { this.visibility = visibility; } /** + * Gets the secret. + * * @return the secret */ public String getSecret() { @@ -98,21 +115,27 @@ public class UserDomain implements UserData { } /** - * @param secret the secret to set + * Sets the secret. + * + * @param secret the new secret */ public void setSecret(String secret) { this.secret = secret; } /** - * @return the validated + * Checks if is validated. + * + * @return true, if is validated */ public boolean isValidated() { return validated; } /** - * @param validated the validated to set + * Sets the validated. + * + * @param validated the new validated */ public void setValidated(boolean validated) { this.validated = validated; diff --git a/core/src/main/java/de/bstly/we/model/UserProfileField.java b/core/src/main/java/de/bstly/we/model/UserProfileField.java index aec0c41..0601b2d 100644 --- a/core/src/main/java/de/bstly/we/model/UserProfileField.java +++ b/core/src/main/java/de/bstly/we/model/UserProfileField.java @@ -16,8 +16,7 @@ import javax.persistence.UniqueConstraint; import de.bstly.we.model.UserProfileField.UserProfileFieldId; /** - * @author _bastler@bstly.de - * + * The Class UserProfileField. */ @Entity @IdClass(UserProfileFieldId.class) @@ -44,6 +43,8 @@ public class UserProfileField implements UserData { private Integer index = 0; /** + * Gets the name. + * * @return the name */ public String getName() { @@ -51,13 +52,17 @@ public class UserProfileField implements UserData { } /** - * @param name the name to set + * Sets the name. + * + * @param name the new name */ public void setName(String name) { this.name = name; } /** + * Gets the target. + * * @return the target */ public Long getTarget() { @@ -65,13 +70,17 @@ public class UserProfileField implements UserData { } /** - * @param target the target to set + * Sets the target. + * + * @param target the new target */ public void setTarget(Long target) { this.target = target; } /** + * Gets the value. + * * @return the value */ public String getValue() { @@ -79,13 +88,17 @@ public class UserProfileField implements UserData { } /** - * @param value the value to set + * Sets the value. + * + * @param value the new value */ public void setValue(String value) { this.value = value; } /** + * Gets the blob. + * * @return the blob */ public String getBlob() { @@ -93,13 +106,17 @@ public class UserProfileField implements UserData { } /** - * @param blob the blob to set + * Sets the blob. + * + * @param blob the new blob */ public void setBlob(String blob) { this.blob = blob; } /** + * Gets the type. + * * @return the type */ public ProfileFieldType getType() { @@ -107,13 +124,17 @@ public class UserProfileField implements UserData { } /** - * @param type the type to set + * Sets the type. + * + * @param type the new type */ public void setType(ProfileFieldType type) { this.type = type; } /** + * Gets the visibility. + * * @return the visibility */ public Visibility getVisibility() { @@ -121,13 +142,17 @@ public class UserProfileField implements UserData { } /** - * @param visibility the visibility to set + * Sets the visibility. + * + * @param visibility the new visibility */ public void setVisibility(Visibility visibility) { this.visibility = visibility; } /** + * Gets the index. + * * @return the index */ public Integer getIndex() { @@ -135,16 +160,16 @@ public class UserProfileField implements UserData { } /** - * @param index the index to set + * Sets the index. + * + * @param index the new index */ public void setIndex(Integer index) { this.index = index; } /** - * - * @author _bastler@bstly.de - * + * The Class UserProfileFieldId. */ public static class UserProfileFieldId implements Serializable { @@ -156,6 +181,8 @@ public class UserProfileField implements UserData { private String name; /** + * Gets the target. + * * @return the target */ public Long getTarget() { @@ -163,13 +190,17 @@ public class UserProfileField implements UserData { } /** - * @param target the target to set + * Sets the target. + * + * @param target the new target */ public void setTarget(Long target) { this.target = target; } /** + * Gets the name. + * * @return the name */ public String getName() { @@ -177,7 +208,9 @@ public class UserProfileField implements UserData { } /** - * @param name the name to set + * Sets the name. + * + * @param name the new name */ public void setName(String name) { this.name = name; diff --git a/core/src/main/java/de/bstly/we/model/UserStatus.java b/core/src/main/java/de/bstly/we/model/UserStatus.java index bea138c..9d7e32f 100644 --- a/core/src/main/java/de/bstly/we/model/UserStatus.java +++ b/core/src/main/java/de/bstly/we/model/UserStatus.java @@ -4,8 +4,7 @@ package de.bstly.we.model; /** - * @author _bastler@bstly.de - * + * The Enum UserStatus. */ public enum UserStatus { diff --git a/core/src/main/java/de/bstly/we/model/UserTotp.java b/core/src/main/java/de/bstly/we/model/UserTotp.java index 20ee48c..ca9b691 100644 --- a/core/src/main/java/de/bstly/we/model/UserTotp.java +++ b/core/src/main/java/de/bstly/we/model/UserTotp.java @@ -19,8 +19,7 @@ import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollectionOption; /** - * @author _bastler@bstly.de - * + * The Class UserTotp. */ @Entity @Table(name = "user_totps", uniqueConstraints = @UniqueConstraint(columnNames = { "target" })) @@ -42,6 +41,8 @@ public class UserTotp implements SecondFactor { private List recoveryCodes; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -49,13 +50,17 @@ public class UserTotp implements SecondFactor { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** + * Gets the target. + * * @return the target */ public Long getTarget() { @@ -63,27 +68,35 @@ public class UserTotp implements SecondFactor { } /** - * @param target the target to set + * Sets the target. + * + * @param target the new target */ public void setTarget(Long target) { this.target = target; } /** - * @return the enabled + * Checks if is enabled. + * + * @return true, if is enabled */ public boolean isEnabled() { return enabled; } /** - * @param enabled the enabled to set + * Sets the enabled. + * + * @param enabled the new enabled */ public void setEnabled(boolean enabled) { this.enabled = enabled; } /** + * Gets the secret. + * * @return the secret */ public String getSecret() { @@ -91,35 +104,45 @@ public class UserTotp implements SecondFactor { } /** - * @param secret the secret to set + * Sets the secret. + * + * @param secret the new secret */ public void setSecret(String secret) { this.secret = secret; } /** - * @return the qrData + * Gets the qr data. + * + * @return the qr data */ public String getQrData() { return qrData; } /** - * @param qrData the qrData to set + * Sets the qr data. + * + * @param qrData the new qr data */ public void setQrData(String qrData) { this.qrData = qrData; } /** - * @return the recoveryCodes + * Gets the recovery codes. + * + * @return the recovery codes */ public List getRecoveryCodes() { return recoveryCodes; } /** - * @param recoveryCodes the recoveryCodes to set + * Sets the recovery codes. + * + * @param recoveryCodes the new recovery codes */ public void setRecoveryCodes(List recoveryCodes) { this.recoveryCodes = recoveryCodes; diff --git a/core/src/main/java/de/bstly/we/model/Visibility.java b/core/src/main/java/de/bstly/we/model/Visibility.java index 4a18dc5..3cfb6da 100644 --- a/core/src/main/java/de/bstly/we/model/Visibility.java +++ b/core/src/main/java/de/bstly/we/model/Visibility.java @@ -4,8 +4,7 @@ package de.bstly.we.model; /** - * @author _bastler@bstly.de - * + * The Enum Visibility. */ public enum Visibility { diff --git a/core/src/main/java/de/bstly/we/model/VoucherMapping.java b/core/src/main/java/de/bstly/we/model/VoucherMapping.java new file mode 100644 index 0000000..67eb919 --- /dev/null +++ b/core/src/main/java/de/bstly/we/model/VoucherMapping.java @@ -0,0 +1,123 @@ +/** + * + */ +package de.bstly.we.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * The Class VoucherMapping. + */ +@Entity +@Table(name = "voucher_mappings") +public class VoucherMapping { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", updatable = false) + private Long id; + @Column(name = "name", nullable = false) + private String name; + @Column(name = "quota", nullable = true) + private String quota; + @Column(name = "voucher", nullable = false) + private int voucher; + @Column(name = "free", columnDefinition = "boolean default false") + private boolean free; + + /** + * Gets the id. + * + * @return the id + */ + public Long getId() { + return id; + } + + /** + * Sets the id. + * + * @param id the new id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Gets the name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets the name. + * + * @param name the new name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Gets the quota. + * + * @return the quota + */ + public String getQuota() { + return quota; + } + + /** + * Sets the quota. + * + * @param quota the new quota + */ + public void setQuota(String quota) { + this.quota = quota; + } + + /** + * Gets the voucher. + * + * @return the voucher + */ + public int getVoucher() { + return voucher; + } + + /** + * Sets the voucher. + * + * @param voucher the new voucher + */ + public void setVoucher(int voucher) { + this.voucher = voucher; + } + + /** + * Checks if is free. + * + * @return true, if is free + */ + public boolean isFree() { + return free; + } + + /** + * Sets the free. + * + * @param free the new free + */ + public void setFree(boolean free) { + this.free = free; + } + +} diff --git a/core/src/main/java/de/bstly/we/repository/PermissionMappingRepository.java b/core/src/main/java/de/bstly/we/repository/PermissionMappingRepository.java index 1587c6d..c5254fb 100755 --- a/core/src/main/java/de/bstly/we/repository/PermissionMappingRepository.java +++ b/core/src/main/java/de/bstly/we/repository/PermissionMappingRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.model.PermissionMapping; /** - * - * @author _bastler@bstly.de - * + * The Interface PermissionMappingRepository. */ @Repository public interface PermissionMappingRepository diff --git a/core/src/main/java/de/bstly/we/repository/PermissionRepository.java b/core/src/main/java/de/bstly/we/repository/PermissionRepository.java index 832ee38..2438ac9 100755 --- a/core/src/main/java/de/bstly/we/repository/PermissionRepository.java +++ b/core/src/main/java/de/bstly/we/repository/PermissionRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.model.Permission; /** - * - * @author _bastler@bstly.de - * + * The Interface PermissionRepository. */ @Repository public interface PermissionRepository diff --git a/core/src/main/java/de/bstly/we/repository/QuotaMappingRepository.java b/core/src/main/java/de/bstly/we/repository/QuotaMappingRepository.java index 604fe85..d4975c1 100644 --- a/core/src/main/java/de/bstly/we/repository/QuotaMappingRepository.java +++ b/core/src/main/java/de/bstly/we/repository/QuotaMappingRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.model.QuotaMapping; /** - * - * @author _bastler@bstly.de - * + * The Interface QuotaMappingRepository. */ @Repository public interface QuotaMappingRepository diff --git a/core/src/main/java/de/bstly/we/repository/QuotaRepository.java b/core/src/main/java/de/bstly/we/repository/QuotaRepository.java index c746e4e..5dc4bf9 100644 --- a/core/src/main/java/de/bstly/we/repository/QuotaRepository.java +++ b/core/src/main/java/de/bstly/we/repository/QuotaRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.model.Quota; /** - * - * @author _bastler@bstly.de - * + * The Interface QuotaRepository. */ @Repository public interface QuotaRepository extends JpaRepository, QuerydslPredicateExecutor { diff --git a/core/src/main/java/de/bstly/we/repository/SystemProfileFieldRepository.java b/core/src/main/java/de/bstly/we/repository/SystemProfileFieldRepository.java index 01ec3c0..443c38d 100644 --- a/core/src/main/java/de/bstly/we/repository/SystemProfileFieldRepository.java +++ b/core/src/main/java/de/bstly/we/repository/SystemProfileFieldRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.model.SystemProfileField; /** - * - * @author _bastler@bstly.de - * + * The Interface SystemProfileFieldRepository. */ @Repository public interface SystemProfileFieldRepository extends JpaRepository, diff --git a/core/src/main/java/de/bstly/we/repository/SystemPropertyRepository.java b/core/src/main/java/de/bstly/we/repository/SystemPropertyRepository.java index 1ef6d99..c79ffd8 100755 --- a/core/src/main/java/de/bstly/we/repository/SystemPropertyRepository.java +++ b/core/src/main/java/de/bstly/we/repository/SystemPropertyRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.model.SystemProperty; /** - * - * @author _bastler@bstly.de - * + * The Interface SystemPropertyRepository. */ @Repository public interface SystemPropertyRepository diff --git a/core/src/main/java/de/bstly/we/repository/UserAliasRepository.java b/core/src/main/java/de/bstly/we/repository/UserAliasRepository.java index 24e0596..73328e8 100644 --- a/core/src/main/java/de/bstly/we/repository/UserAliasRepository.java +++ b/core/src/main/java/de/bstly/we/repository/UserAliasRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.model.UserAlias; /** - * - * @author _bastler@bstly.de - * + * The Interface UserAliasRepository. */ @Repository public interface UserAliasRepository diff --git a/core/src/main/java/de/bstly/we/repository/UserDomainRepository.java b/core/src/main/java/de/bstly/we/repository/UserDomainRepository.java index 8a78127..4f70670 100644 --- a/core/src/main/java/de/bstly/we/repository/UserDomainRepository.java +++ b/core/src/main/java/de/bstly/we/repository/UserDomainRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.model.UserDomain; /** - * - * @author _bastler@bstly.de - * + * The Interface UserDomainRepository. */ @Repository public interface UserDomainRepository diff --git a/core/src/main/java/de/bstly/we/repository/UserProfileFieldRepository.java b/core/src/main/java/de/bstly/we/repository/UserProfileFieldRepository.java index 8208cb9..0aa9eb9 100644 --- a/core/src/main/java/de/bstly/we/repository/UserProfileFieldRepository.java +++ b/core/src/main/java/de/bstly/we/repository/UserProfileFieldRepository.java @@ -11,9 +11,7 @@ import de.bstly.we.model.UserProfileField; import de.bstly.we.model.UserProfileField.UserProfileFieldId; /** - * - * @author _bastler@bstly.de - * + * The Interface UserProfileFieldRepository. */ @Repository public interface UserProfileFieldRepository diff --git a/core/src/main/java/de/bstly/we/repository/UserRepository.java b/core/src/main/java/de/bstly/we/repository/UserRepository.java index 0d59077..2b10598 100755 --- a/core/src/main/java/de/bstly/we/repository/UserRepository.java +++ b/core/src/main/java/de/bstly/we/repository/UserRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.model.User; /** - * - * @author _bastler@bstly.de - * + * The Interface UserRepository. */ @Repository public interface UserRepository extends JpaRepository, QuerydslPredicateExecutor { diff --git a/core/src/main/java/de/bstly/we/repository/UserTotpRepository.java b/core/src/main/java/de/bstly/we/repository/UserTotpRepository.java index e8c5d66..378920f 100644 --- a/core/src/main/java/de/bstly/we/repository/UserTotpRepository.java +++ b/core/src/main/java/de/bstly/we/repository/UserTotpRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.model.UserTotp; /** - * - * @author _bastler@bstly.de - * + * The Interface UserTotpRepository. */ @Repository public interface UserTotpRepository extends JpaRepository, QuerydslPredicateExecutor { diff --git a/core/src/main/java/de/bstly/we/repository/VoucherMappingRepository.java b/core/src/main/java/de/bstly/we/repository/VoucherMappingRepository.java new file mode 100644 index 0000000..27a4a8d --- /dev/null +++ b/core/src/main/java/de/bstly/we/repository/VoucherMappingRepository.java @@ -0,0 +1,19 @@ +/** + * + */ +package de.bstly.we.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.querydsl.QuerydslPredicateExecutor; +import org.springframework.stereotype.Repository; + +import de.bstly.we.model.VoucherMapping; + +/** + * The Interface VoucherMappingRepository. + */ +@Repository +public interface VoucherMappingRepository + extends JpaRepository, QuerydslPredicateExecutor { + +} diff --git a/core/src/main/java/de/bstly/we/security/LocalAuthenticationEntryPoint.java b/core/src/main/java/de/bstly/we/security/LocalAuthenticationEntryPoint.java index b54e6f1..64e55bd 100644 --- a/core/src/main/java/de/bstly/we/security/LocalAuthenticationEntryPoint.java +++ b/core/src/main/java/de/bstly/we/security/LocalAuthenticationEntryPoint.java @@ -18,27 +18,24 @@ import org.springframework.security.web.util.matcher.RequestMatcher; import com.google.common.collect.Lists; /** - * - * @author _bastler@bstly.de - * + * The Class LocalAuthenticationEntryPoint. */ public class LocalAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPoint { private List requestMatchers = Lists.newArrayList(); /** - * - * @param loginUrl + * Instantiates a new local authentication entry point. + * + * @param loginFormUrl the login form url */ public LocalAuthenticationEntryPoint(String loginFormUrl) { super(loginFormUrl); }; + /* - * @see - * org.springframework.security.web.AuthenticationEntryPoint#commence(javax. - * servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, - * org.springframework.security.core.AuthenticationException) + * @see org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint#commence(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.security.core.AuthenticationException) */ @Override public void commence(HttpServletRequest request, HttpServletResponse response, @@ -54,6 +51,11 @@ public class LocalAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPo response.setStatus(HttpStatus.FORBIDDEN.value()); } + /** + * Adds the request matcher. + * + * @param requestMatcher the request matcher + */ public void addRequestMatcher(RequestMatcher requestMatcher) { this.requestMatchers.add(requestMatcher); } diff --git a/core/src/main/java/de/bstly/we/security/LocalAuthenticationProvider.java b/core/src/main/java/de/bstly/we/security/LocalAuthenticationProvider.java index 77c580c..2c47478 100755 --- a/core/src/main/java/de/bstly/we/security/LocalAuthenticationProvider.java +++ b/core/src/main/java/de/bstly/we/security/LocalAuthenticationProvider.java @@ -19,20 +19,16 @@ import de.bstly.we.security.token.LocalAnonymousAuthenticationToken; import de.bstly.we.security.token.LocalSecondFactorAuthenticationToken; /** - * - * @author _bastler@bstly.de - * + * The Class LocalAuthenticationProvider. */ public class LocalAuthenticationProvider extends DaoAuthenticationProvider { @Autowired private SecondFactorProviderManager secondFactorProviderManager; + /* - * - * @see org.springframework.security.authentication.dao. - * AbstractUserDetailsAuthenticationProvider#authenticate(org.springframework. - * security.core.Authentication) + * @see org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider#authenticate(org.springframework.security.core.Authentication) */ @Override public Authentication authenticate(Authentication auth) throws AuthenticationException { @@ -85,6 +81,9 @@ public class LocalAuthenticationProvider extends DaoAuthenticationProvider { return auth; } + /* + * @see org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider#supports(java.lang.Class) + */ public boolean supports(Class authentication) { return (UsernamePasswordAuthenticationToken.class.isAssignableFrom(authentication)) || (LocalSecondFactorAuthenticationToken.class.isAssignableFrom(authentication)) @@ -92,9 +91,7 @@ public class LocalAuthenticationProvider extends DaoAuthenticationProvider { } /** - * - * @author _bastler@bstly.de - * + * The Class SecondFactorAuthenticationException. */ public static class SecondFactorAuthenticationException extends InsufficientAuthenticationException { @@ -107,7 +104,10 @@ public class LocalAuthenticationProvider extends DaoAuthenticationProvider { private static final long serialVersionUID = 1L; /** - * @param msg + * Instantiates a new second factor authentication exception. + * + * @param message the message + * @param principal the principal */ public SecondFactorAuthenticationException(String message, LocalUserDetails principal) { super(message); @@ -115,6 +115,8 @@ public class LocalAuthenticationProvider extends DaoAuthenticationProvider { } /** + * Gets the principal. + * * @return the principal */ public LocalUserDetails getPrincipal() { @@ -122,7 +124,9 @@ public class LocalAuthenticationProvider extends DaoAuthenticationProvider { } /** - * @param principal the principal to set + * Sets the principal. + * + * @param principal the new principal */ public void setPrincipal(LocalUserDetails principal) { this.principal = principal; diff --git a/core/src/main/java/de/bstly/we/security/LocalRememberMeServices.java b/core/src/main/java/de/bstly/we/security/LocalRememberMeServices.java index ae779ec..8a2f736 100644 --- a/core/src/main/java/de/bstly/we/security/LocalRememberMeServices.java +++ b/core/src/main/java/de/bstly/we/security/LocalRememberMeServices.java @@ -10,27 +10,25 @@ import org.springframework.security.web.authentication.rememberme.PersistentToke import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; /** - * - * @author _bastler@bstly.de - * + * The Class LocalRememberMeServices. */ public class LocalRememberMeServices extends PersistentTokenBasedRememberMeServices { /** - * @param key - * @param userDetailsService - * @param tokenRepository + * Instantiates a new local remember me services. + * + * @param key the key + * @param userDetailsService the user details service + * @param tokenRepository the token repository */ public LocalRememberMeServices(String key, UserDetailsService userDetailsService, PersistentTokenRepository tokenRepository) { super(key, userDetailsService, tokenRepository); } + /* - * - * @see org.springframework.security.web.authentication.rememberme. - * AbstractRememberMeServices#rememberMeRequested(javax.servlet.http. - * HttpServletRequest, java.lang.String) + * @see org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices#rememberMeRequested(javax.servlet.http.HttpServletRequest, java.lang.String) */ @Override protected boolean rememberMeRequested(HttpServletRequest request, String parameter) { diff --git a/core/src/main/java/de/bstly/we/security/LocalServletContextListener.java b/core/src/main/java/de/bstly/we/security/LocalServletContextListener.java index 5d70b90..19d6958 100644 --- a/core/src/main/java/de/bstly/we/security/LocalServletContextListener.java +++ b/core/src/main/java/de/bstly/we/security/LocalServletContextListener.java @@ -4,8 +4,15 @@ package de.bstly.we.security; /** - * @author _bastler@bstly.de + * The listener interface for receiving localServletContext events. + * The class that is interested in processing a localServletContext + * event implements this interface, and the object created + * with that class is registered with a component using the + * component's addLocalServletContextListener method. When + * the localServletContext event occurs, that object's appropriate + * method is invoked. * + * @see LocalServletContextEvent */ public class LocalServletContextListener { diff --git a/core/src/main/java/de/bstly/we/security/LocalUserDetailsService.java b/core/src/main/java/de/bstly/we/security/LocalUserDetailsService.java index d0b4b86..4089330 100755 --- a/core/src/main/java/de/bstly/we/security/LocalUserDetailsService.java +++ b/core/src/main/java/de/bstly/we/security/LocalUserDetailsService.java @@ -21,9 +21,7 @@ import de.bstly.we.model.User; import de.bstly.we.security.model.LocalUserDetails; /** - * - * @author _bastler@bstly.de - * + * The Class LocalUserDetailsService. */ @Service("users") public class LocalUserDetailsService implements UserDetailsService { @@ -34,10 +32,7 @@ public class LocalUserDetailsService implements UserDetailsService { private PermissionManager permissionManager; /* - * (non-Javadoc) - * - * @see org.springframework.security.core.userdetails.UserDetailsService# - * loadUserByUsername(java.lang.String) + * @see org.springframework.security.core.userdetails.UserDetailsService#loadUserByUsername(java.lang.String) */ @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { @@ -91,9 +86,10 @@ public class LocalUserDetailsService implements UserDetailsService { } /** - * - * @param userId - * @return + * Gets the authorities for user. + * + * @param userId the user id + * @return the authorities for user */ public Set getAuthoritiesForUser(Long userId) { Set authorities = new HashSet(); diff --git a/core/src/main/java/de/bstly/we/security/SecurityConfig.java b/core/src/main/java/de/bstly/we/security/SecurityConfig.java index 45fe180..4d856fa 100755 --- a/core/src/main/java/de/bstly/we/security/SecurityConfig.java +++ b/core/src/main/java/de/bstly/we/security/SecurityConfig.java @@ -44,8 +44,7 @@ import de.bstly.we.security.handler.RestAuthenticationSuccessHandler; import dev.samstevens.totp.code.HashingAlgorithm; /** - * @author _bastler@bstly.de - * + * The Class SecurityConfig. */ @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) @@ -78,19 +77,19 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { public static final String KEEP_PARAM = "keep"; /** - * @param auth - * @throws Exception + * Configure authentication. + * + * @param auth the auth + * @throws Exception the exception */ @Autowired public void configureAuthentication(AuthenticationManagerBuilder auth) throws Exception { auth.authenticationProvider(daoAuthenticationProvider()); } + /* - * - * @see org.springframework.security.config.annotation.web.configuration. - * WebSecurityConfigurerAdapter#configure(org.springframework.security.config. - * annotation.web.builders.HttpSecurity) + * @see org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter#configure(org.springframework.security.config.annotation.web.builders.HttpSecurity) */ @Override protected void configure(HttpSecurity http) throws Exception { @@ -140,8 +139,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { } /** - * - * @return + * Cors configuration source. + * + * @return the cors configuration source */ @Bean public CorsConfigurationSource corsConfigurationSource() { @@ -156,8 +156,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { } /** - * - * @return + * Dao authentication provider. + * + * @return the dao authentication provider */ @Bean public DaoAuthenticationProvider daoAuthenticationProvider() { @@ -168,8 +169,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { } /** - * - * @return + * Password encoder. + * + * @return the argon 2 password encoder */ @Bean(name = "passwordEncoder") public Argon2PasswordEncoder passwordEncoder() { @@ -177,8 +179,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { } /** - * - * @return + * Local anonymous authentication filter. + * + * @return the local anonymous authentication filter */ @Bean public LocalAnonymousAuthenticationFilter localAnonymousAuthenticationFilter() { @@ -186,8 +189,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { } /** - * - * @return + * Local authentication entry point. + * + * @return the local authentication entry point */ @Bean public LocalAuthenticationEntryPoint localAuthenticationEntryPoint() { @@ -200,8 +204,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { } /** - * - * @return + * Form authentication success handler. + * + * @return the form authentication success handler */ @Bean public FormAuthenticationSuccessHandler formAuthenticationSuccessHandler() { @@ -215,9 +220,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { } /** - * - * @return - * @throws Exception + * Form second factor authentication filter. + * + * @return the form second factor authentication filter + * @throws Exception the exception */ @Bean public FormSecondFactorAuthenticationFilter formSecondFactorAuthenticationFilter() @@ -232,9 +238,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { } /** - * - * @return - * @throws Exception + * Rest authentication filter. + * + * @return the rest authentication filter + * @throws Exception the exception */ @Bean public RestAuthenticationFilter restAuthenticationFilter() throws Exception { @@ -247,9 +254,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { } /** - * - * @return - * @throws Exception + * Rest second factor authentication filter. + * + * @return the rest second factor authentication filter + * @throws Exception the exception */ @Bean public RestSecondFactorAuthenticationFilter restSecondFactorAuthenticationFilter() @@ -266,14 +274,20 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { } /** - * - * @return + * Hashing algorithm. + * + * @return the hashing algorithm */ @Bean public HashingAlgorithm hashingAlgorithm() { return HashingAlgorithm.SHA256; } + /** + * Persistent token repository. + * + * @return the persistent token repository + */ @Bean public PersistentTokenRepository persistentTokenRepository() { JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl(); @@ -281,6 +295,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { return tokenRepository; } + /** + * Remember me services. + * + * @return the remember me services + */ @Bean public RememberMeServices rememberMeServices() { PersistentTokenBasedRememberMeServices rememberMeServices = new LocalRememberMeServices( diff --git a/core/src/main/java/de/bstly/we/security/businesslogic/SecondFactorProvider.java b/core/src/main/java/de/bstly/we/security/businesslogic/SecondFactorProvider.java index 56cd3cb..9f6976c 100644 --- a/core/src/main/java/de/bstly/we/security/businesslogic/SecondFactorProvider.java +++ b/core/src/main/java/de/bstly/we/security/businesslogic/SecondFactorProvider.java @@ -7,63 +7,71 @@ import de.bstly.we.businesslogic.UserDataProvider; import de.bstly.we.model.SecondFactor; /** - * @author _bastler@bstly.de + * The Interface SecondFactorProvider. * + * @param the generic type */ public interface SecondFactorProvider extends UserDataProvider { - /** - * - * @return + /* + * @see de.bstly.we.businesslogic.UserDataProvider#getId() */ String getId(); /** - * - * @return + * Supports. + * + * @param provider the provider + * @return true, if successful */ boolean supports(String provider); /** - * - * @param userId - * @return + * Checks if is enabled. + * + * @param userId the user id + * @return true, if is enabled */ boolean isEnabled(Long userId); /** - * - * @param userId - * @param code - * @return + * Validate. + * + * @param userId the user id + * @param code the code + * @return true, if successful */ boolean validate(Long userId, String code); /** - * - * @param userId - * @return + * Gets the. + * + * @param userId the user id + * @return the t */ T get(Long userId); /** - * - * @param userId - * @return + * Creates the. + * + * @param userId the user id + * @return the t */ T create(Long userId); /** - * - * @param userId - * @param code - * @return + * Enable. + * + * @param userId the user id + * @param code the code + * @return true, if successful */ boolean enable(Long userId, String code); /** - * - * @param userId + * Delete. + * + * @param userId the user id */ void delete(Long userId); diff --git a/core/src/main/java/de/bstly/we/security/businesslogic/SecondFactorProviderManager.java b/core/src/main/java/de/bstly/we/security/businesslogic/SecondFactorProviderManager.java index ccab806..48da821 100644 --- a/core/src/main/java/de/bstly/we/security/businesslogic/SecondFactorProviderManager.java +++ b/core/src/main/java/de/bstly/we/security/businesslogic/SecondFactorProviderManager.java @@ -13,9 +13,7 @@ import org.springframework.stereotype.Component; import com.google.common.collect.Lists; /** - * - * @author _bastler@bstly.de - * + * The Class SecondFactorProviderManager. */ @Component public class SecondFactorProviderManager implements SmartInitializingSingleton { @@ -28,9 +26,9 @@ public class SecondFactorProviderManager implements SmartInitializingSingleton { */ private List> providers; + /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() + * @see org.springframework.beans.factory.SmartInitializingSingleton#afterSingletonsInstantiated() */ @Override public void afterSingletonsInstantiated() { @@ -43,17 +41,19 @@ public class SecondFactorProviderManager implements SmartInitializingSingleton { } /** - * - * @return + * Gets the all. + * + * @return the all */ public List> getAll() { return providers; } /** - * - * @param userId - * @return + * Gets the enabled. + * + * @param userId the user id + * @return the enabled */ public List> getEnabled(Long userId) { List> result = Lists.newArrayList(); @@ -68,9 +68,10 @@ public class SecondFactorProviderManager implements SmartInitializingSingleton { } /** - * - * @param id - * @return + * Gets the provider. + * + * @param id the id + * @return the provider */ public SecondFactorProvider getProvider(String id) { for (SecondFactorProvider provider : providers) { diff --git a/core/src/main/java/de/bstly/we/security/businesslogic/SecondFactorRequestProvider.java b/core/src/main/java/de/bstly/we/security/businesslogic/SecondFactorRequestProvider.java index cb86706..04cf747 100644 --- a/core/src/main/java/de/bstly/we/security/businesslogic/SecondFactorRequestProvider.java +++ b/core/src/main/java/de/bstly/we/security/businesslogic/SecondFactorRequestProvider.java @@ -6,15 +6,17 @@ package de.bstly.we.security.businesslogic; import de.bstly.we.model.SecondFactor; /** - * @author _bastler@bstly.de + * The Interface SecondFactorRequestProvider. * + * @param the generic type */ public interface SecondFactorRequestProvider extends SecondFactorProvider { /** - * - * @param userId + * Request. + * + * @param userId the user id */ void request(Long userId); diff --git a/core/src/main/java/de/bstly/we/security/filter/FormSecondFactorAuthenticationFilter.java b/core/src/main/java/de/bstly/we/security/filter/FormSecondFactorAuthenticationFilter.java index dc5c53e..4cc2730 100644 --- a/core/src/main/java/de/bstly/we/security/filter/FormSecondFactorAuthenticationFilter.java +++ b/core/src/main/java/de/bstly/we/security/filter/FormSecondFactorAuthenticationFilter.java @@ -24,9 +24,7 @@ import de.bstly.we.security.model.LocalUserDetails; import de.bstly.we.security.token.LocalSecondFactorAuthenticationToken; /** - * - * @author _bastler@bstly.de - * + * The Class FormSecondFactorAuthenticationFilter. */ public class FormSecondFactorAuthenticationFilter extends AbstractAuthenticationProcessingFilter { @@ -34,16 +32,17 @@ public class FormSecondFactorAuthenticationFilter extends AbstractAuthentication public static final String SPRING_SECURITY_FORM_2FA_CODE_KEY = "code"; /** - * + * Instantiates a new form second factor authentication filter. + * + * @param defaultFilterProcessesUrl the default filter processes url */ public FormSecondFactorAuthenticationFilter(String defaultFilterProcessesUrl) { super(defaultFilterProcessesUrl); } + /* - * @see org.springframework.security.web.authentication. - * AbstractAuthenticationProcessingFilter#attemptAuthentication(javax.servlet. - * http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + * @see org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter#attemptAuthentication(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ @Override public Authentication attemptAuthentication(HttpServletRequest request, @@ -76,12 +75,9 @@ public class FormSecondFactorAuthenticationFilter extends AbstractAuthentication } + /* - * - * @see org.springframework.security.web.authentication. - * AbstractAuthenticationProcessingFilter#unsuccessfulAuthentication(javax. - * servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, - * org.springframework.security.core.AuthenticationException) + * @see org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter#unsuccessfulAuthentication(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.security.core.AuthenticationException) */ @Override protected void unsuccessfulAuthentication(HttpServletRequest request, @@ -97,11 +93,23 @@ public class FormSecondFactorAuthenticationFilter extends AbstractAuthentication getFailureHandler().onAuthenticationFailure(request, response, failed); } + /** + * Obtain provider. + * + * @param request the request + * @return the string + */ @Nullable protected String obtainProvider(HttpServletRequest request) { return request.getParameter(SPRING_SECURITY_FORM_2FA_PROVIDER_KEY); } + /** + * Obtain code. + * + * @param request the request + * @return the string + */ @Nullable protected String obtainCode(HttpServletRequest request) { return request.getParameter(SPRING_SECURITY_FORM_2FA_CODE_KEY); diff --git a/core/src/main/java/de/bstly/we/security/filter/LocalAnonymousAuthenticationFilter.java b/core/src/main/java/de/bstly/we/security/filter/LocalAnonymousAuthenticationFilter.java index f02a49d..644eb31 100755 --- a/core/src/main/java/de/bstly/we/security/filter/LocalAnonymousAuthenticationFilter.java +++ b/core/src/main/java/de/bstly/we/security/filter/LocalAnonymousAuthenticationFilter.java @@ -19,27 +19,22 @@ import de.bstly.we.security.model.LocalUserDetails; import de.bstly.we.security.token.LocalAnonymousAuthenticationToken; /** - * - * @author _bastler@bstly.de - * + * The Class LocalAnonymousAuthenticationFilter. */ public class LocalAnonymousAuthenticationFilter extends AnonymousAuthenticationFilter { public static final String KEY = "anonymous"; /** - * @param key + * Instantiates a new local anonymous authentication filter. */ public LocalAnonymousAuthenticationFilter() { super(KEY); } + /* - * - * @see - * org.springframework.security.web.authentication.AnonymousAuthenticationFilter - * #doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, - * javax.servlet.FilterChain) + * @see org.springframework.security.web.authentication.AnonymousAuthenticationFilter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) */ @Override public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) @@ -52,10 +47,7 @@ public class LocalAnonymousAuthenticationFilter extends AnonymousAuthenticationF } /* - * - * @see - * org.springframework.security.web.authentication.AnonymousAuthenticationFilter - * #createAuthentication(javax.servlet.http.HttpServletRequest) + * @see org.springframework.security.web.authentication.AnonymousAuthenticationFilter#createAuthentication(javax.servlet.http.HttpServletRequest) */ @Override protected Authentication createAuthentication(HttpServletRequest request) { diff --git a/core/src/main/java/de/bstly/we/security/filter/RestAuthenticationFilter.java b/core/src/main/java/de/bstly/we/security/filter/RestAuthenticationFilter.java index a7cdb2d..997f0bc 100644 --- a/core/src/main/java/de/bstly/we/security/filter/RestAuthenticationFilter.java +++ b/core/src/main/java/de/bstly/we/security/filter/RestAuthenticationFilter.java @@ -27,9 +27,7 @@ import com.google.gson.JsonParser; import de.bstly.we.security.SecurityConfig; /** - * - * @author _bastler@bstly.de - * + * The Class RestAuthenticationFilter. */ public class RestAuthenticationFilter extends AbstractAuthenticationProcessingFilter { @@ -37,16 +35,16 @@ public class RestAuthenticationFilter extends AbstractAuthenticationProcessingFi private String passwordKey = UsernamePasswordAuthenticationFilter.SPRING_SECURITY_FORM_PASSWORD_KEY; /** - * + * Instantiates a new rest authentication filter. + * + * @param defaultFilterProcessesUrl the default filter processes url */ public RestAuthenticationFilter(String defaultFilterProcessesUrl) { super(defaultFilterProcessesUrl); } /* - * @see org.springframework.security.web.authentication. - * AbstractAuthenticationProcessingFilter#attemptAuthentication(javax.servlet. - * http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + * @see org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter#attemptAuthentication(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ @Override public Authentication attemptAuthentication(HttpServletRequest request, @@ -88,10 +86,9 @@ public class RestAuthenticationFilter extends AbstractAuthenticationProcessingFi } /** - * Sets the key name which will be used to obtain the username from the login - * request. + * Sets the username key. * - * @param usernameKey the key name. Defaults to "username". + * @param usernameKey the new username key */ public void setUsernameKey(String usernameKey) { Assert.hasText(usernameKey, "Username key must not be empty or null"); @@ -99,10 +96,9 @@ public class RestAuthenticationFilter extends AbstractAuthenticationProcessingFi } /** - * Sets the key name which will be used to obtain the password from the login - * request.. + * Sets the password parameter. * - * @param passwordKey the key name. Defaults to "password". + * @param passwordKey the new password parameter */ public void setPasswordParameter(String passwordKey) { Assert.hasText(passwordKey, "Password key must not be empty or null"); @@ -110,16 +106,18 @@ public class RestAuthenticationFilter extends AbstractAuthenticationProcessingFi } /** - * - * @return + * Gets the username key. + * + * @return the username key */ public final String getUsernameKey() { return usernameKey; } /** - * - * @return + * Gets the password key. + * + * @return the password key */ public final String getPasswordKey() { return passwordKey; diff --git a/core/src/main/java/de/bstly/we/security/filter/RestSecondFactorAuthenticationFilter.java b/core/src/main/java/de/bstly/we/security/filter/RestSecondFactorAuthenticationFilter.java index bc3bd7e..e839875 100644 --- a/core/src/main/java/de/bstly/we/security/filter/RestSecondFactorAuthenticationFilter.java +++ b/core/src/main/java/de/bstly/we/security/filter/RestSecondFactorAuthenticationFilter.java @@ -26,23 +26,22 @@ import de.bstly.we.security.model.LocalUserDetails; import de.bstly.we.security.token.LocalSecondFactorAuthenticationToken; /** - * - * @author _bastler@bstly.de - * + * The Class RestSecondFactorAuthenticationFilter. */ public class RestSecondFactorAuthenticationFilter extends FormSecondFactorAuthenticationFilter { /** - * + * Instantiates a new rest second factor authentication filter. + * + * @param defaultFilterProcessesUrl the default filter processes url */ public RestSecondFactorAuthenticationFilter(String defaultFilterProcessesUrl) { super(defaultFilterProcessesUrl); } + /* - * @see org.springframework.security.web.authentication. - * AbstractAuthenticationProcessingFilter#attemptAuthentication(javax.servlet. - * http.HttpServletRequest, javax.servlet.http.HttpServletResponse) + * @see de.bstly.we.security.filter.FormSecondFactorAuthenticationFilter#attemptAuthentication(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ @Override public Authentication attemptAuthentication(HttpServletRequest request, @@ -94,12 +93,9 @@ public class RestSecondFactorAuthenticationFilter extends FormSecondFactorAuthen } } + /* - * - * @see org.springframework.security.web.authentication. - * AbstractAuthenticationProcessingFilter#unsuccessfulAuthentication(javax. - * servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, - * org.springframework.security.core.AuthenticationException) + * @see de.bstly.we.security.filter.FormSecondFactorAuthenticationFilter#unsuccessfulAuthentication(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.security.core.AuthenticationException) */ @Override protected void unsuccessfulAuthentication(HttpServletRequest request, diff --git a/core/src/main/java/de/bstly/we/security/handler/FormAuthenticationSuccessHandler.java b/core/src/main/java/de/bstly/we/security/handler/FormAuthenticationSuccessHandler.java index c0321d8..95959c1 100644 --- a/core/src/main/java/de/bstly/we/security/handler/FormAuthenticationSuccessHandler.java +++ b/core/src/main/java/de/bstly/we/security/handler/FormAuthenticationSuccessHandler.java @@ -21,9 +21,7 @@ import com.google.common.collect.Lists; import de.bstly.we.security.token.LocalSecondFactorAuthenticationToken; /** - * - * @author _bastler@bstly.de - * + * The Class FormAuthenticationSuccessHandler. */ public class FormAuthenticationSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler { @@ -37,27 +35,28 @@ public class FormAuthenticationSuccessHandler private List requestMatchers = Lists.newArrayList(); /** - * + * Instantiates a new form authentication success handler. + * + * @param rememberMeParameter the remember me parameter */ public FormAuthenticationSuccessHandler(String rememberMeParameter) { this.rememberMeParameter = rememberMeParameter; } /** - * - * @param defaultTargetUrl + * Instantiates a new form authentication success handler. + * + * @param defaultTargetUrl the default target url + * @param rememberMeParameter the remember me parameter */ public FormAuthenticationSuccessHandler(String defaultTargetUrl, String rememberMeParameter) { setDefaultTargetUrl(defaultTargetUrl); this.rememberMeParameter = rememberMeParameter; } + /* - * - * @see org.springframework.security.web.authentication. - * SavedRequestAwareAuthenticationSuccessHandler#onAuthenticationSuccess(javax. - * servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, - * org.springframework.security.core.Authentication) + * @see org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler#onAuthenticationSuccess(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.security.core.Authentication) */ @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, @@ -101,8 +100,9 @@ public class FormAuthenticationSuccessHandler } /** - * - * @param totpRedirectUrl + * Sets the totp redirect url. + * + * @param totpRedirectUrl the new totp redirect url */ public void setTotpRedirectUrl(String totpRedirectUrl) { Assert.isTrue(UrlUtils.isValidRedirectUrl(totpRedirectUrl), @@ -110,12 +110,19 @@ public class FormAuthenticationSuccessHandler this.totpRedirectUrl = totpRedirectUrl; } + /** + * Adds the request matcher. + * + * @param requestMatcher the request matcher + */ public void addRequestMatcher(RequestMatcher requestMatcher) { this.requestMatchers.add(requestMatcher); } /** - * @return the rememberMeParameter + * Gets the remember me parameter. + * + * @return the remember me parameter */ public String getRememberMeParameter() { return rememberMeParameter; diff --git a/core/src/main/java/de/bstly/we/security/handler/LocalAccessDeniedHandler.java b/core/src/main/java/de/bstly/we/security/handler/LocalAccessDeniedHandler.java index 53c0d31..9a3fb72 100644 --- a/core/src/main/java/de/bstly/we/security/handler/LocalAccessDeniedHandler.java +++ b/core/src/main/java/de/bstly/we/security/handler/LocalAccessDeniedHandler.java @@ -7,8 +7,7 @@ import org.springframework.security.web.access.AccessDeniedHandlerImpl; import org.springframework.stereotype.Component; /** - * @author _bastler@bstly.de - * + * The Class LocalAccessDeniedHandler. */ @Component public class LocalAccessDeniedHandler extends AccessDeniedHandlerImpl { diff --git a/core/src/main/java/de/bstly/we/security/handler/RestAuthenticationFailureHandler.java b/core/src/main/java/de/bstly/we/security/handler/RestAuthenticationFailureHandler.java index c77b2ec..624d4b0 100644 --- a/core/src/main/java/de/bstly/we/security/handler/RestAuthenticationFailureHandler.java +++ b/core/src/main/java/de/bstly/we/security/handler/RestAuthenticationFailureHandler.java @@ -12,19 +12,14 @@ import org.springframework.security.web.authentication.AuthenticationFailureHand import org.springframework.stereotype.Component; /** - * - * @author _bastler@bstly.de - * + * The Class RestAuthenticationFailureHandler. */ @Component public class RestAuthenticationFailureHandler implements AuthenticationFailureHandler { + /* - * @see - * org.springframework.security.web.authentication.AuthenticationFailureHandler# - * onAuthenticationFailure(javax.servlet.http.HttpServletRequest, - * javax.servlet.http.HttpServletResponse, - * org.springframework.security.core.AuthenticationException) + * @see org.springframework.security.web.authentication.AuthenticationFailureHandler#onAuthenticationFailure(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.security.core.AuthenticationException) */ @Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, diff --git a/core/src/main/java/de/bstly/we/security/handler/RestAuthenticationSuccessHandler.java b/core/src/main/java/de/bstly/we/security/handler/RestAuthenticationSuccessHandler.java index 7cf878d..bb69649 100644 --- a/core/src/main/java/de/bstly/we/security/handler/RestAuthenticationSuccessHandler.java +++ b/core/src/main/java/de/bstly/we/security/handler/RestAuthenticationSuccessHandler.java @@ -13,26 +13,21 @@ import org.springframework.stereotype.Component; import de.bstly.we.security.SecurityConfig; /** - * - * @author _bastler@bstly.de - * + * The Class RestAuthenticationSuccessHandler. */ @Component public class RestAuthenticationSuccessHandler extends FormAuthenticationSuccessHandler { /** - * @param rememberMeParameter + * Instantiates a new rest authentication success handler. */ public RestAuthenticationSuccessHandler() { super(SecurityConfig.KEEP_PARAM); } + /* - * - * @see org.springframework.security.web.authentication. - * SimpleUrlAuthenticationSuccessHandler#onAuthenticationSuccess(javax.servlet. - * http.HttpServletRequest, javax.servlet.http.HttpServletResponse, - * org.springframework.security.core.Authentication) + * @see de.bstly.we.security.handler.FormAuthenticationSuccessHandler#onAuthenticationSuccess(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.springframework.security.core.Authentication) */ @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, diff --git a/core/src/main/java/de/bstly/we/security/model/LocalUserDetails.java b/core/src/main/java/de/bstly/we/security/model/LocalUserDetails.java index 8920cac..e5a5e78 100755 --- a/core/src/main/java/de/bstly/we/security/model/LocalUserDetails.java +++ b/core/src/main/java/de/bstly/we/security/model/LocalUserDetails.java @@ -9,9 +9,7 @@ import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.User; /** - * - * @author _bastler@bstly.de - * + * The Class LocalUserDetails. */ public class LocalUserDetails extends User { @@ -22,9 +20,12 @@ public class LocalUserDetails extends User { private Long userId; /** - * @param username - * @param password - * @param authorities + * Instantiates a new local user details. + * + * @param userId the user id + * @param username the username + * @param password the password + * @param authorities the authorities */ public LocalUserDetails(Long userId, String username, String password, Collection authorities) { @@ -34,14 +35,18 @@ public class LocalUserDetails extends User { } /** - * @return the userId + * Gets the user id. + * + * @return the user id */ public Long getUserId() { return userId; } /** - * @param userId the userId to set + * Sets the user id. + * + * @param userId the new user id */ public void setUserId(Long userId) { this.userId = userId; diff --git a/core/src/main/java/de/bstly/we/security/token/LocalAnonymousAuthenticationToken.java b/core/src/main/java/de/bstly/we/security/token/LocalAnonymousAuthenticationToken.java index a97ffc0..ff883c5 100644 --- a/core/src/main/java/de/bstly/we/security/token/LocalAnonymousAuthenticationToken.java +++ b/core/src/main/java/de/bstly/we/security/token/LocalAnonymousAuthenticationToken.java @@ -10,8 +10,7 @@ import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.AuthorityUtils; /** - * @author _bastler@bstly.de - * + * The Class LocalAnonymousAuthenticationToken. */ public class LocalAnonymousAuthenticationToken extends AnonymousAuthenticationToken { @@ -24,16 +23,19 @@ public class LocalAnonymousAuthenticationToken extends AnonymousAuthenticationTo .createAuthorityList("ROLE_ANONYMOUS"); /** - * @param principal + * Instantiates a new local anonymous authentication token. + * + * @param principal the principal */ public LocalAnonymousAuthenticationToken(Object principal) { this(principal, AUTHORITIES); } /** - * - * @param principal - * @param authorities + * Instantiates a new local anonymous authentication token. + * + * @param principal the principal + * @param authorities the authorities */ public LocalAnonymousAuthenticationToken(Object principal, List authorities) { super(ANONYMOUS_USERNAME, principal, authorities); diff --git a/core/src/main/java/de/bstly/we/security/token/LocalSecondFactorAuthenticationToken.java b/core/src/main/java/de/bstly/we/security/token/LocalSecondFactorAuthenticationToken.java index 04dc5ad..a899eb5 100644 --- a/core/src/main/java/de/bstly/we/security/token/LocalSecondFactorAuthenticationToken.java +++ b/core/src/main/java/de/bstly/we/security/token/LocalSecondFactorAuthenticationToken.java @@ -12,8 +12,7 @@ import org.springframework.security.core.authority.AuthorityUtils; import de.bstly.we.security.model.LocalUserDetails; /** - * @author _bastler@bstly.de - * + * The Class LocalSecondFactorAuthenticationToken. */ public class LocalSecondFactorAuthenticationToken extends AbstractAuthenticationToken { @@ -32,7 +31,11 @@ public class LocalSecondFactorAuthenticationToken extends AbstractAuthentication private final String code; /** - * @param principal + * Instantiates a new local second factor authentication token. + * + * @param principal the principal + * @param provider the provider + * @param code the code */ public LocalSecondFactorAuthenticationToken(LocalUserDetails principal, String provider, String code) { @@ -60,7 +63,8 @@ public class LocalSecondFactorAuthenticationToken extends AbstractAuthentication } /** - * + * Gets the code. + * * @return the code */ public String getCode() { @@ -68,6 +72,8 @@ public class LocalSecondFactorAuthenticationToken extends AbstractAuthentication } /** + * Gets the provider. + * * @return the provider */ public String getProvider() { diff --git a/email/src/main/java/de/bstly/we/email/businesslogic/EmailManager.java b/email/src/main/java/de/bstly/we/email/businesslogic/EmailManager.java index 130ec29..e9c339e 100644 --- a/email/src/main/java/de/bstly/we/email/businesslogic/EmailManager.java +++ b/email/src/main/java/de/bstly/we/email/businesslogic/EmailManager.java @@ -10,8 +10,7 @@ import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Component; /** - * @author _bastler@bstly.de - * + * The Class EmailManager. */ @Component public class EmailManager { @@ -19,6 +18,15 @@ public class EmailManager { @Autowired private JavaMailSender javaMailSender; + /** + * Send text. + * + * @param to the to + * @param from the from + * @param subject the subject + * @param text the text + * @return the mail message + */ public MailMessage sendText(String to, String from, String subject, String text) { SimpleMailMessage message = new SimpleMailMessage(); message.setFrom(from); @@ -30,6 +38,15 @@ public class EmailManager { return message; } + /** + * Send bcc. + * + * @param bcc the bcc + * @param from the from + * @param subject the subject + * @param text the text + * @return the mail message + */ public MailMessage sendBcc(String[] bcc, String from, String subject, String text) { SimpleMailMessage message = new SimpleMailMessage(); message.setFrom(from); diff --git a/email/src/main/java/de/bstly/we/email/controller/EmailController.java b/email/src/main/java/de/bstly/we/email/controller/EmailController.java index f4d57ab..9d0b055 100644 --- a/email/src/main/java/de/bstly/we/email/controller/EmailController.java +++ b/email/src/main/java/de/bstly/we/email/controller/EmailController.java @@ -30,8 +30,7 @@ import de.bstly.we.model.User; import de.bstly.we.model.UserProfileField; /** - * @author _bastler@bstly.de - * + * The Class EmailController. */ @RestController @RequestMapping("/email") @@ -47,9 +46,10 @@ public class EmailController extends BaseController { private UserProfileFieldManager userProfileFieldManager; /** - * - * @param to - * @return + * Send test. + * + * @param to the to + * @return the mail message */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/test") @@ -58,6 +58,11 @@ public class EmailController extends BaseController { "Test from we.bstly"); } + /** + * Gets the user mail list. + * + * @return the user mail list + */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/list") public List getUserMailList() { diff --git a/email/src/main/java/de/bstly/we/email/controller/model/UserMailModel.java b/email/src/main/java/de/bstly/we/email/controller/model/UserMailModel.java index 890e0b3..d56d8fc 100644 --- a/email/src/main/java/de/bstly/we/email/controller/model/UserMailModel.java +++ b/email/src/main/java/de/bstly/we/email/controller/model/UserMailModel.java @@ -4,8 +4,7 @@ package de.bstly.we.email.controller.model; /** - * @author _bastler@bstly.de - * + * The Class UserMailModel. */ public class UserMailModel { @@ -14,8 +13,10 @@ public class UserMailModel { private String locale; /** - * @param username - * @param email + * Instantiates a new user mail model. + * + * @param username the username + * @param email the email */ public UserMailModel(String username, String email) { super(); @@ -24,6 +25,8 @@ public class UserMailModel { } /** + * Gets the username. + * * @return the username */ public String getUsername() { @@ -31,13 +34,17 @@ public class UserMailModel { } /** - * @param username the username to set + * Sets the username. + * + * @param username the new username */ public void setUsername(String username) { this.username = username; } /** + * Gets the email. + * * @return the email */ public String getEmail() { @@ -45,13 +52,17 @@ public class UserMailModel { } /** - * @param email the email to set + * Sets the email. + * + * @param email the new email */ public void setEmail(String email) { this.email = email; } /** + * Gets the locale. + * * @return the locale */ public String getLocale() { @@ -59,7 +70,9 @@ public class UserMailModel { } /** - * @param locale the locale to set + * Sets the locale. + * + * @param locale the new locale */ public void setLocale(String locale) { this.locale = locale; diff --git a/i18n/src/main/java/de/bstly/we/i18n/businesslogic/I18nManager.java b/i18n/src/main/java/de/bstly/we/i18n/businesslogic/I18nManager.java index 30a8b9f..1e341fd 100644 --- a/i18n/src/main/java/de/bstly/we/i18n/businesslogic/I18nManager.java +++ b/i18n/src/main/java/de/bstly/we/i18n/businesslogic/I18nManager.java @@ -20,8 +20,7 @@ import de.bstly.we.i18n.model.I18n; import de.bstly.we.i18n.repository.I18nRepository; /** - * @author _bastler@bstly.de - * + * The Class I18nManager. */ @Component public class I18nManager { @@ -31,18 +30,20 @@ public class I18nManager { private Gson gson = new Gson(); /** - * - * @param locale - * @return + * Gets the. + * + * @param locale the locale + * @return the i 18 n */ public I18n get(String locale) { return i18nRepository.findById(locale).orElse(null); } /** - * - * @param locale - * @return + * Gets the label. + * + * @param locale the locale + * @return the label */ public JsonObject getLabel(String locale) { I18n i18n = get(locale); @@ -57,17 +58,19 @@ public class I18nManager { } /** - * - * @return + * Gets the locales. + * + * @return the locales */ public List getLocales() { return i18nRepository.findAll().stream().map(I18n::getLocale).collect(Collectors.toList()); } /** - * - * @param dest - * @param src + * Extend json object. + * + * @param dest the dest + * @param src the src */ protected void extendJsonObject(JsonObject dest, JsonObject src) { for (Entry srcEntry : src.entrySet()) { @@ -87,10 +90,11 @@ public class I18nManager { } /** - * - * @param locale - * @param newLabel - * @return + * Adds the label. + * + * @param locale the locale + * @param newLabel the new label + * @return the i 18 n */ public I18n addLabel(String locale, JsonObject newLabel) { JsonObject label = getLabel(locale); @@ -109,10 +113,11 @@ public class I18nManager { } /** - * - * @param locale - * @param label - * @return + * Sets the label. + * + * @param locale the locale + * @param label the label + * @return the i 18 n */ public I18n setLabel(String locale, JsonObject label) { I18n i18n = new I18n(); @@ -123,8 +128,9 @@ public class I18nManager { } /** - * - * @param locale + * Delete label. + * + * @param locale the locale */ public void deleteLabel(String locale) { if (i18nRepository.existsById(locale)) { diff --git a/i18n/src/main/java/de/bstly/we/i18n/controller/I18nController.java b/i18n/src/main/java/de/bstly/we/i18n/controller/I18nController.java index d6ec69a..d0757b0 100644 --- a/i18n/src/main/java/de/bstly/we/i18n/controller/I18nController.java +++ b/i18n/src/main/java/de/bstly/we/i18n/controller/I18nController.java @@ -28,8 +28,7 @@ import de.bstly.we.controller.BaseController; import de.bstly.we.i18n.businesslogic.I18nManager; /** - * @author _bastler@bstly.de - * + * The Class I18nController. */ @RestController @RequestMapping("/i18n") @@ -40,8 +39,9 @@ public class I18nController extends BaseController { private Gson gson = new Gson(); /** - * - * @return + * Gets the locales. + * + * @return the locales */ @GetMapping public List getLocales() { @@ -49,11 +49,13 @@ public class I18nController extends BaseController { } /** - * - * @param locale - * @param response - * @throws JsonIOException - * @throws IOException + * Gets the label. + * + * @param locale the locale + * @param response the response + * @return the label + * @throws JsonIOException the json IO exception + * @throws IOException Signals that an I/O exception has occurred. */ @GetMapping("/{locale}") public void getLabel(@PathVariable("locale") String locale, HttpServletResponse response) @@ -66,9 +68,10 @@ public class I18nController extends BaseController { } /** - * - * @param locale - * @param label + * Sets the label. + * + * @param locale the locale + * @param label the label */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/{locale}") @@ -81,9 +84,10 @@ public class I18nController extends BaseController { } /** - * - * @param locale - * @param label + * Adds the label. + * + * @param locale the locale + * @param label the label */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PutMapping("/{locale}") @@ -96,8 +100,9 @@ public class I18nController extends BaseController { } /** - * - * @param locale + * Delete locale. + * + * @param locale the locale */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/{locale}") diff --git a/i18n/src/main/java/de/bstly/we/i18n/model/I18n.java b/i18n/src/main/java/de/bstly/we/i18n/model/I18n.java index bedcf9d..21310cf 100644 --- a/i18n/src/main/java/de/bstly/we/i18n/model/I18n.java +++ b/i18n/src/main/java/de/bstly/we/i18n/model/I18n.java @@ -11,9 +11,7 @@ import javax.persistence.Table; import javax.persistence.UniqueConstraint; /** - * - * @author _bastler@bstly.de - * + * The Class I18n. */ @Entity @Table(name = "i18n", uniqueConstraints = @UniqueConstraint(columnNames = { "locale" })) @@ -34,6 +32,8 @@ public class I18n { private String label; /** + * Gets the locale. + * * @return the locale */ public String getLocale() { @@ -41,13 +41,17 @@ public class I18n { } /** - * @param locale the locale to set + * Sets the locale. + * + * @param locale the new locale */ public void setLocale(String locale) { this.locale = locale; } /** + * Gets the label. + * * @return the label */ public String getLabel() { @@ -55,7 +59,9 @@ public class I18n { } /** - * @param label the label to set + * Sets the label. + * + * @param label the new label */ public void setLabel(String label) { this.label = label; diff --git a/i18n/src/main/java/de/bstly/we/i18n/repository/I18nRepository.java b/i18n/src/main/java/de/bstly/we/i18n/repository/I18nRepository.java index 94e2bfa..e5788e5 100644 --- a/i18n/src/main/java/de/bstly/we/i18n/repository/I18nRepository.java +++ b/i18n/src/main/java/de/bstly/we/i18n/repository/I18nRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.i18n.model.I18n; /** - * - * @author _bastler@bstly.de - * + * The Interface I18nRepository. */ @Repository public interface I18nRepository diff --git a/invite/src/main/java/de/bstly/we/invite/businesslogic/InviteManager.java b/invite/src/main/java/de/bstly/we/invite/businesslogic/InviteManager.java index a67aa92..7ec16e0 100644 --- a/invite/src/main/java/de/bstly/we/invite/businesslogic/InviteManager.java +++ b/invite/src/main/java/de/bstly/we/invite/businesslogic/InviteManager.java @@ -26,8 +26,7 @@ import de.bstly.we.invite.repository.InviteRepository; import de.bstly.we.model.UserData; /** - * @author _bastler@bstly.de - * + * The Class InviteManager. */ @Component public class InviteManager implements UserDataProvider { @@ -42,28 +41,32 @@ public class InviteManager implements UserDataProvider { private int codeLength; /** - * @param id - * @return + * Gets the. + * + * @param id the id + * @return the invite */ public Invite get(Long id) { return inviteRepository.findById(id).orElse(null); } /** - * - * @param owner - * @return + * Gets the all by owner. + * + * @param owner the owner + * @return the all by owner */ public List getAllByOwner(Long owner) { return Lists.newArrayList(inviteRepository.findAll(qInvite.owner.eq(owner))); } /** - * - * @param page - * @param size - * @param search - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param search the search + * @return the page */ public Page get(int page, int size, String search) { if (StringUtils.hasText(search)) { @@ -74,23 +77,27 @@ public class InviteManager implements UserDataProvider { } /** - * @param id - * @return + * Gets the by code. + * + * @param code the code + * @return the by code */ public Invite getByCode(String code) { return inviteRepository.findOne(qInvite.code.eq(code)).orElse(null); } /** - * - * @param owner - * @param item - * @param page - * @param size - * @param sortBy - * @param descending - * @param search - * @return + * Gets the by owner. + * + * @param owner the owner + * @param item the item + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @param search the search + * @param redeemed the redeemed + * @return the by owner */ public Page getByOwner(Long owner, Integer item, int page, int size, String sortBy, boolean descending, String search, String redeemed) { @@ -120,12 +127,15 @@ public class InviteManager implements UserDataProvider { } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the others. + * + * @param owner the owner + * @param item the item + * @param page the page + * @param size the size + * @param search the search + * @param redeemed the redeemed + * @return the others */ public Page getOthers(Long owner, int item, int page, int size, String search, String redeemed) { @@ -150,9 +160,10 @@ public class InviteManager implements UserDataProvider { } /** - * - * @param invite - * @return + * Save. + * + * @param invite the invite + * @return the invite */ public Invite save(Invite invite) { if (!StringUtils.hasText(invite.getCode())) { @@ -174,15 +185,16 @@ public class InviteManager implements UserDataProvider { } /** - * - * @param id + * Delete. + * + * @param id the id */ public void delete(Long id) { inviteRepository.deleteById(id); } /** - * + * Delete all. */ public void deleteAll() { inviteRepository.deleteAll(); diff --git a/invite/src/main/java/de/bstly/we/invite/businesslogic/InviteMappingManager.java b/invite/src/main/java/de/bstly/we/invite/businesslogic/InviteMappingManager.java index 92170f5..7e258de 100644 --- a/invite/src/main/java/de/bstly/we/invite/businesslogic/InviteMappingManager.java +++ b/invite/src/main/java/de/bstly/we/invite/businesslogic/InviteMappingManager.java @@ -21,8 +21,7 @@ import de.bstly.we.invite.repository.InviteMappingRepository; import de.bstly.we.invite.repository.InviteRepository; /** - * @author _bastler@bstly.de - * + * The Class InviteMappingManager. */ @Component public class InviteMappingManager { @@ -35,29 +34,33 @@ public class InviteMappingManager { private QInvite qInvite = QInvite.invite; /** - * @param id - * @return + * Gets the. + * + * @param quota the quota + * @return the invite mapping */ public InviteMapping get(String quota) { return inviteMappingRepository.findById(quota).orElse(null); } /** - * - * @param item - * @return + * Gets the by item. + * + * @param item the item + * @return the by item */ public InviteMapping getByItem(int item) { return inviteMappingRepository.findOne(qInviteMapping.item.eq(item)).orElse(null); } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { Sort sort = descending ? Sort.by(sortBy).descending() : Sort.by(sortBy).ascending(); @@ -65,12 +68,13 @@ public class InviteMappingManager { } /** - * - * @param owner - * @param room - * @param starts - * @param expires - * @return + * Creates the. + * + * @param quota the quota + * @param item the item + * @param starts the starts + * @param expires the expires + * @return the invite mapping */ public InviteMapping create(String quota, int item, Instant starts, Instant expires) { Assert.isNull(get(quota), "ivite mapping for quota already exists"); @@ -84,9 +88,10 @@ public class InviteMappingManager { } /** - * - * @param inviteMapping - * @return + * Save. + * + * @param inviteMapping the invite mapping + * @return the invite mapping */ public InviteMapping save(InviteMapping inviteMapping) { @@ -107,8 +112,9 @@ public class InviteMappingManager { } /** - * - * @param quota + * Delete. + * + * @param quota the quota */ public void delete(String quota) { inviteMappingRepository.deleteById(quota); diff --git a/invite/src/main/java/de/bstly/we/invite/controller/InviteController.java b/invite/src/main/java/de/bstly/we/invite/controller/InviteController.java index 49f4b35..645a37d 100644 --- a/invite/src/main/java/de/bstly/we/invite/controller/InviteController.java +++ b/invite/src/main/java/de/bstly/we/invite/controller/InviteController.java @@ -49,8 +49,7 @@ import de.bstly.we.model.UserStatus; import de.bstly.we.model.Visibility; /** - * @author _bastler@bstly.de - * + * The Class InviteController. */ @RestController @RequestMapping("/invites") @@ -76,9 +75,10 @@ public class InviteController extends BaseController { private UserProfileFieldValidator userProfileFieldValidator; /** - * - * @param code - * @return + * Gets the. + * + * @param code the code + * @return the invite */ @GetMapping("/{code}") public Invite get(@PathVariable("code") String code) { @@ -112,8 +112,9 @@ public class InviteController extends BaseController { } /** - * - * @param userModel + * Register. + * + * @param userModel the user model */ @PostMapping public void register(@RequestBody UserModel userModel) { @@ -187,9 +188,16 @@ public class InviteController extends BaseController { } /** - * - * @param quotaParameter - * @return + * Gets the invites. + * + * @param quotaParameter the quota parameter + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param sortParamater the sort paramater + * @param descParameter the desc parameter + * @param searchParameter the search parameter + * @param redeemedParameter the redeemed parameter + * @return the invites */ @PreAuthorize("isAuthenticated()") @GetMapping @@ -215,12 +223,14 @@ public class InviteController extends BaseController { } /** - * - * @param quota - * @param page - * @param sizeParameter - * @param searchParameter - * @return + * Gets the other invites. + * + * @param quota the quota + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param searchParameter the search parameter + * @param redeemedParameter the redeemed parameter + * @return the other invites */ @PreAuthorize("isAuthenticated()") @GetMapping("/{quota}/others") @@ -252,10 +262,11 @@ public class InviteController extends BaseController { } /** - * - * @param quota - * @param inviteModel - * @return + * Creates the invite. + * + * @param quota the quota + * @param inviteModel the invite model + * @return the invite */ @PreAuthorize("isAuthenticated()") @PostMapping("/{quota}") @@ -302,9 +313,10 @@ public class InviteController extends BaseController { } /** - * - * @param inviteModel - * @return + * Update invite. + * + * @param inviteModel the invite model + * @return the invite */ @PreAuthorize("isAuthenticated()") @PatchMapping diff --git a/invite/src/main/java/de/bstly/we/invite/controller/InviteManagingController.java b/invite/src/main/java/de/bstly/we/invite/controller/InviteManagingController.java index 59746e9..cdd5d55 100644 --- a/invite/src/main/java/de/bstly/we/invite/controller/InviteManagingController.java +++ b/invite/src/main/java/de/bstly/we/invite/controller/InviteManagingController.java @@ -30,8 +30,7 @@ import de.bstly.we.invite.businesslogic.InviteMappingManager; import de.bstly.we.invite.model.Invite; /** - * @author _bastler@bstly.de - * + * The Class InviteManagingController. */ @RestController @RequestMapping("/invites/manage") @@ -43,10 +42,12 @@ public class InviteManagingController extends BaseController { private InviteMappingManager inviteMappingManager; /** - * - * @param page - * @param size - * @return + * Gets the invites. + * + * @param page the page + * @param size the size + * @param search the search + * @return the invites */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -57,9 +58,10 @@ public class InviteManagingController extends BaseController { } /** - * - * @param userModel - * @return + * Creates the or update. + * + * @param invite the invite + * @return the invite */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -72,9 +74,10 @@ public class InviteManagingController extends BaseController { } /** - * - * @param invites - * @return + * Creates the or update list. + * + * @param invites the invites + * @return the list */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/list") @@ -92,8 +95,9 @@ public class InviteManagingController extends BaseController { } /** - * - * @param id + * Delete. + * + * @param id the id */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/{id}") @@ -105,8 +109,7 @@ public class InviteManagingController extends BaseController { } /** - * - * @param id + * Delete all. */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping diff --git a/invite/src/main/java/de/bstly/we/invite/controller/InviteMappingController.java b/invite/src/main/java/de/bstly/we/invite/controller/InviteMappingController.java index 3e59e7e..9c61230 100644 --- a/invite/src/main/java/de/bstly/we/invite/controller/InviteMappingController.java +++ b/invite/src/main/java/de/bstly/we/invite/controller/InviteMappingController.java @@ -29,8 +29,7 @@ import de.bstly.we.invite.businesslogic.InviteMappingManager; import de.bstly.we.invite.model.InviteMapping; /** - * @author _bastler@bstly.de - * + * The Class InviteMappingController. */ @RestController @RequestMapping("/invites/mappings") @@ -40,10 +39,11 @@ public class InviteMappingController extends BaseController { private InviteMappingManager inviteMappingManager; /** - * - * @param pageParameter - * @param sizeParameter - * @return + * Gets the invite mappings. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @return the invite mappings */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -55,9 +55,10 @@ public class InviteMappingController extends BaseController { } /** - * - * @param userModel - * @return + * Creates the or update. + * + * @param inviteMapping the invite mapping + * @return the invite mapping */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -66,9 +67,10 @@ public class InviteMappingController extends BaseController { } /** - * - * @param inviteMappings - * @return + * Creates the or update list. + * + * @param inviteMappings the invite mappings + * @return the list */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/list") @@ -86,8 +88,9 @@ public class InviteMappingController extends BaseController { } /** - * - * @param quota + * Delete. + * + * @param quota the quota */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/{quota}") diff --git a/invite/src/main/java/de/bstly/we/invite/model/Invite.java b/invite/src/main/java/de/bstly/we/invite/model/Invite.java index d8e2180..7b0bfda 100644 --- a/invite/src/main/java/de/bstly/we/invite/model/Invite.java +++ b/invite/src/main/java/de/bstly/we/invite/model/Invite.java @@ -16,8 +16,7 @@ import javax.persistence.Table; import de.bstly.we.model.UserData; /** - * @author _bastler@bstly.de - * + * The Class Invite. */ @Entity @Table(name = "invites") @@ -39,6 +38,8 @@ public class Invite implements UserData { private String codeLink; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -46,13 +47,17 @@ public class Invite implements UserData { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** + * Gets the owner. + * * @return the owner */ public Long getOwner() { @@ -60,13 +65,17 @@ public class Invite implements UserData { } /** - * @param owner the owner to set + * Sets the owner. + * + * @param owner the new owner */ public void setOwner(Long owner) { this.owner = owner; } /** + * Gets the code. + * * @return the code */ public String getCode() { @@ -74,13 +83,17 @@ public class Invite implements UserData { } /** - * @param code the code to set + * Sets the code. + * + * @param code the new code */ public void setCode(String code) { this.code = code; } /** + * Gets the item. + * * @return the item */ public Integer getItem() { @@ -88,13 +101,17 @@ public class Invite implements UserData { } /** - * @param item the item to set + * Sets the item. + * + * @param item the new item */ public void setItem(Integer item) { this.item = item; } /** + * Gets the starts. + * * @return the starts */ public Instant getStarts() { @@ -102,13 +119,17 @@ public class Invite implements UserData { } /** - * @param starts the starts to set + * Sets the starts. + * + * @param starts the new starts */ public void setStarts(Instant starts) { this.starts = starts; } /** + * Gets the expires. + * * @return the expires */ public Instant getExpires() { @@ -116,13 +137,17 @@ public class Invite implements UserData { } /** - * @param expires the expires to set + * Sets the expires. + * + * @param expires the new expires */ public void setExpires(Instant expires) { this.expires = expires; } /** + * Gets the message. + * * @return the message */ public String getMessage() { @@ -130,13 +155,17 @@ public class Invite implements UserData { } /** - * @param message the message to set + * Sets the message. + * + * @param message the new message */ public void setMessage(String message) { this.message = message; } /** + * Gets the note. + * * @return the note */ public String getNote() { @@ -144,35 +173,45 @@ public class Invite implements UserData { } /** - * @param note the note to set + * Sets the note. + * + * @param note the new note */ public void setNote(String note) { this.note = note; } /** - * @return the redeemed + * Checks if is redeemed. + * + * @return true, if is redeemed */ public boolean isRedeemed() { return redeemed; } /** - * @param redeemed the redeemed to set + * Sets the redeemed. + * + * @param redeemed the new redeemed */ public void setRedeemed(boolean redeemed) { this.redeemed = redeemed; } /** - * @return the codeLink + * Gets the code link. + * + * @return the code link */ public String getCodeLink() { return codeLink; } /** - * @param codeLink the codeLink to set + * Sets the code link. + * + * @param codeLink the new code link */ public void setCodeLink(String codeLink) { this.codeLink = codeLink; diff --git a/invite/src/main/java/de/bstly/we/invite/model/InviteMapping.java b/invite/src/main/java/de/bstly/we/invite/model/InviteMapping.java index 3ce14ca..3423200 100644 --- a/invite/src/main/java/de/bstly/we/invite/model/InviteMapping.java +++ b/invite/src/main/java/de/bstly/we/invite/model/InviteMapping.java @@ -11,8 +11,7 @@ import javax.persistence.Id; import javax.persistence.Table; /** - * @author _bastler@bstly.de - * + * The Class InviteMapping. */ @Entity @Table(name = "invite_mapping") @@ -31,6 +30,8 @@ public class InviteMapping { private String defaultMessage; /** + * Gets the quota. + * * @return the quota */ public String getQuota() { @@ -38,13 +39,17 @@ public class InviteMapping { } /** - * @param quota the quota to set + * Sets the quota. + * + * @param quota the new quota */ public void setQuota(String quota) { this.quota = quota; } /** + * Gets the item. + * * @return the item */ public Integer getItem() { @@ -52,13 +57,17 @@ public class InviteMapping { } /** - * @param item the item to set + * Sets the item. + * + * @param item the new item */ public void setItem(Integer item) { this.item = item; } /** + * Gets the starts. + * * @return the starts */ public Instant getStarts() { @@ -66,13 +75,17 @@ public class InviteMapping { } /** - * @param starts the starts to set + * Sets the starts. + * + * @param starts the new starts */ public void setStarts(Instant starts) { this.starts = starts; } /** + * Gets the expires. + * * @return the expires */ public Instant getExpires() { @@ -80,49 +93,63 @@ public class InviteMapping { } /** - * @param expires the expires to set + * Sets the expires. + * + * @param expires the new expires */ public void setExpires(Instant expires) { this.expires = expires; } /** - * @return the messageLimit + * Gets the message limit. + * + * @return the message limit */ public Integer getMessageLimit() { return messageLimit; } /** - * @param messageLimit the messageLimit to set + * Sets the message limit. + * + * @param messageLimit the new message limit */ public void setMessageLimit(Integer messageLimit) { this.messageLimit = messageLimit; } /** - * @return the codeLink + * Gets the code link. + * + * @return the code link */ public String getCodeLink() { return codeLink; } /** - * @param codeLink the codeLink to set + * Sets the code link. + * + * @param codeLink the new code link */ public void setCodeLink(String codeLink) { this.codeLink = codeLink; } /** - * @return the defaultMessage + * Gets the default message. + * + * @return the default message */ public String getDefaultMessage() { return defaultMessage; } /** - * @param defaultMessage the defaultMessage to set + * Sets the default message. + * + * @param defaultMessage the new default message */ public void setDefaultMessage(String defaultMessage) { this.defaultMessage = defaultMessage; diff --git a/invite/src/main/java/de/bstly/we/invite/repository/InviteMappingRepository.java b/invite/src/main/java/de/bstly/we/invite/repository/InviteMappingRepository.java index 4db58b9..71e24eb 100755 --- a/invite/src/main/java/de/bstly/we/invite/repository/InviteMappingRepository.java +++ b/invite/src/main/java/de/bstly/we/invite/repository/InviteMappingRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.invite.model.InviteMapping; /** - * - * @author _bastler@bstly.de - * + * The Interface InviteMappingRepository. */ @Repository public interface InviteMappingRepository diff --git a/invite/src/main/java/de/bstly/we/invite/repository/InviteRepository.java b/invite/src/main/java/de/bstly/we/invite/repository/InviteRepository.java index 8341b5f..83ac72f 100644 --- a/invite/src/main/java/de/bstly/we/invite/repository/InviteRepository.java +++ b/invite/src/main/java/de/bstly/we/invite/repository/InviteRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.invite.model.Invite; /** - * - * @author _bastler@bstly.de - * + * The Interface InviteRepository. */ @Repository public interface InviteRepository diff --git a/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/JitsiPermissions.java b/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/JitsiPermissions.java index 2041825..9a7dc85 100644 --- a/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/JitsiPermissions.java +++ b/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/JitsiPermissions.java @@ -4,8 +4,7 @@ package de.bstly.we.jitsi.businesslogic; /** - * @author _bastler@bstly.de - * + * The Interface JitsiPermissions. */ public interface JitsiPermissions { diff --git a/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/JitsiQuotas.java b/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/JitsiQuotas.java index 136dd2c..e20ac1c 100644 --- a/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/JitsiQuotas.java +++ b/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/JitsiQuotas.java @@ -4,8 +4,7 @@ package de.bstly.we.jitsi.businesslogic; /** - * @author _bastler@bstly.de - * + * The Interface JitsiQuotas. */ public interface JitsiQuotas { diff --git a/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/JitsiRoomManager.java b/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/JitsiRoomManager.java index e0d0fe3..c89f5fb 100644 --- a/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/JitsiRoomManager.java +++ b/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/JitsiRoomManager.java @@ -45,8 +45,7 @@ import de.bstly.we.urlshortener.model.ShortenedUrl; import de.bstly.we.urlshortener.repository.ShortenedUrlRepository; /** - * @author _bastler@bstly.de - * + * The Class JitsiRoomManager. */ @Component public class JitsiRoomManager implements SmartInitializingSingleton, UserDataProvider { @@ -75,9 +74,9 @@ public class JitsiRoomManager implements SmartInitializingSingleton, UserDataPro @Value("${jitsi.urlFormat:%s/jwt?%s}") private String urlFormat; + /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() + * @see org.springframework.beans.factory.SmartInitializingSingleton#afterSingletonsInstantiated() */ @Override public void afterSingletonsInstantiated() { @@ -89,29 +88,33 @@ public class JitsiRoomManager implements SmartInitializingSingleton, UserDataPro } /** - * @param id - * @return + * Gets the. + * + * @param id the id + * @return the jitsi room */ public JitsiRoom get(Long id) { return jitsiRoomRepository.findById(id).orElse(null); } /** - * - * @param owner - * @return + * Gets the all by owner. + * + * @param owner the owner + * @return the all by owner */ public List getAllByOwner(Long owner) { return Lists.newArrayList(jitsiRoomRepository.findAll(qJitsiRoom.owner.eq(owner))); } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { return jitsiRoomRepository.findAll(PageRequest.of(page, size, @@ -119,9 +122,14 @@ public class JitsiRoomManager implements SmartInitializingSingleton, UserDataPro } /** - * - * @param userId - * @return + * Gets the for user id. + * + * @param userId the user id + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the for user id */ public Page getForUserId(Long userId, int page, int size, String sortBy, boolean descending) { @@ -134,13 +142,15 @@ public class JitsiRoomManager implements SmartInitializingSingleton, UserDataPro } /** - * - * @param owner - * @param room - * @param starts - * @param expires - * @return - * @throws JOSEException + * Creates the. + * + * @param owner the owner + * @param room the room + * @param starts the starts + * @param moderationStarts the moderation starts + * @param expires the expires + * @return the jitsi room + * @throws JOSEException the JOSE exception */ public JitsiRoom create(Long owner, String room, Instant starts, Instant moderationStarts, Instant expires) throws JOSEException { @@ -155,10 +165,11 @@ public class JitsiRoomManager implements SmartInitializingSingleton, UserDataPro } /** - * - * @param jitsiRoom - * @return - * @throws JOSEException + * Save. + * + * @param jitsiRoom the jitsi room + * @return the jitsi room + * @throws JOSEException the JOSE exception */ public JitsiRoom save(JitsiRoom jitsiRoom) throws JOSEException { Assert.notNull(jitsiRoom.getRoom(), "No domain defined!"); @@ -216,9 +227,10 @@ public class JitsiRoomManager implements SmartInitializingSingleton, UserDataPro } /** - * - * @param jitsiRoom - * @return + * Creates the shortened url. + * + * @param jitsiRoom the jitsi room + * @return the jitsi room */ public JitsiRoom createShortenedUrl(JitsiRoom jitsiRoom) { ShortenedUrl shortenedUrl = shortenedUrlManager.create(jitsiRoom.getOwner(), @@ -231,8 +243,10 @@ public class JitsiRoomManager implements SmartInitializingSingleton, UserDataPro } /** - * - * @param id + * Delete. + * + * @param jitsiRoom the jitsi room + * @param quota the quota */ public void delete(JitsiRoom jitsiRoom, boolean quota) { if (quota) { @@ -271,9 +285,10 @@ public class JitsiRoomManager implements SmartInitializingSingleton, UserDataPro } /** - * - * @param owner - * @param quota + * Delete all. + * + * @param owner the owner + * @param quota the quota */ public void deleteAll(Long owner, boolean quota) { List jitsiRooms = Lists @@ -284,6 +299,7 @@ public class JitsiRoomManager implements SmartInitializingSingleton, UserDataPro } } + /* * @see de.bstly.we.businesslogic.UserDataProvider#getId() */ @@ -292,6 +308,7 @@ public class JitsiRoomManager implements SmartInitializingSingleton, UserDataPro return "jitsiRooms"; } + /* * @see de.bstly.we.businesslogic.UserDataProvider#getUserData(java.lang.Long) */ @@ -304,6 +321,7 @@ public class JitsiRoomManager implements SmartInitializingSingleton, UserDataPro return result; } + /* * @see de.bstly.we.businesslogic.UserDataProvider#purgeUserData(java.lang.Long) */ @@ -315,7 +333,7 @@ public class JitsiRoomManager implements SmartInitializingSingleton, UserDataPro } /** - * + * Clear expired rooms. */ @Scheduled(cron = "0 */5 * * * *") protected void clearExpiredRooms() { diff --git a/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/support/UrlShortenerSync.java b/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/support/UrlShortenerSync.java index 0527fc1..ef9f79f 100644 --- a/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/support/UrlShortenerSync.java +++ b/jitsi/src/main/java/de/bstly/we/jitsi/businesslogic/support/UrlShortenerSync.java @@ -16,8 +16,7 @@ import de.bstly.we.jitsi.repository.JitsiRoomRepository; import de.bstly.we.urlshortener.model.ShortenedUrl; /** - * @author Lurkars - * + * The Class UrlShortenerSync. */ @Component public class UrlShortenerSync implements ApplicationListener { @@ -26,9 +25,9 @@ public class UrlShortenerSync implements ApplicationListener private JitsiRoomRepository jitsiRoomRepository; private QJitsiRoom qJitsiRoom = QJitsiRoom.jitsiRoom; + /* - * @see org.springframework.context.ApplicationListener#onApplicationEvent(org. - * springframework.context.ApplicationEvent) + * @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent) */ @Override public void onApplicationEvent(AbstractModelEvent event) { diff --git a/jitsi/src/main/java/de/bstly/we/jitsi/controller/JitsiRoomController.java b/jitsi/src/main/java/de/bstly/we/jitsi/controller/JitsiRoomController.java index 4877597..5b1e5dc 100644 --- a/jitsi/src/main/java/de/bstly/we/jitsi/controller/JitsiRoomController.java +++ b/jitsi/src/main/java/de/bstly/we/jitsi/controller/JitsiRoomController.java @@ -38,8 +38,7 @@ import de.bstly.we.urlshortener.businesslogic.ShortenedUrlPermissions; import de.bstly.we.urlshortener.businesslogic.ShortenedUrlQuotas; /** - * @author _bastler@bstly.de - * + * The Class JitsiRoomController. */ @RestController @RequestMapping("/jitsi/rooms") @@ -55,10 +54,13 @@ public class JitsiRoomController extends BaseController { private QuotaManager quotaManager; /** - * - * @param pageParameter - * @param sizeParameter - * @return + * Gets the jitsi rooms. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param sortParameter the sort parameter + * @param descParameter the desc parameter + * @return the jitsi rooms */ @PreAuthorize("isAuthenticated()") @GetMapping @@ -76,9 +78,10 @@ public class JitsiRoomController extends BaseController { } /** - * - * @param jitsiRoom - * @return + * Creates the jitsi room. + * + * @param jitsiRoom the jitsi room + * @return the jitsi room */ @PreAuthorize("isAuthenticated()") @PostMapping @@ -122,9 +125,10 @@ public class JitsiRoomController extends BaseController { } /** - * - * @param jitsiRoom - * @return + * Update jitsi room. + * + * @param jitsiRoom the jitsi room + * @return the jitsi room */ @PreAuthorize("isAuthenticated()") @PatchMapping @@ -164,6 +168,12 @@ public class JitsiRoomController extends BaseController { } } + /** + * Creates the shortened url. + * + * @param id the id + * @return the jitsi room + */ @PreAuthorize("isAuthenticated()") @PatchMapping("/{id}") public JitsiRoom createShortenedUrl(@PathVariable("id") Long id) { @@ -189,8 +199,9 @@ public class JitsiRoomController extends BaseController { } /** - * - * @param id + * Delete jitsi room. + * + * @param id the id */ @PreAuthorize("isAuthenticated()") @DeleteMapping("/{id}") diff --git a/jitsi/src/main/java/de/bstly/we/jitsi/controller/JitsiRoomManagementController.java b/jitsi/src/main/java/de/bstly/we/jitsi/controller/JitsiRoomManagementController.java index 313923a..71d765f 100644 --- a/jitsi/src/main/java/de/bstly/we/jitsi/controller/JitsiRoomManagementController.java +++ b/jitsi/src/main/java/de/bstly/we/jitsi/controller/JitsiRoomManagementController.java @@ -29,8 +29,7 @@ import de.bstly.we.jitsi.controller.validation.JitsiRoomValidator; import de.bstly.we.jitsi.model.JitsiRoom; /** - * @author _bastler@bstly.de - * + * The Class JitsiRoomManagementController. */ @RestController @RequestMapping("/jitsi/rooms/manage") @@ -42,8 +41,11 @@ public class JitsiRoomManagementController extends BaseController { private JitsiRoomValidator jitsiRoomValidator; /** - * - * @return + * Gets the jitsi rooms. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @return the jitsi rooms */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -53,9 +55,10 @@ public class JitsiRoomManagementController extends BaseController { } /** - * - * @param jitsiRoom - * @return + * Creates the or update jitsi room. + * + * @param jitsiRoom the jitsi room + * @return the jitsi room */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -75,8 +78,10 @@ public class JitsiRoomManagementController extends BaseController { } /** - * - * @param id + * Delete jitsi room. + * + * @param id the id + * @param quota the quota */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/{id}") @@ -92,8 +97,10 @@ public class JitsiRoomManagementController extends BaseController { } /** - * - * @param owner + * Delete all. + * + * @param owner the owner + * @param quota the quota */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/all/{owner}") diff --git a/jitsi/src/main/java/de/bstly/we/jitsi/controller/validation/JitsiRoomValidator.java b/jitsi/src/main/java/de/bstly/we/jitsi/controller/validation/JitsiRoomValidator.java index fb4fbd7..3bfee98 100644 --- a/jitsi/src/main/java/de/bstly/we/jitsi/controller/validation/JitsiRoomValidator.java +++ b/jitsi/src/main/java/de/bstly/we/jitsi/controller/validation/JitsiRoomValidator.java @@ -18,8 +18,7 @@ import de.bstly.we.jitsi.model.QJitsiRoom; import de.bstly.we.jitsi.repository.JitsiRoomRepository; /** - * @author _bastler@bstly.de - * + * The Class JitsiRoomValidator. */ @Component public class JitsiRoomValidator implements Validator { @@ -35,6 +34,7 @@ public class JitsiRoomValidator implements Validator { private JitsiRoomRepository jitsiRoomRepository; private QJitsiRoom qJitsiRoom = QJitsiRoom.jitsiRoom; + /* * @see org.springframework.validation.Validator#supports(java.lang.Class) */ @@ -43,9 +43,9 @@ public class JitsiRoomValidator implements Validator { return clazz.isAssignableFrom(JitsiRoom.class); } + /* - * @see org.springframework.validation.Validator#validate(java.lang.Object, - * org.springframework.validation.Errors) + * @see org.springframework.validation.Validator#validate(java.lang.Object, org.springframework.validation.Errors) */ @Override public void validate(Object target, Errors errors) { @@ -64,10 +64,11 @@ public class JitsiRoomValidator implements Validator { } /** - * - * @param roomName - * @param field - * @param errors + * Validate. + * + * @param owner the owner + * @param roomName the room name + * @param errors the errors */ public void validate(Long owner, String roomName, Errors errors) { if (owner == null) { @@ -92,10 +93,10 @@ public class JitsiRoomValidator implements Validator { } /** - * - * @param owner - * @param roomName - * @param errors + * Validate room. + * + * @param roomName the room name + * @param errors the errors */ public void validateRoom(String roomName, Errors errors) { for (String systemRoomName : systemPropertyManager.get(RESERVED_JITSI_ROOMS, "") @@ -110,9 +111,10 @@ public class JitsiRoomValidator implements Validator { } /** - * - * @param jitsiRoom - * @param errors + * Validate expiry. + * + * @param jitsiRoom the jitsi room + * @param errors the errors */ public void validateExpiry(JitsiRoom jitsiRoom, Errors errors) { diff --git a/jitsi/src/main/java/de/bstly/we/jitsi/model/JitsiRoom.java b/jitsi/src/main/java/de/bstly/we/jitsi/model/JitsiRoom.java index 5406ea0..8b249e5 100644 --- a/jitsi/src/main/java/de/bstly/we/jitsi/model/JitsiRoom.java +++ b/jitsi/src/main/java/de/bstly/we/jitsi/model/JitsiRoom.java @@ -20,8 +20,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import de.bstly.we.model.UserData; /** - * @author _bastler@bstly.de - * + * The Class JitsiRoom. */ @Entity @Table(name = "jitsi_rooms") @@ -52,6 +51,8 @@ public class JitsiRoom implements UserData { private String orgUrl; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -59,13 +60,17 @@ public class JitsiRoom implements UserData { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** + * Gets the owner. + * * @return the owner */ public Long getOwner() { @@ -73,13 +78,17 @@ public class JitsiRoom implements UserData { } /** - * @param owner the owner to set + * Sets the owner. + * + * @param owner the new owner */ public void setOwner(Long owner) { this.owner = owner; } /** + * Gets the room. + * * @return the room */ public String getRoom() { @@ -87,13 +96,17 @@ public class JitsiRoom implements UserData { } /** - * @param room the room to set + * Sets the room. + * + * @param room the new room */ public void setRoom(String room) { this.room = room; } /** + * Gets the starts. + * * @return the starts */ public Instant getStarts() { @@ -101,27 +114,35 @@ public class JitsiRoom implements UserData { } /** - * @param starts the starts to set + * Sets the starts. + * + * @param starts the new starts */ public void setStarts(Instant starts) { this.starts = starts; } /** - * @return the moderationStarts + * Gets the moderation starts. + * + * @return the moderation starts */ public Instant getModerationStarts() { return moderationStarts; } /** - * @param moderationStarts the moderationStarts to set + * Sets the moderation starts. + * + * @param moderationStarts the new moderation starts */ public void setModerationStarts(Instant moderationStarts) { this.moderationStarts = moderationStarts; } /** + * Gets the expires. + * * @return the expires */ public Instant getExpires() { @@ -129,13 +150,17 @@ public class JitsiRoom implements UserData { } /** - * @param expires the expires to set + * Sets the expires. + * + * @param expires the new expires */ public void setExpires(Instant expires) { this.expires = expires; } /** + * Gets the token. + * * @return the token */ public String getToken() { @@ -143,27 +168,35 @@ public class JitsiRoom implements UserData { } /** - * @param token the token to set + * Sets the token. + * + * @param token the new token */ public void setToken(String token) { this.token = token; } /** - * @return the moderationToken + * Gets the moderation token. + * + * @return the moderation token */ public String getModerationToken() { return moderationToken; } /** - * @param moderationToken the moderationToken to set + * Sets the moderation token. + * + * @param moderationToken the new moderation token */ public void setModerationToken(String moderationToken) { this.moderationToken = moderationToken; } /** + * Gets the url. + * * @return the url */ public String getUrl() { @@ -171,27 +204,35 @@ public class JitsiRoom implements UserData { } /** - * @param url the url to set + * Sets the url. + * + * @param url the new url */ public void setUrl(String url) { this.url = url; } /** - * @return the moderationUrl + * Gets the moderation url. + * + * @return the moderation url */ public String getModerationUrl() { return moderationUrl; } /** - * @param moderationUrl the moderationUrl to set + * Sets the moderation url. + * + * @param moderationUrl the new moderation url */ public void setModerationUrl(String moderationUrl) { this.moderationUrl = moderationUrl; } /** + * Gets the code. + * * @return the code */ public String getCode() { @@ -199,21 +240,27 @@ public class JitsiRoom implements UserData { } /** - * @param code the code to set + * Sets the code. + * + * @param code the new code */ public void setCode(String code) { this.code = code; } /** - * @return the orgUrl + * Gets the org url. + * + * @return the org url */ public String getOrgUrl() { return orgUrl; } /** - * @param orgUrl the orgUrl to set + * Sets the org url. + * + * @param orgUrl the new org url */ public void setOrgUrl(String orgUrl) { this.orgUrl = orgUrl; diff --git a/jitsi/src/main/java/de/bstly/we/jitsi/repository/JitsiRoomRepository.java b/jitsi/src/main/java/de/bstly/we/jitsi/repository/JitsiRoomRepository.java index b746e8b..270e490 100755 --- a/jitsi/src/main/java/de/bstly/we/jitsi/repository/JitsiRoomRepository.java +++ b/jitsi/src/main/java/de/bstly/we/jitsi/repository/JitsiRoomRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.jitsi.model.JitsiRoom; /** - * - * @author _bastler@bstly.de - * + * The Interface JitsiRoomRepository. */ @Repository public interface JitsiRoomRepository diff --git a/membership/src/main/java/de/bstly/we/membership/businesslogic/MembershipManager.java b/membership/src/main/java/de/bstly/we/membership/businesslogic/MembershipManager.java index c8fb46e..96415ca 100644 --- a/membership/src/main/java/de/bstly/we/membership/businesslogic/MembershipManager.java +++ b/membership/src/main/java/de/bstly/we/membership/businesslogic/MembershipManager.java @@ -43,8 +43,7 @@ import de.bstly.we.businesslogic.SystemPropertyManager; import de.bstly.we.businesslogic.support.InstantHelper; /** - * @author _bastler@bstly.de - * + * The Class MembershipManager. */ @Component public class MembershipManager { @@ -58,7 +57,7 @@ public class MembershipManager { private DateFormat pretixDateFormat = new SimpleDateFormat("yyyy-MM-dd"); /** - * + * Generate membership ids. */ public void generateMembershipIds() { String membershipItemId = systemPropertyManager @@ -194,7 +193,7 @@ public class MembershipManager { } /** - * + * Active memberships. */ public void activeMemberships() { @@ -319,7 +318,7 @@ public class MembershipManager { } /** - * + * Creates the membership extension. */ public void createMembershipExtension() { @@ -565,7 +564,7 @@ public class MembershipManager { } /** - * + * Calculate price. */ public void calculatePrice() { int membershipItemId = systemPropertyManager @@ -631,10 +630,11 @@ public class MembershipManager { } /** - * - * @param writer - * @param includeInactive - * @return + * Membership csv export. + * + * @param writer the writer + * @param includeInactive the include inactive + * @return the json array */ public JsonArray membershipCsvExport(Writer writer, boolean includeInactive) { String membershipItemId = systemPropertyManager @@ -726,7 +726,7 @@ public class MembershipManager { } /** - * + * Cron. */ @Scheduled(cron = "${we.bstly.membership.cron:0 0 0 * * * }") public void cron() { @@ -737,11 +737,12 @@ public class MembershipManager { } /** - * - * @param path - * @param queryParams - * @param result - * @return + * Fetch all order positions. + * + * @param path the path + * @param queryParams the query params + * @param result the result + * @return the list */ protected List fetchAllOrderPositions(String path, MultiValueMap queryParams, List result) { @@ -762,10 +763,11 @@ public class MembershipManager { } /** - * - * @param orderPosition - * @param question - * @return + * Gets the answer object. + * + * @param orderPosition the order position + * @param question the question + * @return the answer object */ protected JsonObject getAnswerObject(JsonObject orderPosition, int question) { if (orderPosition.has("answers")) { @@ -780,10 +782,11 @@ public class MembershipManager { } /** - * - * @param orderPosition - * @param question - * @return + * Gets the number answer. + * + * @param orderPosition the order position + * @param question the question + * @return the number answer */ protected int getNumberAnswer(JsonObject orderPosition, int question) { JsonObject answer = getAnswerObject(orderPosition, question); @@ -794,10 +797,11 @@ public class MembershipManager { } /** - * - * @param orderPosition - * @param question - * @return + * Gets the date answer. + * + * @param orderPosition the order position + * @param question the question + * @return the date answer */ protected Instant getDateAnswer(JsonObject orderPosition, int question) { JsonObject answer = getAnswerObject(orderPosition, question); diff --git a/membership/src/main/java/de/bstly/we/membership/controller/MembershipController.java b/membership/src/main/java/de/bstly/we/membership/controller/MembershipController.java index 40e1b03..aad0f3f 100644 --- a/membership/src/main/java/de/bstly/we/membership/controller/MembershipController.java +++ b/membership/src/main/java/de/bstly/we/membership/controller/MembershipController.java @@ -29,8 +29,7 @@ import de.bstly.we.controller.support.EntityResponseStatusException; import de.bstly.we.membership.businesslogic.MembershipManager; /** - * @author _bastler@bstly.de - * + * The Class MembershipController. */ @RestController @@ -44,8 +43,9 @@ public class MembershipController extends BaseController { private String WEBHOOK_KEY; /** - * - * @param response + * Cron. + * + * @param response the response */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/cron") @@ -54,8 +54,9 @@ public class MembershipController extends BaseController { } /** - * - * @param response + * Generate membership ids. + * + * @param response the response */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/ids") @@ -64,8 +65,9 @@ public class MembershipController extends BaseController { } /** - * - * @param response + * Active memberships. + * + * @param response the response */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/active") @@ -74,8 +76,9 @@ public class MembershipController extends BaseController { } /** - * - * @param response + * Creates the membership extension. + * + * @param response the response */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/extension") @@ -84,8 +87,9 @@ public class MembershipController extends BaseController { } /** - * - * @param response + * Calculate price. + * + * @param response the response */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/calculateprice") @@ -93,6 +97,14 @@ public class MembershipController extends BaseController { membershipManager.calculatePrice(); } + /** + * Gets the member mail list. + * + * @param includeInactive the include inactive + * @param response the response + * @return the member mail list + * @throws IOException Signals that an I/O exception has occurred. + */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/export") public void getMemberMailList( @@ -105,9 +117,10 @@ public class MembershipController extends BaseController { } /** - * - * @param webhookKey - * @param payload + * Webhook. + * + * @param webhookKey the webhook key + * @param payload the payload */ @PostMapping("/pretix/webhook") public void webhook(@RequestParam("key") String webhookKey, @RequestBody String payload) { diff --git a/minetest/src/main/java/de/bstly/we/minetest/businesslogic/MinetestAccountManager.java b/minetest/src/main/java/de/bstly/we/minetest/businesslogic/MinetestAccountManager.java index ccc4259..87e36a3 100644 --- a/minetest/src/main/java/de/bstly/we/minetest/businesslogic/MinetestAccountManager.java +++ b/minetest/src/main/java/de/bstly/we/minetest/businesslogic/MinetestAccountManager.java @@ -23,8 +23,7 @@ import de.bstly.we.model.Quota; import de.bstly.we.model.UserData; /** - * @author _bastler@bstly.de - * + * The Class MinetestAccountManager. */ @Component public class MinetestAccountManager implements UserDataProvider { @@ -36,18 +35,20 @@ public class MinetestAccountManager implements UserDataProvider { private QMinetestAccount qMinetestAccount = QMinetestAccount.minetestAccount; /** - * - * @param name - * @return + * Gets the. + * + * @param name the name + * @return the minetest account */ public MinetestAccount get(String name) { return minetestAccountRepository.findById(name).orElse(null); } /** - * - * @param userId - * @return + * Gets the all by owner. + * + * @param userId the user id + * @return the all by owner */ public List getAllByOwner(Long userId) { return Lists @@ -55,12 +56,13 @@ public class MinetestAccountManager implements UserDataProvider { } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { return minetestAccountRepository.findAll(PageRequest.of(page, size, @@ -68,11 +70,12 @@ public class MinetestAccountManager implements UserDataProvider { } /** - * - * @param owner - * @param name - * @param quota - * @return + * Creates the. + * + * @param owner the owner + * @param name the name + * @param quota the quota + * @return the minetest account */ public MinetestAccount create(Long owner, String name, boolean quota) { MinetestAccount minetestAccount = new MinetestAccount(); @@ -97,18 +100,20 @@ public class MinetestAccountManager implements UserDataProvider { } /** - * - * @param minetestAccount - * @return + * Save. + * + * @param minetestAccount the minetest account + * @return the minetest account */ public MinetestAccount save(MinetestAccount minetestAccount) { return minetestAccountRepository.save(minetestAccount); } /** - * - * @param minetestAccount - * @param quota + * Delete. + * + * @param minetestAccount the minetest account + * @param quota the quota */ public void delete(MinetestAccount minetestAccount, boolean quota) { if (quota) { @@ -127,9 +132,10 @@ public class MinetestAccountManager implements UserDataProvider { } /** - * - * @param owner - * @param quota + * Delete all. + * + * @param owner the owner + * @param quota the quota */ public void deleteAll(Long owner, boolean quota) { List minetestAccounts = Lists @@ -140,6 +146,7 @@ public class MinetestAccountManager implements UserDataProvider { } } + /* * @see de.bstly.we.businesslogic.UserDataProvider#getId() */ @@ -148,6 +155,7 @@ public class MinetestAccountManager implements UserDataProvider { return "minetest-accounts"; } + /* * @see de.bstly.we.businesslogic.UserDataProvider#getUserData(java.lang.Long) */ @@ -160,6 +168,7 @@ public class MinetestAccountManager implements UserDataProvider { return result; } + /* * @see de.bstly.we.businesslogic.UserDataProvider#purgeUserData(java.lang.Long) */ diff --git a/minetest/src/main/java/de/bstly/we/minetest/businesslogic/MinetestPermissions.java b/minetest/src/main/java/de/bstly/we/minetest/businesslogic/MinetestPermissions.java index 6274b26..3136e5a 100644 --- a/minetest/src/main/java/de/bstly/we/minetest/businesslogic/MinetestPermissions.java +++ b/minetest/src/main/java/de/bstly/we/minetest/businesslogic/MinetestPermissions.java @@ -4,8 +4,7 @@ package de.bstly.we.minetest.businesslogic; /** - * @author _bastler@bstly.de - * + * The Interface MinetestPermissions. */ public interface MinetestPermissions { diff --git a/minetest/src/main/java/de/bstly/we/minetest/businesslogic/MinetestQuotas.java b/minetest/src/main/java/de/bstly/we/minetest/businesslogic/MinetestQuotas.java index d81da20..eec468e 100644 --- a/minetest/src/main/java/de/bstly/we/minetest/businesslogic/MinetestQuotas.java +++ b/minetest/src/main/java/de/bstly/we/minetest/businesslogic/MinetestQuotas.java @@ -4,8 +4,7 @@ package de.bstly.we.minetest.businesslogic; /** - * @author _bastler@bstly.de - * + * The Interface MinetestQuotas. */ public interface MinetestQuotas { diff --git a/minetest/src/main/java/de/bstly/we/minetest/controller/MinetestAccountController.java b/minetest/src/main/java/de/bstly/we/minetest/controller/MinetestAccountController.java index 17a303a..2f4bb90 100644 --- a/minetest/src/main/java/de/bstly/we/minetest/controller/MinetestAccountController.java +++ b/minetest/src/main/java/de/bstly/we/minetest/controller/MinetestAccountController.java @@ -30,8 +30,7 @@ import de.bstly.we.minetest.model.MinetestAccount; import de.bstly.we.model.Quota; /** - * @author _bastler@bstly.de - * + * The Class MinetestAccountController. */ @RestController @RequestMapping("/minetest/accounts") @@ -47,8 +46,9 @@ public class MinetestAccountController extends BaseController { private MinetestAccountValidator minetestAccountModelValidator; /** - * - * @return + * Gets the minetest accounts. + * + * @return the minetest accounts */ @PreAuthorize("isAuthenticated()") @GetMapping @@ -62,9 +62,10 @@ public class MinetestAccountController extends BaseController { } /** - * - * @param minetestAccountModel - * @return + * Creates the minetest account. + * + * @param minetestAccount the minetest account + * @return the minetest account */ @PreAuthorize("isAuthenticated()") @PostMapping @@ -92,8 +93,9 @@ public class MinetestAccountController extends BaseController { } /** - * - * @param id + * Delete minetest account. + * + * @param name the name */ @PreAuthorize("isAuthenticated()") @DeleteMapping("/{name}") diff --git a/minetest/src/main/java/de/bstly/we/minetest/controller/MinetestAccountManagementController.java b/minetest/src/main/java/de/bstly/we/minetest/controller/MinetestAccountManagementController.java index 8335ae8..fadccea 100644 --- a/minetest/src/main/java/de/bstly/we/minetest/controller/MinetestAccountManagementController.java +++ b/minetest/src/main/java/de/bstly/we/minetest/controller/MinetestAccountManagementController.java @@ -27,8 +27,7 @@ import de.bstly.we.minetest.controller.validation.MinetestAccountValidator; import de.bstly.we.minetest.model.MinetestAccount; /** - * @author _bastler@bstly.de - * + * The Class MinetestAccountManagementController. */ @RestController @RequestMapping("/minetest/accounts/manage") @@ -40,8 +39,11 @@ public class MinetestAccountManagementController extends BaseController { private MinetestAccountValidator minetestAccountModelValidator; /** - * - * @return + * Gets the minetest accounts. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @return the minetest accounts */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -53,9 +55,10 @@ public class MinetestAccountManagementController extends BaseController { } /** - * - * @param minetestAccount - * @return + * Creates the or update minetest account. + * + * @param minetestAccount the minetest account + * @return the minetest account */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -73,8 +76,10 @@ public class MinetestAccountManagementController extends BaseController { } /** - * - * @param id + * Delete minetest account. + * + * @param name the name + * @param quota the quota */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/{name}") @@ -91,8 +96,10 @@ public class MinetestAccountManagementController extends BaseController { } /** - * - * @param owner + * Delete all. + * + * @param owner the owner + * @param quota the quota */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/all/{owner}") diff --git a/minetest/src/main/java/de/bstly/we/minetest/controller/validation/MinetestAccountValidator.java b/minetest/src/main/java/de/bstly/we/minetest/controller/validation/MinetestAccountValidator.java index 4d0c63d..0fe6b17 100644 --- a/minetest/src/main/java/de/bstly/we/minetest/controller/validation/MinetestAccountValidator.java +++ b/minetest/src/main/java/de/bstly/we/minetest/controller/validation/MinetestAccountValidator.java @@ -15,8 +15,7 @@ import de.bstly.we.minetest.businesslogic.MinetestAccountManager; import de.bstly.we.minetest.model.MinetestAccount; /** - * @author _bastler@bstly.de - * + * The Class MinetestAccountValidator. */ @Component public class MinetestAccountValidator implements Validator { @@ -27,19 +26,18 @@ public class MinetestAccountValidator implements Validator { private SystemPropertyManager systemPropertyManager; protected static final String NAME_REGEX = "^([-_a-zA-Z0-9]+)$"; + /* * @see org.springframework.validation.Validator#supports(java.lang.Class) */ - @Override public boolean supports(Class clazz) { return clazz.isAssignableFrom(MinetestAccount.class); } + /* - * @see org.springframework.validation.Validator#validate(java.lang.Object, - * org.springframework.validation.Errors) + * @see org.springframework.validation.Validator#validate(java.lang.Object, org.springframework.validation.Errors) */ - @Override public void validate(Object target, Errors errors) { validateMinetestName(target, errors); if (!errors.hasErrors()) { @@ -48,9 +46,10 @@ public class MinetestAccountValidator implements Validator { } /** - * - * @param target - * @param errors + * Validate minetest name. + * + * @param target the target + * @param errors the errors */ public void validateMinetestName(Object target, Errors errors) { MinetestAccount minetestAccount = (MinetestAccount) target; @@ -72,9 +71,10 @@ public class MinetestAccountValidator implements Validator { } /** - * - * @param target - * @param errors + * Validate reserved names. + * + * @param target the target + * @param errors the errors */ public void validateReservedNames(Object target, Errors errors) { MinetestAccount minetestAccount = (MinetestAccount) target; diff --git a/minetest/src/main/java/de/bstly/we/minetest/model/MinetestAccount.java b/minetest/src/main/java/de/bstly/we/minetest/model/MinetestAccount.java index 2f9c0a6..14c99d2 100644 --- a/minetest/src/main/java/de/bstly/we/minetest/model/MinetestAccount.java +++ b/minetest/src/main/java/de/bstly/we/minetest/model/MinetestAccount.java @@ -12,8 +12,7 @@ import javax.persistence.Table; import de.bstly.we.model.UserData; /** - * @author _bastler@bstly.de - * + * The Class MinetestAccount. */ @Entity @Table(name = "minetest_accounts") @@ -29,6 +28,8 @@ public class MinetestAccount implements UserData { private String skin; /** + * Gets the name. + * * @return the name */ public String getName() { @@ -36,13 +37,17 @@ public class MinetestAccount implements UserData { } /** - * @param name the name to set + * Sets the name. + * + * @param name the new name */ public void setName(String name) { this.name = name; } /** + * Gets the owner. + * * @return the owner */ public Long getOwner() { @@ -50,13 +55,17 @@ public class MinetestAccount implements UserData { } /** - * @param owner the owner to set + * Sets the owner. + * + * @param owner the new owner */ public void setOwner(Long owner) { this.owner = owner; } /** + * Gets the skin. + * * @return the skin */ public String getSkin() { @@ -64,7 +73,9 @@ public class MinetestAccount implements UserData { } /** - * @param skin the skin to set + * Sets the skin. + * + * @param skin the new skin */ public void setSkin(String skin) { this.skin = skin; diff --git a/minetest/src/main/java/de/bstly/we/minetest/repository/MinetestAccountRepository.java b/minetest/src/main/java/de/bstly/we/minetest/repository/MinetestAccountRepository.java index 7bbddbf..1c86780 100755 --- a/minetest/src/main/java/de/bstly/we/minetest/repository/MinetestAccountRepository.java +++ b/minetest/src/main/java/de/bstly/we/minetest/repository/MinetestAccountRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.minetest.model.MinetestAccount; /** - * - * @author _bastler@bstly.de - * + * The Interface MinetestAccountRepository. */ @Repository public interface MinetestAccountRepository diff --git a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcAuthorizationCodeManager.java b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcAuthorizationCodeManager.java index 75cb1d6..33dd83e 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcAuthorizationCodeManager.java +++ b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcAuthorizationCodeManager.java @@ -14,9 +14,7 @@ import com.google.common.collect.Maps; import de.bstly.we.oidc.model.OidcAuthorizationCode; /** - * - * @author _bastler@bstly.de - * + * The Class OidcAuthorizationCodeManager. */ @Service public class OidcAuthorizationCodeManager { @@ -27,12 +25,14 @@ public class OidcAuthorizationCodeManager { private final Map oidcAuthorizationCodes = Maps.newHashMap(); /** - * - * @param clientId - * @param redirectUri - * @param scopes - * @param subject - * @return + * Creates the. + * + * @param clientId the client id + * @param redirectUri the redirect uri + * @param scopes the scopes + * @param userId the user id + * @param nonce the nonce + * @return the oidc authorization code */ public OidcAuthorizationCode create(String clientId, URI redirectUri, Set scopes, Long userId, String nonce) { @@ -43,17 +43,19 @@ public class OidcAuthorizationCodeManager { } /** - * - * @param code - * @return + * Gets the by code. + * + * @param code the code + * @return the by code */ public OidcAuthorizationCode getByCode(String code) { return oidcAuthorizationCodes.get(code); } /** - * - * @param code + * Removes the by code. + * + * @param code the code */ public void removeByCode(String code) { oidcAuthorizationCodes.remove(code); diff --git a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcClientManager.java b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcClientManager.java index d8b47f1..ce0f7b6 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcClientManager.java +++ b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcClientManager.java @@ -22,9 +22,7 @@ import de.bstly.we.oidc.model.QOidcClient; import de.bstly.we.oidc.repository.OidcClientRepository; /** - * - * @author _bastler@bstly.de - * + * The Class OidcClientManager. */ @Service public class OidcClientManager { @@ -38,10 +36,11 @@ public class OidcClientManager { private QOidcClient qOidcClient = QOidcClient.oidcClient; /** - * - * @param clientName - * @param redirectUris - * @return + * Creates the client. + * + * @param clientName the client name + * @param redirectUris the redirect uris + * @return the oidc client */ public OidcClient createClient(String clientName, Set redirectUris) { return createClient(clientName, @@ -52,13 +51,16 @@ public class OidcClientManager { } /** - * - * @param clientName - * @param clientAuthenticationMethods - * @param authorizationGrantTypes - * @param redirectUris - * @param scopes - * @return + * Creates the client. + * + * @param clientName the client name + * @param clientAuthenticationMethods the client authentication methods + * @param authorizationGrantTypes the authorization grant types + * @param redirectUris the redirect uris + * @param scopes the scopes + * @param loginUrl the login url + * @param alwaysPermitted the always permitted + * @return the oidc client */ public OidcClient createClient(String clientName, Set clientAuthenticationMethods, @@ -90,18 +92,20 @@ public class OidcClientManager { } /** - * - * @param oidcClient - * @return + * Update client. + * + * @param oidcClient the oidc client + * @return the oidc client */ public OidcClient updateClient(OidcClient oidcClient) { return oidcClientRepository.save(oidcClient); } /** - * - * @param clientName - * @return + * Creates the new secret by client name. + * + * @param clientName the client name + * @return the oidc client */ public OidcClient createNewSecretByClientName(String clientName) { OidcClient oidcClient = getByClientName(clientName); @@ -113,28 +117,31 @@ public class OidcClientManager { } /** - * - * @param clientId - * @return + * Gets the by client id. + * + * @param clientId the client id + * @return the by client id */ public OidcClient getByClientId(String clientId) { return oidcClientRepository.findOne(qOidcClient.clientId.eq(clientId)).orElse(null); } /** - * - * @param clientName - * @return + * Gets the by client name. + * + * @param clientName the client name + * @return the by client name */ public OidcClient getByClientName(String clientName) { return oidcClientRepository.findOne(qOidcClient.clientName.eq(clientName)).orElse(null); } /** - * - * @param clientId - * @param clientSecret - * @return + * Gets the by client id and secret. + * + * @param clientId the client id + * @param clientSecret the client secret + * @return the by client id and secret */ public OidcClient getByClientIdAndSecret(String clientId, String clientSecret) { return oidcClientRepository.findOne( @@ -143,9 +150,9 @@ public class OidcClientManager { } /** - * - * @param clientId - * @return + * Delete by client id. + * + * @param clientId the client id */ public void deleteByClientId(String clientId) { OidcClient oidcClient = getByClientId(clientId); @@ -155,8 +162,9 @@ public class OidcClientManager { } /** - * - * @param name + * Delete by client name. + * + * @param clientName the client name */ public void deleteByClientName(String clientName) { OidcClient oidcClient = getByClientName(clientName); @@ -165,12 +173,13 @@ public class OidcClientManager { } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { Sort sort = descending ? Sort.by(sortBy).descending() : Sort.by(sortBy).ascending(); diff --git a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcTokenManager.java b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcTokenManager.java index 6ba3c47..306c8b5 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcTokenManager.java +++ b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcTokenManager.java @@ -49,9 +49,7 @@ import de.bstly.we.oidc.model.QOidcToken; import de.bstly.we.oidc.repository.OidcTokenRepository; /** - * - * @author _bastler@bstly.de - * + * The Class OidcTokenManager. */ @Service public class OidcTokenManager { @@ -79,6 +77,11 @@ public class OidcTokenManager { private SystemPropertyManager systemPropertyManager; private QOidcToken qOidcToken = QOidcToken.oidcToken; + /** + * Inits the oidc token manager. + * + * @throws JOSEException the JOSE exception + */ @PostConstruct public void initOidcTokenManager() throws JOSEException { RSAKey rsaJWK = null; @@ -100,10 +103,11 @@ public class OidcTokenManager { } /** - * - * @param client - * @param target - * @return + * Creates the token. + * + * @param client the client + * @param userId the user id + * @return the oidc token */ public OidcToken createToken(OidcClient client, Long userId) { OidcToken token = new OidcToken(); @@ -114,14 +118,15 @@ public class OidcTokenManager { } /** - * - * @param client - * @param userId - * @param nonce - * @param scopes - * @param issuer - * @return - * @throws JOSEException + * Creates the token with id token. + * + * @param client the client + * @param userId the user id + * @param nonce the nonce + * @param scopes the scopes + * @param issuer the issuer + * @return the oidc token + * @throws JOSEException the JOSE exception */ public OidcToken createTokenWithIdToken(OidcClient client, Long userId, String nonce, Set scopes, String issuer) throws JOSEException { @@ -161,9 +166,10 @@ public class OidcTokenManager { } /** - * - * @param user - * @return + * Creates the user claims. + * + * @param user the user + * @return the builder */ public Builder createUserClaims(User user) { @@ -219,41 +225,46 @@ public class OidcTokenManager { } /** - * - * @param accessToken - * @return + * Gets the by access token. + * + * @param accessToken the access token + * @return the by access token */ public OidcToken getByAccessToken(String accessToken) { return tokenRepository.findOne(qOidcToken.accessToken.eq(accessToken)).orElse(null); } /** - * - * @return + * Gets the signer. + * + * @return the signer */ public JWSSigner getSigner() { return signer; } /** - * - * @return + * Gets the verifier. + * + * @return the verifier */ public JWSVerifier getVerifier() { return verifier; } /** - * - * @return + * Gets the public key. + * + * @return the public key */ public RSAKey getPublicKey() { return publicKey; } /** - * - * @return + * Gets the jwk set. + * + * @return the jwk set */ public JWKSet getJwkSet() { return jwkSet; diff --git a/oidc/src/main/java/de/bstly/we/oidc/controller/OIDCClientController.java b/oidc/src/main/java/de/bstly/we/oidc/controller/OIDCClientController.java index 4f6e4f6..8b3fc1f 100755 --- a/oidc/src/main/java/de/bstly/we/oidc/controller/OIDCClientController.java +++ b/oidc/src/main/java/de/bstly/we/oidc/controller/OIDCClientController.java @@ -31,9 +31,7 @@ import de.bstly.we.oidc.model.OidcClientAuthenticationMethod; import de.bstly.we.oidc.repository.OidcClientRepository; /** - * - * @author _bastler@bstly.de - * + * The Class OIDCClientController. */ @RestController @RequestMapping("/oidc/clients") @@ -45,10 +43,11 @@ public class OIDCClientController extends BaseController { private OidcClientRepository registeredClientRepository; /** - * - * @param pageParameter - * @param sizeParameter - * @return + * Gets the clients. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @return the clients */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -59,9 +58,10 @@ public class OIDCClientController extends BaseController { } /** - * - * @param name - * @return + * Gets the. + * + * @param name the name + * @return the oidc client */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/{name}") @@ -75,9 +75,10 @@ public class OIDCClientController extends BaseController { } /** - * - * @param clientId - * @return + * Gets the by client id. + * + * @param clientId the client id + * @return the by client id */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/id/{clientId}") @@ -91,9 +92,10 @@ public class OIDCClientController extends BaseController { } /** - * - * @param oidcClientModel - * @return + * Creates the. + * + * @param oidcClientModel the oidc client model + * @return the oidc client */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -122,9 +124,10 @@ public class OIDCClientController extends BaseController { } /** - * - * @param oAuth2ClientModel - * @return + * Update. + * + * @param client the client + * @return the oidc client */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PatchMapping @@ -146,9 +149,9 @@ public class OIDCClientController extends BaseController { } /** - * - * @param oAuth2ClientModel - * @return + * Delete client. + * + * @param name the name */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/{name}") @@ -160,9 +163,10 @@ public class OIDCClientController extends BaseController { } /** - * - * @param oAuth2ClientModel - * @return + * Creates the new secret. + * + * @param name the name + * @return the oidc client */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/{name}/secret") diff --git a/oidc/src/main/java/de/bstly/we/oidc/controller/OidcAuthorizationController.java b/oidc/src/main/java/de/bstly/we/oidc/controller/OidcAuthorizationController.java index cfb32fc..b0f8112 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/controller/OidcAuthorizationController.java +++ b/oidc/src/main/java/de/bstly/we/oidc/controller/OidcAuthorizationController.java @@ -36,9 +36,7 @@ import de.bstly.we.oidc.model.OidcClient; import de.bstly.we.security.model.LocalUserDetails; /** - * - * @author _bastler@bstly.de - * + * The Class OidcAuthorizationController. */ @RequestMapping("/oidc/authorize") @RestController @@ -54,15 +52,18 @@ public class OidcAuthorizationController { private OidcAuthorizationCodeManager oidcAuthorizationCodeManager; /** - * - * @param scope - * @param responseType - * @param clientId - * @param redirectUri - * @param state - * @param request - * @param response - * @throws IOException + * Authorization request. + * + * @param scope the scope + * @param responseType the response type + * @param clientId the client id + * @param redirectUri the redirect uri + * @param state the state + * @param nonce the nonce + * @param principal the principal + * @param request the request + * @param response the response + * @throws IOException Signals that an I/O exception has occurred. */ @PreAuthorize("isAuthenticated()") @GetMapping @@ -167,11 +168,11 @@ public class OidcAuthorizationController { } /** - * - * @param exception - * @param httpServletResponse - * @return - * @throws IOException + * Handle. + * + * @param exception the exception + * @param response the response + * @throws IOException Signals that an I/O exception has occurred. */ @ExceptionHandler(InvalidAuthorizationRequestError.class) public void handle(InvalidAuthorizationRequestError exception, HttpServletResponse response) @@ -192,9 +193,7 @@ public class OidcAuthorizationController { } /** - * - * @author _bastler@bstly.de - * + * The Class InvalidAuthorizationRequestError. */ static class InvalidAuthorizationRequestError extends RuntimeException { /** @@ -208,11 +207,12 @@ public class OidcAuthorizationController { private String state; /** - * - * @param redirectUri - * @param errorCode - * @param errorDescription - * @param state + * Instantiates a new invalid authorization request error. + * + * @param redirectUri the redirect uri + * @param errorCode the error code + * @param errorDescription the error description + * @param state the state */ InvalidAuthorizationRequestError(URI redirectUri, OidcAuthorizationErrorCode errorCode, String errorDescription, String state) { @@ -224,48 +224,62 @@ public class OidcAuthorizationController { } /** - * @return the redirectUri + * Gets the redirect uri. + * + * @return the redirect uri */ public URI getRedirectUri() { return redirectUri; } /** - * @param redirectUri the redirectUri to set + * Sets the redirect uri. + * + * @param redirectUri the new redirect uri */ public void setRedirectUri(URI redirectUri) { this.redirectUri = redirectUri; } /** - * @return the errorCode + * Gets the error code. + * + * @return the error code */ public OidcAuthorizationErrorCode getErrorCode() { return errorCode; } /** - * @param errorCode the errorCode to set + * Sets the error code. + * + * @param errorCode the new error code */ public void setErrorCode(OidcAuthorizationErrorCode errorCode) { this.errorCode = errorCode; } /** - * @return the errorDescription + * Gets the error description. + * + * @return the error description */ public String getErrorDescription() { return errorDescription; } /** - * @param errorDescription the errorDescription to set + * Sets the error description. + * + * @param errorDescription the new error description */ public void setErrorDescription(String errorDescription) { this.errorDescription = errorDescription; } /** + * Gets the state. + * * @return the state */ public String getState() { @@ -273,7 +287,9 @@ public class OidcAuthorizationController { } /** - * @param state the state to set + * Sets the state. + * + * @param state the new state */ public void setState(String state) { this.state = state; diff --git a/oidc/src/main/java/de/bstly/we/oidc/controller/OidcDiscoveryController.java b/oidc/src/main/java/de/bstly/we/oidc/controller/OidcDiscoveryController.java index bfffce6..210ea3c 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/controller/OidcDiscoveryController.java +++ b/oidc/src/main/java/de/bstly/we/oidc/controller/OidcDiscoveryController.java @@ -22,8 +22,7 @@ import de.bstly.we.controller.support.EntityResponseStatusException; import de.bstly.we.oidc.model.OidcConfiguration; /** - * @author _bastler@bstly.de - * + * The Class OidcDiscoveryController. */ @RequestMapping("/.well-known/openid-configuration") @RestController @@ -32,6 +31,13 @@ public class OidcDiscoveryController { @Value("${oidc.provider.issuer:}") private String oidcIssuer; + /** + * Gets the configuration. + * + * @param request the request + * @param response the response + * @return the configuration + */ @GetMapping public OidcConfiguration getConfiguration(HttpServletRequest request, HttpServletResponse response) { diff --git a/oidc/src/main/java/de/bstly/we/oidc/controller/OidcJwksController.java b/oidc/src/main/java/de/bstly/we/oidc/controller/OidcJwksController.java index 3e48489..2401e9d 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/controller/OidcJwksController.java +++ b/oidc/src/main/java/de/bstly/we/oidc/controller/OidcJwksController.java @@ -13,9 +13,7 @@ import org.springframework.web.bind.annotation.RestController; import de.bstly.we.oidc.businesslogic.OidcTokenManager; /** - * - * @author _bastler@bstly.de - * + * The Class OidcJwksController. */ @RequestMapping("/oidc/jwks") @RestController @@ -24,6 +22,11 @@ public class OidcJwksController { @Autowired private OidcTokenManager oidcTokenManager; + /** + * Gets the jwks. + * + * @return the jwks + */ @GetMapping public Map getJwks() { return oidcTokenManager.getJwkSet().toJSONObject(); diff --git a/oidc/src/main/java/de/bstly/we/oidc/controller/OidcTokenController.java b/oidc/src/main/java/de/bstly/we/oidc/controller/OidcTokenController.java index f3187a7..405c98d 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/controller/OidcTokenController.java +++ b/oidc/src/main/java/de/bstly/we/oidc/controller/OidcTokenController.java @@ -44,9 +44,7 @@ import de.bstly.we.oidc.model.OidcTokenRequest; import de.bstly.we.oidc.model.OidcTokenResponse; /** - * - * @author _bastler@bstly.de - * + * The Class OidcTokenController. */ @RequestMapping("/oidc/token") @RestController @@ -66,6 +64,15 @@ public class OidcTokenController { @Value("${oidc.provider.issuer:}") private String oidcIssuer; + /** + * Gets the token. + * + * @param authorizationHeader the authorization header + * @param tokenRequest the token request + * @param request the request + * @param response the response + * @return the token + */ @PostMapping public OidcTokenResponse getToken( // Authorization header for BASIC client authentication method @@ -198,11 +205,12 @@ public class OidcTokenController { } /** - * - * @param exception - * @param httpServletResponse - * @return - * @throws IOException + * Handle. + * + * @param exception the exception + * @param response the response + * @return the response entity + * @throws IOException Signals that an I/O exception has occurred. */ @ExceptionHandler(InvalidTokenRequestError.class) public ResponseEntity handle(InvalidTokenRequestError exception, @@ -213,9 +221,7 @@ public class OidcTokenController { } /** - * - * @author _bastler@bstly.de - * + * The Class InvalidTokenRequestError. */ static class InvalidTokenRequestError extends RuntimeException { @@ -227,6 +233,12 @@ public class OidcTokenController { private OidcTokenErrorCode errorCode; private String errorDescription; + /** + * Instantiates a new invalid token request error. + * + * @param errorCode the error code + * @param errorDescription the error description + */ InvalidTokenRequestError(OidcTokenErrorCode errorCode, String errorDescription) { super(errorDescription); this.errorCode = errorCode; @@ -234,28 +246,36 @@ public class OidcTokenController { } /** - * @return the errorCode + * Gets the error code. + * + * @return the error code */ public OidcTokenErrorCode getErrorCode() { return errorCode; } /** - * @param errorCode the errorCode to set + * Sets the error code. + * + * @param errorCode the new error code */ public void setErrorCode(OidcTokenErrorCode errorCode) { this.errorCode = errorCode; } /** - * @return the errorDescription + * Gets the error description. + * + * @return the error description */ public String getErrorDescription() { return errorDescription; } /** - * @param errorDescription the errorDescription to set + * Sets the error description. + * + * @param errorDescription the new error description */ public void setErrorDescription(String errorDescription) { this.errorDescription = errorDescription; diff --git a/oidc/src/main/java/de/bstly/we/oidc/controller/OidcUserInfoController.java b/oidc/src/main/java/de/bstly/we/oidc/controller/OidcUserInfoController.java index 210abe4..c239f76 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/controller/OidcUserInfoController.java +++ b/oidc/src/main/java/de/bstly/we/oidc/controller/OidcUserInfoController.java @@ -23,9 +23,7 @@ import de.bstly.we.oidc.businesslogic.OidcTokenManager; import de.bstly.we.oidc.model.OidcToken; /** - * - * @author _bastler@bstly.de - * + * The Class OidcUserInfoController. */ @RequestMapping("/oidc/userinfo") @RestController @@ -37,9 +35,10 @@ public class OidcUserInfoController extends BaseController { private UserManager userManager; /** - * - * @param authorizationHeader - * @return + * Gets the user info. + * + * @param authorizationHeader the authorization header + * @return the user info */ @RequestMapping(method = { RequestMethod.GET, RequestMethod.POST }) public void getUserInfo( diff --git a/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcClientModel.java b/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcClientModel.java index adbfab0..6390487 100755 --- a/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcClientModel.java +++ b/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcClientModel.java @@ -9,9 +9,7 @@ import de.bstly.we.oidc.model.OidcAuthorizationGrantType; import de.bstly.we.oidc.model.OidcClientAuthenticationMethod; /** - * - * @author _bastler@bstly.de - * + * The Class OidcClientModel. */ public class OidcClientModel { @@ -24,6 +22,8 @@ public class OidcClientModel { private boolean alwaysPermitted; /** + * Gets the name. + * * @return the name */ public String getName() { @@ -31,35 +31,45 @@ public class OidcClientModel { } /** - * @param name the name to set + * Sets the name. + * + * @param name the new name */ public void setName(String name) { this.name = name; } /** - * @return the registeredRedirectUris + * Gets the registered redirect uris. + * + * @return the registered redirect uris */ public Set getRegisteredRedirectUris() { return registeredRedirectUris; } /** - * @param registeredRedirectUris the registeredRedirectUris to set + * Sets the registered redirect uris. + * + * @param registeredRedirectUris the new registered redirect uris */ public void setRegisteredRedirectUris(Set registeredRedirectUris) { this.registeredRedirectUris = registeredRedirectUris; } /** - * @return the clientAuthenticationMethods + * Gets the client authentication methods. + * + * @return the client authentication methods */ public Set getClientAuthenticationMethods() { return clientAuthenticationMethods; } /** - * @param clientAuthenticationMethods the clientAuthenticationMethods to set + * Sets the client authentication methods. + * + * @param clientAuthenticationMethods the new client authentication methods */ public void setClientAuthenticationMethods( Set clientAuthenticationMethods) { @@ -67,14 +77,18 @@ public class OidcClientModel { } /** - * @return the authorizationGrantTypes + * Gets the authorization grant types. + * + * @return the authorization grant types */ public Set getAuthorizationGrantTypes() { return authorizationGrantTypes; } /** - * @param authorizationGrantTypes the authorizationGrantTypes to set + * Sets the authorization grant types. + * + * @param authorizationGrantTypes the new authorization grant types */ public void setAuthorizationGrantTypes( Set authorizationGrantTypes) { @@ -82,6 +96,8 @@ public class OidcClientModel { } /** + * Gets the scopes. + * * @return the scopes */ public Set getScopes() { @@ -89,35 +105,45 @@ public class OidcClientModel { } /** - * @param scopes the scopes to set + * Sets the scopes. + * + * @param scopes the new scopes */ public void setScopes(Set scopes) { this.scopes = scopes; } /** - * @return the loginUrl + * Gets the login url. + * + * @return the login url */ public String getLoginUrl() { return loginUrl; } /** - * @param loginUrl the loginUrl to set + * Sets the login url. + * + * @param loginUrl the new login url */ public void setLoginUrl(String loginUrl) { this.loginUrl = loginUrl; } /** - * @return the alwaysPermitted + * Checks if is always permitted. + * + * @return true, if is always permitted */ public boolean isAlwaysPermitted() { return alwaysPermitted; } /** - * @param alwaysPermitted the alwaysPermitted to set + * Sets the always permitted. + * + * @param alwaysPermitted the new always permitted */ public void setAlwaysPermitted(boolean alwaysPermitted) { this.alwaysPermitted = alwaysPermitted; diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationCode.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationCode.java index 4ec5977..0674752 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationCode.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationCode.java @@ -11,9 +11,7 @@ import java.util.Set; import org.apache.commons.lang3.RandomStringUtils; /** - * - * @author _bastler@bstly.de - * + * The Class OidcAuthorizationCode. */ public class OidcAuthorizationCode { @@ -29,12 +27,13 @@ public class OidcAuthorizationCode { private final String nonce; /** - * @param clientId - * @param redirectUri - * @param scopes - * @param code - * @param expiry - * @param subject + * Instantiates a new oidc authorization code. + * + * @param clientId the client id + * @param redirectUri the redirect uri + * @param scopes the scopes + * @param userId the user id + * @param nonce the nonce */ public OidcAuthorizationCode(String clientId, URI redirectUri, Set scopes, Long userId, String nonce) { @@ -48,20 +47,26 @@ public class OidcAuthorizationCode { } /** - * @return the clientId + * Gets the client id. + * + * @return the client id */ public String getClientId() { return clientId; } /** - * @return the redirectUri + * Gets the redirect uri. + * + * @return the redirect uri */ public URI getRedirectUri() { return redirectUri; } /** + * Gets the scopes. + * * @return the scopes */ public Set getScopes() { @@ -69,6 +74,8 @@ public class OidcAuthorizationCode { } /** + * Gets the code. + * * @return the code */ public String getCode() { @@ -76,6 +83,8 @@ public class OidcAuthorizationCode { } /** + * Gets the expiry. + * * @return the expiry */ public Instant getExpiry() { @@ -83,13 +92,17 @@ public class OidcAuthorizationCode { } /** - * @return the userId + * Gets the user id. + * + * @return the user id */ public Long getUserId() { return userId; } /** + * Gets the nonce. + * * @return the nonce */ public String getNonce() { diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationErrorCode.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationErrorCode.java index 0b849f5..f8a8d3f 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationErrorCode.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationErrorCode.java @@ -4,9 +4,7 @@ package de.bstly.we.oidc.model; /** - * - * @author _bastler@bstly.de - * + * The Enum OidcAuthorizationErrorCode. */ public enum OidcAuthorizationErrorCode { INVALID_REQUEST("invalid_request"), UNAUTHORIZED_CLIENT("unauthorized_client"), ACCESS_DENIED("access_denied"), @@ -20,10 +18,20 @@ public enum OidcAuthorizationErrorCode { private final String authorizationErrorCode; + /** + * Instantiates a new oidc authorization error code. + * + * @param authorizationErrorCode the authorization error code + */ OidcAuthorizationErrorCode(String authorizationErrorCode) { this.authorizationErrorCode = authorizationErrorCode; } + /** + * Gets the authorization error code. + * + * @return the authorization error code + */ public String getAuthorizationErrorCode() { return authorizationErrorCode; } diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationGrantType.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationGrantType.java index 53d4543..16afc8b 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationGrantType.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationGrantType.java @@ -4,9 +4,7 @@ package de.bstly.we.oidc.model; /** - * - * @author _bastler@bstly.de - * + * The Enum OidcAuthorizationGrantType. */ public enum OidcAuthorizationGrantType { authorization_code, client_credentials diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationResponseType.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationResponseType.java index 7120294..c917eb4 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationResponseType.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorizationResponseType.java @@ -4,9 +4,7 @@ package de.bstly.we.oidc.model; /** - * - * @author _bastler@bstly.de - * + * The Enum OidcAuthorizationResponseType. */ public enum OidcAuthorizationResponseType { code diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcClient.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcClient.java index 124dfce..00eef99 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcClient.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcClient.java @@ -20,9 +20,7 @@ import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollectionOption; /** - * - * @author _bastler@bstly.de - * + * The Class OidcClient. */ @Entity @Table(name = "oidc_clients") @@ -66,6 +64,8 @@ public class OidcClient { private String category; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -73,63 +73,81 @@ public class OidcClient { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** - * @return the clientName + * Gets the client name. + * + * @return the client name */ public String getClientName() { return clientName; } /** - * @param clientName the clientName to set + * Sets the client name. + * + * @param clientName the new client name */ public void setClientName(String clientName) { this.clientName = clientName; } /** - * @return the clientId + * Gets the client id. + * + * @return the client id */ public String getClientId() { return clientId; } /** - * @param clientId the clientId to set + * Sets the client id. + * + * @param clientId the new client id */ public void setClientId(String clientId) { this.clientId = clientId; } /** - * @return the clientSecret + * Gets the client secret. + * + * @return the client secret */ public String getClientSecret() { return clientSecret; } /** - * @param clientSecret the clientSecret to set + * Sets the client secret. + * + * @param clientSecret the new client secret */ public void setClientSecret(String clientSecret) { this.clientSecret = clientSecret; } /** - * @return the clientAuthenticationMethods + * Gets the client authentication methods. + * + * @return the client authentication methods */ public Set getClientAuthenticationMethods() { return clientAuthenticationMethods; } /** - * @param clientAuthenticationMethods the clientAuthenticationMethods to set + * Sets the client authentication methods. + * + * @param clientAuthenticationMethods the new client authentication methods */ public void setClientAuthenticationMethods( Set clientAuthenticationMethods) { @@ -137,14 +155,18 @@ public class OidcClient { } /** - * @return the authorizationGrantTypes + * Gets the authorization grant types. + * + * @return the authorization grant types */ public Set getAuthorizationGrantTypes() { return authorizationGrantTypes; } /** - * @param authorizationGrantTypes the authorizationGrantTypes to set + * Sets the authorization grant types. + * + * @param authorizationGrantTypes the new authorization grant types */ public void setAuthorizationGrantTypes( Set authorizationGrantTypes) { @@ -152,20 +174,26 @@ public class OidcClient { } /** - * @return the redirectUris + * Gets the redirect uris. + * + * @return the redirect uris */ public Set getRedirectUris() { return redirectUris; } /** - * @param redirectUris the redirectUris to set + * Sets the redirect uris. + * + * @param redirectUris the new redirect uris */ public void setRedirectUris(Set redirectUris) { this.redirectUris = redirectUris; } /** + * Gets the scopes. + * * @return the scopes */ public Set getScopes() { @@ -173,55 +201,71 @@ public class OidcClient { } /** - * @param scopes the scopes to set + * Sets the scopes. + * + * @param scopes the new scopes */ public void setScopes(Set scopes) { this.scopes = scopes; } /** - * @return the tokenLifetime + * Gets the token lifetime. + * + * @return the token lifetime */ public Long getTokenLifetime() { return tokenLifetime; } /** - * @param tokenLifetime the tokenLifetime to set + * Sets the token lifetime. + * + * @param tokenLifetime the new token lifetime */ public void setTokenLifetime(Long tokenLifetime) { this.tokenLifetime = tokenLifetime; } /** - * @return the loginUrl + * Gets the login url. + * + * @return the login url */ public String getLoginUrl() { return loginUrl; } /** - * @param loginUrl the loginUrl to set + * Sets the login url. + * + * @param loginUrl the new login url */ public void setLoginUrl(String loginUrl) { this.loginUrl = loginUrl; } /** - * @return the alwaysPermitted + * Checks if is always permitted. + * + * @return true, if is always permitted */ public boolean isAlwaysPermitted() { return alwaysPermitted; } /** - * @param alwaysPermitted the alwaysPermitted to set + * Sets the always permitted. + * + * @param alwaysPermitted the new always permitted */ public void setAlwaysPermitted(boolean alwaysPermitted) { this.alwaysPermitted = alwaysPermitted; } /** + * Gets the category. + * * @return the category */ public String getCategory() { @@ -229,7 +273,9 @@ public class OidcClient { } /** - * @param category the category to set + * Sets the category. + * + * @param category the new category */ public void setCategory(String category) { this.category = category; diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcClientAuthenticationMethod.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcClientAuthenticationMethod.java index e169527..c96cbc6 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcClientAuthenticationMethod.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcClientAuthenticationMethod.java @@ -4,9 +4,7 @@ package de.bstly.we.oidc.model; /** - * - * @author _bastler@bstly.de - * + * The Enum OidcClientAuthenticationMethod. */ public enum OidcClientAuthenticationMethod { basic, post diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcConfiguration.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcConfiguration.java index 351f416..4736189 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcConfiguration.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcConfiguration.java @@ -7,8 +7,7 @@ import java.net.URI; import java.util.Set; /** - * @author _bastler@bstly.de - * + * The Class OidcConfiguration. */ public class OidcConfiguration { @@ -24,6 +23,8 @@ public class OidcConfiguration { private Set token_endpoint_auth_methods_supported; /** + * Gets the issuer. + * * @return the issuer */ public String getIssuer() { @@ -31,135 +32,171 @@ public class OidcConfiguration { } /** - * @param issuer the issuer to set + * Sets the issuer. + * + * @param issuer the new issuer */ public void setIssuer(String issuer) { this.issuer = issuer; } /** - * @return the authorization_endpoint + * Gets the authorization endpoint. + * + * @return the authorization endpoint */ public URI getAuthorization_endpoint() { return authorization_endpoint; } /** - * @param authorization_endpoint the authorization_endpoint to set + * Sets the authorization endpoint. + * + * @param authorization_endpoint the new authorization endpoint */ public void setAuthorization_endpoint(URI authorization_endpoint) { this.authorization_endpoint = authorization_endpoint; } /** - * @return the token_endpoint + * Gets the token endpoint. + * + * @return the token endpoint */ public URI getToken_endpoint() { return token_endpoint; } /** - * @param token_endpoint the token_endpoint to set + * Sets the token endpoint. + * + * @param token_endpoint the new token endpoint */ public void setToken_endpoint(URI token_endpoint) { this.token_endpoint = token_endpoint; } /** - * @return the userinfo_endpoint + * Gets the userinfo endpoint. + * + * @return the userinfo endpoint */ public URI getUserinfo_endpoint() { return userinfo_endpoint; } /** - * @param userinfo_endpoint the userinfo_endpoint to set + * Sets the userinfo endpoint. + * + * @param userinfo_endpoint the new userinfo endpoint */ public void setUserinfo_endpoint(URI userinfo_endpoint) { this.userinfo_endpoint = userinfo_endpoint; } /** - * @return the jwks_uri + * Gets the jwks uri. + * + * @return the jwks uri */ public URI getJwks_uri() { return jwks_uri; } /** - * @param jwks_uri the jwks_uri to set + * Sets the jwks uri. + * + * @param jwks_uri the new jwks uri */ public void setJwks_uri(URI jwks_uri) { this.jwks_uri = jwks_uri; } /** - * @return the scopes_supported + * Gets the scopes supported. + * + * @return the scopes supported */ public Set getScopes_supported() { return scopes_supported; } /** - * @param scopes_supported the scopes_supported to set + * Sets the scopes supported. + * + * @param scopes_supported the new scopes supported */ public void setScopes_supported(Set scopes_supported) { this.scopes_supported = scopes_supported; } /** - * @return the response_types_supported + * Gets the response types supported. + * + * @return the response types supported */ public Set getResponse_types_supported() { return response_types_supported; } /** - * @param response_types_supported the response_types_supported to set + * Sets the response types supported. + * + * @param response_types_supported the new response types supported */ public void setResponse_types_supported(Set response_types_supported) { this.response_types_supported = response_types_supported; } /** - * @return the subject_types_supported + * Gets the subject types supported. + * + * @return the subject types supported */ public Set getSubject_types_supported() { return subject_types_supported; } /** - * @param subject_types_supported the subject_types_supported to set + * Sets the subject types supported. + * + * @param subject_types_supported the new subject types supported */ public void setSubject_types_supported(Set subject_types_supported) { this.subject_types_supported = subject_types_supported; } /** - * @return the grant_types_supported + * Gets the grant types supported. + * + * @return the grant types supported */ public Set getGrant_types_supported() { return grant_types_supported; } /** - * @param grant_types_supported the grant_types_supported to set + * Sets the grant types supported. + * + * @param grant_types_supported the new grant types supported */ public void setGrant_types_supported(Set grant_types_supported) { this.grant_types_supported = grant_types_supported; } /** - * @return the token_endpoint_auth_methods_supported + * Gets the token endpoint auth methods supported. + * + * @return the token endpoint auth methods supported */ public Set getToken_endpoint_auth_methods_supported() { return token_endpoint_auth_methods_supported; } /** - * @param token_endpoint_auth_methods_supported the - * token_endpoint_auth_methods_supported - * to set + * Sets the token endpoint auth methods supported. + * + * @param token_endpoint_auth_methods_supported the new token endpoint auth methods supported */ public void setToken_endpoint_auth_methods_supported( Set token_endpoint_auth_methods_supported) { diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcToken.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcToken.java index 4a6af62..a9207d6 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcToken.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcToken.java @@ -19,9 +19,7 @@ import org.hibernate.annotations.LazyCollectionOption; import com.fasterxml.jackson.annotation.JsonIgnore; /** - * - * @author _bastler@bstly.de - * + * The Class OidcToken. */ @Entity @Table(name = "oidc_tokens") @@ -49,6 +47,8 @@ public class OidcToken { private Set scopes; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -56,27 +56,35 @@ public class OidcToken { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** - * @return the userId + * Gets the user id. + * + * @return the user id */ public Long getUserId() { return userId; } /** - * @param userId the userId to set + * Sets the user id. + * + * @param userId the new user id */ public void setUserId(Long userId) { this.userId = userId; } /** + * Gets the client. + * * @return the client */ public Long getClient() { @@ -84,69 +92,89 @@ public class OidcToken { } /** - * @param client the client to set + * Sets the client. + * + * @param client the new client */ public void setClient(Long client) { this.client = client; } /** - * @return the accessToken + * Gets the access token. + * + * @return the access token */ public String getAccessToken() { return accessToken; } /** - * @param accessToken the accessToken to set + * Sets the access token. + * + * @param accessToken the new access token */ public void setAccessToken(String accessToken) { this.accessToken = accessToken; } /** - * @return the refreshToken + * Gets the refresh token. + * + * @return the refresh token */ public String getRefreshToken() { return refreshToken; } /** - * @param refreshToken the refreshToken to set + * Sets the refresh token. + * + * @param refreshToken the new refresh token */ public void setRefreshToken(String refreshToken) { this.refreshToken = refreshToken; } /** - * @return the expiresIn + * Gets the expires in. + * + * @return the expires in */ public Long getExpiresIn() { return expiresIn; } /** - * @param expiresIn the expiresIn to set + * Sets the expires in. + * + * @param expiresIn the new expires in */ public void setExpiresIn(Long expiresIn) { this.expiresIn = expiresIn; } /** - * @return the idToken + * Gets the id token. + * + * @return the id token */ public String getIdToken() { return idToken; } /** - * @param idToken the idToken to set + * Sets the id token. + * + * @param idToken the new id token */ public void setIdToken(String idToken) { this.idToken = idToken; } /** + * Gets the scopes. + * * @return the scopes */ public Set getScopes() { @@ -154,7 +182,9 @@ public class OidcToken { } /** - * @param scopes the scopes to set + * Sets the scopes. + * + * @param scopes the new scopes */ public void setScopes(Set scopes) { this.scopes = scopes; diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcTokenErrorCode.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcTokenErrorCode.java index 84287ab..590575a 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcTokenErrorCode.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcTokenErrorCode.java @@ -4,9 +4,7 @@ package de.bstly.we.oidc.model; /** - * - * @author _bastler@bstly.de - * + * The Enum OidcTokenErrorCode. */ public enum OidcTokenErrorCode { INVALID_REQUEST("invalid_request"), INVALID_CLIENT("invalid_client"), @@ -15,10 +13,20 @@ public enum OidcTokenErrorCode { private final String tokenErrorCode; + /** + * Instantiates a new oidc token error code. + * + * @param tokenErrorCode the token error code + */ OidcTokenErrorCode(String tokenErrorCode) { this.tokenErrorCode = tokenErrorCode; } + /** + * Gets the token error code. + * + * @return the token error code + */ public String getTokenErrorCode() { return tokenErrorCode; } diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcTokenRequest.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcTokenRequest.java index 7bbaf93..7f00547 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcTokenRequest.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcTokenRequest.java @@ -6,9 +6,7 @@ package de.bstly.we.oidc.model; import java.net.URI; /** - * - * @author _bastler@bstly.de - * + * The Class OidcTokenRequest. */ public class OidcTokenRequest { @@ -20,12 +18,14 @@ public class OidcTokenRequest { private final String scope; /** - * @param code - * @param grant_type - * @param client_id - * @param client_secret - * @param redirect_uri - * @param scope + * Instantiates a new oidc token request. + * + * @param code the code + * @param grant_type the grant type + * @param client_id the client id + * @param client_secret the client secret + * @param redirect_uri the redirect uri + * @param scope the scope */ public OidcTokenRequest(String code, OidcAuthorizationGrantType grant_type, String client_id, String client_secret, URI redirect_uri, String scope) { @@ -39,34 +39,44 @@ public class OidcTokenRequest { } /** - * @return the client_id + * Gets the client id. + * + * @return the client id */ public String getClient_id() { return client_id; } /** - * @param client_id the client_id to set + * Sets the client id. + * + * @param client_id the new client id */ public void setClient_id(String client_id) { this.client_id = client_id; } /** - * @return the client_secret + * Gets the client secret. + * + * @return the client secret */ public String getClient_secret() { return client_secret; } /** - * @param client_secret the client_secret to set + * Sets the client secret. + * + * @param client_secret the new client secret */ public void setClient_secret(String client_secret) { this.client_secret = client_secret; } /** + * Gets the code. + * * @return the code */ public String getCode() { @@ -74,20 +84,26 @@ public class OidcTokenRequest { } /** - * @return the grant_type + * Gets the grant type. + * + * @return the grant type */ public OidcAuthorizationGrantType getGrant_type() { return grant_type; } /** - * @return the redirect_uri + * Gets the redirect uri. + * + * @return the redirect uri */ public URI getRedirect_uri() { return redirect_uri; } /** + * Gets the scope. + * * @return the scope */ public String getScope() { diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcTokenResponse.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcTokenResponse.java index 5c5f74a..67b409c 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcTokenResponse.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcTokenResponse.java @@ -4,9 +4,7 @@ package de.bstly.we.oidc.model; /** - * - * @author _bastler@bstly.de - * + * The Class OidcTokenResponse. */ public class OidcTokenResponse { @@ -17,70 +15,90 @@ public class OidcTokenResponse { private String id_token; /** - * @return the access_token + * Gets the access token. + * + * @return the access token */ public String getAccess_token() { return access_token; } /** - * @param access_token the access_token to set + * Sets the access token. + * + * @param access_token the new access token */ public void setAccess_token(String access_token) { this.access_token = access_token; } /** - * @return the token_type + * Gets the token type. + * + * @return the token type */ public String getToken_type() { return token_type; } /** - * @param token_type the token_type to set + * Sets the token type. + * + * @param token_type the new token type */ public void setToken_type(String token_type) { this.token_type = token_type; } /** - * @return the refresh_token + * Gets the refresh token. + * + * @return the refresh token */ public String getRefresh_token() { return refresh_token; } /** - * @param refresh_token the refresh_token to set + * Sets the refresh token. + * + * @param refresh_token the new refresh token */ public void setRefresh_token(String refresh_token) { this.refresh_token = refresh_token; } /** - * @return the expires_in + * Gets the expires in. + * + * @return the expires in */ public long getExpires_in() { return expires_in; } /** - * @param expires_in the expires_in to set + * Sets the expires in. + * + * @param expires_in the new expires in */ public void setExpires_in(long expires_in) { this.expires_in = expires_in; } /** - * @return the id_token + * Gets the id token. + * + * @return the id token */ public String getId_token() { return id_token; } /** - * @param id_token the id_token to set + * Sets the id token. + * + * @param id_token the new id token */ public void setId_token(String id_token) { this.id_token = id_token; diff --git a/oidc/src/main/java/de/bstly/we/oidc/repository/OidcClientRepository.java b/oidc/src/main/java/de/bstly/we/oidc/repository/OidcClientRepository.java index 874ff7f..88a04ee 100755 --- a/oidc/src/main/java/de/bstly/we/oidc/repository/OidcClientRepository.java +++ b/oidc/src/main/java/de/bstly/we/oidc/repository/OidcClientRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.oidc.model.OidcClient; /** - * - * @author _bastler@bstly.de - * + * The Interface OidcClientRepository. */ @Repository public interface OidcClientRepository extends JpaRepository, QuerydslPredicateExecutor { diff --git a/oidc/src/main/java/de/bstly/we/oidc/repository/OidcTokenRepository.java b/oidc/src/main/java/de/bstly/we/oidc/repository/OidcTokenRepository.java index 6dfe79f..25c5ba3 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/repository/OidcTokenRepository.java +++ b/oidc/src/main/java/de/bstly/we/oidc/repository/OidcTokenRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.oidc.model.OidcToken; /** - * - * @author _bastler@bstly.de - * + * The Interface OidcTokenRepository. */ @Repository public interface OidcTokenRepository extends JpaRepository, QuerydslPredicateExecutor { diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/DebugController.java b/partey/src/main/java/de/bstly/we/partey/api/controller/DebugController.java index 49283c6..789f28e 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/DebugController.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/DebugController.java @@ -17,9 +17,7 @@ import de.bstly.we.partey.api.controller.support.DebugLogger; import de.bstly.we.partey.api.security.ParteyApiAuthentication; /** - * - * @author _bastler@bstly.de - * + * The Class DebugController. */ @RestController @RequestMapping("/partey/api") @@ -29,7 +27,11 @@ public class DebugController extends DebugLogger { private ParteyApiAuthentication parteyApiAuthentication; /** - * + * Debug. + * + * @param payload the payload + * @param request the request + * @param response the response */ @RequestMapping("/**") public void debug(@RequestBody Optional payload, HttpServletRequest request, diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/MapController.java b/partey/src/main/java/de/bstly/we/partey/api/controller/MapController.java index 77bf5b6..ea37c9e 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/MapController.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/MapController.java @@ -24,9 +24,7 @@ import de.bstly.we.partey.businesslogic.model.Room; import de.bstly.we.partey.model.GameRoomPolicyTypes; /** - * - * @author _bastler@bstly.de - * + * The Class MapController. */ @RestController @RequestMapping("/partey/api/map") @@ -38,10 +36,12 @@ public class MapController extends DebugLogger { private ParteyMapManager parteyMapManager; /** - * - * @param playUri - * @param request - * @return + * Gets the map data. + * + * @param playUri the play uri + * @param request the request + * @param response the response + * @return the map data */ @GetMapping public MapDetailsData getMapData(@RequestParam("playUri") String playUri, HttpServletRequest request, diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/ReportController.java b/partey/src/main/java/de/bstly/we/partey/api/controller/ReportController.java index b030955..4cc3183 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/ReportController.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/ReportController.java @@ -17,8 +17,7 @@ import de.bstly.we.partey.api.security.ParteyApiAuthentication; import de.bstly.we.partey.businesslogic.ParteyUserReportManager; /** - * @author _bastler@bstly.de - * + * The Class ReportController. */ @RestController @RequestMapping("/partey/api/report") @@ -29,6 +28,12 @@ public class ReportController extends DebugLogger { @Autowired private ParteyUserReportManager parteyUserReportManager; + /** + * Report. + * + * @param userReport the user report + * @param request the request + */ @PostMapping("") public void report(@RequestBody UserReport userReport, HttpServletRequest request) { parteyApiAuthentication.authenticateRequest(request); diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/RoomController.java b/partey/src/main/java/de/bstly/we/partey/api/controller/RoomController.java index 04eb708..3a6607b 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/RoomController.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/RoomController.java @@ -31,9 +31,7 @@ import de.bstly.we.partey.businesslogic.model.Room; import de.bstly.we.partey.model.ParteyUserTag; /** - * - * @author _bastler@bstly.de - * + * The Class RoomController. */ @RestController @RequestMapping("/partey/api/room") @@ -56,11 +54,12 @@ public class RoomController extends DebugLogger { private List worldMapCache = Lists.newArrayList(); /** - * - * @param userIdentifier - * @param roomId - * @param request - * @return + * Access. + * + * @param userIdentifier the user identifier + * @param roomId the room id + * @param request the request + * @return the member data */ @GetMapping("/access") public MemberData access(@RequestParam("userIdentifier") String userIdentifier, @@ -105,10 +104,11 @@ public class RoomController extends DebugLogger { } /** - * - * @param roomUrl - * @param request - * @return + * Same world. + * + * @param roomUrl the room url + * @param request the request + * @return the list */ @GetMapping("/sameWorld") public List sameWorld(@RequestParam("roomUrl") String roomUrl, diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/model/CharacterTexture.java b/partey/src/main/java/de/bstly/we/partey/api/controller/model/CharacterTexture.java index 2d3019f..0714842 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/model/CharacterTexture.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/model/CharacterTexture.java @@ -4,9 +4,7 @@ package de.bstly.we.partey.api.controller.model; /** - * - * @author _bastler@bstly.de - * + * The Class CharacterTexture. */ public class CharacterTexture { @@ -16,6 +14,8 @@ public class CharacterTexture { private String rights; /** + * Gets the id. + * * @return the id */ public int getId() { @@ -23,13 +23,17 @@ public class CharacterTexture { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(int id) { this.id = id; } /** + * Gets the level. + * * @return the level */ public int getLevel() { @@ -37,13 +41,17 @@ public class CharacterTexture { } /** - * @param level the level to set + * Sets the level. + * + * @param level the new level */ public void setLevel(int level) { this.level = level; } /** + * Gets the url. + * * @return the url */ public String getUrl() { @@ -51,13 +59,17 @@ public class CharacterTexture { } /** - * @param url the url to set + * Sets the url. + * + * @param url the new url */ public void setUrl(String url) { this.url = url; } /** + * Gets the rights. + * * @return the rights */ public String getRights() { @@ -65,7 +77,9 @@ public class CharacterTexture { } /** - * @param rights the rights to set + * Sets the rights. + * + * @param rights the new rights */ public void setRights(String rights) { this.rights = rights; diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/model/MapDetailsData.java b/partey/src/main/java/de/bstly/we/partey/api/controller/model/MapDetailsData.java index 30f0b99..bb4c13f 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/model/MapDetailsData.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/model/MapDetailsData.java @@ -10,9 +10,7 @@ import com.google.common.collect.Lists; import de.bstly.we.partey.model.GameRoomPolicyTypes; /** - * - * @author _bastler@bstly.de - * + * The Class MapDetailsData. */ public class MapDetailsData { @@ -24,34 +22,44 @@ public class MapDetailsData { private String iframeAuthentication; /** - * @return the mapUrl + * Gets the map url. + * + * @return the map url */ public String getMapUrl() { return mapUrl; } /** - * @param mapUrl the mapUrl to set + * Sets the map url. + * + * @param mapUrl the new map url */ public void setMapUrl(String mapUrl) { this.mapUrl = mapUrl; } /** - * @return the policy_type + * Gets the policy type. + * + * @return the policy type */ public GameRoomPolicyTypes getPolicy_type() { return policy_type; } /** - * @param policy_type the policy_type to set + * Sets the policy type. + * + * @param policy_type the new policy type */ public void setPolicy_type(GameRoomPolicyTypes policy_type) { this.policy_type = policy_type; } /** + * Gets the tags. + * * @return the tags */ public List getTags() { @@ -59,13 +67,17 @@ public class MapDetailsData { } /** - * @param tags the tags to set + * Sets the tags. + * + * @param tags the new tags */ public void setTags(List tags) { this.tags = tags; } /** + * Gets the textures. + * * @return the textures */ public List getTextures() { @@ -73,35 +85,45 @@ public class MapDetailsData { } /** - * @param textures the textures to set + * Sets the textures. + * + * @param textures the new textures */ public void setTextures(List textures) { this.textures = textures; } /** - * @return the authenticationMandatory + * Checks if is authentication mandatory. + * + * @return true, if is authentication mandatory */ public boolean isAuthenticationMandatory() { return authenticationMandatory; } /** - * @param authenticationMandatory the authenticationMandatory to set + * Sets the authentication mandatory. + * + * @param authenticationMandatory the new authentication mandatory */ public void setAuthenticationMandatory(boolean authenticationMandatory) { this.authenticationMandatory = authenticationMandatory; } /** - * @return the iframeAuthentication + * Gets the iframe authentication. + * + * @return the iframe authentication */ public String getIframeAuthentication() { return iframeAuthentication; } /** - * @param iframeAuthentication the iframeAuthentication to set + * Sets the iframe authentication. + * + * @param iframeAuthentication the new iframe authentication */ public void setIframeAuthentication(String iframeAuthentication) { this.iframeAuthentication = iframeAuthentication; diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/model/MemberData.java b/partey/src/main/java/de/bstly/we/partey/api/controller/model/MemberData.java index 1d4b43b..600d048 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/model/MemberData.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/model/MemberData.java @@ -8,9 +8,7 @@ import java.util.List; import com.beust.jcommander.internal.Lists; /** - * - * @author _bastler@bstly.de - * + * The Class MemberData. */ public class MemberData { @@ -22,20 +20,26 @@ public class MemberData { private boolean anonymous; /** - * @return the userUuid + * Gets the user uuid. + * + * @return the user uuid */ public String getUserUuid() { return userUuid; } /** - * @param userUuid the userUuid to set + * Sets the user uuid. + * + * @param userUuid the new user uuid */ public void setUserUuid(String userUuid) { this.userUuid = userUuid; } /** + * Gets the tags. + * * @return the tags */ public List getTags() { @@ -43,27 +47,35 @@ public class MemberData { } /** - * @param tags the tags to set + * Sets the tags. + * + * @param tags the new tags */ public void setTags(List tags) { this.tags = tags; } /** - * @return the visitCardUrl + * Gets the visit card url. + * + * @return the visit card url */ public String getVisitCardUrl() { return visitCardUrl; } /** - * @param visitCardUrl the visitCardUrl to set + * Sets the visit card url. + * + * @param visitCardUrl the new visit card url */ public void setVisitCardUrl(String visitCardUrl) { this.visitCardUrl = visitCardUrl; } /** + * Gets the textures. + * * @return the textures */ public List getTextures() { @@ -71,13 +83,17 @@ public class MemberData { } /** - * @param textures the textures to set + * Sets the textures. + * + * @param textures the new textures */ public void setTextures(List textures) { this.textures = textures; } /** + * Gets the messages. + * * @return the messages */ public List getMessages() { @@ -85,21 +101,27 @@ public class MemberData { } /** - * @param messages the messages to set + * Sets the messages. + * + * @param messages the new messages */ public void setMessages(List messages) { this.messages = messages; } /** - * @return the anonymous + * Checks if is anonymous. + * + * @return true, if is anonymous */ public boolean isAnonymous() { return anonymous; } /** - * @param anonymous the anonymous to set + * Sets the anonymous. + * + * @param anonymous the new anonymous */ public void setAnonymous(boolean anonymous) { this.anonymous = anonymous; diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/model/UserReport.java b/partey/src/main/java/de/bstly/we/partey/api/controller/model/UserReport.java index 3cf0b0f..e519081 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/model/UserReport.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/model/UserReport.java @@ -4,8 +4,7 @@ package de.bstly.we.partey.api.controller.model; /** - * @author _bastler@bstly.de - * + * The Class UserReport. */ public class UserReport { @@ -15,56 +14,72 @@ public class UserReport { private String reportWorldSlug; /** - * @return the reportedUserUuid + * Gets the reported user uuid. + * + * @return the reported user uuid */ public String getReportedUserUuid() { return reportedUserUuid; } /** - * @param reportedUserUuid the reportedUserUuid to set + * Sets the reported user uuid. + * + * @param reportedUserUuid the new reported user uuid */ public void setReportedUserUuid(String reportedUserUuid) { this.reportedUserUuid = reportedUserUuid; } /** - * @return the reportedUserComment + * Gets the reported user comment. + * + * @return the reported user comment */ public String getReportedUserComment() { return reportedUserComment; } /** - * @param reportedUserComment the reportedUserComment to set + * Sets the reported user comment. + * + * @param reportedUserComment the new reported user comment */ public void setReportedUserComment(String reportedUserComment) { this.reportedUserComment = reportedUserComment; } /** - * @return the reporterUserUuid + * Gets the reporter user uuid. + * + * @return the reporter user uuid */ public String getReporterUserUuid() { return reporterUserUuid; } /** - * @param reporterUserUuid the reporterUserUuid to set + * Sets the reporter user uuid. + * + * @param reporterUserUuid the new reporter user uuid */ public void setReporterUserUuid(String reporterUserUuid) { this.reporterUserUuid = reporterUserUuid; } /** - * @return the reportWorldSlug + * Gets the report world slug. + * + * @return the report world slug */ public String getReportWorldSlug() { return reportWorldSlug; } /** - * @param reportWorldSlug the reportWorldSlug to set + * Sets the report world slug. + * + * @param reportWorldSlug the new report world slug */ public void setReportWorldSlug(String reportWorldSlug) { this.reportWorldSlug = reportWorldSlug; diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/support/DebugLogger.java b/partey/src/main/java/de/bstly/we/partey/api/controller/support/DebugLogger.java index 85fff73..11a7f3a 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/support/DebugLogger.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/support/DebugLogger.java @@ -14,8 +14,7 @@ import org.slf4j.LoggerFactory; import com.google.gson.Gson; /** - * @author _bastler@bstly.de - * + * The Class DebugLogger. */ public class DebugLogger { @@ -23,17 +22,19 @@ public class DebugLogger { protected Gson gson = new Gson(); /** - * - * @param request + * Debug print request. + * + * @param request the request */ public void debugPrintRequest(HttpServletRequest request) { debugPrintRequest(request, Optional.empty()); } /** - * - * @param request - * @param payload + * Debug print request. + * + * @param request the request + * @param payload the payload */ public void debugPrintRequest(HttpServletRequest request, Optional payload) { logger.debug( @@ -63,9 +64,10 @@ public class DebugLogger { } /** - * - * @param response - * @param payload + * Debug print response. + * + * @param response the response + * @param payload the payload */ public void debugPrintResponse(HttpServletRequest response, Optional payload) { if (payload.isPresent()) { diff --git a/partey/src/main/java/de/bstly/we/partey/api/security/ParteyApiAuthentication.java b/partey/src/main/java/de/bstly/we/partey/api/security/ParteyApiAuthentication.java index 836a113..58a4401 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/security/ParteyApiAuthentication.java +++ b/partey/src/main/java/de/bstly/we/partey/api/security/ParteyApiAuthentication.java @@ -20,8 +20,7 @@ import de.bstly.we.controller.support.EntityResponseStatusException; import de.bstly.we.security.model.LocalUserDetails; /** - * @author _bastler@bstly.de - * + * The Class ParteyApiAuthentication. */ @Component public class ParteyApiAuthentication { @@ -32,6 +31,11 @@ public class ParteyApiAuthentication { @Autowired private PermissionManager permissionManager; + /** + * Authenticate request. + * + * @param request the request + */ public void authenticateRequest(HttpServletRequest request) { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (auth != null && auth.isAuthenticated() diff --git a/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyMapManager.java b/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyMapManager.java index c1d5eaa..333695d 100644 --- a/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyMapManager.java +++ b/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyMapManager.java @@ -28,8 +28,7 @@ import de.bstly.we.partey.model.ParteyMap; import de.bstly.we.partey.repository.ParteyMapRepository; /** - * @author _bastler@bstly.de - * + * The Class ParteyMapManager. */ @Component public class ParteyMapManager { @@ -44,21 +43,23 @@ public class ParteyMapManager { private Pattern externalMapUriPattern = Pattern.compile("\\/_\\/(.+)"); /** - * - * @param id - * @return + * Gets the. + * + * @param id the id + * @return the partey map */ public ParteyMap get(String id) { return parteyMapRepository.findById(id).orElse(null); } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { PageRequest pageRequest = PageRequest.of(page, size, @@ -68,27 +69,30 @@ public class ParteyMapManager { } /** - * - * @param name - * @return + * Save. + * + * @param parteyMap the partey map + * @return the partey map */ public ParteyMap save(ParteyMap parteyMap) { return parteyMapRepository.save(parteyMap); } /** - * - * @param id + * Delete. + * + * @param id the id */ public void delete(String id) { parteyMapRepository.deleteById(id); } /** - * - * @param url - * @param request - * @return + * Parses the room. + * + * @param url the url + * @param request the request + * @return the room */ public Room parseRoom(String url, HttpServletRequest request) { Room room = new Room(); diff --git a/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyPermissions.java b/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyPermissions.java index 03073b1..8894a41 100644 --- a/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyPermissions.java +++ b/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyPermissions.java @@ -4,8 +4,7 @@ package de.bstly.we.partey.businesslogic; /** - * @author _bastler@bstly.de - * + * The Interface ParteyPermissions. */ public interface ParteyPermissions { diff --git a/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyQuotas.java b/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyQuotas.java index 6d28811..bcfecf5 100644 --- a/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyQuotas.java +++ b/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyQuotas.java @@ -4,8 +4,7 @@ package de.bstly.we.partey.businesslogic; /** - * @author _bastler@bstly.de - * + * The Interface ParteyQuotas. */ public interface ParteyQuotas { diff --git a/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyUserReportManager.java b/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyUserReportManager.java index 97481d8..ede302f 100644 --- a/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyUserReportManager.java +++ b/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyUserReportManager.java @@ -16,8 +16,7 @@ import de.bstly.we.partey.model.QParteyUserReport; import de.bstly.we.partey.repository.ParteyUserReportRepository; /** - * @author _bastler@bstly.de - * + * The Class ParteyUserReportManager. */ @Component public class ParteyUserReportManager { @@ -29,12 +28,13 @@ public class ParteyUserReportManager { private QParteyUserReport qParteyUserReport = QParteyUserReport.parteyUserReport; /** - * - * @param reporter - * @param user - * @param comment - * @param world - * @return + * Creates the. + * + * @param reporter the reporter + * @param user the user + * @param comment the comment + * @param world the world + * @return the partey user report */ public ParteyUserReport create(Long reporter, Long user, String comment, String world) { ParteyUserReport parteyUserReport = new ParteyUserReport(); @@ -53,12 +53,13 @@ public class ParteyUserReportManager { } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { PageRequest pageRequest = PageRequest.of(page, size, @@ -68,32 +69,35 @@ public class ParteyUserReportManager { } /** - * - * @param parteyUserReport - * @return + * Save. + * + * @param parteyUserReport the partey user report + * @return the partey user report */ public ParteyUserReport save(ParteyUserReport parteyUserReport) { return parteyUserReportRepository.save(parteyUserReport); } /** - * - * @param id + * Delete. + * + * @param id the id */ public void delete(Long id) { parteyUserReportRepository.deleteById(id); } /** - * + * Delete all. */ public void deleteAll() { parteyUserReportRepository.deleteAll(); } /** - * - * @param before + * Delete all before. + * + * @param before the before */ public void deleteAllBefore(Instant before) { parteyUserReportRepository.deleteAll( diff --git a/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyUserReportModeratorManager.java b/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyUserReportModeratorManager.java index cb9049e..7edb463 100644 --- a/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyUserReportModeratorManager.java +++ b/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyUserReportModeratorManager.java @@ -24,8 +24,7 @@ import de.bstly.we.partey.model.QParteyUserReportModerator; import de.bstly.we.partey.repository.ParteyUserReportModeratorRepository; /** - * @author _bastler@bstly.de - * + * The Class ParteyUserReportModeratorManager. */ @Component public class ParteyUserReportModeratorManager { @@ -41,12 +40,13 @@ public class ParteyUserReportModeratorManager { private QParteyUserReportModerator qParteyUserReportModerator = QParteyUserReportModerator.parteyUserReportModerator; /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { @@ -57,8 +57,9 @@ public class ParteyUserReportModeratorManager { } /** - * - * @param parteyUserReport + * Send mail. + * + * @param parteyUserReport the partey user report */ public void sendMail(ParteyUserReport parteyUserReport) { String subject = "User in partey reported"; @@ -91,17 +92,19 @@ public class ParteyUserReportModeratorManager { } /** - * - * @param parteyUserReportModerator - * @return + * Save. + * + * @param parteyUserReportModerator the partey user report moderator + * @return the partey user report moderator */ public ParteyUserReportModerator save(ParteyUserReportModerator parteyUserReportModerator) { return parteyUserReportModeratorRepository.save(parteyUserReportModerator); } /** - * - * @param id + * Delete. + * + * @param id the id */ public void delete(Long id) { parteyUserReportModeratorRepository.deleteById(id); diff --git a/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyUserTagManager.java b/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyUserTagManager.java index a1bf3b3..29a2297 100644 --- a/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyUserTagManager.java +++ b/partey/src/main/java/de/bstly/we/partey/businesslogic/ParteyUserTagManager.java @@ -18,8 +18,7 @@ import de.bstly.we.partey.model.QParteyUserTag; import de.bstly.we.partey.repository.ParteyUserTagRepository; /** - * @author _bastler@bstly.de - * + * The Class ParteyUserTagManager. */ @Component public class ParteyUserTagManager { @@ -29,12 +28,13 @@ public class ParteyUserTagManager { private QParteyUserTag qParteyUserTag = QParteyUserTag.parteyUserTag; /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { PageRequest pageRequest = PageRequest.of(page, size, @@ -44,9 +44,10 @@ public class ParteyUserTagManager { } /** - * - * @param target - * @return + * Gets the for target. + * + * @param target the target + * @return the for target */ public List getForTarget(long target) { return Lists @@ -54,25 +55,28 @@ public class ParteyUserTagManager { } /** - * - * @param parteyUserTag - * @return + * Save. + * + * @param parteyUserTag the partey user tag + * @return the partey user tag */ public ParteyUserTag save(ParteyUserTag parteyUserTag) { return parteyUserTagRepository.save(parteyUserTag); } /** - * - * @param id + * Delete. + * + * @param id the id */ public void delete(Long id) { parteyUserTagRepository.deleteById(id); } /** - * - * @param before + * Delete all for target. + * + * @param target the target */ public void deleteAllForTarget(Long target) { parteyUserTagRepository diff --git a/partey/src/main/java/de/bstly/we/partey/businesslogic/model/Room.java b/partey/src/main/java/de/bstly/we/partey/businesslogic/model/Room.java index 9bdce1e..0cc1819 100644 --- a/partey/src/main/java/de/bstly/we/partey/businesslogic/model/Room.java +++ b/partey/src/main/java/de/bstly/we/partey/businesslogic/model/Room.java @@ -10,8 +10,7 @@ import com.google.common.collect.Lists; import de.bstly.we.partey.model.GameRoomPolicyTypes; /** - * @author _bastler@bstly.de - * + * The Class Room. */ public class Room { @@ -22,6 +21,8 @@ public class Room { private List tags = Lists.newArrayList(); /** + * Gets the url. + * * @return the url */ public String getUrl() { @@ -29,55 +30,71 @@ public class Room { } /** - * @param url the url to set + * Sets the url. + * + * @param url the new url */ public void setUrl(String url) { this.url = url; } /** - * @return the mapId + * Gets the map id. + * + * @return the map id */ public String getMapId() { return mapId; } /** - * @param mapId the mapId to set + * Sets the map id. + * + * @param mapId the new map id */ public void setMapId(String mapId) { this.mapId = mapId; } /** - * @return the mapUrl + * Gets the map url. + * + * @return the map url */ public String getMapUrl() { return mapUrl; } /** - * @param mapUrl the mapUrl to set + * Sets the map url. + * + * @param mapUrl the new map url */ public void setMapUrl(String mapUrl) { this.mapUrl = mapUrl; } /** - * @return the policyType + * Gets the policy type. + * + * @return the policy type */ public GameRoomPolicyTypes getPolicyType() { return policyType; } /** - * @param policyType the policyType to set + * Sets the policy type. + * + * @param policyType the new policy type */ public void setPolicyType(GameRoomPolicyTypes policyType) { this.policyType = policyType; } /** + * Gets the tags. + * * @return the tags */ public List getTags() { @@ -85,7 +102,9 @@ public class Room { } /** - * @param tags the tags to set + * Sets the tags. + * + * @param tags the new tags */ public void setTags(List tags) { this.tags = tags; diff --git a/partey/src/main/java/de/bstly/we/partey/controller/MapManagementController.java b/partey/src/main/java/de/bstly/we/partey/controller/MapManagementController.java index 49e2ecd..ec97e57 100644 --- a/partey/src/main/java/de/bstly/we/partey/controller/MapManagementController.java +++ b/partey/src/main/java/de/bstly/we/partey/controller/MapManagementController.java @@ -25,9 +25,7 @@ import de.bstly.we.partey.model.GameRoomPolicyTypes; import de.bstly.we.partey.model.ParteyMap; /** - * - * @author _bastler@bstly.de - * + * The Class MapManagementController. */ @RestController @RequestMapping("/partey/maps") @@ -37,12 +35,13 @@ public class MapManagementController extends BaseController { private ParteyMapManager parteyMapManager; /** - * - * @param pageParameter - * @param sizeParameter - * @param sortParameter - * @param descParameter - * @return + * Gets the partey maps. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param sortParameter the sort parameter + * @param descParameter the desc parameter + * @return the partey maps */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -59,9 +58,10 @@ public class MapManagementController extends BaseController { } /** - * - * @param parteyMap - * @return + * Creates the or update partey map. + * + * @param parteyMap the partey map + * @return the partey map */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -78,8 +78,9 @@ public class MapManagementController extends BaseController { } /** - * - * @param id + * Delete partey map. + * + * @param id the id */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("{id}") diff --git a/partey/src/main/java/de/bstly/we/partey/controller/UserReportManagementController.java b/partey/src/main/java/de/bstly/we/partey/controller/UserReportManagementController.java index 9b39438..3aa35a0 100644 --- a/partey/src/main/java/de/bstly/we/partey/controller/UserReportManagementController.java +++ b/partey/src/main/java/de/bstly/we/partey/controller/UserReportManagementController.java @@ -23,9 +23,7 @@ import de.bstly.we.partey.businesslogic.ParteyUserReportManager; import de.bstly.we.partey.model.ParteyUserReport; /** - * - * @author _bastler@bstly.de - * + * The Class UserReportManagementController. */ @RestController @RequestMapping("/partey/reports") @@ -35,12 +33,13 @@ public class UserReportManagementController extends BaseController { private ParteyUserReportManager parteyUserReportManager; /** - * - * @param pageParameter - * @param sizeParameter - * @param sortParameter - * @param descParameter - * @return + * Gets the partey user reports. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param sortParameter the sort parameter + * @param descParameter the desc parameter + * @return the partey user reports */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -58,9 +57,10 @@ public class UserReportManagementController extends BaseController { } /** - * - * @param parteyUserReport - * @return + * Creates the or update partey user report. + * + * @param parteyUserReport the partey user report + * @return the partey user report */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -70,8 +70,9 @@ public class UserReportManagementController extends BaseController { } /** - * - * @param id + * Delete partey user report. + * + * @param id the id */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("{id}") @@ -80,8 +81,9 @@ public class UserReportManagementController extends BaseController { } /** - * - * @param beforeParameter + * Delete all partey user report. + * + * @param beforeParameter the before parameter */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping() diff --git a/partey/src/main/java/de/bstly/we/partey/controller/UserReportModeratorManagementController.java b/partey/src/main/java/de/bstly/we/partey/controller/UserReportModeratorManagementController.java index 01fae43..ba2c60f 100644 --- a/partey/src/main/java/de/bstly/we/partey/controller/UserReportModeratorManagementController.java +++ b/partey/src/main/java/de/bstly/we/partey/controller/UserReportModeratorManagementController.java @@ -22,9 +22,7 @@ import de.bstly.we.partey.businesslogic.ParteyUserReportModeratorManager; import de.bstly.we.partey.model.ParteyUserReportModerator; /** - * - * @author _bastler@bstly.de - * + * The Class UserReportModeratorManagementController. */ @RestController @RequestMapping("/partey/reports/moderators") @@ -34,12 +32,13 @@ public class UserReportModeratorManagementController extends BaseController { private ParteyUserReportModeratorManager parteyUserReportModeratorManager; /** - * - * @param pageParameter - * @param sizeParameter - * @param sortParameter - * @param descParameter - * @return + * Gets the partey user report moderators. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param sortParameter the sort parameter + * @param descParameter the desc parameter + * @return the partey user report moderators */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -58,9 +57,10 @@ public class UserReportModeratorManagementController extends BaseController { } /** - * - * @param parteyUserReport - * @return + * Creates the or update partey user report moderator. + * + * @param parteyUserReportModerator the partey user report moderator + * @return the partey user report moderator */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -70,8 +70,9 @@ public class UserReportModeratorManagementController extends BaseController { } /** - * - * @param id + * Delete partey user report moderator. + * + * @param id the id */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("{id}") diff --git a/partey/src/main/java/de/bstly/we/partey/controller/UserTagController.java b/partey/src/main/java/de/bstly/we/partey/controller/UserTagController.java index 81bd7dd..0bbf989 100644 --- a/partey/src/main/java/de/bstly/we/partey/controller/UserTagController.java +++ b/partey/src/main/java/de/bstly/we/partey/controller/UserTagController.java @@ -16,9 +16,7 @@ import de.bstly.we.partey.businesslogic.ParteyUserTagManager; import de.bstly.we.partey.model.ParteyUserTag; /** - * - * @author _bastler@bstly.de - * + * The Class UserTagController. */ @RestController @RequestMapping("/partey/tags") @@ -28,9 +26,9 @@ public class UserTagController extends BaseController { private ParteyUserTagManager parteyUserTagManager; /** - * - * @param target - * @return + * Gets the partey user tags for target. + * + * @return the partey user tags for target */ @PreAuthorize("isAuthenticated()") @GetMapping diff --git a/partey/src/main/java/de/bstly/we/partey/controller/UserTagManagementController.java b/partey/src/main/java/de/bstly/we/partey/controller/UserTagManagementController.java index 21fc2e0..fa1d8bb 100644 --- a/partey/src/main/java/de/bstly/we/partey/controller/UserTagManagementController.java +++ b/partey/src/main/java/de/bstly/we/partey/controller/UserTagManagementController.java @@ -27,9 +27,7 @@ import de.bstly.we.partey.businesslogic.ParteyUserTagManager; import de.bstly.we.partey.model.ParteyUserTag; /** - * - * @author _bastler@bstly.de - * + * The Class UserTagManagementController. */ @RestController @RequestMapping("/partey/tags/manage") @@ -41,12 +39,13 @@ public class UserTagManagementController extends BaseController { private UserManager userManager; /** - * - * @param pageParameter - * @param sizeParameter - * @param sortParameter - * @param descParameter - * @return + * Gets the partey user tags. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param sortParameter the sort parameter + * @param descParameter the desc parameter + * @return the partey user tags */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -63,9 +62,10 @@ public class UserTagManagementController extends BaseController { } /** - * - * @param target - * @return + * Gets the partey user tags for target. + * + * @param username the username + * @return the partey user tags for target */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("{username}") @@ -81,9 +81,10 @@ public class UserTagManagementController extends BaseController { } /** - * - * @param parteyUserReport - * @return + * Creates the or update partey user tag. + * + * @param parteyUserTag the partey user tag + * @return the partey user tag */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -92,8 +93,9 @@ public class UserTagManagementController extends BaseController { } /** - * - * @param id + * Delete partey user tag. + * + * @param id the id */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("{id}") diff --git a/partey/src/main/java/de/bstly/we/partey/model/GameRoomPolicyTypes.java b/partey/src/main/java/de/bstly/we/partey/model/GameRoomPolicyTypes.java index 1456428..cf9c85c 100644 --- a/partey/src/main/java/de/bstly/we/partey/model/GameRoomPolicyTypes.java +++ b/partey/src/main/java/de/bstly/we/partey/model/GameRoomPolicyTypes.java @@ -6,9 +6,7 @@ package de.bstly.we.partey.model; import com.fasterxml.jackson.annotation.JsonFormat; /** - * - * @author _bastler@bstly.de - * + * The Enum GameRoomPolicyTypes. */ @JsonFormat(shape = JsonFormat.Shape.NUMBER) public enum GameRoomPolicyTypes { diff --git a/partey/src/main/java/de/bstly/we/partey/model/ParteyMap.java b/partey/src/main/java/de/bstly/we/partey/model/ParteyMap.java index d95a7cb..4a6f7e1 100644 --- a/partey/src/main/java/de/bstly/we/partey/model/ParteyMap.java +++ b/partey/src/main/java/de/bstly/we/partey/model/ParteyMap.java @@ -19,8 +19,7 @@ import org.hibernate.annotations.LazyCollectionOption; import com.google.common.collect.Lists; /** - * @author _bastler@bstly.de - * + * The Class ParteyMap. */ @Entity @Table(name = "partey_maps") @@ -36,6 +35,8 @@ public class ParteyMap { private List tags = Lists.newArrayList(); /** + * Gets the id. + * * @return the id */ public String getId() { @@ -43,27 +44,35 @@ public class ParteyMap { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(String id) { this.id = id; } /** - * @return the policyType + * Gets the policy type. + * + * @return the policy type */ public GameRoomPolicyTypes getPolicyType() { return policyType; } /** - * @param policyType the policyType to set + * Sets the policy type. + * + * @param policyType the new policy type */ public void setPolicyType(GameRoomPolicyTypes policyType) { this.policyType = policyType; } /** + * Gets the tags. + * * @return the tags */ public List getTags() { @@ -71,7 +80,9 @@ public class ParteyMap { } /** - * @param tags the tags to set + * Sets the tags. + * + * @param tags the new tags */ public void setTags(List tags) { this.tags = tags; diff --git a/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReport.java b/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReport.java index 8276715..37bffd2 100644 --- a/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReport.java +++ b/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReport.java @@ -13,8 +13,7 @@ import javax.persistence.Id; import javax.persistence.Lob; /** - * @author _bastler@bstly.de - * + * The Class ParteyUserReport. */ @Entity public class ParteyUserReport { @@ -31,6 +30,8 @@ public class ParteyUserReport { private Instant created; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -38,13 +39,17 @@ public class ParteyUserReport { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** + * Gets the reporter. + * * @return the reporter */ public Long getReporter() { @@ -52,13 +57,17 @@ public class ParteyUserReport { } /** - * @param reporter the reporter to set + * Sets the reporter. + * + * @param reporter the new reporter */ public void setReporter(Long reporter) { this.reporter = reporter; } /** + * Gets the user. + * * @return the user */ public Long getUser() { @@ -66,13 +75,17 @@ public class ParteyUserReport { } /** - * @param user the user to set + * Sets the user. + * + * @param user the new user */ public void setUser(Long user) { this.user = user; } /** + * Gets the comment. + * * @return the comment */ public String getComment() { @@ -80,13 +93,17 @@ public class ParteyUserReport { } /** - * @param comment the comment to set + * Sets the comment. + * + * @param comment the new comment */ public void setComment(String comment) { this.comment = comment; } /** + * Gets the world. + * * @return the world */ public String getWorld() { @@ -94,13 +111,17 @@ public class ParteyUserReport { } /** - * @param world the world to set + * Sets the world. + * + * @param world the new world */ public void setWorld(String world) { this.world = world; } /** + * Gets the created. + * * @return the created */ public Instant getCreated() { @@ -108,7 +129,9 @@ public class ParteyUserReport { } /** - * @param created the created to set + * Sets the created. + * + * @param created the new created */ public void setCreated(Instant created) { this.created = created; diff --git a/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReportModerator.java b/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReportModerator.java index 294f54c..d92e7ee 100644 --- a/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReportModerator.java +++ b/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReportModerator.java @@ -10,8 +10,7 @@ import javax.persistence.GenerationType; import javax.persistence.Id; /** - * @author _bastler@bstly.de - * + * The Class ParteyUserReportModerator. */ @Entity public class ParteyUserReportModerator { @@ -25,6 +24,8 @@ public class ParteyUserReportModerator { private boolean disabled; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -32,13 +33,17 @@ public class ParteyUserReportModerator { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** + * Gets the email. + * * @return the email */ public String getEmail() { @@ -46,21 +51,27 @@ public class ParteyUserReportModerator { } /** - * @param email the email to set + * Sets the email. + * + * @param email the new email */ public void setEmail(String email) { this.email = email; } /** - * @return the disabled + * Checks if is disabled. + * + * @return true, if is disabled */ public boolean isDisabled() { return disabled; } /** - * @param disabled the disabled to set + * Sets the disabled. + * + * @param disabled the new disabled */ public void setDisabled(boolean disabled) { this.disabled = disabled; diff --git a/partey/src/main/java/de/bstly/we/partey/model/ParteyUserTag.java b/partey/src/main/java/de/bstly/we/partey/model/ParteyUserTag.java index 5282b23..8deffdc 100644 --- a/partey/src/main/java/de/bstly/we/partey/model/ParteyUserTag.java +++ b/partey/src/main/java/de/bstly/we/partey/model/ParteyUserTag.java @@ -10,8 +10,7 @@ import javax.persistence.GenerationType; import javax.persistence.Id; /** - * @author _bastler@bstly.de - * + * The Class ParteyUserTag. */ @Entity public class ParteyUserTag { @@ -24,6 +23,8 @@ public class ParteyUserTag { private String tag; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -31,13 +32,17 @@ public class ParteyUserTag { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** + * Gets the target. + * * @return the target */ public Long getTarget() { @@ -45,13 +50,17 @@ public class ParteyUserTag { } /** - * @param target the target to set + * Sets the target. + * + * @param target the new target */ public void setTarget(Long target) { this.target = target; } /** + * Gets the tag. + * * @return the tag */ public String getTag() { @@ -59,7 +68,9 @@ public class ParteyUserTag { } /** - * @param tag the tag to set + * Sets the tag. + * + * @param tag the new tag */ public void setTag(String tag) { this.tag = tag; diff --git a/partey/src/main/java/de/bstly/we/partey/repository/ParteyMapRepository.java b/partey/src/main/java/de/bstly/we/partey/repository/ParteyMapRepository.java index 15452a6..69153b5 100755 --- a/partey/src/main/java/de/bstly/we/partey/repository/ParteyMapRepository.java +++ b/partey/src/main/java/de/bstly/we/partey/repository/ParteyMapRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.partey.model.ParteyMap; /** - * - * @author _bastler@bstly.de - * + * The Interface ParteyMapRepository. */ @Repository public interface ParteyMapRepository diff --git a/partey/src/main/java/de/bstly/we/partey/repository/ParteyUserReportModeratorRepository.java b/partey/src/main/java/de/bstly/we/partey/repository/ParteyUserReportModeratorRepository.java index 5649c57..6a1add0 100644 --- a/partey/src/main/java/de/bstly/we/partey/repository/ParteyUserReportModeratorRepository.java +++ b/partey/src/main/java/de/bstly/we/partey/repository/ParteyUserReportModeratorRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.partey.model.ParteyUserReportModerator; /** - * - * @author _bastler@bstly.de - * + * The Interface ParteyUserReportModeratorRepository. */ @Repository public interface ParteyUserReportModeratorRepository diff --git a/partey/src/main/java/de/bstly/we/partey/repository/ParteyUserReportRepository.java b/partey/src/main/java/de/bstly/we/partey/repository/ParteyUserReportRepository.java index 60e603f..1654f70 100644 --- a/partey/src/main/java/de/bstly/we/partey/repository/ParteyUserReportRepository.java +++ b/partey/src/main/java/de/bstly/we/partey/repository/ParteyUserReportRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.partey.model.ParteyUserReport; /** - * - * @author _bastler@bstly.de - * + * The Interface ParteyUserReportRepository. */ @Repository public interface ParteyUserReportRepository diff --git a/partey/src/main/java/de/bstly/we/partey/repository/ParteyUserTagRepository.java b/partey/src/main/java/de/bstly/we/partey/repository/ParteyUserTagRepository.java index d0bcf01..72a63fa 100644 --- a/partey/src/main/java/de/bstly/we/partey/repository/ParteyUserTagRepository.java +++ b/partey/src/main/java/de/bstly/we/partey/repository/ParteyUserTagRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.partey.model.ParteyUserTag; /** - * - * @author _bastler@bstly.de - * + * The Interface ParteyUserTagRepository. */ @Repository public interface ParteyUserTagRepository diff --git a/partey/src/main/java/de/bstly/we/partey/timeslot/businesslogic/TimeslotManager.java b/partey/src/main/java/de/bstly/we/partey/timeslot/businesslogic/TimeslotManager.java index 46e9ba3..b0cce8d 100644 --- a/partey/src/main/java/de/bstly/we/partey/timeslot/businesslogic/TimeslotManager.java +++ b/partey/src/main/java/de/bstly/we/partey/timeslot/businesslogic/TimeslotManager.java @@ -27,8 +27,7 @@ import de.bstly.we.partey.timeslot.model.TimeslotType; import de.bstly.we.partey.timeslot.repository.TimeslotRepository; /** - * @author _bastler@bstly.de - * + * The Class TimeslotManager. */ @Component public class TimeslotManager implements UserDataProvider { @@ -43,35 +42,39 @@ public class TimeslotManager implements UserDataProvider { private QTimeslot qTimeslot = QTimeslot.timeslot; /** - * - * @param id - * @return + * Gets the. + * + * @param id the id + * @return the timeslot */ public Timeslot get(Long id) { return timeslotRepository.findById(id).orElse(null); } /** - * - * @param owner - * @return + * Gets the all by owner. + * + * @param owner the owner + * @return the all by owner */ public List getAllByOwner(Long owner) { return Lists.newArrayList(timeslotRepository.findAll(qTimeslot.owner.eq(owner))); } /** - * - * @param owner - * @param after - * @param type - * @param visibility - * @param search - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param owner the owner + * @param invertOwner the invert owner + * @param after the after + * @param type the type + * @param visibility the visibility + * @param search the search + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(Long owner, boolean invertOwner, Instant after, TimeslotType type, Visibility visibility, String search, int page, int size, String sortBy, @@ -115,9 +118,10 @@ public class TimeslotManager implements UserDataProvider { } /** - * - * @param owner - * @return + * Quota. + * + * @param owner the owner + * @return the long */ public long quota(Long owner) { return timeslotRepository.count(qTimeslot.owner.eq(owner).and( @@ -125,9 +129,10 @@ public class TimeslotManager implements UserDataProvider { } /** - * - * @param timeslot - * @return + * Save. + * + * @param timeslot the timeslot + * @return the timeslot */ public Timeslot save(Timeslot timeslot) { Assert.isTrue(timeslot.getStarts().isBefore(timeslot.getEnds()), @@ -136,13 +141,15 @@ public class TimeslotManager implements UserDataProvider { } /** - * - * @param id + * Delete. + * + * @param id the id */ public void delete(Long id) { timeslotRepository.deleteById(id); } + /* * @see de.bstly.we.businesslogic.UserDataProvider#getId() */ @@ -151,6 +158,7 @@ public class TimeslotManager implements UserDataProvider { return "partey-timeslots"; } + /* * @see de.bstly.we.businesslogic.UserDataProvider#getUserData(java.lang.Long) */ @@ -163,6 +171,7 @@ public class TimeslotManager implements UserDataProvider { return result; } + /* * @see de.bstly.we.businesslogic.UserDataProvider#purgeUserData(java.lang.Long) */ @@ -174,7 +183,7 @@ public class TimeslotManager implements UserDataProvider { } /** - * + * Clear ended timeslots. */ @Scheduled(cron = "0 */5 * * * *") protected void clearEndedTimeslots() { diff --git a/partey/src/main/java/de/bstly/we/partey/timeslot/controller/TimeslotController.java b/partey/src/main/java/de/bstly/we/partey/timeslot/controller/TimeslotController.java index 05cee37..cbb3566 100644 --- a/partey/src/main/java/de/bstly/we/partey/timeslot/controller/TimeslotController.java +++ b/partey/src/main/java/de/bstly/we/partey/timeslot/controller/TimeslotController.java @@ -37,8 +37,7 @@ import de.bstly.we.partey.timeslot.model.Timeslot; import de.bstly.we.partey.timeslot.model.TimeslotType; /** - * @author _bastler@bstly.de - * + * The Class TimeslotController. */ @RestController @RequestMapping("/partey/timeslots") @@ -56,17 +55,18 @@ public class TimeslotController extends BaseController { private UserManager userManager; /** - * - * @param pageParameter - * @param sizeParameter - * @param sortParameter - * @param descParameter - * @param ownerParameter - * @param afterParameter - * @param typeParameter - * @param visibilityParameter - * @param searchParameter - * @return + * Gets the timeslots. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param sortParameter the sort parameter + * @param descParameter the desc parameter + * @param ownerParameter the owner parameter + * @param afterParameter the after parameter + * @param typeParameter the type parameter + * @param visibilityParameter the visibility parameter + * @param searchParameter the search parameter + * @return the timeslots */ @PreAuthorize("isAuthenticated()") @GetMapping @@ -122,9 +122,9 @@ public class TimeslotController extends BaseController { } /** - * - * @param timeslot - * @return + * Quota. + * + * @return the long */ @PreAuthorize("isAuthenticated()") @GetMapping("/quota") @@ -135,9 +135,10 @@ public class TimeslotController extends BaseController { } /** - * - * @param timeslot - * @return + * Creates the timeslot. + * + * @param timeslot the timeslot + * @return the timeslot */ @PreAuthorize("isAuthenticated()") @PostMapping @@ -169,9 +170,10 @@ public class TimeslotController extends BaseController { } /** - * - * @param timeslot - * @return + * Update timeslot. + * + * @param timeslot the timeslot + * @return the timeslot */ @PreAuthorize("isAuthenticated()") @PatchMapping @@ -216,8 +218,9 @@ public class TimeslotController extends BaseController { } /** - * - * @param id + * Delete timeslot. + * + * @param id the id */ @PreAuthorize("isAuthenticated()") @DeleteMapping("{id}") diff --git a/partey/src/main/java/de/bstly/we/partey/timeslot/controller/TimeslotManagementController.java b/partey/src/main/java/de/bstly/we/partey/timeslot/controller/TimeslotManagementController.java index a5f7c10..6282b2a 100644 --- a/partey/src/main/java/de/bstly/we/partey/timeslot/controller/TimeslotManagementController.java +++ b/partey/src/main/java/de/bstly/we/partey/timeslot/controller/TimeslotManagementController.java @@ -30,8 +30,7 @@ import de.bstly.we.partey.timeslot.model.Timeslot; import de.bstly.we.partey.timeslot.model.TimeslotType; /** - * @author _bastler@bstly.de - * + * The Class TimeslotManagementController. */ @RestController @RequestMapping("/partey/timeslots/manage") @@ -43,16 +42,19 @@ public class TimeslotManagementController extends BaseController { private TimeslotValidator timeslotValidator; /** - * - * @param pageParameter - * @param sizeParameter - * @param sortParameter - * @param descParameter - * @param afterParameter - * @param typeParameter - * @param visibilityParameter - * @param searchParameter - * @return + * Gets the timeslots. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param sortParameter the sort parameter + * @param descParameter the desc parameter + * @param ownerParameter the owner parameter + * @param invertOwnerParameter the invert owner parameter + * @param afterParameter the after parameter + * @param typeParameter the type parameter + * @param visibilityParameter the visibility parameter + * @param searchParameter the search parameter + * @return the timeslots */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -79,9 +81,10 @@ public class TimeslotManagementController extends BaseController { } /** - * - * @param timeslot - * @return + * Creates the or update timeslot. + * + * @param timeslot the timeslot + * @return the timeslot */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -100,8 +103,9 @@ public class TimeslotManagementController extends BaseController { } /** - * - * @param id + * Delete timeslot. + * + * @param id the id */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("{id}") diff --git a/partey/src/main/java/de/bstly/we/partey/timeslot/controller/validation/TimeslotValidator.java b/partey/src/main/java/de/bstly/we/partey/timeslot/controller/validation/TimeslotValidator.java index bb3ad47..7919238 100644 --- a/partey/src/main/java/de/bstly/we/partey/timeslot/controller/validation/TimeslotValidator.java +++ b/partey/src/main/java/de/bstly/we/partey/timeslot/controller/validation/TimeslotValidator.java @@ -21,8 +21,7 @@ import de.bstly.we.partey.timeslot.model.Timeslot; import de.bstly.we.partey.timeslot.repository.TimeslotRepository; /** - * @author _bastler@bstly.de - * + * The Class TimeslotValidator. */ @Component public class TimeslotValidator implements Validator { @@ -35,6 +34,7 @@ public class TimeslotValidator implements Validator { private SystemPropertyManager systemPropertyManager; private QTimeslot qTimeslot = QTimeslot.timeslot; + /* * @see org.springframework.validation.Validator#supports(java.lang.Class) */ @@ -43,9 +43,9 @@ public class TimeslotValidator implements Validator { return clazz.isAssignableFrom(Timeslot.class); } + /* - * @see org.springframework.validation.Validator#validate(java.lang.Object, - * org.springframework.validation.Errors) + * @see org.springframework.validation.Validator#validate(java.lang.Object, org.springframework.validation.Errors) */ @Override public void validate(Object target, Errors errors) { @@ -56,8 +56,10 @@ public class TimeslotValidator implements Validator { } /** - * @param timeslot - * @param errors + * Validate time. + * + * @param timeslot the timeslot + * @param errors the errors */ public void validateTime(Timeslot timeslot, Errors errors) { if (timeslot.getStarts() == null) { @@ -113,8 +115,10 @@ public class TimeslotValidator implements Validator { } /** - * @param timeslot - * @param errors + * Validate type. + * + * @param timeslot the timeslot + * @param errors the errors */ public void validateType(Timeslot timeslot, Errors errors) { if (timeslot.getId() != null && timeslotRepository.existsById(timeslot.getId())) { @@ -134,9 +138,10 @@ public class TimeslotValidator implements Validator { } /** - * - * @param timeslot - * @param errors + * Validate type audio. + * + * @param timeslot the timeslot + * @param errors the errors */ public void validateTypeAudio(Timeslot timeslot, Errors errors) { timeslot.setStream(null); @@ -151,9 +156,10 @@ public class TimeslotValidator implements Validator { } /** - * - * @param timeslot - * @param errors + * Validate type video. + * + * @param timeslot the timeslot + * @param errors the errors */ public void validateTypeVideo(Timeslot timeslot, Errors errors) { timeslot.setSecret(null); diff --git a/partey/src/main/java/de/bstly/we/partey/timeslot/model/Timeslot.java b/partey/src/main/java/de/bstly/we/partey/timeslot/model/Timeslot.java index 9bd12ad..984c99b 100644 --- a/partey/src/main/java/de/bstly/we/partey/timeslot/model/Timeslot.java +++ b/partey/src/main/java/de/bstly/we/partey/timeslot/model/Timeslot.java @@ -20,8 +20,7 @@ import de.bstly.we.model.UserData; import de.bstly.we.model.Visibility; /** - * @author _bastler@bstly.de - * + * The Class Timeslot. */ @Entity @Table(name = "timeslots") @@ -57,6 +56,8 @@ public class Timeslot implements UserData { private String username; /** + * Gets the id. + * * @return the id */ public Long getId() { @@ -64,13 +65,17 @@ public class Timeslot implements UserData { } /** - * @param id the id to set + * Sets the id. + * + * @param id the new id */ public void setId(Long id) { this.id = id; } /** + * Gets the owner. + * * @return the owner */ public Long getOwner() { @@ -78,13 +83,17 @@ public class Timeslot implements UserData { } /** - * @param owner the owner to set + * Sets the owner. + * + * @param owner the new owner */ public void setOwner(Long owner) { this.owner = owner; } /** + * Gets the type. + * * @return the type */ public TimeslotType getType() { @@ -92,13 +101,17 @@ public class Timeslot implements UserData { } /** - * @param type the type to set + * Sets the type. + * + * @param type the new type */ public void setType(TimeslotType type) { this.type = type; } /** + * Gets the starts. + * * @return the starts */ public Instant getStarts() { @@ -106,13 +119,17 @@ public class Timeslot implements UserData { } /** - * @param starts the starts to set + * Sets the starts. + * + * @param starts the new starts */ public void setStarts(Instant starts) { this.starts = starts; } /** + * Gets the ends. + * * @return the ends */ public Instant getEnds() { @@ -120,13 +137,17 @@ public class Timeslot implements UserData { } /** - * @param ends the ends to set + * Sets the ends. + * + * @param ends the new ends */ public void setEnds(Instant ends) { this.ends = ends; } /** + * Gets the visibility. + * * @return the visibility */ public Visibility getVisibility() { @@ -134,13 +155,17 @@ public class Timeslot implements UserData { } /** - * @param visibility the visibility to set + * Sets the visibility. + * + * @param visibility the new visibility */ public void setVisibility(Visibility visibility) { this.visibility = visibility; } /** + * Gets the title. + * * @return the title */ public String getTitle() { @@ -148,13 +173,17 @@ public class Timeslot implements UserData { } /** - * @param title the title to set + * Sets the title. + * + * @param title the new title */ public void setTitle(String title) { this.title = title; } /** + * Gets the description. + * * @return the description */ public String getDescription() { @@ -162,13 +191,17 @@ public class Timeslot implements UserData { } /** - * @param description the description to set + * Sets the description. + * + * @param description the new description */ public void setDescription(String description) { this.description = description; } /** + * Gets the stream. + * * @return the stream */ public String getStream() { @@ -176,13 +209,17 @@ public class Timeslot implements UserData { } /** - * @param stream the stream to set + * Sets the stream. + * + * @param stream the new stream */ public void setStream(String stream) { this.stream = stream; } /** + * Gets the secret. + * * @return the secret */ public String getSecret() { @@ -190,27 +227,35 @@ public class Timeslot implements UserData { } /** - * @param secret the secret to set + * Sets the secret. + * + * @param secret the new secret */ public void setSecret(String secret) { this.secret = secret; } /** - * @return the clearAfter + * Checks if is clear after. + * + * @return true, if is clear after */ public boolean isClearAfter() { return clearAfter; } /** - * @param clearAfter the clearAfter to set + * Sets the clear after. + * + * @param clearAfter the new clear after */ public void setClearAfter(boolean clearAfter) { this.clearAfter = clearAfter; } /** + * Gets the username. + * * @return the username */ public String getUsername() { @@ -218,7 +263,9 @@ public class Timeslot implements UserData { } /** - * @param username the username to set + * Sets the username. + * + * @param username the new username */ public void setUsername(String username) { this.username = username; diff --git a/partey/src/main/java/de/bstly/we/partey/timeslot/model/TimeslotType.java b/partey/src/main/java/de/bstly/we/partey/timeslot/model/TimeslotType.java index e48a965..35f4d53 100644 --- a/partey/src/main/java/de/bstly/we/partey/timeslot/model/TimeslotType.java +++ b/partey/src/main/java/de/bstly/we/partey/timeslot/model/TimeslotType.java @@ -4,8 +4,7 @@ package de.bstly.we.partey.timeslot.model; /** - * @author _bastler@bstly.de - * + * The Enum TimeslotType. */ public enum TimeslotType { VIDEO, AUDIO diff --git a/partey/src/main/java/de/bstly/we/partey/timeslot/repository/TimeslotRepository.java b/partey/src/main/java/de/bstly/we/partey/timeslot/repository/TimeslotRepository.java index 5c5d9ff..b1ccd52 100755 --- a/partey/src/main/java/de/bstly/we/partey/timeslot/repository/TimeslotRepository.java +++ b/partey/src/main/java/de/bstly/we/partey/timeslot/repository/TimeslotRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.partey.timeslot.model.Timeslot; /** - * - * @author _bastler@bstly.de - * + * The Interface TimeslotRepository. */ @Repository public interface TimeslotRepository diff --git a/pom.xml b/pom.xml index 7648992..52a9753 100755 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ UTF-8 11 - 1.0.1-SNAPSHOT + 1.1.0-SNAPSHOT diff --git a/services/src/main/java/de/bstly/we/services/businesslogic/ServiceManager.java b/services/src/main/java/de/bstly/we/services/businesslogic/ServiceManager.java index 2518710..65b32e0 100644 --- a/services/src/main/java/de/bstly/we/services/businesslogic/ServiceManager.java +++ b/services/src/main/java/de/bstly/we/services/businesslogic/ServiceManager.java @@ -24,9 +24,7 @@ import de.bstly.we.services.model.Service; import de.bstly.we.services.repository.ServiceRepository; /** - * - * @author _bastler@bstly.de - * + * The Class ServiceManager. */ @Component public class ServiceManager { @@ -41,27 +39,30 @@ public class ServiceManager { private QService qService = QService.service; /** - * - * @param name - * @return + * Gets the. + * + * @param name the name + * @return the service */ public Service get(String name) { return serviceRepository.findById(name).orElse(null); } /** - * - * @param service - * @return + * Update. + * + * @param service the service + * @return the service */ public Service update(Service service) { return serviceRepository.save(service); } /** - * - * @param target - * @return + * Gets the for target. + * + * @param target the target + * @return the for target */ public List getForTarget(Long target) { List services = Lists.newArrayList(); @@ -116,20 +117,22 @@ public class ServiceManager { } /** - * - * @param name + * Delete. + * + * @param name the name */ public void delete(String name) { serviceRepository.deleteById(name); } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending) { Sort sort = descending ? Sort.by(sortBy).descending() : Sort.by(sortBy).ascending(); diff --git a/services/src/main/java/de/bstly/we/services/controller/ServiceController.java b/services/src/main/java/de/bstly/we/services/controller/ServiceController.java index b87f700..1ec387d 100644 --- a/services/src/main/java/de/bstly/we/services/controller/ServiceController.java +++ b/services/src/main/java/de/bstly/we/services/controller/ServiceController.java @@ -15,8 +15,7 @@ import de.bstly.we.services.businesslogic.ServiceManager; import de.bstly.we.services.model.Service; /** - * @author _bastler@bstly.de - * + * The Class ServiceController. */ @RestController @RequestMapping("/services") @@ -26,8 +25,9 @@ public class ServiceController extends BaseController { private ServiceManager serviceManager; /** - * - * @return + * Gets the services. + * + * @return the services */ @GetMapping public List getServices() { diff --git a/services/src/main/java/de/bstly/we/services/controller/ServiceManagementController.java b/services/src/main/java/de/bstly/we/services/controller/ServiceManagementController.java index d8276d7..a0ebe80 100644 --- a/services/src/main/java/de/bstly/we/services/controller/ServiceManagementController.java +++ b/services/src/main/java/de/bstly/we/services/controller/ServiceManagementController.java @@ -23,8 +23,7 @@ import de.bstly.we.services.businesslogic.ServiceManager; import de.bstly.we.services.model.Service; /** - * @author _bastler@bstly.de - * + * The Class ServiceManagementController. */ @RestController @RequestMapping("/services/manage") @@ -34,10 +33,11 @@ public class ServiceManagementController extends BaseController { private ServiceManager serviceManager; /** - * - * @param pageParameter - * @param sizeParameter - * @return + * Gets the all services. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @return the all services */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -47,9 +47,10 @@ public class ServiceManagementController extends BaseController { } /** - * - * @param service - * @return + * Creates the or update service. + * + * @param service the service + * @return the service */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -62,8 +63,9 @@ public class ServiceManagementController extends BaseController { } /** - * - * @param service + * Delete service. + * + * @param service the service */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping diff --git a/services/src/main/java/de/bstly/we/services/model/Service.java b/services/src/main/java/de/bstly/we/services/model/Service.java index ff9c03f..9b8142e 100644 --- a/services/src/main/java/de/bstly/we/services/model/Service.java +++ b/services/src/main/java/de/bstly/we/services/model/Service.java @@ -10,9 +10,7 @@ import javax.persistence.Table; import javax.persistence.UniqueConstraint; /** - * - * @author _bastler@bstly.de - * + * The Class Service. */ @Entity @Table(name = "services", uniqueConstraints = @UniqueConstraint(columnNames = { "name" })) @@ -33,15 +31,17 @@ public class Service { private String category; /** - * + * Instantiates a new service. */ public Service() { super(); } /** - * @param name - * @param url + * Instantiates a new service. + * + * @param name the name + * @param url the url */ public Service(String name, String url) { super(); @@ -50,6 +50,8 @@ public class Service { } /** + * Gets the name. + * * @return the name */ public String getName() { @@ -57,13 +59,17 @@ public class Service { } /** - * @param name the name to set + * Sets the name. + * + * @param name the new name */ public void setName(String name) { this.name = name; } /** + * Gets the url. + * * @return the url */ public String getUrl() { @@ -71,41 +77,53 @@ public class Service { } /** - * @param url the url to set + * Sets the url. + * + * @param url the new url */ public void setUrl(String url) { this.url = url; } /** - * @return the alwaysPermitted + * Checks if is always permitted. + * + * @return true, if is always permitted */ public boolean isAlwaysPermitted() { return alwaysPermitted; } /** - * @param alwaysPermitted the alwaysPermitted to set + * Sets the always permitted. + * + * @param alwaysPermitted the new always permitted */ public void setAlwaysPermitted(boolean alwaysPermitted) { this.alwaysPermitted = alwaysPermitted; } /** - * @return the sameSite + * Checks if is same site. + * + * @return true, if is same site */ public boolean isSameSite() { return sameSite; } /** - * @param sameSite the sameSite to set + * Sets the same site. + * + * @param sameSite the new same site */ public void setSameSite(boolean sameSite) { this.sameSite = sameSite; } /** + * Gets the permission. + * * @return the permission */ public String getPermission() { @@ -113,13 +131,17 @@ public class Service { } /** - * @param permission the permission to set + * Sets the permission. + * + * @param permission the new permission */ public void setPermission(String permission) { this.permission = permission; } /** + * Gets the category. + * * @return the category */ public String getCategory() { @@ -127,7 +149,9 @@ public class Service { } /** - * @param category the category to set + * Sets the category. + * + * @param category the new category */ public void setCategory(String category) { this.category = category; diff --git a/services/src/main/java/de/bstly/we/services/repository/ServiceRepository.java b/services/src/main/java/de/bstly/we/services/repository/ServiceRepository.java index c061ac2..301380a 100644 --- a/services/src/main/java/de/bstly/we/services/repository/ServiceRepository.java +++ b/services/src/main/java/de/bstly/we/services/repository/ServiceRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.services.model.Service; /** - * - * @author _bastler@bstly.de - * + * The Interface ServiceRepository. */ @Repository public interface ServiceRepository extends JpaRepository, QuerydslPredicateExecutor { diff --git a/urlshortener/src/main/java/de/bstly/we/urlshortener/businesslogic/ShortenedUrlManager.java b/urlshortener/src/main/java/de/bstly/we/urlshortener/businesslogic/ShortenedUrlManager.java index 8878e43..73a1841 100644 --- a/urlshortener/src/main/java/de/bstly/we/urlshortener/businesslogic/ShortenedUrlManager.java +++ b/urlshortener/src/main/java/de/bstly/we/urlshortener/businesslogic/ShortenedUrlManager.java @@ -32,8 +32,7 @@ import de.bstly.we.urlshortener.model.ShortenedUrl; import de.bstly.we.urlshortener.repository.ShortenedUrlRepository; /** - * @author _bastler@bstly.de - * + * The Class ShortenedUrlManager. */ @Component public class ShortenedUrlManager implements SmartInitializingSingleton, UserDataProvider { @@ -57,9 +56,9 @@ public class ShortenedUrlManager implements SmartInitializingSingleton, UserData public static final String SYSTEM_PROPERTY_URL_SHORTENER_NOT_FOUND = "urlShortener.notFoundRedirect"; public static final String SYSTEM_PROPERTY_URL_SHORTENER_PASSWORD = "urlShortener.passwordRedirect"; + /* - * @see org.springframework.beans.factory.SmartInitializingSingleton# - * afterSingletonsInstantiated() + * @see org.springframework.beans.factory.SmartInitializingSingleton#afterSingletonsInstantiated() */ @Override public void afterSingletonsInstantiated() { @@ -84,31 +83,34 @@ public class ShortenedUrlManager implements SmartInitializingSingleton, UserData } /** - * - * @param code - * @return + * Gets the. + * + * @param code the code + * @return the shortened url */ public ShortenedUrl get(String code) { return shortenedUrlRepository.findById(code).orElse(null); } /** - * - * @param userId - * @return + * Gets the all by owner. + * + * @param userId the user id + * @return the all by owner */ public List getAllByOwner(Long userId) { return Lists.newArrayList(shortenedUrlRepository.findAll(qShortenedUrl.owner.eq(userId))); } /** - * - * @param page - * @param size - * @param sortBy - * @param descending - * @param search - * @return + * Gets the. + * + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @param search the search + * @return the page */ public Page get(int page, int size, String sortBy, boolean descending, String search) { @@ -126,14 +128,15 @@ public class ShortenedUrlManager implements SmartInitializingSingleton, UserData } /** - * - * @param userId - * @param page - * @param size - * @param sortBy - * @param descending - * @param search - * @return + * Gets the for user id. + * + * @param userId the user id + * @param page the page + * @param size the size + * @param sortBy the sort by + * @param descending the descending + * @param search the search + * @return the for user id */ public Page getForUserId(Long userId, int page, int size, String sortBy, boolean descending, String search) { @@ -156,14 +159,17 @@ public class ShortenedUrlManager implements SmartInitializingSingleton, UserData } /** - * - * @param owner - * @param url - * @param code - * @param expires - * @param password - * @param quota - * @return + * Creates the. + * + * @param owner the owner + * @param url the url + * @param note the note + * @param code the code + * @param expires the expires + * @param password the password + * @param queryParameters the query parameters + * @param quota the quota + * @return the shortened url */ public ShortenedUrl create(Long owner, String url, String note, String code, Instant expires, String password, boolean queryParameters, boolean quota) { @@ -210,9 +216,10 @@ public class ShortenedUrlManager implements SmartInitializingSingleton, UserData } /** - * - * @param shortenedUrl - * @return + * Save. + * + * @param shortenedUrl the shortened url + * @return the shortened url */ public ShortenedUrl save(ShortenedUrl shortenedUrl) { @@ -225,9 +232,10 @@ public class ShortenedUrlManager implements SmartInitializingSingleton, UserData } /** - * - * @param shortenedUrl - * @param quota + * Delete. + * + * @param shortenedUrl the shortened url + * @param quota the quota */ public void delete(ShortenedUrl shortenedUrl, boolean quota) { if (quota) { @@ -246,9 +254,10 @@ public class ShortenedUrlManager implements SmartInitializingSingleton, UserData } /** - * - * @param owner - * @param quota + * Delete all. + * + * @param owner the owner + * @param quota the quota */ public void deleteAll(Long owner, boolean quota) { List shortenedUrls = Lists @@ -259,6 +268,7 @@ public class ShortenedUrlManager implements SmartInitializingSingleton, UserData } } + /* * @see de.bstly.we.businesslogic.UserDataProvider#getId() */ @@ -267,6 +277,7 @@ public class ShortenedUrlManager implements SmartInitializingSingleton, UserData return "shortend-urls"; } + /* * @see de.bstly.we.businesslogic.UserDataProvider#getUserData(java.lang.Long) */ @@ -279,6 +290,7 @@ public class ShortenedUrlManager implements SmartInitializingSingleton, UserData return result; } + /* * @see de.bstly.we.businesslogic.UserDataProvider#purgeUserData(java.lang.Long) */ @@ -290,7 +302,7 @@ public class ShortenedUrlManager implements SmartInitializingSingleton, UserData } /** - * + * Clear or update shortened urls. */ @Scheduled(cron = "0 */5 * * * *") public void clearOrUpdateShortenedUrls() { diff --git a/urlshortener/src/main/java/de/bstly/we/urlshortener/businesslogic/ShortenedUrlPermissions.java b/urlshortener/src/main/java/de/bstly/we/urlshortener/businesslogic/ShortenedUrlPermissions.java index 54402b1..46c2e92 100644 --- a/urlshortener/src/main/java/de/bstly/we/urlshortener/businesslogic/ShortenedUrlPermissions.java +++ b/urlshortener/src/main/java/de/bstly/we/urlshortener/businesslogic/ShortenedUrlPermissions.java @@ -4,8 +4,7 @@ package de.bstly.we.urlshortener.businesslogic; /** - * @author _bastler@bstly.de - * + * The Interface ShortenedUrlPermissions. */ public interface ShortenedUrlPermissions { public static final String URL_SHORTENER = "url_shortener"; diff --git a/urlshortener/src/main/java/de/bstly/we/urlshortener/businesslogic/ShortenedUrlQuotas.java b/urlshortener/src/main/java/de/bstly/we/urlshortener/businesslogic/ShortenedUrlQuotas.java index 4dc3e88..d7b8e96 100644 --- a/urlshortener/src/main/java/de/bstly/we/urlshortener/businesslogic/ShortenedUrlQuotas.java +++ b/urlshortener/src/main/java/de/bstly/we/urlshortener/businesslogic/ShortenedUrlQuotas.java @@ -4,8 +4,7 @@ package de.bstly.we.urlshortener.businesslogic; /** - * @author _bastler@bstly.de - * + * The Interface ShortenedUrlQuotas. */ public interface ShortenedUrlQuotas { diff --git a/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/ShortenedUrlController.java b/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/ShortenedUrlController.java index b6838e2..d38cb82 100644 --- a/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/ShortenedUrlController.java +++ b/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/ShortenedUrlController.java @@ -44,8 +44,7 @@ import de.bstly.we.urlshortener.controller.validation.ShortenedUrlModelValidator import de.bstly.we.urlshortener.model.ShortenedUrl; /** - * @author _bastler@bstly.de - * + * The Class ShortenedUrlController. */ @RestController @RequestMapping("/url/shortener") @@ -65,11 +64,13 @@ public class ShortenedUrlController extends BaseController { private ShortenedUrlModelValidator shortenedUrlModelValidator; /** - * - * @param code - * @param request - * @param response - * @throws IOException + * Gets the shortened url link. + * + * @param code the code + * @param request the request + * @param response the response + * @return the shortened url link + * @throws IOException Signals that an I/O exception has occurred. */ @GetMapping("/{code}") public void getShortenedUrlLink(@PathVariable("code") String code, HttpServletRequest request, @@ -104,12 +105,14 @@ public class ShortenedUrlController extends BaseController { } /** - * - * @param code - * @param password - * @param request - * @param response - * @throws IOException + * Gets the protected shortened url link. + * + * @param code the code + * @param password the password + * @param request the request + * @param response the response + * @return the protected shortened url link + * @throws IOException Signals that an I/O exception has occurred. */ @PostMapping("/{code}") public void getProtectedShortenedUrlLink(@PathVariable("code") String code, @@ -159,11 +162,12 @@ public class ShortenedUrlController extends BaseController { } /** - * - * @param shortenedUrl - * @param request - * @param response - * @throws IOException + * Send valid redirect. + * + * @param shortenedUrl the shortened url + * @param request the request + * @param response the response + * @throws IOException Signals that an I/O exception has occurred. */ protected void sendValidRedirect(ShortenedUrl shortenedUrl, HttpServletRequest request, HttpServletResponse response) throws IOException { @@ -184,9 +188,10 @@ public class ShortenedUrlController extends BaseController { } /** - * - * @param code - * @return + * Gets the shortened url. + * + * @param code the code + * @return the shortened url */ @PreAuthorize("isAuthenticated()") @GetMapping("/model/{code}") @@ -211,8 +216,14 @@ public class ShortenedUrlController extends BaseController { } /** - * - * @return + * Gets the shortened urls. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param sortParameter the sort parameter + * @param descParameter the desc parameter + * @param searchParameter the search parameter + * @return the shortened urls */ @PreAuthorize("isAuthenticated()") @GetMapping @@ -234,9 +245,10 @@ public class ShortenedUrlController extends BaseController { } /** - * - * @param shortenedUrlModel - * @return + * Creates the shortened url. + * + * @param shortenedUrlModel the shortened url model + * @return the shortened url */ @PreAuthorize("isAuthenticated()") @PostMapping @@ -268,9 +280,10 @@ public class ShortenedUrlController extends BaseController { } /** - * - * @param shortenedUrlModel - * @return + * Update shortened url. + * + * @param shortenedUrlModel the shortened url model + * @return the shortened url */ @PreAuthorize("isAuthenticated()") @PatchMapping @@ -333,8 +346,9 @@ public class ShortenedUrlController extends BaseController { } /** - * - * @param id + * Delete shortened url. + * + * @param code the code */ @PreAuthorize("isAuthenticated()") @DeleteMapping("/{code}") diff --git a/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/ShortenedUrlManagementController.java b/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/ShortenedUrlManagementController.java index f4cf6a2..11aa1a7 100644 --- a/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/ShortenedUrlManagementController.java +++ b/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/ShortenedUrlManagementController.java @@ -24,8 +24,7 @@ import de.bstly.we.urlshortener.businesslogic.ShortenedUrlManager; import de.bstly.we.urlshortener.model.ShortenedUrl; /** - * @author _bastler@bstly.de - * + * The Class ShortenedUrlManagementController. */ @RestController @RequestMapping("/url/shortener/manage") @@ -35,8 +34,12 @@ public class ShortenedUrlManagementController extends BaseController { private ShortenedUrlManager shortenedUrlManager; /** - * - * @return + * Gets the shortened urls. + * + * @param pageParameter the page parameter + * @param sizeParameter the size parameter + * @param searchParameter the search parameter + * @return the shortened urls */ @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping @@ -49,9 +52,10 @@ public class ShortenedUrlManagementController extends BaseController { } /** - * - * @param shortenedUrl - * @return + * Creates the or update shortened url. + * + * @param shortenedUrl the shortened url + * @return the shortened url */ @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping @@ -60,8 +64,10 @@ public class ShortenedUrlManagementController extends BaseController { } /** - * - * @param id + * Delete shortened url. + * + * @param code the code + * @param quota the quota */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/{code}") @@ -77,8 +83,10 @@ public class ShortenedUrlManagementController extends BaseController { } /** - * - * @param owner + * Delete all. + * + * @param owner the owner + * @param quota the quota */ @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/all/{owner}") diff --git a/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/model/ShortenedUrlModel.java b/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/model/ShortenedUrlModel.java index 9aa90ea..ef1a19c 100644 --- a/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/model/ShortenedUrlModel.java +++ b/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/model/ShortenedUrlModel.java @@ -6,8 +6,7 @@ package de.bstly.we.urlshortener.controller.model; import java.time.Instant; /** - * @author _bastler@bstly.de - * + * The Class ShortenedUrlModel. */ public class ShortenedUrlModel { @@ -22,6 +21,8 @@ public class ShortenedUrlModel { private boolean newPassword; /** + * Gets the code. + * * @return the code */ public String getCode() { @@ -29,27 +30,35 @@ public class ShortenedUrlModel { } /** - * @param code the code to set + * Sets the code. + * + * @param code the new code */ public void setCode(String code) { this.code = code; } /** - * @return the newCode + * Gets the new code. + * + * @return the new code */ public String getNewCode() { return newCode; } /** - * @param newCode the newCode to set + * Sets the new code. + * + * @param newCode the new new code */ public void setNewCode(String newCode) { this.newCode = newCode; } /** + * Gets the url. + * * @return the url */ public String getUrl() { @@ -57,13 +66,17 @@ public class ShortenedUrlModel { } /** - * @param url the url to set + * Sets the url. + * + * @param url the new url */ public void setUrl(String url) { this.url = url; } /** + * Gets the note. + * * @return the note */ public String getNote() { @@ -71,13 +84,17 @@ public class ShortenedUrlModel { } /** - * @param note the note to set + * Sets the note. + * + * @param note the new note */ public void setNote(String note) { this.note = note; } /** + * Gets the expires. + * * @return the expires */ public Instant getExpires() { @@ -85,13 +102,17 @@ public class ShortenedUrlModel { } /** - * @param expires the expires to set + * Sets the expires. + * + * @param expires the new expires */ public void setExpires(Instant expires) { this.expires = expires; } /** + * Gets the password. + * * @return the password */ public String getPassword() { @@ -99,49 +120,63 @@ public class ShortenedUrlModel { } /** - * @param password the password to set + * Sets the password. + * + * @param password the new password */ public void setPassword(String password) { this.password = password; } /** - * @return the password2 + * Gets the password 2. + * + * @return the password 2 */ public String getPassword2() { return password2; } /** - * @param password2 the password2 to set + * Sets the password 2. + * + * @param password2 the new password 2 */ public void setPassword2(String password2) { this.password2 = password2; } /** - * @return the queryParameters + * Checks if is query parameters. + * + * @return true, if is query parameters */ public boolean isQueryParameters() { return queryParameters; } /** - * @param queryParameters the queryParameters to set + * Sets the query parameters. + * + * @param queryParameters the new query parameters */ public void setQueryParameters(boolean queryParameters) { this.queryParameters = queryParameters; } /** - * @return the newPassword + * Checks if is new password. + * + * @return true, if is new password */ public boolean isNewPassword() { return newPassword; } /** - * @param newPassword the newPassword to set + * Sets the new password. + * + * @param newPassword the new new password */ public void setNewPassword(boolean newPassword) { this.newPassword = newPassword; diff --git a/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/validation/ShortenedUrlModelValidator.java b/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/validation/ShortenedUrlModelValidator.java index 210cb39..8a37cc5 100644 --- a/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/validation/ShortenedUrlModelValidator.java +++ b/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/validation/ShortenedUrlModelValidator.java @@ -16,8 +16,7 @@ import de.bstly.we.urlshortener.businesslogic.ShortenedUrlManager; import de.bstly.we.urlshortener.controller.model.ShortenedUrlModel; /** - * @author _bastler@bstly.de - * + * The Class ShortenedUrlModelValidator. */ @Component public class ShortenedUrlModelValidator implements Validator { @@ -27,6 +26,7 @@ public class ShortenedUrlModelValidator implements Validator { private UrlValidator urlValidator = new UrlValidator(UrlValidator.ALLOW_ALL_SCHEMES); protected static final String codePart = "^[a-zA-Z0-9_!#$%&'*+/=?`{|}~^-]+(?:\\\\.[A-Z0-9_!#$%&'*+/=?`{|}~^-]+)*$"; + /* * @see org.springframework.validation.Validator#supports(java.lang.Class) */ @@ -35,9 +35,9 @@ public class ShortenedUrlModelValidator implements Validator { return clazz.isAssignableFrom(ShortenedUrlModel.class); } + /* - * @see org.springframework.validation.Validator#validate(java.lang.Object, - * org.springframework.validation.Errors) + * @see org.springframework.validation.Validator#validate(java.lang.Object, org.springframework.validation.Errors) */ @Override public void validate(Object target, Errors errors) { diff --git a/urlshortener/src/main/java/de/bstly/we/urlshortener/model/ShortenedUrl.java b/urlshortener/src/main/java/de/bstly/we/urlshortener/model/ShortenedUrl.java index c62de00..4885bed 100644 --- a/urlshortener/src/main/java/de/bstly/we/urlshortener/model/ShortenedUrl.java +++ b/urlshortener/src/main/java/de/bstly/we/urlshortener/model/ShortenedUrl.java @@ -23,8 +23,7 @@ import de.bstly.we.model.AbstractModel; import de.bstly.we.model.UserData; /** - * @author _bastler@bstly.de - * + * The Class ShortenedUrl. */ @Entity @Table(name = "shortened_urls") @@ -51,6 +50,8 @@ public class ShortenedUrl implements UserData, AbstractModel { private boolean hasPassword; /** + * Gets the code. + * * @return the code */ public String getCode() { @@ -58,13 +59,17 @@ public class ShortenedUrl implements UserData, AbstractModel { } /** - * @param code the code to set + * Sets the code. + * + * @param code the new code */ public void setCode(String code) { this.code = code; } /** + * Gets the owner. + * * @return the owner */ public Long getOwner() { @@ -72,13 +77,17 @@ public class ShortenedUrl implements UserData, AbstractModel { } /** - * @param owner the owner to set + * Sets the owner. + * + * @param owner the new owner */ public void setOwner(Long owner) { this.owner = owner; } /** + * Gets the url. + * * @return the url */ public String getUrl() { @@ -86,13 +95,17 @@ public class ShortenedUrl implements UserData, AbstractModel { } /** - * @param url the url to set + * Sets the url. + * + * @param url the new url */ public void setUrl(String url) { this.url = url; } /** + * Gets the expires. + * * @return the expires */ public Instant getExpires() { @@ -100,27 +113,35 @@ public class ShortenedUrl implements UserData, AbstractModel { } /** - * @param expires the expires to set + * Sets the expires. + * + * @param expires the new expires */ public void setExpires(Instant expires) { this.expires = expires; } /** - * @return the passwordHash + * Gets the password hash. + * + * @return the password hash */ public String getPasswordHash() { return passwordHash; } /** - * @param passwordHash the passwordHash to set + * Sets the password hash. + * + * @param passwordHash the new password hash */ public void setPasswordHash(String passwordHash) { this.passwordHash = passwordHash; } /** + * Gets the link. + * * @return the link */ public String getLink() { @@ -128,13 +149,17 @@ public class ShortenedUrl implements UserData, AbstractModel { } /** - * @param link the link to set + * Sets the link. + * + * @param link the new link */ public void setLink(String link) { this.link = link; } /** + * Gets the note. + * * @return the note */ public String getNote() { @@ -142,28 +167,36 @@ public class ShortenedUrl implements UserData, AbstractModel { } /** - * @param note the note to set + * Sets the note. + * + * @param note the new note */ public void setNote(String note) { this.note = note; } /** - * @return the queryParameters + * Checks if is query parameters. + * + * @return true, if is query parameters */ public boolean isQueryParameters() { return queryParameters; } /** - * @param queryParameters the queryParameters to set + * Sets the query parameters. + * + * @param queryParameters the new query parameters */ public void setQueryParameters(boolean queryParameters) { this.queryParameters = queryParameters; } /** - * @return the hasPassword + * Checks if is checks for password. + * + * @return true, if is checks for password */ public boolean isHasPassword() { return StringUtils.hasText(passwordHash); diff --git a/urlshortener/src/main/java/de/bstly/we/urlshortener/repository/ShortenedUrlRepository.java b/urlshortener/src/main/java/de/bstly/we/urlshortener/repository/ShortenedUrlRepository.java index 5b9beb2..052af00 100755 --- a/urlshortener/src/main/java/de/bstly/we/urlshortener/repository/ShortenedUrlRepository.java +++ b/urlshortener/src/main/java/de/bstly/we/urlshortener/repository/ShortenedUrlRepository.java @@ -10,9 +10,7 @@ import org.springframework.stereotype.Repository; import de.bstly.we.urlshortener.model.ShortenedUrl; /** - * - * @author _bastler@bstly.de - * + * The Interface ShortenedUrlRepository. */ @Repository public interface ShortenedUrlRepository