add lombok to clean codebase

This commit is contained in:
2025-11-09 18:40:38 +01:00
parent 8d9b10bace
commit c27e68caf0
88 changed files with 704 additions and 7787 deletions
+7
View File
@@ -30,5 +30,12 @@
<version>${querydsl.version}</version> <version>${querydsl.version}</version>
<classifier>jakarta</classifier> <classifier>jakarta</classifier>
</dependency> </dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>
@@ -20,6 +20,8 @@ import jakarta.persistence.Transient;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import de.bstly.we.model.UserData; import de.bstly.we.model.UserData;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class BorrowItem. * The Class BorrowItem.
@@ -27,6 +29,8 @@ import de.bstly.we.model.UserData;
@Entity @Entity
@Table(name = "borrow_items") @Table(name = "borrow_items")
@JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonInclude(JsonInclude.Include.NON_EMPTY)
@Getter
@Setter
public class BorrowItem implements UserData { public class BorrowItem implements UserData {
@Id @Id
@@ -58,205 +62,7 @@ public class BorrowItem implements UserData {
@Transient @Transient
private List<? extends BorrowItemSlot> slots; private List<? extends BorrowItemSlot> slots;
/** /**
* 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 owner.
*
* @return the owner
*/
public Long getOwner() {
return owner;
}
/**
* Sets the owner.
*
* @param owner the new owner
*/
public void setOwner(Long owner) {
this.owner = owner;
}
/**
* 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 description.
*
* @return the description
*/
public String getDescription() {
return description;
}
/**
* Sets the description.
*
* @param description the new description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* Gets the url.
*
* @return the url
*/
public String getUrl() {
return url;
}
/**
* Sets the url.
*
* @param url the new url
*/
public void setUrl(String url) {
this.url = url;
}
/**
* Gets the email notification.
*
* @return the email notification
*/
public Boolean getEmailNotification() {
return emailNotification;
}
/**
* Sets the email notification.
*
* @param emailNotification the new email notification
*/
public void setEmailNotification(Boolean emailNotification) {
this.emailNotification = emailNotification;
}
/**
* Gets the email.
*
* @return the email
*/
public String getEmail() {
return email;
}
/**
* Sets the email.
*
* @param email the new email
*/
public void setEmail(String email) {
this.email = email;
}
/**
* Checks if is auto accept.
*
* @return true, if is auto accept
*/
public boolean isAutoAccept() {
return autoAccept;
}
/**
* Sets the auto accept.
*
* @param autoAccept the new auto accept
*/
public void setAutoAccept(boolean autoAccept) {
this.autoAccept = autoAccept;
}
/**
* Gets the min duration.
*
* @return the min duration
*/
public Duration getMinDuration() {
return minDuration;
}
/**
* Sets the min duration.
*
* @param minDuration the new min duration
*/
public void setMinDuration(Duration minDuration) {
this.minDuration = minDuration;
}
/**
* Gets the max duration.
*
* @return the max duration
*/
public Duration getMaxDuration() {
return maxDuration;
}
/**
* Sets the max duration.
*
* @param maxDuration the new max duration
*/
public void setMaxDuration(Duration maxDuration) {
this.maxDuration = maxDuration;
}
/**
* Gets the availability.
*
* @return the availability
*/
public BorrowItemAvailability getAvailability() {
return availability;
}
/**
* Sets the availability.
*
* @param availability the new availability
*/
public void setAvailability(BorrowItemAvailability availability) {
this.availability = availability;
}
/**
* Gets the slots. * Gets the slots.
* *
* @return the slots * @return the slots
@@ -264,14 +70,4 @@ public class BorrowItem implements UserData {
public List<? extends BorrowItemSlot> getSlots() { public List<? extends BorrowItemSlot> getSlots() {
return slots; return slots;
} }
/**
* Sets the slots.
*
* @param slots the new slots
*/
public void setSlots(List<? extends BorrowItemSlot> slots) {
this.slots = slots;
}
} }
@@ -8,12 +8,16 @@ import java.time.Instant;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class BorrowItemManualSlot. * The Class BorrowItemManualSlot.
*/ */
@Entity @Entity
@Table(name = "borrow_item_manual_slots") @Table(name = "borrow_item_manual_slots")
@Getter
@Setter
public class BorrowItemManualSlot extends BorrowItemSlot { public class BorrowItemManualSlot extends BorrowItemSlot {
@Column(name = "start") @Column(name = "start")
@@ -21,40 +25,4 @@ public class BorrowItemManualSlot extends BorrowItemSlot {
@Column(name = "end") @Column(name = "end")
private Instant end; private Instant end;
/**
* Gets the start.
*
* @return the start
*/
public Instant getStart() {
return start;
}
/**
* Sets the start.
*
* @param start the new start
*/
public void setStart(Instant start) {
this.start = start;
}
/**
* Gets the end.
*
* @return the end
*/
public Instant getEnd() {
return end;
}
/**
* Sets the end.
*
* @param end the new end
*/
public void setEnd(Instant end) {
this.end = end;
}
} }
@@ -11,12 +11,16 @@ import jakarta.persistence.Entity;
import jakarta.persistence.EnumType; import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated; import jakarta.persistence.Enumerated;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class BorrowItemPeriodSlot. * The Class BorrowItemPeriodSlot.
*/ */
@Entity @Entity
@Table(name = "borrow_item_period_slots") @Table(name = "borrow_item_period_slots")
@Getter
@Setter
public class BorrowItemPeriodSlot extends BorrowItemSlot { public class BorrowItemPeriodSlot extends BorrowItemSlot {
@Column(name = "start_day") @Column(name = "start_day")
@@ -30,76 +34,4 @@ public class BorrowItemPeriodSlot extends BorrowItemSlot {
@Column(name = "end_time") @Column(name = "end_time")
private LocalTime endTime; private LocalTime endTime;
/**
* Gets the start day.
*
* @return the start day
*/
public DayOfWeek getStartDay() {
return startDay;
}
/**
* Sets the start day.
*
* @param startDay the new start day
*/
public void setStartDay(DayOfWeek startDay) {
this.startDay = startDay;
}
/**
* Gets the start time.
*
* @return the start time
*/
public LocalTime getStartTime() {
return startTime;
}
/**
* Sets the start time.
*
* @param startTime the new start time
*/
public void setStartTime(LocalTime startTime) {
this.startTime = startTime;
}
/**
* Gets the end day.
*
* @return the end day
*/
public DayOfWeek getEndDay() {
return endDay;
}
/**
* Sets the end day.
*
* @param endDay the new end day
*/
public void setEndDay(DayOfWeek endDay) {
this.endDay = endDay;
}
/**
* Gets the end time.
*
* @return the end time
*/
public LocalTime getEndTime() {
return endTime;
}
/**
* Sets the end time.
*
* @param endTime the new end time
*/
public void setEndTime(LocalTime endTime) {
this.endTime = endTime;
}
} }
@@ -16,6 +16,8 @@ import jakarta.persistence.InheritanceType;
import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeInfo.As; import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class BorrowItemSlot. * The Class BorrowItemSlot.
@@ -26,6 +28,8 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
@JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = As.PROPERTY, property = "type") @JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = As.PROPERTY, property = "type")
@JsonSubTypes({ @JsonSubTypes.Type(value = BorrowItemManualSlot.class, name = "MANUAL"), @JsonSubTypes({ @JsonSubTypes.Type(value = BorrowItemManualSlot.class, name = "MANUAL"),
@JsonSubTypes.Type(value = BorrowItemPeriodSlot.class, name = "PERIOD") }) @JsonSubTypes.Type(value = BorrowItemPeriodSlot.class, name = "PERIOD") })
@Getter
@Setter
public abstract class BorrowItemSlot { public abstract class BorrowItemSlot {
@Id @Id
@@ -35,40 +39,4 @@ public abstract class BorrowItemSlot {
@Column(name = "item") @Column(name = "item")
private Long item; private Long item;
/**
* 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 item.
*
* @return the item
*/
public Long getItem() {
return item;
}
/**
* Sets the item.
*
* @param item the new item
*/
public void setItem(Long item) {
this.item = item;
}
} }
@@ -17,12 +17,16 @@ import jakarta.persistence.Table;
import jakarta.persistence.Transient; import jakarta.persistence.Transient;
import de.bstly.we.model.UserData; import de.bstly.we.model.UserData;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class BorrowRequest. * The Class BorrowRequest.
*/ */
@Entity @Entity
@Table(name = "borrow_requests") @Table(name = "borrow_requests")
@Getter
@Setter
public class BorrowRequest implements UserData { public class BorrowRequest implements UserData {
@Id @Id
@@ -49,166 +53,4 @@ public class BorrowRequest implements UserData {
@Transient @Transient
private BorrowItem borrowItem; private BorrowItem borrowItem;
/**
* 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 item.
*
* @return the item
*/
public Long getItem() {
return item;
}
/**
* Sets the item.
*
* @param item the new item
*/
public void setItem(Long item) {
this.item = item;
}
/**
* Gets the user.
*
* @return the user
*/
public Long getUser() {
return user;
}
/**
* Sets the user.
*
* @param user the new user
*/
public void setUser(Long user) {
this.user = user;
}
/**
* Gets the status.
*
* @return the status
*/
public BorrowRequestStatus getStatus() {
return status;
}
/**
* Sets the status.
*
* @param status the new status
*/
public void setStatus(BorrowRequestStatus status) {
this.status = status;
}
/**
* Gets the starts.
*
* @return the starts
*/
public Instant getStarts() {
return starts;
}
/**
* 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() {
return ends;
}
/**
* Sets the ends.
*
* @param ends the new ends
*/
public void setEnds(Instant ends) {
this.ends = ends;
}
/**
* Gets the reply.
*
* @return the reply
*/
public String getReply() {
return reply;
}
/**
* Sets the reply.
*
* @param reply the new reply
*/
public void setReply(String reply) {
this.reply = reply;
}
/**
* Gets the comment.
*
* @return the comment
*/
public String getComment() {
return comment;
}
/**
* Sets the comment.
*
* @param comment the new comment
*/
public void setComment(String comment) {
this.comment = comment;
}
/**
* Gets the borrow item.
*
* @return the borrow item
*/
public BorrowItem getBorrowItem() {
return borrowItem;
}
/**
* Sets the borrow item.
*
* @param borrowItem the new borrow item
*/
public void setBorrowItem(BorrowItem borrowItem) {
this.borrowItem = borrowItem;
}
} }
+7
View File
@@ -111,5 +111,12 @@
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>
@@ -4,10 +4,14 @@
package de.bstly.we.controller.model; package de.bstly.we.controller.model;
import java.util.Map; import java.util.Map;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class ItemModel. * The Class ItemModel.
*/ */
@Getter
@Setter
public class ItemModel { public class ItemModel {
private Map<String, String> name; private Map<String, String> name;
@@ -22,31 +26,4 @@ public class ItemModel {
return name; return name;
} }
/**
* Sets the name.
*
* @param name the name
*/
public void setName(Map<String, String> name) {
this.name = name;
}
/**
* Gets the secret.
*
* @return the secret
*/
public String getSecret() {
return secret;
}
/**
* Sets the secret.
*
* @param secret the new secret
*/
public void setSecret(String secret) {
this.secret = secret;
}
} }
@@ -7,49 +7,16 @@ import java.util.List;
import de.bstly.we.model.PermissionMapping; import de.bstly.we.model.PermissionMapping;
import de.bstly.we.model.QuotaMapping; import de.bstly.we.model.QuotaMapping;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class ItemResultModel. * The Class ItemResultModel.
*/ */
@Getter
@Setter
public class ItemResultModel { public class ItemResultModel {
private List<PermissionMapping> permissionMappings; private List<PermissionMapping> permissionMappings;
private List<QuotaMapping> quotaMappings; private List<QuotaMapping> quotaMappings;
/**
* Gets the permission mappings.
*
* @return the permission mappings
*/
public List<PermissionMapping> getPermissionMappings() {
return permissionMappings;
}
/**
* Sets the permission mappings.
*
* @param permissionMappings the new permission mappings
*/
public void setPermissionMappings(List<PermissionMapping> permissionMappings) {
this.permissionMappings = permissionMappings;
}
/**
* Gets the quota mappings.
*
* @return the quota mappings
*/
public List<QuotaMapping> getQuotaMappings() {
return quotaMappings;
}
/**
* Sets the quota mappings.
*
* @param quotaMappings the new quota mappings
*/
public void setQuotaMappings(List<QuotaMapping> quotaMappings) {
this.quotaMappings = quotaMappings;
}
} }
@@ -3,48 +3,17 @@
*/ */
package de.bstly.we.controller.model; package de.bstly.we.controller.model;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class LoginModel. * The Class LoginModel.
*/ */
@Getter
@Setter
public class LoginModel { public class LoginModel {
private String username; private String username;
private String password; private String password;
/**
* Gets the username.
*
* @return the username
*/
public String getUsername() {
return username;
}
/**
* 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() {
return password;
}
/**
* Sets the password.
*
* @param password the new password
*/
public void setPassword(String password) {
this.password = password;
}
} }
@@ -4,12 +4,16 @@
package de.bstly.we.controller.model; package de.bstly.we.controller.model;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class PagesResult. * The Class PagesResult.
* *
* @param <T> the generic type * @param <T> the generic type
*/ */
@Getter
@Setter
public class PagesResult<T extends Object> { public class PagesResult<T extends Object> {
private List<T> result; private List<T> result;
@@ -27,85 +31,4 @@ public class PagesResult<T extends Object> {
return result; return result;
} }
/**
* Sets the result.
*
* @param result the new result
*/
public void setResult(List<T> result) {
this.result = result;
}
/**
* Gets the size.
*
* @return the size
*/
public int getSize() {
return size;
}
/**
* 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() {
return page;
}
/**
* Sets the page.
*
* @param page the new page
*/
public void setPage(int page) {
this.page = page;
}
/**
* Gets the total elements.
*
* @return the total elements
*/
public int getTotalElements() {
return totalElements;
}
/**
* Sets the total elements.
*
* @param totalElements the new total elements
*/
public void setTotalElements(int totalElements) {
this.totalElements = totalElements;
}
/**
* Gets the total pages.
*
* @return the total pages
*/
public int getTotalPages() {
return totalPages;
}
/**
* Sets the total pages.
*
* @param totalPages the new total pages
*/
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
} }
@@ -3,66 +3,18 @@
*/ */
package de.bstly.we.controller.model; package de.bstly.we.controller.model;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class PasswordModel. * The Class PasswordModel.
*/ */
@Getter
@Setter
public class PasswordModel { public class PasswordModel {
private String old; private String old;
private String password; private String password;
private String password2; private String password2;
/**
* Gets the old.
*
* @return the old
*/
public String getOld() {
return old;
}
/**
* 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() {
return password;
}
/**
* Sets the password.
*
* @param password the new password
*/
public void setPassword(String password) {
this.password = password;
}
/**
* Gets the password 2.
*
* @return the password 2
*/
public String getPassword2() {
return password2;
}
/**
* Sets the password 2.
*
* @param password2 the new password 2
*/
public void setPassword2(String password2) {
this.password2 = password2;
}
} }
@@ -3,29 +3,15 @@
*/ */
package de.bstly.we.controller.model; package de.bstly.we.controller.model;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class PasswordResetModel. * The Class PasswordResetModel.
*/ */
@Getter
@Setter
public class PasswordResetModel extends PasswordModel { public class PasswordResetModel extends PasswordModel {
private String token; private String token;
/**
* Gets the token.
*
* @return the token
*/
public String getToken() {
return token;
}
/**
* Sets the token.
*
* @param token the new token
*/
public void setToken(String token) {
this.token = token;
}
} }
@@ -6,10 +6,14 @@ package de.bstly.we.controller.model;
import java.util.Map; import java.util.Map;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class PretixRequest. * The Class PretixRequest.
*/ */
@Getter
@Setter
public class PretixRequest { public class PretixRequest {
private String path; private String path;
@@ -17,43 +21,7 @@ public class PretixRequest {
private Map<String, String> queryParameters; private Map<String, String> queryParameters;
private Object payload; private Object payload;
/** /**
* Gets the path.
*
* @return the path
*/
public String getPath() {
return path;
}
/**
* 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() {
return method;
}
/**
* Sets the method.
*
* @param method the new method
*/
public void setMethod(HttpMethod method) {
this.method = method;
}
/**
* Gets the query parameters. * Gets the query parameters.
* *
* @return the query parameters * @return the query parameters
@@ -62,31 +30,4 @@ public class PretixRequest {
return queryParameters; return queryParameters;
} }
/**
* Sets the query parameters.
*
* @param queryParameters the query parameters
*/
public void setQueryParameters(Map<String, String> queryParameters) {
this.queryParameters = queryParameters;
}
/**
* Gets the payload.
*
* @return the payload
*/
public Object getPayload() {
return payload;
}
/**
* Sets the payload.
*
* @param payload the new payload
*/
public void setPayload(Object payload) {
this.payload = payload;
}
} }
@@ -6,68 +6,18 @@ package de.bstly.we.controller.model;
import java.util.List; import java.util.List;
import de.bstly.we.model.UserProfileField; import de.bstly.we.model.UserProfileField;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class ProfileModel. * The Class ProfileModel.
*/ */
@Getter
@Setter
public class ProfileModel { public class ProfileModel {
private String username; private String username;
private List<String> aliases; private List<String> aliases;
private List<UserProfileField> profileFields; private List<UserProfileField> profileFields;
/**
* Gets the username.
*
* @return the username
*/
public String getUsername() {
return username;
}
/**
* Sets the username.
*
* @param username the new username
*/
public void setUsername(String username) {
this.username = username;
}
/**
* Gets the aliases.
*
* @return the aliases
*/
public List<String> getAliases() {
return aliases;
}
/**
* Sets the aliases.
*
* @param aliases the new aliases
*/
public void setAliases(List<String> aliases) {
this.aliases = aliases;
}
/**
* Gets the profile fields.
*
* @return the profile fields
*/
public List<UserProfileField> getProfileFields() {
return profileFields;
}
/**
* Sets the profile fields.
*
* @param profileFields the new profile fields
*/
public void setProfileFields(List<UserProfileField> profileFields) {
this.profileFields = profileFields;
}
} }
@@ -3,60 +3,20 @@
*/ */
package de.bstly.we.controller.model; package de.bstly.we.controller.model;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class SecondFactorProviderModel. * The Class SecondFactorProviderModel.
*/ */
@Getter
@Setter
@AllArgsConstructor
public class SecondFactorProviderModel { public class SecondFactorProviderModel {
private String id; private String id;
private boolean request; private boolean request;
/**
* Instantiates a new second factor provider model.
*
* @param id the id
* @param request the request
*/
public SecondFactorProviderModel(String id, boolean request) {
super();
this.id = id;
this.request = request;
}
/**
* Gets the id.
*
* @return the id
*/
public String getId() {
return id;
}
/**
* Sets the id.
*
* @param id the new id
*/
public void setId(String id) {
this.id = id;
}
/**
* Checks if is request.
*
* @return true, if is request
*/
public boolean isRequest() {
return request;
}
/**
* Sets the request.
*
* @param request the new request
*/
public void setRequest(boolean request) {
this.request = request;
}
} }
@@ -11,10 +11,14 @@ import de.bstly.we.model.Quota;
import de.bstly.we.model.QuotaMapping; import de.bstly.we.model.QuotaMapping;
import de.bstly.we.model.UserProfileField; import de.bstly.we.model.UserProfileField;
import de.bstly.we.model.UserStatus; import de.bstly.we.model.UserStatus;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class UserModel. * The Class UserModel.
*/ */
@Getter
@Setter
public class UserModel extends PasswordModel { public class UserModel extends PasswordModel {
private String username; private String username;
@@ -25,149 +29,4 @@ public class UserModel extends PasswordModel {
private UserStatus status; private UserStatus status;
private String token; private String token;
private List<UserProfileField> profileFields; private List<UserProfileField> profileFields;
/**
* Gets the username.
*
* @return the username
*/
public String getUsername() {
return username;
}
/**
* Sets the username.
*
* @param username the new username
*/
public void setUsername(String username) {
this.username = username;
}
/**
* Gets the permissions.
*
* @return the permissions
*/
public List<Permission> getPermissions() {
return permissions;
}
/**
* Sets the permissions.
*
* @param permissions the new permissions
*/
public void setPermissions(List<Permission> permissions) {
this.permissions = permissions;
}
/**
* Gets the permission mappings.
*
* @return the permission mappings
*/
public List<PermissionMapping> getPermissionMappings() {
return permissionMappings;
}
/**
* Sets the permission mappings.
*
* @param permissionMappings the new permission mappings
*/
public void setPermissionMappings(List<PermissionMapping> permissionMappings) {
this.permissionMappings = permissionMappings;
}
/**
* Gets the quotas.
*
* @return the quotas
*/
public List<Quota> getQuotas() {
return quotas;
}
/**
* Sets the quotas.
*
* @param quotas the new quotas
*/
public void setQuotas(List<Quota> quotas) {
this.quotas = quotas;
}
/**
* Gets the quota mappings.
*
* @return the quota mappings
*/
public List<QuotaMapping> getQuotaMappings() {
return quotaMappings;
}
/**
* Sets the quota mappings.
*
* @param quotaMappings the new quota mappings
*/
public void setQuotaMappings(List<QuotaMapping> quotaMappings) {
this.quotaMappings = quotaMappings;
}
/**
* Gets the status.
*
* @return the status
*/
public UserStatus getStatus() {
return status;
}
/**
* 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() {
return token;
}
/**
* Sets the token.
*
* @param token the new token
*/
public void setToken(String token) {
this.token = token;
}
/**
* Gets the profile fields.
*
* @return the profile fields
*/
public List<UserProfileField> getProfileFields() {
return profileFields;
}
/**
* Sets the profile fields.
*
* @param profileFields the new profile fields
*/
public void setProfileFields(List<UserProfileField> profileFields) {
this.profileFields = profileFields;
}
} }
@@ -6,10 +6,14 @@ package de.bstly.we.event;
import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationEvent;
import de.bstly.we.model.AbstractModel; import de.bstly.we.model.AbstractModel;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class AbstractModelEvent. * The Class AbstractModelEvent.
*/ */
@Getter
@Setter
public class AbstractModelEvent extends ApplicationEvent { public class AbstractModelEvent extends ApplicationEvent {
/** /**
@@ -20,52 +24,10 @@ public class AbstractModelEvent extends ApplicationEvent {
private AbstractModelEventType type; private AbstractModelEventType type;
private AbstractModel model; private AbstractModel model;
/**
* Instantiates a new abstract model event.
*
* @param type the type
* @param model the model
*/
public AbstractModelEvent(AbstractModelEventType type, AbstractModel model) { public AbstractModelEvent(AbstractModelEventType type, AbstractModel model) {
super(model); super(model);
this.type = type; this.type = type;
this.model = model; this.model = model;
} }
/**
* Gets the type.
*
* @return the type
*/
public AbstractModelEventType getType() {
return type;
}
/**
* 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() {
return model;
}
/**
* Sets the model.
*
* @param model the new model
*/
public void setModel(AbstractModel model) {
this.model = model;
}
} }
@@ -11,12 +11,16 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class Permission. * The Class Permission.
*/ */
@Entity @Entity
@Table(name = "permissions") @Table(name = "permissions")
@Getter
@Setter
public class Permission implements UserData { public class Permission implements UserData {
@Id @Id
@@ -34,112 +38,4 @@ public class Permission implements UserData {
@Column(name = "expires") @Column(name = "expires")
private Instant expires; private Instant expires;
/**
* 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 target.
*
* @return the target
*/
public Long getTarget() {
return target;
}
/**
* Sets the target.
*
* @param target the new target
*/
public void setTarget(Long target) {
this.target = target;
}
/**
* Checks if is addon.
*
* @return true, if is addon
*/
public boolean isAddon() {
return addon;
}
/**
* 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() {
return starts;
}
/**
* 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() {
return expires;
}
/**
* Sets the expires.
*
* @param expires the new expires
*/
public void setExpires(Instant expires) {
this.expires = expires;
}
} }
@@ -19,12 +19,16 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class PermissionMapping. * The Class PermissionMapping.
*/ */
@Entity @Entity
@Table(name = "permission_mappings") @Table(name = "permission_mappings")
@Getter
@Setter
public class PermissionMapping { public class PermissionMapping {
public static final ChronoUnit DEFAULT_LIFETIME_UNIT = ChronoUnit.DAYS; public static final ChronoUnit DEFAULT_LIFETIME_UNIT = ChronoUnit.DAYS;
@@ -58,222 +62,6 @@ public class PermissionMapping {
@Column(name = "expires_question") @Column(name = "expires_question")
private String expiresQuestion; private String expiresQuestion;
/**
* 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 product.
*
* @return the product
*/
public String getProduct() {
return product;
}
/**
* 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() {
return item;
}
/**
* Sets the item.
*
* @param item the new item
*/
public void setItem(Integer item) {
this.item = item;
}
/**
* Gets the names.
*
* @return the names
*/
public Set<String> getNames() {
return names;
}
/**
* Sets the names.
*
* @param names the new names
*/
public void setNames(Set<String> names) {
this.names = names;
}
/**
* Checks if is addon.
*
* @return true, if is addon
*/
public boolean isAddon() {
return addon;
}
/**
* 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() {
return lifetime;
}
/**
* Sets the lifetime.
*
* @param lifetime the new lifetime
*/
public void setLifetime(Long lifetime) {
this.lifetime = lifetime;
}
/**
* Gets the lifetime unit.
*
* @return the lifetime unit
*/
public ChronoUnit getLifetimeUnit() {
return lifetimeUnit;
}
/**
* Sets the lifetime unit.
*
* @param lifetimeUnit the new lifetime unit
*/
public void setLifetimeUnit(ChronoUnit lifetimeUnit) {
this.lifetimeUnit = lifetimeUnit;
}
/**
* Checks if is lifetime round.
*
* @return true, if is lifetime round
*/
public boolean isLifetimeRound() {
return lifetimeRound;
}
/**
* Sets the lifetime round.
*
* @param lifetimeRound the new lifetime round
*/
public void setLifetimeRound(boolean lifetimeRound) {
this.lifetimeRound = lifetimeRound;
}
/**
* Gets the starts.
*
* @return the starts
*/
public Instant getStarts() {
return starts;
}
/**
* 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() {
return expires;
}
/**
* Sets the expires.
*
* @param expires the new expires
*/
public void setExpires(Instant expires) {
this.expires = expires;
}
/**
* Gets the starts question.
*
* @return the starts question
*/
public String getStartsQuestion() {
return startsQuestion;
}
/**
* Sets the starts question.
*
* @param startsQuestion the new starts question
*/
public void setStartsQuestion(String startsQuestion) {
this.startsQuestion = startsQuestion;
}
/**
* Gets the expires question.
*
* @return the expires question
*/
public String getExpiresQuestion() {
return expiresQuestion;
}
/**
* Sets the expires question.
*
* @param expiresQuestion the new expires question
*/
public void setExpiresQuestion(String expiresQuestion) {
this.expiresQuestion = expiresQuestion;
}
/** /**
* The Class ChronoUnitConverter. * The Class ChronoUnitConverter.
*/ */
@@ -9,12 +9,16 @@ import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class PersistentLogin. * The Class PersistentLogin.
*/ */
@Entity @Entity
@Table(name = "persistent_logins") @Table(name = "persistent_logins")
@Getter
@Setter
public class PersistentLogin { public class PersistentLogin {
@Column(name = "username", length = 64, nullable = false) @Column(name = "username", length = 64, nullable = false)
@@ -27,76 +31,4 @@ public class PersistentLogin {
@Column(name = "last_used", nullable = false) @Column(name = "last_used", nullable = false)
private Instant last_used; private Instant last_used;
/**
* Gets the username.
*
* @return the username
*/
public String getUsername() {
return username;
}
/**
* 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() {
return series;
}
/**
* 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() {
return token;
}
/**
* Sets the token.
*
* @param token the new token
*/
public void setToken(String token) {
this.token = token;
}
/**
* Gets the last used.
*
* @return the last used
*/
public Instant getLast_used() {
return last_used;
}
/**
* Sets the last used.
*
* @param last_used the new last used
*/
public void setLast_used(Instant last_used) {
this.last_used = last_used;
}
} }
+4 -108
View File
@@ -9,12 +9,16 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class Quota. * The Class Quota.
*/ */
@Entity @Entity
@Table(name = "quotas") @Table(name = "quotas")
@Getter
@Setter
public class Quota implements UserData { public class Quota implements UserData {
@Id @Id
@@ -32,112 +36,4 @@ public class Quota implements UserData {
@Column(name = "disposable", columnDefinition = "boolean default false") @Column(name = "disposable", columnDefinition = "boolean default false")
private boolean disposable; private boolean disposable;
/**
* 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 target.
*
* @return the target
*/
public Long getTarget() {
return target;
}
/**
* 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() {
return name;
}
/**
* 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() {
return value;
}
/**
* 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() {
return unit;
}
/**
* Sets the unit.
*
* @param unit the new unit
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
* Checks if is disposable.
*
* @return true, if is disposable
*/
public boolean isDisposable() {
return disposable;
}
/**
* Sets the disposable.
*
* @param disposable the new disposable
*/
public void setDisposable(boolean disposable) {
this.disposable = disposable;
}
} }
@@ -14,12 +14,16 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class QuotaMapping. * The Class QuotaMapping.
*/ */
@Entity @Entity
@Table(name = "quota_mappings") @Table(name = "quota_mappings")
@Getter
@Setter
public class QuotaMapping { public class QuotaMapping {
@Id @Id
@@ -42,149 +46,4 @@ public class QuotaMapping {
private boolean append; private boolean append;
@Column(name = "disposable", columnDefinition = "boolean default false") @Column(name = "disposable", columnDefinition = "boolean default false")
private boolean disposable; private boolean disposable;
/**
* 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 products.
*
* @return the products
*/
public Set<String> getProducts() {
return products;
}
/**
* Sets the products.
*
* @param products the new products
*/
public void setProducts(Set<String> products) {
this.products = products;
}
/**
* Gets the items.
*
* @return the items
*/
public Set<Integer> getItems() {
return items;
}
/**
* Sets the items.
*
* @param items the new items
*/
public void setItems(Set<Integer> items) {
this.items = items;
}
/**
* 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 value.
*
* @return the value
*/
public long getValue() {
return value;
}
/**
* 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() {
return unit;
}
/**
* Sets the unit.
*
* @param unit the new unit
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
* Checks if is append.
*
* @return true, if is append
*/
public boolean isAppend() {
return append;
}
/**
* Sets the append.
*
* @param append the new append
*/
public void setAppend(boolean append) {
this.append = append;
}
/**
* Checks if is disposable.
*
* @return true, if is disposable
*/
public boolean isDisposable() {
return disposable;
}
/**
* Sets the disposable.
*
* @param disposable the new disposable
*/
public void setDisposable(boolean disposable) {
this.disposable = disposable;
}
} }
@@ -7,12 +7,16 @@ import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class SystemProfileField. * The Class SystemProfileField.
*/ */
@Entity @Entity
@Table(name = "system_profile_fields") @Table(name = "system_profile_fields")
@Getter
@Setter
public class SystemProfileField { public class SystemProfileField {
@Id @Id
@@ -23,58 +27,4 @@ public class SystemProfileField {
@Column(name = "unique_value", columnDefinition = "boolean default false") @Column(name = "unique_value", columnDefinition = "boolean default false")
private boolean uniqueValue; private boolean uniqueValue;
/**
* 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 type.
*
* @return the type
*/
public ProfileFieldType getType() {
return type;
}
/**
* Sets the type.
*
* @param type the new type
*/
public void setType(ProfileFieldType type) {
this.type = type;
}
/**
* Checks if is unique value.
*
* @return true, if is unique value
*/
public boolean isUniqueValue() {
return uniqueValue;
}
/**
* Sets the unique value.
*
* @param uniqueValue the new unique value
*/
public void setUniqueValue(boolean uniqueValue) {
this.uniqueValue = uniqueValue;
}
} }
@@ -8,12 +8,20 @@ import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Lob; import jakarta.persistence.Lob;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/** /**
* The Class SystemProperty. * The Class SystemProperty.
*/ */
@Entity @Entity
@Table(name = "system_properties") @Table(name = "system_properties")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class SystemProperty { public class SystemProperty {
@Id @Id
@@ -23,59 +31,4 @@ public class SystemProperty {
@Column(name = "value", length = 100000) @Column(name = "value", length = 100000)
private String value; private String value;
/**
* Instantiates a new system property.
*/
public SystemProperty() {
super();
}
/**
* Instantiates a new system property.
*
* @param key the key
* @param value the value
*/
public SystemProperty(String key, String value) {
super();
this.key = key;
this.value = value;
}
/**
* Gets the key.
*
* @return the key
*/
public String getKey() {
return key;
}
/**
* 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() {
return value;
}
/**
* Sets the value.
*
* @param value the new value
*/
public void setValue(String value) {
this.value = value;
}
} }
+4 -125
View File
@@ -12,12 +12,16 @@ import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class User. * The Class User.
*/ */
@Entity @Entity
@Table(name = "users", uniqueConstraints = @UniqueConstraint(columnNames = { "username" })) @Table(name = "users", uniqueConstraints = @UniqueConstraint(columnNames = { "username" }))
@Getter
@Setter
public class User implements UserData { public class User implements UserData {
@Id @Id
@@ -38,129 +42,4 @@ public class User implements UserData {
@Column(name = "reset_token") @Column(name = "reset_token")
private String resetToken; private String resetToken;
/**
* 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 username.
*
* @return the username
*/
public String getUsername() {
return username;
}
/**
* Sets the username.
*
* @param username the new username
*/
public void setUsername(String username) {
this.username = username;
}
/**
* Gets the password hash.
*
* @return the password hash
*/
public String getPasswordHash() {
return passwordHash;
}
/**
* Sets the password hash.
*
* @param passwordHash the new password hash
*/
public void setPasswordHash(String passwordHash) {
this.passwordHash = passwordHash;
}
/**
* Checks if is disabled.
*
* @return true, if is disabled
*/
public boolean isDisabled() {
return disabled;
}
/**
* Sets the disabled.
*
* @param disabled the new disabled
*/
public void setDisabled(boolean disabled) {
this.disabled = disabled;
}
/**
* Checks if is locked.
*
* @return true, if is locked
*/
public boolean isLocked() {
return locked;
}
/**
* 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() {
return status;
}
/**
* Sets the status.
*
* @param status the new status
*/
public void setStatus(UserStatus status) {
this.status = status;
}
/**
* Gets the reset token.
*
* @return the reset token
*/
public String getResetToken() {
return resetToken;
}
/**
* Sets the reset token.
*
* @param resetToken the new reset token
*/
public void setResetToken(String resetToken) {
this.resetToken = resetToken;
}
} }
@@ -10,12 +10,16 @@ import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class UserAlias. * The Class UserAlias.
*/ */
@Entity @Entity
@Table(name = "aliases", uniqueConstraints = @UniqueConstraint(columnNames = { "alias" })) @Table(name = "aliases", uniqueConstraints = @UniqueConstraint(columnNames = { "alias" }))
@Getter
@Setter
public class UserAlias implements UserData { public class UserAlias implements UserData {
@Id @Id
@@ -29,76 +33,4 @@ public class UserAlias implements UserData {
@Column(name = "visibility", nullable = false) @Column(name = "visibility", nullable = false)
private Visibility visibility = Visibility.PROTECTED; private Visibility visibility = Visibility.PROTECTED;
/**
* 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 target.
*
* @return the target
*/
public Long getTarget() {
return target;
}
/**
* 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() {
return alias;
}
/**
* 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() {
return visibility;
}
/**
* Sets the visibility.
*
* @param visibility the new visibility
*/
public void setVisibility(Visibility visibility) {
this.visibility = visibility;
}
} }
@@ -10,12 +10,16 @@ import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class UserDomain. * The Class UserDomain.
*/ */
@Entity @Entity
@Table(name = "domains", uniqueConstraints = @UniqueConstraint(columnNames = { "domain" })) @Table(name = "domains", uniqueConstraints = @UniqueConstraint(columnNames = { "domain" }))
@Getter
@Setter
public class UserDomain implements UserData { public class UserDomain implements UserData {
@Id @Id
@@ -33,111 +37,4 @@ public class UserDomain implements UserData {
@Column(name = "validated", columnDefinition = "boolean default false") @Column(name = "validated", columnDefinition = "boolean default false")
private boolean validated; private boolean validated;
/**
* 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 target.
*
* @return the target
*/
public Long getTarget() {
return target;
}
/**
* 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() {
return domain;
}
/**
* 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() {
return visibility;
}
/**
* 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() {
return secret;
}
/**
* Sets the secret.
*
* @param secret the new secret
*/
public void setSecret(String secret) {
this.secret = secret;
}
/**
* Checks if is validated.
*
* @return true, if is validated
*/
public boolean isValidated() {
return validated;
}
/**
* Sets the validated.
*
* @param validated the new validated
*/
public void setValidated(boolean validated) {
this.validated = validated;
}
} }
@@ -5,6 +5,7 @@ package de.bstly.we.model;
import java.io.Serializable; import java.io.Serializable;
import de.bstly.we.model.UserProfileField.UserProfileFieldId;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
@@ -12,8 +13,8 @@ import jakarta.persistence.IdClass;
import jakarta.persistence.Lob; import jakarta.persistence.Lob;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
import lombok.Getter;
import de.bstly.we.model.UserProfileField.UserProfileFieldId; import lombok.Setter;
/** /**
* The Class UserProfileField. * The Class UserProfileField.
@@ -21,6 +22,8 @@ import de.bstly.we.model.UserProfileField.UserProfileFieldId;
@Entity @Entity
@IdClass(UserProfileFieldId.class) @IdClass(UserProfileFieldId.class)
@Table(name = "profile_fields", uniqueConstraints = @UniqueConstraint(columnNames = { "target", "name" })) @Table(name = "profile_fields", uniqueConstraints = @UniqueConstraint(columnNames = { "target", "name" }))
@Getter
@Setter
public class UserProfileField implements UserData { public class UserProfileField implements UserData {
@Id @Id
@@ -32,7 +35,7 @@ public class UserProfileField implements UserData {
@Column(name = "value", nullable = true) @Column(name = "value", nullable = true)
private String value; private String value;
@Lob @Lob
@Column(name = "blob_value", nullable = true, length = 100000) @Column(name = "blob_value", nullable = true, length = 100000)
private String blob; private String blob;
@Column(name = "type", nullable = false) @Column(name = "type", nullable = false)
private ProfileFieldType type; private ProfileFieldType type;
@@ -41,135 +44,11 @@ public class UserProfileField implements UserData {
@Column(name = "order_index", nullable = true) @Column(name = "order_index", nullable = true)
private Integer index = 0; private Integer index = 0;
/**
* 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 target.
*
* @return the target
*/
public Long getTarget() {
return target;
}
/**
* 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() {
return value;
}
/**
* 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() {
return blob;
}
/**
* 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() {
return type;
}
/**
* 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() {
return visibility;
}
/**
* 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() {
return index;
}
/**
* Sets the index.
*
* @param index the new index
*/
public void setIndex(Integer index) {
this.index = index;
}
/** /**
* The Class UserProfileFieldId. * The Class UserProfileFieldId.
*/ */
@Getter
@Setter
public static class UserProfileFieldId implements Serializable { public static class UserProfileFieldId implements Serializable {
/** /**
@@ -179,42 +58,6 @@ public class UserProfileField implements UserData {
private Long target; private Long target;
private String name; private String name;
/**
* Gets the target.
*
* @return the target
*/
public Long getTarget() {
return target;
}
/**
* 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() {
return name;
}
/**
* Sets the name.
*
* @param name the new name
*/
public void setName(String name) {
this.name = name;
}
/* /*
* @see java.lang.Object#equals(java.lang.Object) * @see java.lang.Object#equals(java.lang.Object)
*/ */
@@ -15,12 +15,16 @@ import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class UserTotp. * The Class UserTotp.
*/ */
@Entity @Entity
@Table(name = "user_totps", uniqueConstraints = @UniqueConstraint(columnNames = { "target" })) @Table(name = "user_totps", uniqueConstraints = @UniqueConstraint(columnNames = { "target" }))
@Getter
@Setter
public class UserTotp implements SecondFactor { public class UserTotp implements SecondFactor {
@Id @Id
@@ -37,112 +41,4 @@ public class UserTotp implements SecondFactor {
@CollectionTable(name = "user_totps_recovery_codes") @CollectionTable(name = "user_totps_recovery_codes")
private List<String> recoveryCodes; private List<String> recoveryCodes;
/**
* 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 target.
*
* @return the target
*/
public Long getTarget() {
return target;
}
/**
* Sets the target.
*
* @param target the new target
*/
public void setTarget(Long target) {
this.target = target;
}
/**
* Checks if is enabled.
*
* @return true, if is enabled
*/
public boolean isEnabled() {
return enabled;
}
/**
* 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() {
return secret;
}
/**
* Sets the secret.
*
* @param secret the new secret
*/
public void setSecret(String secret) {
this.secret = secret;
}
/**
* Gets the qr data.
*
* @return the qr data
*/
public String getQrData() {
return qrData;
}
/**
* Sets the qr data.
*
* @param qrData the new qr data
*/
public void setQrData(String qrData) {
this.qrData = qrData;
}
/**
* Gets the recovery codes.
*
* @return the recovery codes
*/
public List<String> getRecoveryCodes() {
return recoveryCodes;
}
/**
* Sets the recovery codes.
*
* @param recoveryCodes the new recovery codes
*/
public void setRecoveryCodes(List<String> recoveryCodes) {
this.recoveryCodes = recoveryCodes;
}
} }
@@ -9,12 +9,16 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class VoucherMapping. * The Class VoucherMapping.
*/ */
@Entity @Entity
@Table(name = "voucher_mappings") @Table(name = "voucher_mappings")
@Getter
@Setter
public class VoucherMapping { public class VoucherMapping {
@Id @Id
@@ -30,94 +34,4 @@ public class VoucherMapping {
@Column(name = "free", columnDefinition = "boolean default false") @Column(name = "free", columnDefinition = "boolean default false")
private boolean free; 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;
}
} }
@@ -7,10 +7,14 @@ import java.util.Collection;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.User;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class LocalUserDetails. * The Class LocalUserDetails.
*/ */
@Getter
@Setter
public class LocalUserDetails extends User { public class LocalUserDetails extends User {
/** /**
@@ -36,36 +40,4 @@ public class LocalUserDetails extends User {
this.alias = alias; this.alias = alias;
} }
/**
* Gets the user id.
*
* @return the user id
*/
public Long getUserId() {
return userId;
}
/**
* Sets the user id.
*
* @param userId the new user id
*/
public void setUserId(Long userId) {
this.userId = userId;
}
/**
* @return the alias
*/
public String getAlias() {
return alias;
}
/**
* @param alias the alias to set
*/
public void setAlias(String alias) {
this.alias = alias;
}
} }
@@ -1,8 +1,11 @@
package de.bstly.we.businesslogic; package de.bstly.we.businesslogic;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.ArgumentMatchers.*; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.mockito.Mockito.*; import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import java.time.Instant; import java.time.Instant;
import java.time.temporal.ChronoUnit; import java.time.temporal.ChronoUnit;
@@ -11,7 +14,6 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks; import org.mockito.InjectMocks;
@@ -23,273 +25,289 @@ import com.google.gson.JsonArray;
import de.bstly.we.model.Permission; import de.bstly.we.model.Permission;
import de.bstly.we.model.PermissionMapping; import de.bstly.we.model.PermissionMapping;
import de.bstly.we.model.QPermission;
import de.bstly.we.repository.PermissionRepository; import de.bstly.we.repository.PermissionRepository;
@ExtendWith(MockitoExtension.class) @ExtendWith(MockitoExtension.class)
class PermissionManagerTest { class PermissionManagerTest {
@Mock @Mock
private PermissionRepository permissionRepository; private PermissionRepository permissionRepository;
@Mock @Mock
private PermissionMappingManager permissionMappingManager; private PermissionMappingManager permissionMappingManager;
@InjectMocks @InjectMocks
private PermissionManager permissionManager; private PermissionManager permissionManager;
private static final Long TARGET_USER_ID = 1L; private static final Long TARGET_USER_ID = 1L;
private static final Integer TEST_ITEM_ID = 1; private static final Integer TEST_ITEM_ID = 1;
private static final String ROLE_MEMBER = "ROLE_MEMBER"; private static final String ROLE_MEMBER = "ROLE_MEMBER";
@Test @Test
void testGetForItem_NewAddonPermission_CreatesNewWhenNoExisting() { void testGetForItem_NewAddonPermission_CreatesNewWhenNoExisting() {
// Given // Given
Instant currentTime = Instant.parse("2025-03-15T10:00:00Z"); Instant currentTime = Instant.parse("2025-03-15T10:00:00Z");
PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true); PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true);
when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping)); when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping));
// No existing permissions // No existing permissions
when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
.thenReturn(Arrays.asList()); .thenReturn(Arrays.asList());
// When // When
List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
currentTime, null); currentTime, null);
// Then // Then
assertEquals(1, result.size()); assertEquals(1, result.size());
Permission permission = result.get(0); Permission permission = result.get(0);
assertEquals(TARGET_USER_ID, permission.getTarget()); assertEquals(TARGET_USER_ID, permission.getTarget());
assertEquals(ROLE_MEMBER, permission.getName()); assertEquals(ROLE_MEMBER, permission.getName());
assertTrue(permission.isAddon()); // Should be addon since no existing permission found assertTrue(permission.isAddon()); // Should be addon since no existing permission found
// Should create new permission with 1 year from current time: March 15, 2025 + 1 year = March 15, 2026 // Should create new permission with 1 year from current time: March 15, 2025 +
Instant expectedExpiry = Instant.parse("2026-03-15T10:00:00Z"); // 1 year = March 15, 2026
assertEquals(expectedExpiry, permission.getExpires()); Instant expectedExpiry = Instant.parse("2026-03-15T10:00:00Z");
} assertEquals(expectedExpiry, permission.getExpires());
@Test
void testGetForItem_AddonExtendsValidPermission_Simple() {
// Given - existing valid permission that expires on June 15, 2025
Instant currentTime = Instant.parse("2025-03-15T10:00:00Z");
Instant existingExpiry = Instant.parse("2025-06-15T10:00:00Z"); // 3 months in the future
Permission existingPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, existingExpiry);
PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true);
when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping));
when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
.thenReturn(Arrays.asList(existingPermission));
// When
List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
currentTime, null);
// Then
assertEquals(1, result.size());
Permission extendedPermission = result.get(0);
assertEquals(existingPermission, extendedPermission); // Should be the same object (extended)
// Should extend by exactly 1 year from current expiry: June 15, 2025 + 1 year = June 15, 2026
Instant expectedExpiry = Instant.parse("2026-06-15T10:00:00Z");
assertEquals(expectedExpiry, extendedPermission.getExpires());
assertEquals(TARGET_USER_ID, extendedPermission.getTarget());
assertEquals(ROLE_MEMBER, extendedPermission.getName());
}
@Test
void testGetForItem_AddonExtendsExpiredPermission_SimpleCase() {
// Given - existing permission that expired on February 15, 2025 (1 month ago from March 15)
Instant currentTime = Instant.parse("2025-03-15T10:00:00Z");
Instant expiredDate = Instant.parse("2025-02-15T10:00:00Z"); // Expired exactly 1 month ago
Permission expiredPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, expiredDate);
PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true);
when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping));
when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
.thenReturn(Arrays.asList(expiredPermission));
// When
List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
currentTime, null);
// Then
assertEquals(1, result.size());
Permission extendedPermission = result.get(0);
assertEquals(expiredPermission, extendedPermission); // Should be the same object (extended)
// Should extend by exactly 1 year from original expiry: Feb 15, 2025 + 1 year = Feb 15, 2026
Instant expectedExpiry = Instant.parse("2026-02-15T10:00:00Z");
assertEquals(expectedExpiry, extendedPermission.getExpires());
assertTrue(extendedPermission.getExpires().isAfter(currentTime)); // Should be in the future
}
@Test
void testGetForItem_AddonExtendsLongExpiredPermission_CatchesUp() {
// Given - permission that expired 2 years ago (Dec 31, 2023, applied in Nov 2025)
Instant currentTime = Instant.parse("2025-02-09T10:00:00Z");
Instant longExpiredDate = Instant.parse("2023-12-31T23:59:59Z");
Permission longExpiredPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, longExpiredDate);
PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true);
when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping));
when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
.thenReturn(Arrays.asList(longExpiredPermission));
// When
List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
currentTime, null);
// Then
assertEquals(1, result.size());
Permission extendedPermission = result.get(0);
assertEquals(longExpiredPermission, extendedPermission); // Should be the same object (extended)
// Should "catch up" to future: 2023-12-31 -> 2024-12-31 -> 2025-12-31 (first future date)
Instant expectedExpiry = Instant.parse("2025-12-31T23:59:59Z");
assertEquals(expectedExpiry, extendedPermission.getExpires());
assertTrue(extendedPermission.getExpires().isAfter(currentTime)); // Should be in the future
}
@Test
void testGetForItem_AddonExtendsNonExpiredPermission_CatchesUp() {
// Given - permission that expired 2 years ago (Dec 31, 2023, applied in Nov 2025)
Instant currentTime = Instant.parse("2025-02-09T10:00:00Z");
Instant expiredDate = Instant.parse("2025-12-31T23:59:59Z");
Permission existingPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, expiredDate);
PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true);
when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping));
when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
.thenReturn(Arrays.asList(existingPermission));
// When
List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
currentTime, null);
// Then
assertEquals(1, result.size());
Permission extendedPermission = result.get(0);
assertEquals(existingPermission, extendedPermission); // Should be the same object (extended)
// Should "catch up" to future: 2025-12-31 -> 2026-12-31 (first future date)
Instant expectedExpiry = Instant.parse("2026-12-31T23:59:59Z");
assertEquals(expectedExpiry, extendedPermission.getExpires());
assertTrue(extendedPermission.getExpires().isAfter(currentTime)); // Should be in the future
}
@Test
void testGetForItem_AddonSelectsLatestExpiringPermission() {
// Given - multiple existing permissions with different expiry dates
Instant currentTime = Instant.parse("2025-03-15T10:00:00Z");
Permission permission1 = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, Instant.parse("2025-06-23T10:00:00Z")); // 100 days
Permission permission2 = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, Instant.parse("2025-10-01T10:00:00Z")); // 200 days (latest)
Permission permission3 = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, Instant.parse("2025-05-04T10:00:00Z")); // 50 days
PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 6L, ChronoUnit.MONTHS, true);
when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping));
when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
.thenReturn(Arrays.asList(permission1, permission2, permission3));
// When
List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
currentTime, null);
// Then
assertEquals(1, result.size());
Permission selectedPermission = result.get(0);
assertEquals(permission2, selectedPermission); // Should select the one with latest expiry (Oct 1, 2025)
// Should extend by 6 months from latest expiry: Oct 1, 2025 + 6 months = April 1, 2026
Instant expectedExpiry = Instant.parse("2026-04-01T10:00:00Z");
assertEquals(expectedExpiry, selectedPermission.getExpires());
assertEquals(TARGET_USER_ID, selectedPermission.getTarget());
assertEquals(ROLE_MEMBER, selectedPermission.getName());
}
@Test
void testGetForItem_NonAddonCreatesNewPermission() {
// Given
Instant currentTime = Instant.parse("2025-03-15T10:00:00Z");
PermissionMapping nonAddonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, false); // Not addon
when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(nonAddonMapping));
// Existing permission exists but should be ignored since this is not an addon
Permission existingPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, Instant.parse("2025-06-23T10:00:00Z"));
when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
.thenReturn(Arrays.asList(existingPermission));
// When
List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
currentTime, null);
// Then
assertEquals(1, result.size());
Permission newPermission = result.get(0);
assertNotEquals(existingPermission, newPermission); // Should be a new permission object
assertEquals(TARGET_USER_ID, newPermission.getTarget());
assertEquals(ROLE_MEMBER, newPermission.getName());
assertFalse(newPermission.isAddon()); // Should not be addon
// Should create new permission with 1 year from current time: March 15, 2025 + 1 year = March 15, 2026
Instant expectedExpiry = Instant.parse("2026-03-15T10:00:00Z");
assertEquals(expectedExpiry, newPermission.getExpires());
}
@Test
void testGetForItem_MultiplePermissionNames() {
// Given - mapping with multiple permission names
Instant currentTime = Instant.parse("2025-03-15T10:00:00Z");
Set<String> permissionNames = new HashSet<>(Arrays.asList("ROLE_MEMBER", "ROLE_SPECIAL"));
PermissionMapping multiMapping = createPermissionMapping(permissionNames, 1L, ChronoUnit.YEARS, true);
when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(multiMapping));
when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
.thenReturn(Arrays.asList()); // No existing permissions
// When
List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
currentTime, null);
// Then
assertEquals(2, result.size());
// Should have both permission names
Set<String> resultNames = new HashSet<>();
for (Permission p : result) {
resultNames.add(p.getName());
assertEquals(TARGET_USER_ID, p.getTarget());
assertTrue(p.isAddon());
} }
assertEquals(permissionNames, resultNames);
}
// Helper methods @Test
private Permission createPermission(Long target, String name, boolean addon, Instant starts, Instant expires) { void testGetForItem_AddonExtendsValidPermission_Simple() {
Permission permission = new Permission(); // Given - existing valid permission that expires on June 15, 2025
permission.setTarget(target); Instant currentTime = Instant.parse("2025-03-15T10:00:00Z");
permission.setName(name); Instant existingExpiry = Instant.parse("2025-06-15T10:00:00Z"); // 3 months in the future
permission.setAddon(addon); Permission existingPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null,
permission.setStarts(starts); existingExpiry);
permission.setExpires(expires);
return permission;
}
private PermissionMapping createAddonPermissionMapping(String permissionName, Long lifetime, ChronoUnit unit, boolean isAddon) { PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true);
Set<String> names = new HashSet<>(); when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping));
names.add(permissionName); when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
return createPermissionMapping(names, lifetime, unit, isAddon); .thenReturn(Arrays.asList(existingPermission));
}
private PermissionMapping createPermissionMapping(Set<String> names, Long lifetime, ChronoUnit unit, boolean isAddon) { // When
PermissionMapping mapping = new PermissionMapping(); List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
mapping.setItem(TEST_ITEM_ID); currentTime, null);
mapping.setNames(names);
mapping.setLifetime(lifetime); // Then
mapping.setLifetimeUnit(unit); assertEquals(1, result.size());
mapping.setAddon(isAddon); Permission extendedPermission = result.get(0);
mapping.setLifetimeRound(false); assertEquals(existingPermission, extendedPermission); // Should be the same object (extended)
return mapping;
} // Should extend by exactly 1 year from current expiry: June 15, 2025 + 1 year =
// June 15, 2026
Instant expectedExpiry = Instant.parse("2026-06-15T10:00:00Z");
assertEquals(expectedExpiry, extendedPermission.getExpires());
assertEquals(TARGET_USER_ID, extendedPermission.getTarget());
assertEquals(ROLE_MEMBER, extendedPermission.getName());
}
@Test
void testGetForItem_AddonExtendsExpiredPermission_SimpleCase() {
// Given - existing permission that expired on February 15, 2025 (1 month ago
// from March 15)
Instant currentTime = Instant.parse("2025-03-15T10:00:00Z");
Instant expiredDate = Instant.parse("2025-02-15T10:00:00Z"); // Expired exactly 1 month ago
Permission expiredPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, expiredDate);
PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true);
when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping));
when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
.thenReturn(Arrays.asList(expiredPermission));
// When
List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
currentTime, null);
// Then
assertEquals(1, result.size());
Permission extendedPermission = result.get(0);
assertEquals(expiredPermission, extendedPermission); // Should be the same object (extended)
// Should extend by exactly 1 year from original expiry: Feb 15, 2025 + 1 year =
// Feb 15, 2026
Instant expectedExpiry = Instant.parse("2026-02-15T10:00:00Z");
assertEquals(expectedExpiry, extendedPermission.getExpires());
assertTrue(extendedPermission.getExpires().isAfter(currentTime)); // Should be in the future
}
@Test
void testGetForItem_AddonExtendsLongExpiredPermission_CatchesUp() {
// Given - permission that expired 2 years ago (Dec 31, 2023, applied in Nov
// 2025)
Instant currentTime = Instant.parse("2025-02-09T10:00:00Z");
Instant longExpiredDate = Instant.parse("2023-12-31T23:59:59Z");
Permission longExpiredPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null,
longExpiredDate);
PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true);
when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping));
when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
.thenReturn(Arrays.asList(longExpiredPermission));
// When
List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
currentTime, null);
// Then
assertEquals(1, result.size());
Permission extendedPermission = result.get(0);
assertEquals(longExpiredPermission, extendedPermission); // Should be the same object (extended)
// Should "catch up" to future: 2023-12-31 -> 2024-12-31 -> 2025-12-31 (first
// future date)
Instant expectedExpiry = Instant.parse("2025-12-31T23:59:59Z");
assertEquals(expectedExpiry, extendedPermission.getExpires());
assertTrue(extendedPermission.getExpires().isAfter(currentTime)); // Should be in the future
}
@Test
void testGetForItem_AddonExtendsNonExpiredPermission_CatchesUp() {
// Given - permission that expired 2 years ago (Dec 31, 2023, applied in Nov
// 2025)
Instant currentTime = Instant.parse("2025-02-09T10:00:00Z");
Instant expiredDate = Instant.parse("2025-12-31T23:59:59Z");
Permission existingPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, expiredDate);
PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true);
when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping));
when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
.thenReturn(Arrays.asList(existingPermission));
// When
List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
currentTime, null);
// Then
assertEquals(1, result.size());
Permission extendedPermission = result.get(0);
assertEquals(existingPermission, extendedPermission); // Should be the same object (extended)
// Should "catch up" to future: 2025-12-31 -> 2026-12-31 (first future date)
Instant expectedExpiry = Instant.parse("2026-12-31T23:59:59Z");
assertEquals(expectedExpiry, extendedPermission.getExpires());
assertTrue(extendedPermission.getExpires().isAfter(currentTime)); // Should be in the future
}
@Test
void testGetForItem_AddonSelectsLatestExpiringPermission() {
// Given - multiple existing permissions with different expiry dates
Instant currentTime = Instant.parse("2025-03-15T10:00:00Z");
Permission permission1 = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null,
Instant.parse("2025-06-23T10:00:00Z")); // 100 days
Permission permission2 = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null,
Instant.parse("2025-10-01T10:00:00Z")); // 200 days (latest)
Permission permission3 = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null,
Instant.parse("2025-05-04T10:00:00Z")); // 50 days
PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 6L, ChronoUnit.MONTHS, true);
when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping));
when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
.thenReturn(Arrays.asList(permission1, permission2, permission3));
// When
List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
currentTime, null);
// Then
assertEquals(1, result.size());
Permission selectedPermission = result.get(0);
assertEquals(permission2, selectedPermission); // Should select the one with latest expiry (Oct 1, 2025)
// Should extend by 6 months from latest expiry: Oct 1, 2025 + 6 months = April
// 1, 2026
Instant expectedExpiry = Instant.parse("2026-04-01T10:00:00Z");
assertEquals(expectedExpiry, selectedPermission.getExpires());
assertEquals(TARGET_USER_ID, selectedPermission.getTarget());
assertEquals(ROLE_MEMBER, selectedPermission.getName());
}
@Test
void testGetForItem_NonAddonCreatesNewPermission() {
// Given
Instant currentTime = Instant.parse("2025-03-15T10:00:00Z");
PermissionMapping nonAddonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS,
false); // Not addon
when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(nonAddonMapping));
// Existing permission exists but should be ignored since this is not an addon
Permission existingPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null,
Instant.parse("2025-06-23T10:00:00Z"));
when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
.thenReturn(Arrays.asList(existingPermission));
// When
List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
currentTime, null);
// Then
assertEquals(1, result.size());
Permission newPermission = result.get(0);
assertNotEquals(existingPermission, newPermission); // Should be a new permission object
assertEquals(TARGET_USER_ID, newPermission.getTarget());
assertEquals(ROLE_MEMBER, newPermission.getName());
assertFalse(newPermission.isAddon()); // Should not be addon
// Should create new permission with 1 year from current time: March 15, 2025 +
// 1 year = March 15, 2026
Instant expectedExpiry = Instant.parse("2026-03-15T10:00:00Z");
assertEquals(expectedExpiry, newPermission.getExpires());
}
@Test
void testGetForItem_MultiplePermissionNames() {
// Given - mapping with multiple permission names
Instant currentTime = Instant.parse("2025-03-15T10:00:00Z");
Set<String> permissionNames = new HashSet<>(Arrays.asList("ROLE_MEMBER", "ROLE_SPECIAL"));
PermissionMapping multiMapping = createPermissionMapping(permissionNames, 1L, ChronoUnit.YEARS, true);
when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(multiMapping));
when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class)))
.thenReturn(Arrays.asList()); // No existing permissions
// When
List<Permission> result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(),
currentTime, null);
// Then
assertEquals(2, result.size());
// Should have both permission names
Set<String> resultNames = new HashSet<>();
for (Permission p : result) {
resultNames.add(p.getName());
assertEquals(TARGET_USER_ID, p.getTarget());
assertTrue(p.isAddon());
}
assertEquals(permissionNames, resultNames);
}
// Helper methods
private Permission createPermission(Long target, String name, boolean addon, Instant starts, Instant expires) {
Permission permission = new Permission();
permission.setTarget(target);
permission.setName(name);
permission.setAddon(addon);
permission.setStarts(starts);
permission.setExpires(expires);
return permission;
}
private PermissionMapping createAddonPermissionMapping(String permissionName, Long lifetime, ChronoUnit unit,
boolean isAddon) {
Set<String> names = new HashSet<>();
names.add(permissionName);
return createPermissionMapping(names, lifetime, unit, isAddon);
}
private PermissionMapping createPermissionMapping(Set<String> names, Long lifetime, ChronoUnit unit,
boolean isAddon) {
PermissionMapping mapping = new PermissionMapping();
mapping.setItem(TEST_ITEM_ID);
mapping.setNames(names);
mapping.setLifetime(lifetime);
mapping.setLifetimeUnit(unit);
mapping.setAddon(isAddon);
mapping.setLifetimeRound(false);
return mapping;
}
} }
+7
View File
@@ -31,5 +31,12 @@
<version>${querydsl.version}</version> <version>${querydsl.version}</version>
<classifier>jakarta</classifier> <classifier>jakarta</classifier>
</dependency> </dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>
@@ -13,6 +13,8 @@ import jakarta.persistence.EntityListeners;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import jakarta.persistence.Transient; import jakarta.persistence.Transient;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class DyndnsToken. * The Class DyndnsToken.
@@ -20,6 +22,8 @@ import jakarta.persistence.Transient;
@Entity @Entity
@Table(name = "dyndns_tokens") @Table(name = "dyndns_tokens")
@EntityListeners(AbstractModelEventListener.class) @EntityListeners(AbstractModelEventListener.class)
@Getter
@Setter
public class DyndnsToken implements UserData { public class DyndnsToken implements UserData {
@Id @Id
@@ -31,58 +35,4 @@ public class DyndnsToken implements UserData {
@Transient @Transient
private String token; private String token;
/**
* Gets the owner.
*
* @return the owner
*/
public Long getOwner() {
return owner;
}
/**
* Sets the owner.
*
* @param owner the new owner
*/
public void setOwner(Long owner) {
this.owner = owner;
}
/**
* Gets the token hash.
*
* @return the token hash
*/
public String getTokenHash() {
return tokenHash;
}
/**
* Sets the token hash.
*
* @param tokenHash the new token hash
*/
public void setTokenHash(String tokenHash) {
this.tokenHash = tokenHash;
}
/**
* Gets the token.
*
* @return the token
*/
public String getToken() {
return token;
}
/**
* Sets the token.
*
* @param token the new token
*/
public void setToken(String token) {
this.token = token;
}
} }
+7
View File
@@ -22,5 +22,12 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId> <artifactId>spring-boot-starter-mail</artifactId>
</dependency> </dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>
@@ -3,9 +3,14 @@
*/ */
package de.bstly.we.email.controller.model; package de.bstly.we.email.controller.model;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class UserMailModel. * The Class UserMailModel.
*/ */
@Getter
@Setter
public class UserMailModel { public class UserMailModel {
private String username; private String username;
@@ -24,58 +29,4 @@ public class UserMailModel {
this.email = email; this.email = email;
} }
/**
* Gets the username.
*
* @return the username
*/
public String getUsername() {
return username;
}
/**
* 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() {
return email;
}
/**
* 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() {
return locale;
}
/**
* Sets the locale.
*
* @param locale the new locale
*/
public void setLocale(String locale) {
this.locale = locale;
}
} }
+7
View File
@@ -25,5 +25,12 @@
<version>${querydsl.version}</version> <version>${querydsl.version}</version>
<classifier>jakarta</classifier> <classifier>jakarta</classifier>
</dependency> </dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>
@@ -9,62 +9,23 @@ import jakarta.persistence.Id;
import jakarta.persistence.Lob; import jakarta.persistence.Lob;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class I18n. * The Class I18n.
*/ */
@Entity @Entity
@Table(name = "i18n", uniqueConstraints = @UniqueConstraint(columnNames = { "locale" })) @Table(name = "i18n", uniqueConstraints = @UniqueConstraint(columnNames = { "locale" }))
@Getter
@Setter
public class I18n { public class I18n {
/**
*
*/
@Id @Id
@Column(name = "locale", unique = true, nullable = false) @Column(name = "locale", unique = true, nullable = false)
private String locale; private String locale;
/**
*
*/
@Lob @Lob
@Column(name = "label", length = 100000) @Column(name = "label", length = 100000)
private String label; private String label;
/**
* Gets the locale.
*
* @return the locale
*/
public String getLocale() {
return locale;
}
/**
* 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() {
return label;
}
/**
* Sets the label.
*
* @param label the new label
*/
public void setLabel(String label) {
this.label = label;
}
} }
+7
View File
@@ -25,5 +25,12 @@
<version>${querydsl.version}</version> <version>${querydsl.version}</version>
<classifier>jakarta</classifier> <classifier>jakarta</classifier>
</dependency> </dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>
@@ -14,12 +14,16 @@ import jakarta.persistence.Lob;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import de.bstly.we.model.UserData; import de.bstly.we.model.UserData;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class Invite. * The Class Invite.
*/ */
@Entity @Entity
@Table(name = "invites") @Table(name = "invites")
@Getter
@Setter
public class Invite implements UserData { public class Invite implements UserData {
@Id @Id
@@ -41,238 +45,4 @@ public class Invite implements UserData {
private String codeLink; private String codeLink;
private String url; private String url;
/**
* 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 owner.
*
* @return the owner
*/
public Long getOwner() {
return owner;
}
/**
* 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() {
return code;
}
/**
* 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() {
return item;
}
/**
* Sets the item.
*
* @param item the new item
*/
public void setItem(Integer item) {
this.item = item;
}
/**
* 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 starts.
*
* @return the starts
*/
public Instant getStarts() {
return starts;
}
/**
* 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() {
return expires;
}
/**
* 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() {
return message;
}
/**
* 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() {
return note;
}
/**
* Sets the note.
*
* @param note the new note
*/
public void setNote(String note) {
this.note = note;
}
/**
* Checks if is redeemed.
*
* @return true, if is redeemed
*/
public boolean isRedeemed() {
return redeemed;
}
/**
* Sets the redeemed.
*
* @param redeemed the new redeemed
*/
public void setRedeemed(boolean redeemed) {
this.redeemed = redeemed;
}
/**
* Gets the redeemed by.
*
* @return the redeemed by
*/
public Long getRedeemedBy() {
return redeemedBy;
}
/**
* Sets the redeemed by.
*
* @param redeemedBy the new redeemed by
*/
public void setRedeemedBy(Long redeemedBy) {
this.redeemedBy = redeemedBy;
}
/**
* Gets the code link.
*
* @return the code link
*/
public String getCodeLink() {
return codeLink;
}
/**
* Sets the code link.
*
* @param codeLink the new code link
*/
public void setCodeLink(String codeLink) {
this.codeLink = codeLink;
}
/**
* Gets the url.
*
* @return the url
*/
public String getUrl() {
return url;
}
/**
* Sets the url.
*
* @param url the new url
*/
public void setUrl(String url) {
this.url = url;
}
} }
@@ -9,12 +9,16 @@ import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class InviteMapping. * The Class InviteMapping.
*/ */
@Entity @Entity
@Table(name = "invite_mapping") @Table(name = "invite_mapping")
@Getter
@Setter
public class InviteMapping { public class InviteMapping {
public static final String QUOTA_PREFIX = "invite_"; public static final String QUOTA_PREFIX = "invite_";
@@ -30,148 +34,4 @@ public class InviteMapping {
private String url; private String url;
private String defaultMessage; private String defaultMessage;
/**
* 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 item.
*
* @return the item
*/
public Integer getItem() {
return item;
}
/**
* 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() {
return starts;
}
/**
* 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() {
return expires;
}
/**
* Sets the expires.
*
* @param expires the new expires
*/
public void setExpires(Instant expires) {
this.expires = expires;
}
/**
* Gets the message limit.
*
* @return the message limit
*/
public Integer getMessageLimit() {
return messageLimit;
}
/**
* Sets the message limit.
*
* @param messageLimit the new message limit
*/
public void setMessageLimit(Integer messageLimit) {
this.messageLimit = messageLimit;
}
/**
* Gets the code link.
*
* @return the code link
*/
public String getCodeLink() {
return codeLink;
}
/**
* Sets the code link.
*
* @param codeLink the new code link
*/
public void setCodeLink(String codeLink) {
this.codeLink = codeLink;
}
/**
* Gets the url.
*
* @return the url
*/
public String getUrl() {
return url;
}
/**
* Sets the url.
*
* @param url the new url
*/
public void setUrl(String url) {
this.url = url;
}
/**
* Gets the default message.
*
* @return the default message
*/
public String getDefaultMessage() {
return defaultMessage;
}
/**
* Sets the default message.
*
* @param defaultMessage the new default message
*/
public void setDefaultMessage(String defaultMessage) {
this.defaultMessage = defaultMessage;
}
} }
+7
View File
@@ -36,5 +36,12 @@
<version>${querydsl.version}</version> <version>${querydsl.version}</version>
<classifier>jakarta</classifier> <classifier>jakarta</classifier>
</dependency> </dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>
@@ -18,12 +18,16 @@ import org.springframework.data.annotation.Reference;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import de.bstly.we.model.UserData; import de.bstly.we.model.UserData;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class JitsiRoom. * The Class JitsiRoom.
*/ */
@Entity @Entity
@Table(name = "jitsi_rooms") @Table(name = "jitsi_rooms")
@Getter
@Setter
public class JitsiRoom implements UserData { public class JitsiRoom implements UserData {
@Id @Id
@@ -55,219 +59,4 @@ public class JitsiRoom implements UserData {
@Column(length = 100000) @Column(length = 100000)
private String orgUrl; private String orgUrl;
/**
* 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 owner.
*
* @return the owner
*/
public Long getOwner() {
return owner;
}
/**
* 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() {
return room;
}
/**
* 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() {
return starts;
}
/**
* Sets the starts.
*
* @param starts the new starts
*/
public void setStarts(Instant starts) {
this.starts = starts;
}
/**
* Gets the moderation starts.
*
* @return the moderation starts
*/
public Instant getModerationStarts() {
return moderationStarts;
}
/**
* 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() {
return expires;
}
/**
* 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() {
return token;
}
/**
* Sets the token.
*
* @param token the new token
*/
public void setToken(String token) {
this.token = token;
}
/**
* Gets the moderation token.
*
* @return the moderation token
*/
public String getModerationToken() {
return moderationToken;
}
/**
* 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() {
return url;
}
/**
* Sets the url.
*
* @param url the new url
*/
public void setUrl(String url) {
this.url = url;
}
/**
* Gets the moderation url.
*
* @return the moderation url
*/
public String getModerationUrl() {
return moderationUrl;
}
/**
* 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() {
return code;
}
/**
* Sets the code.
*
* @param code the new code
*/
public void setCode(String code) {
this.code = code;
}
/**
* Gets the org url.
*
* @return the org url
*/
public String getOrgUrl() {
return orgUrl;
}
/**
* Sets the org url.
*
* @param orgUrl the new org url
*/
public void setOrgUrl(String orgUrl) {
this.orgUrl = orgUrl;
}
} }
+7
View File
@@ -17,5 +17,12 @@
<artifactId>webstly-partey</artifactId> <artifactId>webstly-partey</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>
@@ -5,9 +5,14 @@ package de.bstly.we.jukebox.businesslogic.model;
import java.time.Instant; import java.time.Instant;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class JukeboxConfig. * The Class JukeboxConfig.
*/ */
@Getter
@Setter
public class JukeboxConfig { public class JukeboxConfig {
private String clientId; private String clientId;
@@ -22,202 +27,4 @@ public class JukeboxConfig {
private Instant expires; private Instant expires;
private String fallbackContextId; private String fallbackContextId;
/**
* Gets the client id.
*
* @return the client id
*/
public String getClientId() {
return clientId;
}
/**
* Sets the client id.
*
* @param clientId the new client id
*/
public void setClientId(String clientId) {
this.clientId = clientId;
}
/**
* Gets the client secret.
*
* @return the client secret
*/
public String getClientSecret() {
return clientSecret;
}
/**
* Sets the client secret.
*
* @param clientSecret the new client secret
*/
public void setClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
}
/**
* Gets the device id.
*
* @return the device id
*/
public String getDeviceId() {
return deviceId;
}
/**
* Sets the device id.
*
* @param deviceId the new device id
*/
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
/**
* Gets the redirect url.
*
* @return the redirect url
*/
public String getRedirectUrl() {
return redirectUrl;
}
/**
* Sets the redirect url.
*
* @param redirectUrl the new redirect url
*/
public void setRedirectUrl(String redirectUrl) {
this.redirectUrl = redirectUrl;
}
/**
* Gets the api url.
*
* @return the api url
*/
public String getApiUrl() {
return apiUrl;
}
/**
* Sets the api url.
*
* @param apiUrl the new api url
*/
public void setApiUrl(String apiUrl) {
this.apiUrl = apiUrl;
}
/**
* Gets the account url.
*
* @return the account url
*/
public String getAccountUrl() {
return accountUrl;
}
/**
* Sets the account url.
*
* @param accountUrl the new account url
*/
public void setAccountUrl(String accountUrl) {
this.accountUrl = accountUrl;
}
/**
* Checks if is active.
*
* @return true, if is active
*/
public boolean isActive() {
return active;
}
/**
* Sets the active.
*
* @param active the new active
*/
public void setActive(boolean active) {
this.active = active;
}
/**
* Gets the access token.
*
* @return the access token
*/
public String getAccessToken() {
return accessToken;
}
/**
* Sets the access token.
*
* @param accessToken the new access token
*/
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
/**
* Gets the refresh token.
*
* @return the refresh token
*/
public String getRefreshToken() {
return refreshToken;
}
/**
* Sets the refresh token.
*
* @param refreshToken the new refresh token
*/
public void setRefreshToken(String refreshToken) {
this.refreshToken = refreshToken;
}
/**
* Gets the expires.
*
* @return the expires
*/
public Instant getExpires() {
return expires;
}
/**
* Sets the expires.
*
* @param expires the new expires
*/
public void setExpires(Instant expires) {
this.expires = expires;
}
/**
* Gets the fallback context id.
*
* @return the fallback context id
*/
public String getFallbackContextId() {
return fallbackContextId;
}
/**
* Sets the fallback context id.
*
* @param fallbackContextId the new fallback context id
*/
public void setFallbackContextId(String fallbackContextId) {
this.fallbackContextId = fallbackContextId;
}
} }
@@ -6,8 +6,6 @@ package de.bstly.we.jukebox.controller;
import java.io.IOException; import java.io.IOException;
import java.util.Optional; import java.util.Optional;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
@@ -25,6 +23,7 @@ import com.google.gson.JsonIOException;
import de.bstly.we.controller.BaseController; import de.bstly.we.controller.BaseController;
import de.bstly.we.jukebox.businesslogic.JukeboxManager; import de.bstly.we.jukebox.businesslogic.JukeboxManager;
import de.bstly.we.jukebox.businesslogic.model.JukeboxConfig; import de.bstly.we.jukebox.businesslogic.model.JukeboxConfig;
import jakarta.servlet.http.HttpServletResponse;
/** /**
* The Class JukeboxManagementController. * The Class JukeboxManagementController.
+7
View File
@@ -32,5 +32,12 @@
<classifier>jakarta</classifier> <classifier>jakarta</classifier>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>
@@ -16,12 +16,16 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class JwtKey. * The Class JwtKey.
*/ */
@Entity @Entity
@Table(name = "jwt_keys") @Table(name = "jwt_keys")
@Getter
@Setter
public class JwtKey { public class JwtKey {
@Id @Id
@@ -49,202 +53,4 @@ public class JwtKey {
@Column(name = "expires", nullable = false) @Column(name = "expires", nullable = false)
private Instant expires; private Instant expires;
/**
* 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 key ID.
*
* @return the key ID
*/
public String getKeyID() {
return keyID;
}
/**
* Sets the key ID.
*
* @param keyID the new key ID
*/
public void setKeyID(String keyID) {
this.keyID = keyID;
}
/**
* Gets the data.
*
* @return the data
*/
public String getData() {
return data;
}
/**
* Sets the data.
*
* @param data the new data
*/
public void setData(String data) {
this.data = data;
}
/**
* Gets the key type.
*
* @return the key type
*/
public String getKeyType() {
return keyType;
}
/**
* Sets the key type.
*
* @param keyType the new key type
*/
public void setKeyType(String keyType) {
this.keyType = keyType;
}
/**
* Gets the key parameter.
*
* @return the key parameter
*/
public String getKeyParameter() {
return keyParameter;
}
/**
* Sets the key parameter.
*
* @param keyParameter the new key parameter
*/
public void setKeyParameter(String keyParameter) {
this.keyParameter = keyParameter;
}
/**
* Gets the key use.
*
* @return the key use
*/
public String getKeyUse() {
return keyUse;
}
/**
* Sets the key use.
*
* @param keyUse the new key use
*/
public void setKeyUse(String keyUse) {
this.keyUse = keyUse;
}
/**
* Gets the jws algorithm.
*
* @return the jws algorithm
*/
public String getJwsAlgorithm() {
return jwsAlgorithm;
}
/**
* Sets the jws algorithm.
*
* @param jwsAlgorithm the new jws algorithm
*/
public void setJwsAlgorithm(String jwsAlgorithm) {
this.jwsAlgorithm = jwsAlgorithm;
}
/**
* Gets the lifetime.
*
* @return the lifetime
*/
public Long getLifetime() {
return lifetime;
}
/**
* Sets the lifetime.
*
* @param lifetime the new lifetime
*/
public void setLifetime(Long lifetime) {
this.lifetime = lifetime;
}
/**
* Gets the created.
*
* @return the created
*/
public Instant getCreated() {
return created;
}
/**
* Sets the created.
*
* @param created the new created
*/
public void setCreated(Instant created) {
this.created = created;
}
/**
* Gets the expires.
*
* @return the expires
*/
public Instant getExpires() {
return expires;
}
/**
* Sets the expires.
*
* @param expires the new expires
*/
public void setExpires(Instant expires) {
this.expires = expires;
}
} }
+7
View File
@@ -25,5 +25,12 @@
<version>${querydsl.version}</version> <version>${querydsl.version}</version>
<classifier>jakarta</classifier> <classifier>jakarta</classifier>
</dependency> </dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>
@@ -10,12 +10,16 @@ import jakarta.persistence.Lob;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import de.bstly.we.model.UserData; import de.bstly.we.model.UserData;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class MinetestAccount. * The Class MinetestAccount.
*/ */
@Entity @Entity
@Table(name = "minetest_accounts") @Table(name = "minetest_accounts")
@Getter
@Setter
public class MinetestAccount implements UserData { public class MinetestAccount implements UserData {
@Id @Id
@@ -27,58 +31,4 @@ public class MinetestAccount implements UserData {
@Column(name = "skin", length = 100000) @Column(name = "skin", length = 100000)
private String skin; private String skin;
/**
* 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 owner.
*
* @return the owner
*/
public Long getOwner() {
return owner;
}
/**
* 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() {
return skin;
}
/**
* Sets the skin.
*
* @param skin the new skin
*/
public void setSkin(String skin) {
this.skin = skin;
}
} }
+7
View File
@@ -25,5 +25,12 @@
<version>${querydsl.version}</version> <version>${querydsl.version}</version>
<classifier>jakarta</classifier> <classifier>jakarta</classifier>
</dependency> </dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>
@@ -143,7 +143,7 @@ public class OidcSessionManager {
* @return the all by target * @return the all by target
*/ */
public List<OidcSession> getAllByTarget(Long clientId) { public List<OidcSession> getAllByTarget(Long clientId) {
return Lists.newArrayList(oidcSessionRepository.findAll(qOidcSession.client.eq(clientId))); return Lists.newArrayList(oidcSessionRepository.findAll(qOidcSession.clientId.eq(clientId)));
} }
/** /**
@@ -165,7 +165,7 @@ public class OidcSessionManager {
*/ */
public List<OidcSession> getAllByTargetAndSubject(Long clientId, Long subject) { public List<OidcSession> getAllByTargetAndSubject(Long clientId, Long subject) {
return Lists.newArrayList( return Lists.newArrayList(
oidcSessionRepository.findAll(qOidcSession.client.eq(clientId).and(qOidcSession.subject.eq(subject)))); oidcSessionRepository.findAll(qOidcSession.clientId.eq(clientId).and(qOidcSession.subject.eq(subject))));
} }
/** /**
@@ -6,10 +6,14 @@ package de.bstly.we.oidc.businesslogic.exception;
import java.net.URI; import java.net.URI;
import de.bstly.we.oidc.businesslogic.model.OidcAuthorizationErrorCode; import de.bstly.we.oidc.businesslogic.model.OidcAuthorizationErrorCode;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class InvalidAuthorizationRequestException. * The Class InvalidAuthorizationRequestException.
*/ */
@Getter
@Setter
public class InvalidAuthorizationRequestException extends RuntimeException { public class InvalidAuthorizationRequestException extends RuntimeException {
/** /**
* default serialVersionUID * default serialVersionUID
@@ -38,76 +42,4 @@ public class InvalidAuthorizationRequestException extends RuntimeException {
this.state = state; this.state = state;
} }
/**
* Gets the redirect uri.
*
* @return the redirect uri
*/
public URI getRedirectUri() {
return redirectUri;
}
/**
* Sets the redirect uri.
*
* @param redirectUri the new redirect uri
*/
public void setRedirectUri(URI redirectUri) {
this.redirectUri = redirectUri;
}
/**
* Gets the error code.
*
* @return the error code
*/
public OidcAuthorizationErrorCode getErrorCode() {
return errorCode;
}
/**
* Sets the error code.
*
* @param errorCode the new error code
*/
public void setErrorCode(OidcAuthorizationErrorCode errorCode) {
this.errorCode = errorCode;
}
/**
* Gets the error description.
*
* @return the error description
*/
public String getErrorDescription() {
return errorDescription;
}
/**
* 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() {
return state;
}
/**
* Sets the state.
*
* @param state the new state
*/
public void setState(String state) {
this.state = state;
}
} }
@@ -4,10 +4,14 @@
package de.bstly.we.oidc.businesslogic.exception; package de.bstly.we.oidc.businesslogic.exception;
import de.bstly.we.oidc.businesslogic.model.OidcTokenErrorCode; import de.bstly.we.oidc.businesslogic.model.OidcTokenErrorCode;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class InvalidTokenRequestException. * The Class InvalidTokenRequestException.
*/ */
@Getter
@Setter
public class InvalidTokenRequestException extends RuntimeException { public class InvalidTokenRequestException extends RuntimeException {
/** /**
@@ -30,40 +34,4 @@ public class InvalidTokenRequestException extends RuntimeException {
this.errorDescription = errorDescription; this.errorDescription = errorDescription;
} }
/**
* Gets the error code.
*
* @return the error code
*/
public OidcTokenErrorCode getErrorCode() {
return errorCode;
}
/**
* Sets the error code.
*
* @param errorCode the new error code
*/
public void setErrorCode(OidcTokenErrorCode errorCode) {
this.errorCode = errorCode;
}
/**
* Gets the error description.
*
* @return the error description
*/
public String getErrorDescription() {
return errorDescription;
}
/**
* Sets the error description.
*
* @param errorDescription the new error description
*/
public void setErrorDescription(String errorDescription) {
this.errorDescription = errorDescription;
}
} }
@@ -9,10 +9,14 @@ import java.time.temporal.ChronoUnit;
import java.util.Set; import java.util.Set;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class OidcAuthorizationCode. * The Class OidcAuthorizationCode.
*/ */
@Getter
@Setter
public class OidcAuthorizationCode { public class OidcAuthorizationCode {
public static final int CODE_LENGTH = 32; public static final int CODE_LENGTH = 32;
@@ -47,99 +51,5 @@ public class OidcAuthorizationCode {
this.nonce = nonce; this.nonce = nonce;
} }
/**
* Gets the client id.
*
* @return the client id
*/
public String getClientId() {
return clientId;
}
/**
* Gets the redirect uri.
*
* @return the redirect uri
*/
public URI getRedirectUri() {
return redirectUri;
}
/**
* Gets the scopes.
*
* @return the scopes
*/
public Set<String> getScopes() {
return scopes;
}
/**
* Gets the code.
*
* @return the code
*/
public String getCode() {
return code;
}
/**
* Gets the expiry.
*
* @return the expiry
*/
public Instant getExpiry() {
return expiry;
}
/**
* Gets the user id.
*
* @return the user id
*/
public Long getUserId() {
return userId;
}
/**
* Gets the nonce.
*
* @return the nonce
*/
public String getNonce() {
return nonce;
}
/**
* Gets the spring session.
*
* @return the spring session
*/
public String getSpringSession() {
return springSession;
}
/**
* Sets the spring session.
*
* @param springSession the new spring session
*/
public void setSpringSession(String springSession) {
this.springSession = springSession;
}
/**
* @return the alias
*/
public String getAlias() {
return alias;
}
/**
* @param alias the alias to set
*/
public void setAlias(String alias) {
this.alias = alias;
}
} }
@@ -5,9 +5,16 @@ package de.bstly.we.oidc.businesslogic.model;
import java.net.URI; import java.net.URI;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class OidcAuthorizationRequest. * The Class OidcAuthorizationRequest.
*/ */
@Getter
@Setter
@AllArgsConstructor
public class OidcAuthorizationRequest { public class OidcAuthorizationRequest {
private String code; private String code;
@@ -25,258 +32,5 @@ public class OidcAuthorizationRequest {
private String login_hint; private String login_hint;
private String acr_values; private String acr_values;
/**
* Instantiates a new oidc authorization request.
*
* @param code the code
* @param client_id the client id
* @param response_type the response type
* @param redirect_uri the redirect uri
* @param scope the scope
* @param state the state
* @param nonce the nonce
* @param display the display
* @param prompt the prompt
* @param max_age the max age
* @param ui_locales the ui locales
* @param id_token_hint the id token hint
* @param login_hint the login hint
* @param acr_values the acr values
*/
public OidcAuthorizationRequest(String code, String client_id, String response_type, URI redirect_uri, String scope,
String state, String nonce, String display, String prompt, String max_age, String ui_locales,
String id_token_hint, String login_hint, String acr_values) {
super();
this.code = code;
this.client_id = client_id;
this.response_type = response_type;
this.redirect_uri = redirect_uri;
this.scope = scope;
this.state = state;
this.nonce = nonce;
this.display = display;
this.prompt = prompt;
this.max_age = max_age;
this.ui_locales = ui_locales;
this.id_token_hint = id_token_hint;
this.login_hint = login_hint;
this.acr_values = acr_values;
}
/**
* Gets the code.
*
* @return the code
*/
public String getCode() {
return code;
}
/**
* Sets the code.
*
* @param code the new code
*/
public void setCode(String code) {
this.code = code;
}
/**
* Gets the client id.
*
* @return the client id
*/
public String getClient_id() {
return client_id;
}
/**
* Gets the response type.
*
* @return the response type
*/
public String getResponse_type() {
return response_type;
}
/**
* Gets the redirect uri.
*
* @return the redirect uri
*/
public URI getRedirect_uri() {
return redirect_uri;
}
/**
* Gets the scope.
*
* @return the scope
*/
public String getScope() {
return scope;
}
/**
* Gets the state.
*
* @return the state
*/
public String getState() {
return state;
}
/**
* Sets the state.
*
* @param state the new state
*/
public void setState(String state) {
this.state = state;
}
/**
* Gets the display.
*
* @return the display
*/
public String getDisplay() {
return display;
}
/**
* Sets the display.
*
* @param display the new display
*/
public void setDisplay(String display) {
this.display = display;
}
/**
* Gets the nonce.
*
* @return the nonce
*/
public String getNonce() {
return nonce;
}
/**
* Sets the nonce.
*
* @param nonce the new nonce
*/
public void setNonce(String nonce) {
this.nonce = nonce;
}
/**
* Gets the prompt.
*
* @return the prompt
*/
public String getPrompt() {
return prompt;
}
/**
* Sets the prompt.
*
* @param prompt the new prompt
*/
public void setPrompt(String prompt) {
this.prompt = prompt;
}
/**
* Gets the max age.
*
* @return the max age
*/
public String getMax_age() {
return max_age;
}
/**
* Sets the max age.
*
* @param max_age the new max age
*/
public void setMax_age(String max_age) {
this.max_age = max_age;
}
/**
* Gets the ui locales.
*
* @return the ui locales
*/
public String getUi_locales() {
return ui_locales;
}
/**
* Sets the ui locales.
*
* @param ui_locales the new ui locales
*/
public void setUi_locales(String ui_locales) {
this.ui_locales = ui_locales;
}
/**
* Gets the id token hint.
*
* @return the id token hint
*/
public String getId_token_hint() {
return id_token_hint;
}
/**
* Sets the id token hint.
*
* @param id_token_hint the new id token hint
*/
public void setId_token_hint(String id_token_hint) {
this.id_token_hint = id_token_hint;
}
/**
* Gets the login hint.
*
* @return the login hint
*/
public String getLogin_hint() {
return login_hint;
}
/**
* Sets the login hint.
*
* @param login_hint the new login hint
*/
public void setLogin_hint(String login_hint) {
this.login_hint = login_hint;
}
/**
* Gets the acr values.
*
* @return the acr values
*/
public String getAcr_values() {
return acr_values;
}
/**
* Sets the acr values.
*
* @param acr_values the new acr values
*/
public void setAcr_values(String acr_values) {
this.acr_values = acr_values;
}
} }
@@ -5,9 +5,16 @@ package de.bstly.we.oidc.businesslogic.model;
import java.net.URI; import java.net.URI;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class OidcTokenRequest. * The Class OidcTokenRequest.
*/ */
@Getter
@Setter
@AllArgsConstructor
public class OidcTokenRequest { public class OidcTokenRequest {
private final String code; private final String code;
@@ -18,117 +25,5 @@ public class OidcTokenRequest {
private final URI redirect_uri; private final URI redirect_uri;
private final String scope; private final String 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 refresh_token the refresh token
* @param redirect_uri the redirect uri
* @param scope the scope
*/
public OidcTokenRequest(String code, OidcAuthorizationGrantType grant_type, String client_id, String client_secret,
String refresh_token, URI redirect_uri, String scope) {
super();
this.code = code;
this.grant_type = grant_type;
this.client_id = client_id;
this.client_secret = client_secret;
this.refresh_token = refresh_token;
this.redirect_uri = redirect_uri;
this.scope = scope;
}
/**
* Gets the client id.
*
* @return the client id
*/
public String getClient_id() {
return client_id;
}
/**
* Sets the client id.
*
* @param client_id the new client id
*/
public void setClient_id(String client_id) {
this.client_id = client_id;
}
/**
* Gets the client secret.
*
* @return the client secret
*/
public String getClient_secret() {
return client_secret;
}
/**
* 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 refresh token.
*
* @return the refresh token
*/
public String getRefresh_token() {
return refresh_token;
}
/**
* Sets the refresh token.
*
* @param refresh_token the new refresh token
*/
public void setRefresh_token(String refresh_token) {
this.refresh_token = refresh_token;
}
/**
* Gets the code.
*
* @return the code
*/
public String getCode() {
return code;
}
/**
* Gets the grant type.
*
* @return the grant type
*/
public OidcAuthorizationGrantType getGrant_type() {
return grant_type;
}
/**
* Gets the redirect uri.
*
* @return the redirect uri
*/
public URI getRedirect_uri() {
return redirect_uri;
}
/**
* Gets the scope.
*
* @return the scope
*/
public String getScope() {
return scope;
}
} }
@@ -4,11 +4,15 @@
package de.bstly.we.oidc.businesslogic.model; package de.bstly.we.oidc.businesslogic.model;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class OidcTokenResponse. * The Class OidcTokenResponse.
*/ */
@JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonInclude(JsonInclude.Include.NON_EMPTY)
@Getter
@Setter
public class OidcTokenResponse { public class OidcTokenResponse {
private String access_token; private String access_token;
@@ -17,94 +21,4 @@ public class OidcTokenResponse {
private long expires_in; private long expires_in;
private String id_token; private String id_token;
/**
* Gets the access token.
*
* @return the access token
*/
public String getAccess_token() {
return access_token;
}
/**
* Sets the access token.
*
* @param access_token the new access token
*/
public void setAccess_token(String access_token) {
this.access_token = access_token;
}
/**
* Gets the token type.
*
* @return the token type
*/
public String getToken_type() {
return token_type;
}
/**
* Sets the token type.
*
* @param token_type the new token type
*/
public void setToken_type(String token_type) {
this.token_type = token_type;
}
/**
* Gets the refresh token.
*
* @return the refresh token
*/
public String getRefresh_token() {
return refresh_token;
}
/**
* Sets the refresh token.
*
* @param refresh_token the new refresh token
*/
public void setRefresh_token(String refresh_token) {
this.refresh_token = refresh_token;
}
/**
* Gets the expires in.
*
* @return the expires in
*/
public long getExpires_in() {
return expires_in;
}
/**
* Sets the expires in.
*
* @param expires_in the new expires in
*/
public void setExpires_in(long expires_in) {
this.expires_in = expires_in;
}
/**
* Gets the id token.
*
* @return the id token
*/
public String getId_token() {
return id_token;
}
/**
* Sets the id token.
*
* @param id_token the new id token
*/
public void setId_token(String id_token) {
this.id_token = id_token;
}
} }
@@ -3,48 +3,17 @@
*/ */
package de.bstly.we.oidc.businesslogic.model; package de.bstly.we.oidc.businesslogic.model;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class OidcTokenRevokeRequest. * The Class OidcTokenRevokeRequest.
*/ */
@Getter
@Setter
public class OidcTokenRevokeRequest { public class OidcTokenRevokeRequest {
private String token; private String token;
private String token_type_hint; private String token_type_hint;
/**
* Gets the token.
*
* @return the token
*/
public String getToken() {
return token;
}
/**
* Sets the token.
*
* @param token the new token
*/
public void setToken(String token) {
this.token = token;
}
/**
* Gets the token type hint.
*
* @return the token type hint
*/
public String getToken_type_hint() {
return token_type_hint;
}
/**
* Sets the token type hint.
*
* @param token_type_hint the new token type hint
*/
public void setToken_type_hint(String token_type_hint) {
this.token_type_hint = token_type_hint;
}
} }
@@ -8,10 +8,14 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import de.bstly.we.oidc.model.OidcSession; import de.bstly.we.oidc.model.OidcSession;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class OidcClientInfo. * The Class OidcClientInfo.
*/ */
@Getter
@Setter
public class OidcClientInfo { public class OidcClientInfo {
private String clientId; private String clientId;
@@ -28,239 +32,4 @@ public class OidcClientInfo {
private Map<String, Object> claims; private Map<String, Object> claims;
private List<OidcSession> sessions; private List<OidcSession> sessions;
/**
* Gets the client id.
*
* @return the client id
*/
public String getClientId() {
return clientId;
}
/**
* Sets the client id.
*
* @param clientId the new client id
*/
public void setClientId(String clientId) {
this.clientId = clientId;
}
/**
* 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 description.
*
* @return the description
*/
public String getDescription() {
return description;
}
/**
* Sets the description.
*
* @param description the new description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* Gets the login url.
*
* @return the login url
*/
public String getLoginUrl() {
return loginUrl;
}
/**
* Sets the login url.
*
* @param loginUrl the new login url
*/
public void setLoginUrl(String loginUrl) {
this.loginUrl = loginUrl;
}
/**
* Gets the frontchannel logout uri.
*
* @return the frontchannel logout uri
*/
public String getFrontchannelLogoutUri() {
return frontchannelLogoutUri;
}
/**
* Sets the frontchannel logout uri.
*
* @param frontchannelLogoutUri the new frontchannel logout uri
*/
public void setFrontchannelLogoutUri(String frontchannelLogoutUri) {
this.frontchannelLogoutUri = frontchannelLogoutUri;
}
/**
* Checks if is frontchannel logout session required.
*
* @return true, if is frontchannel logout session required
*/
public boolean isFrontchannelLogoutSessionRequired() {
return frontchannelLogoutSessionRequired;
}
/**
* Sets the frontchannel logout session required.
*
* @param frontchannelLogoutSessionRequired the new frontchannel logout session
* required
*/
public void setFrontchannelLogoutSessionRequired(boolean frontchannelLogoutSessionRequired) {
this.frontchannelLogoutSessionRequired = frontchannelLogoutSessionRequired;
}
/**
* Checks if is backchannel logout.
*
* @return true, if is backchannel logout
*/
public boolean isBackchannelLogout() {
return backchannelLogout;
}
/**
* Sets the backchannel logout.
*
* @param backchannelLogout the new backchannel logout
*/
public void setBackchannelLogout(boolean backchannelLogout) {
this.backchannelLogout = backchannelLogout;
}
/**
* Checks if is authorize.
*
* @return true, if is authorize
*/
public boolean isAuthorize() {
return authorize;
}
/**
* Sets the authorize.
*
* @param authorize the new authorize
*/
public void setAuthorize(boolean authorize) {
this.authorize = authorize;
}
/**
* Gets the scopes.
*
* @return the scopes
*/
public Set<String> getScopes() {
return scopes;
}
/**
* Sets the scopes.
*
* @param scopes the new scopes
*/
public void setScopes(Set<String> scopes) {
this.scopes = scopes;
}
/**
* Gets the claim mapping.
*
* @return the claim mapping
*/
public Map<String, Set<String>> getClaimMapping() {
return claimMapping;
}
/**
* Sets the claim mapping.
*
* @param claimMapping the claim mapping
*/
public void setClaimMapping(Map<String, Set<String>> claimMapping) {
this.claimMapping = claimMapping;
}
/**
* Gets the authorized scopes.
*
* @return the authorized scopes
*/
public Set<String> getAuthorizedScopes() {
return authorizedScopes;
}
/**
* Sets the authorized scopes.
*
* @param authorizedScopes the new authorized scopes
*/
public void setAuthorizedScopes(Set<String> authorizedScopes) {
this.authorizedScopes = authorizedScopes;
}
/**
* Gets the claims.
*
* @return the claims
*/
public Map<String, Object> getClaims() {
return claims;
}
/**
* Sets the claims.
*
* @param claims the claims
*/
public void setClaims(Map<String, Object> claims) {
this.claims = claims;
}
/**
* Gets the sessions.
*
* @return the sessions
*/
public List<OidcSession> getSessions() {
return sessions;
}
/**
* Sets the sessions.
*
* @param sessions the new sessions
*/
public void setSessions(List<OidcSession> sessions) {
this.sessions = sessions;
}
} }
@@ -7,10 +7,14 @@ import java.util.Set;
import de.bstly.we.oidc.businesslogic.model.OidcAuthorizationGrantType; import de.bstly.we.oidc.businesslogic.model.OidcAuthorizationGrantType;
import de.bstly.we.oidc.businesslogic.model.OidcClientAuthenticationMethod; import de.bstly.we.oidc.businesslogic.model.OidcClientAuthenticationMethod;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class OidcClientModel. * The Class OidcClientModel.
*/ */
@Getter
@Setter
public class OidcClientModel { public class OidcClientModel {
private String name; private String name;
@@ -21,130 +25,4 @@ public class OidcClientModel {
private String loginUrl; private String loginUrl;
private boolean alwaysPermitted; private boolean alwaysPermitted;
/**
* 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 registered redirect uris.
*
* @return the registered redirect uris
*/
public Set<String> getRegisteredRedirectUris() {
return registeredRedirectUris;
}
/**
* Sets the registered redirect uris.
*
* @param registeredRedirectUris the new registered redirect uris
*/
public void setRegisteredRedirectUris(Set<String> registeredRedirectUris) {
this.registeredRedirectUris = registeredRedirectUris;
}
/**
* Gets the client authentication methods.
*
* @return the client authentication methods
*/
public Set<OidcClientAuthenticationMethod> getClientAuthenticationMethods() {
return clientAuthenticationMethods;
}
/**
* Sets the client authentication methods.
*
* @param clientAuthenticationMethods the new client authentication methods
*/
public void setClientAuthenticationMethods(Set<OidcClientAuthenticationMethod> clientAuthenticationMethods) {
this.clientAuthenticationMethods = clientAuthenticationMethods;
}
/**
* Gets the authorization grant types.
*
* @return the authorization grant types
*/
public Set<OidcAuthorizationGrantType> getAuthorizationGrantTypes() {
return authorizationGrantTypes;
}
/**
* Sets the authorization grant types.
*
* @param authorizationGrantTypes the new authorization grant types
*/
public void setAuthorizationGrantTypes(Set<OidcAuthorizationGrantType> authorizationGrantTypes) {
this.authorizationGrantTypes = authorizationGrantTypes;
}
/**
* Gets the scopes.
*
* @return the scopes
*/
public Set<String> getScopes() {
return scopes;
}
/**
* Sets the scopes.
*
* @param scopes the new scopes
*/
public void setScopes(Set<String> scopes) {
this.scopes = scopes;
}
/**
* Gets the login url.
*
* @return the login url
*/
public String getLoginUrl() {
return loginUrl;
}
/**
* Sets the login url.
*
* @param loginUrl the new login url
*/
public void setLoginUrl(String loginUrl) {
this.loginUrl = loginUrl;
}
/**
* Checks if is always permitted.
*
* @return true, if is always permitted
*/
public boolean isAlwaysPermitted() {
return alwaysPermitted;
}
/**
* Sets the always permitted.
*
* @param alwaysPermitted the new always permitted
*/
public void setAlwaysPermitted(boolean alwaysPermitted) {
this.alwaysPermitted = alwaysPermitted;
}
} }
@@ -5,10 +5,14 @@ package de.bstly.we.oidc.controller.model;
import java.net.URI; import java.net.URI;
import java.util.Set; import java.util.Set;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class OidcConfiguration. * The Class OidcConfiguration.
*/ */
@Getter
@Setter
public class OidcConfiguration { public class OidcConfiguration {
private String issuer; private String issuer;
@@ -23,193 +27,4 @@ public class OidcConfiguration {
private Set<String> token_endpoint_auth_methods_supported; private Set<String> token_endpoint_auth_methods_supported;
private Set<String> id_token_signing_alg_values_supported; private Set<String> id_token_signing_alg_values_supported;
/**
* Gets the issuer.
*
* @return the issuer
*/
public String getIssuer() {
return issuer;
}
/**
* Sets the issuer.
*
* @param issuer the new issuer
*/
public void setIssuer(String issuer) {
this.issuer = issuer;
}
/**
* Gets the authorization endpoint.
*
* @return the authorization endpoint
*/
public URI getAuthorization_endpoint() {
return authorization_endpoint;
}
/**
* Sets the authorization endpoint.
*
* @param authorization_endpoint the new authorization endpoint
*/
public void setAuthorization_endpoint(URI authorization_endpoint) {
this.authorization_endpoint = authorization_endpoint;
}
/**
* Gets the token endpoint.
*
* @return the token endpoint
*/
public URI getToken_endpoint() {
return token_endpoint;
}
/**
* Sets the token endpoint.
*
* @param token_endpoint the new token endpoint
*/
public void setToken_endpoint(URI token_endpoint) {
this.token_endpoint = token_endpoint;
}
/**
* Gets the userinfo endpoint.
*
* @return the userinfo endpoint
*/
public URI getUserinfo_endpoint() {
return userinfo_endpoint;
}
/**
* Sets the userinfo endpoint.
*
* @param userinfo_endpoint the new userinfo endpoint
*/
public void setUserinfo_endpoint(URI userinfo_endpoint) {
this.userinfo_endpoint = userinfo_endpoint;
}
/**
* Gets the jwks uri.
*
* @return the jwks uri
*/
public URI getJwks_uri() {
return jwks_uri;
}
/**
* Sets the jwks uri.
*
* @param jwks_uri the new jwks uri
*/
public void setJwks_uri(URI jwks_uri) {
this.jwks_uri = jwks_uri;
}
/**
* Gets the scopes supported.
*
* @return the scopes supported
*/
public Set<String> getScopes_supported() {
return scopes_supported;
}
/**
* Sets the scopes supported.
*
* @param scopes_supported the new scopes supported
*/
public void setScopes_supported(Set<String> scopes_supported) {
this.scopes_supported = scopes_supported;
}
/**
* Gets the response types supported.
*
* @return the response types supported
*/
public Set<String> getResponse_types_supported() {
return response_types_supported;
}
/**
* Sets the response types supported.
*
* @param response_types_supported the new response types supported
*/
public void setResponse_types_supported(Set<String> response_types_supported) {
this.response_types_supported = response_types_supported;
}
/**
* Gets the subject types supported.
*
* @return the subject types supported
*/
public Set<String> getSubject_types_supported() {
return subject_types_supported;
}
/**
* Sets the subject types supported.
*
* @param subject_types_supported the new subject types supported
*/
public void setSubject_types_supported(Set<String> subject_types_supported) {
this.subject_types_supported = subject_types_supported;
}
/**
* Gets the grant types supported.
*
* @return the grant types supported
*/
public Set<String> getGrant_types_supported() {
return grant_types_supported;
}
/**
* Sets the grant types supported.
*
* @param grant_types_supported the new grant types supported
*/
public void setGrant_types_supported(Set<String> grant_types_supported) {
this.grant_types_supported = grant_types_supported;
}
/**
* Gets the token endpoint auth methods supported.
*
* @return the token endpoint auth methods supported
*/
public Set<String> getToken_endpoint_auth_methods_supported() {
return token_endpoint_auth_methods_supported;
}
/**
* 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<String> token_endpoint_auth_methods_supported) {
this.token_endpoint_auth_methods_supported = token_endpoint_auth_methods_supported;
}
public Set<String> getId_token_signing_alg_values_supported() {
return id_token_signing_alg_values_supported;
}
public void setId_token_signing_alg_values_supported(Set<String> id_token_signing_alg_values_supported) {
this.id_token_signing_alg_values_supported = id_token_signing_alg_values_supported;
}
} }
@@ -14,12 +14,16 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class OidcAuthorization. * The Class OidcAuthorization.
*/ */
@Entity @Entity
@Table(name = "oidc_authorizations") @Table(name = "oidc_authorizations")
@Getter
@Setter
public class OidcAuthorization { public class OidcAuthorization {
@Id @Id
@@ -34,43 +38,7 @@ public class OidcAuthorization {
@CollectionTable(name = "oidc_authorizations_scopes") @CollectionTable(name = "oidc_authorizations_scopes")
private Set<String> scopes; private Set<String> scopes;
/** /**
* Gets the client.
*
* @return the client
*/
public Long getClient() {
return client;
}
/**
* Sets the client.
*
* @param client the new client
*/
public void setClient(Long client) {
this.client = client;
}
/**
* Gets the subject.
*
* @return the subject
*/
public Long getSubject() {
return subject;
}
/**
* Sets the subject.
*
* @param subject the new subject
*/
public void setSubject(Long subject) {
this.subject = subject;
}
/**
* Gets the scopes. * Gets the scopes.
* *
* @return the scopes * @return the scopes
@@ -78,14 +46,4 @@ public class OidcAuthorization {
public Set<String> getScopes() { public Set<String> getScopes() {
return scopes; return scopes;
} }
/**
* Sets the scopes.
*
* @param scopes the new scopes
*/
public void setScopes(Set<String> scopes) {
this.scopes = scopes;
}
} }
@@ -18,12 +18,16 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class OidcClient. * The Class OidcClient.
*/ */
@Entity @Entity
@Table(name = "oidc_clients") @Table(name = "oidc_clients")
@Getter
@Setter
public class OidcClient { public class OidcClient {
@Id @Id
@@ -75,354 +79,4 @@ public class OidcClient {
@Column(name = "category") @Column(name = "category")
private String category; private String category;
/**
* 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 client name.
*
* @return the client name
*/
public String getClientName() {
return clientName;
}
/**
* Sets the client name.
*
* @param clientName the new client name
*/
public void setClientName(String clientName) {
this.clientName = clientName;
}
/**
* Gets the client id.
*
* @return the client id
*/
public String getClientId() {
return clientId;
}
/**
* Sets the client id.
*
* @param clientId the new client id
*/
public void setClientId(String clientId) {
this.clientId = clientId;
}
/**
* Gets the client secret.
*
* @return the client secret
*/
public String getClientSecret() {
return clientSecret;
}
/**
* Sets the client secret.
*
* @param clientSecret the new client secret
*/
public void setClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
}
/**
* Gets the client authentication methods.
*
* @return the client authentication methods
*/
public Set<OidcClientAuthenticationMethod> getClientAuthenticationMethods() {
return clientAuthenticationMethods;
}
/**
* Sets the client authentication methods.
*
* @param clientAuthenticationMethods the new client authentication methods
*/
public void setClientAuthenticationMethods(Set<OidcClientAuthenticationMethod> clientAuthenticationMethods) {
this.clientAuthenticationMethods = clientAuthenticationMethods;
}
/**
* Gets the authorization grant types.
*
* @return the authorization grant types
*/
public Set<OidcAuthorizationGrantType> getAuthorizationGrantTypes() {
return authorizationGrantTypes;
}
/**
* Sets the authorization grant types.
*
* @param authorizationGrantTypes the new authorization grant types
*/
public void setAuthorizationGrantTypes(Set<OidcAuthorizationGrantType> authorizationGrantTypes) {
this.authorizationGrantTypes = authorizationGrantTypes;
}
/**
* Gets the redirect uris.
*
* @return the redirect uris
*/
public Set<String> getRedirectUris() {
return redirectUris;
}
/**
* Sets the redirect uris.
*
* @param redirectUris the new redirect uris
*/
public void setRedirectUris(Set<String> redirectUris) {
this.redirectUris = redirectUris;
}
/**
* Gets the scopes.
*
* @return the scopes
*/
public Set<String> getScopes() {
return scopes;
}
/**
* Sets the scopes.
*
* @param scopes the new scopes
*/
public void setScopes(Set<String> scopes) {
this.scopes = scopes;
}
/**
* Gets the token lifetime.
*
* @return the token lifetime
*/
public Long getTokenLifetime() {
return tokenLifetime;
}
/**
* Sets the token lifetime.
*
* @param tokenLifetime the new token lifetime
*/
public void setTokenLifetime(Long tokenLifetime) {
this.tokenLifetime = tokenLifetime;
}
/**
* Gets the login url.
*
* @return the login url
*/
public String getLoginUrl() {
return loginUrl;
}
/**
* Sets the login url.
*
* @param loginUrl the new login url
*/
public void setLoginUrl(String loginUrl) {
this.loginUrl = loginUrl;
}
/**
* Gets the frontchannel logout uri.
*
* @return the frontchannel logout uri
*/
public String getFrontchannelLogoutUri() {
return frontchannelLogoutUri;
}
/**
* Sets the frontchannel logout uri.
*
* @param frontchannelLogoutUri the new frontchannel logout uri
*/
public void setFrontchannelLogoutUri(String frontchannelLogoutUri) {
this.frontchannelLogoutUri = frontchannelLogoutUri;
}
/**
* Checks if is frontchannel logout session required.
*
* @return true, if is frontchannel logout session required
*/
public boolean isFrontchannelLogoutSessionRequired() {
return frontchannelLogoutSessionRequired;
}
/**
* Sets the frontchannel logout session required.
*
* @param frontchannelLogoutSessionRequired the new frontchannel logout session
* required
*/
public void setFrontchannelLogoutSessionRequired(boolean frontchannelLogoutSessionRequired) {
this.frontchannelLogoutSessionRequired = frontchannelLogoutSessionRequired;
}
/**
* Gets the backchannel logout uri.
*
* @return the backchannel logout uri
*/
public String getBackchannelLogoutUri() {
return backchannelLogoutUri;
}
/**
* Sets the backchannel logout uri.
*
* @param backchannelLogoutUri the new backchannel logout uri
*/
public void setBackchannelLogoutUri(String backchannelLogoutUri) {
this.backchannelLogoutUri = backchannelLogoutUri;
}
/**
* Checks if is backchannel logout session required.
*
* @return true, if is backchannel logout session required
*/
public boolean isBackchannelLogoutSessionRequired() {
return backchannelLogoutSessionRequired;
}
/**
* Sets the backchannel logout session required.
*
* @param backchannelLogoutSessionRequired the new backchannel logout session
* required
*/
public void setBackchannelLogoutSessionRequired(boolean backchannelLogoutSessionRequired) {
this.backchannelLogoutSessionRequired = backchannelLogoutSessionRequired;
}
/**
* Checks if is authorize.
*
* @return true, if is authorize
*/
public boolean isAuthorize() {
return authorize;
}
/**
* Sets the authorize.
*
* @param authorize the new authorize
*/
public void setAuthorize(boolean authorize) {
this.authorize = authorize;
}
/**
* @return the aliasAllowed
*/
public boolean isAliasAllowed() {
return aliasAllowed;
}
/**
* @param aliasAllowed the aliasAllowed to set
*/
public void setAliasAllowed(boolean aliasAllowed) {
this.aliasAllowed = aliasAllowed;
}
/**
* @return the aliasQuota
*/
public boolean isAliasQuota() {
return aliasQuota;
}
/**
* @param aliasQuota the aliasQuota to set
*/
public void setAliasQuota(boolean aliasQuota) {
this.aliasQuota = aliasQuota;
}
/**
* @return the aliasSubject
*/
public boolean isAliasSubject() {
return aliasSubject;
}
/**
* @param aliasSubject the aliasSubject to set
*/
public void setAliasSubject(boolean aliasSubject) {
this.aliasSubject = aliasSubject;
}
/**
* Checks if is always permitted.
*
* @return true, if is always permitted
*/
public boolean isAlwaysPermitted() {
return alwaysPermitted;
}
/**
* 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() {
return category;
}
/**
* Sets the category.
*
* @param category the new category
*/
public void setCategory(String category) {
this.category = category;
}
} }
@@ -9,12 +9,16 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class OidcSession. * The Class OidcSession.
*/ */
@Entity @Entity
@Table(name = "oidc_sessions") @Table(name = "oidc_sessions")
@Getter
@Setter
public class OidcSession { public class OidcSession {
@Id @Id
@@ -22,7 +26,7 @@ public class OidcSession {
@Column(name = "id") @Column(name = "id")
private Long id; private Long id;
@Column(name = "client_id") @Column(name = "client_id")
private Long client; private Long clientId;
@Column(name = "subject") @Column(name = "subject")
private Long subject; private Long subject;
@Column(name = "sid") @Column(name = "sid")
@@ -32,112 +36,4 @@ public class OidcSession {
@Column(name = "spring_session_id") @Column(name = "spring_session_id")
private String springSession; private String springSession;
/**
* 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 client id.
*
* @return the client id
*/
public Long getClientId() {
return client;
}
/**
* Sets the client id.
*
* @param clientId the new client id
*/
public void setClientId(Long clientId) {
this.client = clientId;
}
/**
* Gets the subject.
*
* @return the subject
*/
public Long getSubject() {
return subject;
}
/**
* Sets the subject.
*
* @param subject the new subject
*/
public void setSubject(Long subject) {
this.subject = subject;
}
/**
* Gets the sid.
*
* @return the sid
*/
public String getSid() {
return sid;
}
/**
* Sets the sid.
*
* @param sid the new sid
*/
public void setSid(String sid) {
this.sid = sid;
}
/**
* Gets the id token.
*
* @return the id token
*/
public String getIdToken() {
return idToken;
}
/**
* Sets the id token.
*
* @param idToken the new id token
*/
public void setIdToken(String idToken) {
this.idToken = idToken;
}
/**
* Gets the spring session.
*
* @return the spring session
*/
public String getSpringSession() {
return springSession;
}
/**
* Sets the spring session.
*
* @param springSession the new spring session
*/
public void setSpringSession(String springSession) {
this.springSession = springSession;
}
} }
@@ -16,12 +16,16 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class OidcToken. * The Class OidcToken.
*/ */
@Entity @Entity
@Table(name = "oidc_tokens") @Table(name = "oidc_tokens")
@Getter
@Setter
public class OidcToken { public class OidcToken {
@Id @Id
@@ -48,180 +52,4 @@ public class OidcToken {
@ElementCollection(fetch = FetchType.EAGER) @ElementCollection(fetch = FetchType.EAGER)
private Set<String> scopes; private Set<String> scopes;
/**
* 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 created.
*
* @return the created
*/
public Instant getCreated() {
return created;
}
/**
* Sets the created.
*
* @param created the new created
*/
public void setCreated(Instant created) {
this.created = created;
}
/**
* Gets the user id.
*
* @return the user id
*/
public Long getUserId() {
return userId;
}
/**
* Sets the user id.
*
* @param userId the new user id
*/
public void setUserId(Long userId) {
this.userId = userId;
}
/**
* @return the alias
*/
public String getAlias() {
return alias;
}
/**
* @param alias the alias to set
*/
public void setAlias(String alias) {
this.alias = alias;
}
/**
* Gets the client.
*
* @return the client
*/
public Long getClient() {
return client;
}
/**
* Sets the client.
*
* @param client the new client
*/
public void setClient(Long client) {
this.client = client;
}
/**
* Gets the access token.
*
* @return the access token
*/
public String getAccessToken() {
return accessToken;
}
/**
* Sets the access token.
*
* @param accessToken the new access token
*/
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
/**
* Gets the refresh token.
*
* @return the refresh token
*/
public String getRefreshToken() {
return refreshToken;
}
/**
* Sets the refresh token.
*
* @param refreshToken the new refresh token
*/
public void setRefreshToken(String refreshToken) {
this.refreshToken = refreshToken;
}
/**
* Gets the expires in.
*
* @return the expires in
*/
public Long getExpiresIn() {
return expiresIn;
}
/**
* Sets the expires in.
*
* @param expiresIn the new expires in
*/
public void setExpiresIn(Long expiresIn) {
this.expiresIn = expiresIn;
}
/**
* Gets the id token.
*
* @return the id token
*/
public String getIdToken() {
return idToken;
}
/**
* 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<String> getScopes() {
return scopes;
}
/**
* Sets the scopes.
*
* @param scopes the new scopes
*/
public void setScopes(Set<String> scopes) {
this.scopes = scopes;
}
} }
+7
View File
@@ -35,5 +35,12 @@
<version>${querydsl.version}</version> <version>${querydsl.version}</version>
<classifier>jakarta</classifier> <classifier>jakarta</classifier>
</dependency> </dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>
@@ -3,67 +3,18 @@
*/ */
package de.bstly.we.partey.api.controller.model; package de.bstly.we.partey.api.controller.model;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class CharacterTexture. * The Class CharacterTexture.
*/ */
@Getter
@Setter
public class CharacterTexture { public class CharacterTexture {
private String id; private String id;
private String url; private String url;
private String layer; private String layer;
/**
* Gets the id.
*
* @return the id
*/
public String getId() {
return id;
}
/**
* Sets the id.
*
* @param id the new id
*/
public void setId(String id) {
this.id = id;
}
/**
* Gets the url.
*
* @return the url
*/
public String getUrl() {
return url;
}
/**
* Sets the url.
*
* @param url the new url
*/
public void setUrl(String url) {
this.url = url;
}
/**
* Gets the layer.
*
* @return the layer
*/
public String getLayer() {
return layer;
}
/**
* Sets the layer.
*
* @param layer the new layer
*/
public void setLayer(String layer) {
this.layer = layer;
}
} }
@@ -6,10 +6,14 @@ package de.bstly.we.partey.api.controller.model;
import java.util.List; import java.util.List;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class MapDetailsData. * The Class MapDetailsData.
*/ */
@Getter
@Setter
public class MapDetailsData { public class MapDetailsData {
private String mapUrl = ""; private String mapUrl = "";
@@ -27,200 +31,4 @@ public class MapDetailsData {
private boolean showPoweredBy = false; private boolean showPoweredBy = false;
private Object thirdParty; private Object thirdParty;
/**
* @return the mapUrl
*/
public String getMapUrl() {
return mapUrl;
}
/**
* @param mapUrl the mapUrl to set
*/
public void setMapUrl(String mapUrl) {
this.mapUrl = mapUrl;
}
/**
* @return the authenticationMandatory
*/
public boolean isAuthenticationMandatory() {
return authenticationMandatory;
}
/**
* @param authenticationMandatory the authenticationMandatory to set
*/
public void setAuthenticationMandatory(boolean authenticationMandatory) {
this.authenticationMandatory = authenticationMandatory;
}
/**
* @return the group
*/
public String getGroup() {
return group;
}
/**
* @param group the group to set
*/
public void setGroup(String group) {
this.group = group;
}
/**
* @return the mucRooms
*/
public List<Object> getMucRooms() {
return mucRooms;
}
/**
* @param mucRooms the mucRooms to set
*/
public void setMucRooms(List<Object> mucRooms) {
this.mucRooms = mucRooms;
}
/**
* @return the contactPage
*/
public String getContactPage() {
return contactPage;
}
/**
* @param contactPage the contactPage to set
*/
public void setContactPage(String contactPage) {
this.contactPage = contactPage;
}
/**
* @return the iframeAuthentication
*/
public String getIframeAuthentication() {
return iframeAuthentication;
}
/**
* @param iframeAuthentication the iframeAuthentication to set
*/
public void setIframeAuthentication(String iframeAuthentication) {
this.iframeAuthentication = iframeAuthentication;
}
/**
* @return the expireOn
*/
public String getExpireOn() {
return expireOn;
}
/**
* @param expireOn the expireOn to set
*/
public void setExpireOn(String expireOn) {
this.expireOn = expireOn;
}
/**
* @return the canReport
*/
public boolean isCanReport() {
return canReport;
}
/**
* @param canReport the canReport to set
*/
public void setCanReport(boolean canReport) {
this.canReport = canReport;
}
/**
* @return the loadingCowebsiteLogo
*/
public String getLoadingCowebsiteLogo() {
return loadingCowebsiteLogo;
}
/**
* @param loadingCowebsiteLogo the loadingCowebsiteLogo to set
*/
public void setLoadingCowebsiteLogo(String loadingCowebsiteLogo) {
this.loadingCowebsiteLogo = loadingCowebsiteLogo;
}
/**
* @return the miniLogo
*/
public String getMiniLogo() {
return miniLogo;
}
/**
* @param miniLogo the miniLogo to set
*/
public void setMiniLogo(String miniLogo) {
this.miniLogo = miniLogo;
}
/**
* @return the loadingLogo
*/
public String getLoadingLogo() {
return loadingLogo;
}
/**
* @param loadingLogo the loadingLogo to set
*/
public void setLoadingLogo(String loadingLogo) {
this.loadingLogo = loadingLogo;
}
/**
* @return the loginSceneLogo
*/
public String getLoginSceneLogo() {
return loginSceneLogo;
}
/**
* @param loginSceneLogo the loginSceneLogo to set
*/
public void setLoginSceneLogo(String loginSceneLogo) {
this.loginSceneLogo = loginSceneLogo;
}
/**
* @return the showPoweredBy
*/
public boolean isShowPoweredBy() {
return showPoweredBy;
}
/**
* @param showPoweredBy the showPoweredBy to set
*/
public void setShowPoweredBy(boolean showPoweredBy) {
this.showPoweredBy = showPoweredBy;
}
/**
* @return the thirdParty
*/
public Object getThirdParty() {
return thirdParty;
}
/**
* @param thirdParty the thirdParty to set
*/
public void setThirdParty(Object thirdParty) {
this.thirdParty = thirdParty;
}
} }
@@ -6,10 +6,14 @@ package de.bstly.we.partey.api.controller.model;
import java.util.List; import java.util.List;
import com.beust.jcommander.internal.Lists; import com.beust.jcommander.internal.Lists;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class MemberData. * The Class MemberData.
*/ */
@Getter
@Setter
public class MemberData { public class MemberData {
private String email; private String email;
@@ -24,190 +28,4 @@ public class MemberData {
private String jabberPassword; private String jabberPassword;
private List<Object> mucRooms = Lists.newArrayList(); private List<Object> mucRooms = Lists.newArrayList();
/**
* Gets the email.
*
* @return the email
*/
public String getEmail() {
return email;
}
/**
* Sets the email.
*
* @param email the new email
*/
public void setEmail(String email) {
this.email = email;
}
/**
* Gets the user uuid.
*
* @return the user uuid
*/
public String getUserUuid() {
return userUuid;
}
/**
* 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<String> getTags() {
return tags;
}
/**
* Sets the tags.
*
* @param tags the new tags
*/
public void setTags(List<String> tags) {
this.tags = tags;
}
/**
* Gets the visit card url.
*
* @return the visit card url
*/
public String getVisitCardUrl() {
return visitCardUrl;
}
/**
* 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<CharacterTexture> getTextures() {
return textures;
}
/**
* Sets the textures.
*
* @param textures the new textures
*/
public void setTextures(List<CharacterTexture> textures) {
this.textures = textures;
}
/**
* Gets the messages.
*
* @return the messages
*/
public List<Object> getMessages() {
return messages;
}
/**
* Sets the messages.
*
* @param messages the new messages
*/
public void setMessages(List<Object> messages) {
this.messages = messages;
}
/**
* Checks if is anonymous.
*
* @return true, if is anonymous
*/
public boolean isAnonymous() {
return anonymous;
}
/**
* Sets the anonymous.
*
* @param anonymous the new anonymous
*/
public void setAnonymous(boolean anonymous) {
this.anonymous = anonymous;
}
/**
* Gets the user room token.
*
* @return the user room token
*/
public String getUserRoomToken() {
return userRoomToken;
}
/**
* Sets the user room token.
*
* @param userRoomToken the new user room token
*/
public void setUserRoomToken(String userRoomToken) {
this.userRoomToken = userRoomToken;
}
/**
* @return the jabberId
*/
public String getJabberId() {
return jabberId;
}
/**
* @param jabberId the jabberId to set
*/
public void setJabberId(String jabberId) {
this.jabberId = jabberId;
}
/**
* @return the jabberPassword
*/
public String getJabberPassword() {
return jabberPassword;
}
/**
* @param jabberPassword the jabberPassword to set
*/
public void setJabberPassword(String jabberPassword) {
this.jabberPassword = jabberPassword;
}
/**
* @return the mucRooms
*/
public List<Object> getMucRooms() {
return mucRooms;
}
/**
* @param mucRooms the mucRooms to set
*/
public void setMucRooms(List<Object> mucRooms) {
this.mucRooms = mucRooms;
}
} }
@@ -3,9 +3,14 @@
*/ */
package de.bstly.we.partey.api.controller.model; package de.bstly.we.partey.api.controller.model;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class UserReport. * The Class UserReport.
*/ */
@Getter
@Setter
public class UserReport { public class UserReport {
private String reportedUserUuid; private String reportedUserUuid;
@@ -13,76 +18,4 @@ public class UserReport {
private String reporterUserUuid; private String reporterUserUuid;
private String reportWorldSlug; private String reportWorldSlug;
/**
* Gets the reported user uuid.
*
* @return the reported user uuid
*/
public String getReportedUserUuid() {
return reportedUserUuid;
}
/**
* Sets the reported user uuid.
*
* @param reportedUserUuid the new reported user uuid
*/
public void setReportedUserUuid(String reportedUserUuid) {
this.reportedUserUuid = reportedUserUuid;
}
/**
* Gets the reported user comment.
*
* @return the reported user comment
*/
public String getReportedUserComment() {
return reportedUserComment;
}
/**
* Sets the reported user comment.
*
* @param reportedUserComment the new reported user comment
*/
public void setReportedUserComment(String reportedUserComment) {
this.reportedUserComment = reportedUserComment;
}
/**
* Gets the reporter user uuid.
*
* @return the reporter user uuid
*/
public String getReporterUserUuid() {
return reporterUserUuid;
}
/**
* Sets the reporter user uuid.
*
* @param reporterUserUuid the new reporter user uuid
*/
public void setReporterUserUuid(String reporterUserUuid) {
this.reporterUserUuid = reporterUserUuid;
}
/**
* Gets the report world slug.
*
* @return the report world slug
*/
public String getReportWorldSlug() {
return reportWorldSlug;
}
/**
* Sets the report world slug.
*
* @param reportWorldSlug the new report world slug
*/
public void setReportWorldSlug(String reportWorldSlug) {
this.reportWorldSlug = reportWorldSlug;
}
} }
@@ -4,68 +4,18 @@
package de.bstly.we.partey.api.controller.model; package de.bstly.we.partey.api.controller.model;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class WokaCollection. * The Class WokaCollection.
*/ */
@Getter
@Setter
public class WokaCollection { public class WokaCollection {
private String name; private String name;
private int position; private int position;
private List<WokaTexture> textures; private List<WokaTexture> textures;
/**
* 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 position.
*
* @return the position
*/
public int getPosition() {
return position;
}
/**
* Sets the position.
*
* @param position the new position
*/
public void setPosition(int position) {
this.position = position;
}
/**
* Gets the textures.
*
* @return the textures
*/
public List<WokaTexture> getTextures() {
return textures;
}
/**
* Sets the textures.
*
* @param textures the new textures
*/
public void setTextures(List<WokaTexture> textures) {
this.textures = textures;
}
} }
@@ -4,49 +4,16 @@
package de.bstly.we.partey.api.controller.model; package de.bstly.we.partey.api.controller.model;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class WokaLayer. * The Class WokaLayer.
*/ */
@Getter
@Setter
public class WokaLayer { public class WokaLayer {
private boolean required; private boolean required;
private List<WokaCollection> collections; private List<WokaCollection> collections;
/**
* Checks if is required.
*
* @return true, if is required
*/
public boolean isRequired() {
return required;
}
/**
* Sets the required.
*
* @param required the new required
*/
public void setRequired(boolean required) {
this.required = required;
}
/**
* Gets the collections.
*
* @return the collections
*/
public List<WokaCollection> getCollections() {
return collections;
}
/**
* Sets the collections.
*
* @param collections the new collections
*/
public void setCollections(List<WokaCollection> collections) {
this.collections = collections;
}
} }
@@ -3,9 +3,14 @@
*/ */
package de.bstly.we.partey.api.controller.model; package de.bstly.we.partey.api.controller.model;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class WokaTexture. * The Class WokaTexture.
*/ */
@Getter
@Setter
public class WokaTexture { public class WokaTexture {
private String id; private String id;
@@ -13,76 +18,4 @@ public class WokaTexture {
private String url; private String url;
private int position; private int position;
/**
* Gets the id.
*
* @return the id
*/
public String getId() {
return id;
}
/**
* Sets the id.
*
* @param id the new id
*/
public void setId(String 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 url.
*
* @return the url
*/
public String getUrl() {
return url;
}
/**
* Sets the url.
*
* @param url the new url
*/
public void setUrl(String url) {
this.url = url;
}
/**
* Gets the position.
*
* @return the position
*/
public int getPosition() {
return position;
}
/**
* Sets the position.
*
* @param position the new position
*/
public void setPosition(int position) {
this.position = position;
}
} }
@@ -3,9 +3,14 @@
*/ */
package de.bstly.we.partey.businesslogic.model; package de.bstly.we.partey.businesslogic.model;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class Room. * The Class Room.
*/ */
@Getter
@Setter
public class Room { public class Room {
private String url; private String url;
@@ -13,72 +18,4 @@ public class Room {
private String mapUrl; private String mapUrl;
private boolean authenticationMandatory; private boolean authenticationMandatory;
/**
* Gets the url.
*
* @return the url
*/
public String getUrl() {
return url;
}
/**
* Sets the url.
*
* @param url the new url
*/
public void setUrl(String url) {
this.url = url;
}
/**
* Gets the map id.
*
* @return the map id
*/
public String getMapId() {
return mapId;
}
/**
* Sets the map id.
*
* @param mapId the new map id
*/
public void setMapId(String mapId) {
this.mapId = mapId;
}
/**
* Gets the map url.
*
* @return the map url
*/
public String getMapUrl() {
return mapUrl;
}
/**
* Sets the map url.
*
* @param mapUrl the new map url
*/
public void setMapUrl(String mapUrl) {
this.mapUrl = mapUrl;
}
/**
* @return the authenticationMandatory
*/
public boolean isAuthenticationMandatory() {
return authenticationMandatory;
}
/**
* @param authenticationMandatory the authenticationMandatory to set
*/
public void setAuthenticationMandatory(boolean authenticationMandatory) {
this.authenticationMandatory = authenticationMandatory;
}
} }
@@ -15,12 +15,16 @@ import jakarta.persistence.Enumerated;
import jakarta.persistence.FetchType; import jakarta.persistence.FetchType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class ParteyMap. * The Class ParteyMap.
*/ */
@Entity @Entity
@Table(name = "partey_maps") @Table(name = "partey_maps")
@Getter
@Setter
public class ParteyMap { public class ParteyMap {
@Id @Id
@@ -31,58 +35,4 @@ public class ParteyMap {
@CollectionTable(name = "partey_maps_tags") @CollectionTable(name = "partey_maps_tags")
private List<String> tags = Lists.newArrayList(); private List<String> tags = Lists.newArrayList();
/**
* Gets the id.
*
* @return the id
*/
public String getId() {
return id;
}
/**
* Sets the id.
*
* @param id the new id
*/
public void setId(String id) {
this.id = id;
}
/**
* Gets the policy type.
*
* @return the policy type
*/
public GameRoomPolicyTypes getPolicyType() {
return policyType;
}
/**
* 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<String> getTags() {
return tags;
}
/**
* Sets the tags.
*
* @param tags the new tags
*/
public void setTags(List<String> tags) {
this.tags = tags;
}
} }
@@ -11,11 +11,15 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Lob; import jakarta.persistence.Lob;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class ParteyUserReport. * The Class ParteyUserReport.
*/ */
@Entity @Entity
@Getter
@Setter
public class ParteyUserReport { public class ParteyUserReport {
@Id @Id
@@ -30,112 +34,4 @@ public class ParteyUserReport {
private String world; private String world;
private Instant created; private Instant created;
/**
* 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 reporter.
*
* @return the reporter
*/
public Long getReporter() {
return reporter;
}
/**
* 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() {
return user;
}
/**
* 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() {
return comment;
}
/**
* 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() {
return world;
}
/**
* 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() {
return created;
}
/**
* Sets the created.
*
* @param created the new created
*/
public void setCreated(Instant created) {
this.created = created;
}
} }
@@ -8,11 +8,15 @@ import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class ParteyUserReportModerator. * The Class ParteyUserReportModerator.
*/ */
@Entity @Entity
@Getter
@Setter
public class ParteyUserReportModerator { public class ParteyUserReportModerator {
@Id @Id
@@ -23,58 +27,4 @@ public class ParteyUserReportModerator {
@Column(columnDefinition = "boolean default false") @Column(columnDefinition = "boolean default false")
private boolean disabled; private boolean disabled;
/**
* 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 email.
*
* @return the email
*/
public String getEmail() {
return email;
}
/**
* Sets the email.
*
* @param email the new email
*/
public void setEmail(String email) {
this.email = email;
}
/**
* Checks if is disabled.
*
* @return true, if is disabled
*/
public boolean isDisabled() {
return disabled;
}
/**
* Sets the disabled.
*
* @param disabled the new disabled
*/
public void setDisabled(boolean disabled) {
this.disabled = disabled;
}
} }
@@ -6,14 +6,17 @@ package de.bstly.we.partey.model;
import java.io.Serializable; import java.io.Serializable;
import java.time.Instant; import java.time.Instant;
import de.bstly.we.model.UserData;
import de.bstly.we.partey.model.ParteyUserTag.ParteyUserTagId;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.IdClass; import jakarta.persistence.IdClass;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import de.bstly.we.model.UserData; import lombok.Getter;
import de.bstly.we.partey.model.ParteyUserTag.ParteyUserTagId; import lombok.NoArgsConstructor;
import lombok.Setter;
/** /**
* The Class ParteyUserTag. * The Class ParteyUserTag.
@@ -21,6 +24,8 @@ import de.bstly.we.partey.model.ParteyUserTag.ParteyUserTagId;
@Entity @Entity
@IdClass(ParteyUserTagId.class) @IdClass(ParteyUserTagId.class)
@Table(name = "partey_user_tags") @Table(name = "partey_user_tags")
@Getter
@Setter
public class ParteyUserTag implements UserData { public class ParteyUserTag implements UserData {
@Id @Id
@@ -34,99 +39,10 @@ public class ParteyUserTag implements UserData {
@Column(name = "username", nullable = false) @Column(name = "username", nullable = false)
private String username; private String username;
/** @Getter
* Gets the target. @Setter
* @NoArgsConstructor
* @return the target @AllArgsConstructor
*/
public Long getTarget() {
return target;
}
/**
* 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() {
return tag;
}
/**
* Sets the tag.
*
* @param tag the new tag
*/
public void setTag(String tag) {
this.tag = tag;
}
/**
* Gets the starts.
*
* @return the starts
*/
public Instant getStarts() {
return starts;
}
/**
* 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() {
return expires;
}
/**
* Sets the expires.
*
* @param expires the new expires
*/
public void setExpires(Instant expires) {
this.expires = expires;
}
/**
* Gets the username.
*
* @return the username
*/
public String getUsername() {
return username;
}
/**
* Sets the username.
*
* @param username the new username
*/
public void setUsername(String username) {
this.username = username;
}
/**
* The Class ParteyUserTagId.
*/
public static class ParteyUserTagId implements Serializable { public static class ParteyUserTagId implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@@ -134,61 +50,6 @@ public class ParteyUserTag implements UserData {
private Long target; private Long target;
private String tag; private String tag;
/**
* Instantiates a new partey user tag id.
*/
public ParteyUserTagId() {
super();
}
/**
* Instantiates a new partey user tag id.
*
* @param target the target
* @param tag the tag
*/
public ParteyUserTagId(Long target, String tag) {
super();
this.target = target;
this.tag = tag;
}
/**
* Gets the target.
*
* @return the target
*/
public Long getTarget() {
return target;
}
/**
* 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() {
return tag;
}
/**
* Sets the tag.
*
* @param tag the new tag
*/
public void setTag(String tag) {
this.tag = tag;
}
/* /*
* @see java.lang.Object#equals(java.lang.Object) * @see java.lang.Object#equals(java.lang.Object)
*/ */
@@ -15,12 +15,16 @@ import jakarta.persistence.Entity;
import jakarta.persistence.FetchType; import jakarta.persistence.FetchType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class ParteyUserTextures. * The Class ParteyUserTextures.
*/ */
@Entity @Entity
@Table(name = "partey_user_textures") @Table(name = "partey_user_textures")
@Getter
@Setter
public class ParteyUserTextures implements UserData { public class ParteyUserTextures implements UserData {
@Id @Id
@@ -31,58 +35,4 @@ public class ParteyUserTextures implements UserData {
@CollectionTable(name = "partey_user_textures_list") @CollectionTable(name = "partey_user_textures_list")
private List<String> textures = Lists.newArrayList(); private List<String> textures = Lists.newArrayList();
/**
* Gets the target.
*
* @return the target
*/
public Long getTarget() {
return target;
}
/**
* Sets the target.
*
* @param target the new target
*/
public void setTarget(Long target) {
this.target = target;
}
/**
* Gets the username.
*
* @return the username
*/
public String getUsername() {
return username;
}
/**
* Sets the username.
*
* @param username the new username
*/
public void setUsername(String username) {
this.username = username;
}
/**
* Gets the textures.
*
* @return the textures
*/
public List<String> getTextures() {
return textures;
}
/**
* Sets the textures.
*
* @param textures the new textures
*/
public void setTextures(List<String> textures) {
this.textures = textures;
}
} }
@@ -18,12 +18,16 @@ import jakarta.persistence.Transient;
import de.bstly.we.model.UserData; import de.bstly.we.model.UserData;
import de.bstly.we.model.Visibility; import de.bstly.we.model.Visibility;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class Timeslot. * The Class Timeslot.
*/ */
@Entity @Entity
@Table(name = "timeslots") @Table(name = "timeslots")
@Getter
@Setter
public class Timeslot implements UserData { public class Timeslot implements UserData {
@Id @Id
@@ -57,238 +61,4 @@ public class Timeslot implements UserData {
@Transient @Transient
private String username; private String username;
/**
* 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 owner.
*
* @return the owner
*/
public Long getOwner() {
return owner;
}
/**
* 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() {
return type;
}
/**
* 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() {
return starts;
}
/**
* 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() {
return ends;
}
/**
* 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() {
return visibility;
}
/**
* 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() {
return title;
}
/**
* 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() {
return description;
}
/**
* Sets the description.
*
* @param description the new description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* Gets the share.
*
* @return the share
*/
public String getShare() {
return share;
}
/**
* Sets the share.
*
* @param share the new share
*/
public void setShare(String share) {
this.share = share;
}
/**
* Gets the stream.
*
* @return the stream
*/
public String getStream() {
return stream;
}
/**
* 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() {
return secret;
}
/**
* Sets the secret.
*
* @param secret the new secret
*/
public void setSecret(String secret) {
this.secret = secret;
}
/**
* Checks if is clear after.
*
* @return true, if is clear after
*/
public boolean isClearAfter() {
return clearAfter;
}
/**
* 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() {
return username;
}
/**
* Sets the username.
*
* @param username the new username
*/
public void setUsername(String username) {
this.username = username;
}
} }
+1 -1
View File
@@ -22,7 +22,7 @@
<unit-api.version>2.2</unit-api.version> <unit-api.version>2.2</unit-api.version>
<commons-csv.version>1.14.1</commons-csv.version> <commons-csv.version>1.14.1</commons-csv.version>
<dnsjava.version>3.6.3</dnsjava.version> <dnsjava.version>3.6.3</dnsjava.version>
<revision>3.6.0</revision> <revision>3.7.0</revision>
</properties> </properties>
<parent> <parent>
+7
View File
@@ -30,5 +30,12 @@
<version>${querydsl.version}</version> <version>${querydsl.version}</version>
<classifier>jakarta</classifier> <classifier>jakarta</classifier>
</dependency> </dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>
@@ -8,12 +8,18 @@ import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/** /**
* The Class Service. * The Class Service.
*/ */
@Entity @Entity
@Table(name = "services", uniqueConstraints = @UniqueConstraint(columnNames = { "name" })) @Table(name = "services", uniqueConstraints = @UniqueConstraint(columnNames = { "name" }))
@Getter
@Setter
@NoArgsConstructor
public class Service { public class Service {
@Id @Id
@@ -29,14 +35,6 @@ public class Service {
private String permission; private String permission;
@Column(name = "category") @Column(name = "category")
private String category; private String category;
/**
* Instantiates a new service.
*/
public Service() {
super();
}
/** /**
* Instantiates a new service. * Instantiates a new service.
* *
@@ -49,112 +47,4 @@ public class Service {
this.url = url; this.url = url;
} }
/**
* 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 url.
*
* @return the url
*/
public String getUrl() {
return url;
}
/**
* Sets the url.
*
* @param url the new url
*/
public void setUrl(String url) {
this.url = url;
}
/**
* Checks if is always permitted.
*
* @return true, if is always permitted
*/
public boolean isAlwaysPermitted() {
return alwaysPermitted;
}
/**
* Sets the always permitted.
*
* @param alwaysPermitted the new always permitted
*/
public void setAlwaysPermitted(boolean alwaysPermitted) {
this.alwaysPermitted = alwaysPermitted;
}
/**
* Checks if is same site.
*
* @return true, if is same site
*/
public boolean isSameSite() {
return sameSite;
}
/**
* 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() {
return permission;
}
/**
* 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() {
return category;
}
/**
* Sets the category.
*
* @param category the new category
*/
public void setCategory(String category) {
this.category = category;
}
} }
+7
View File
@@ -25,5 +25,12 @@
<version>${querydsl.version}</version> <version>${querydsl.version}</version>
<classifier>jakarta</classifier> <classifier>jakarta</classifier>
</dependency> </dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
</project> </project>
@@ -4,10 +4,14 @@
package de.bstly.we.urlshortener.controller.model; package de.bstly.we.urlshortener.controller.model;
import java.time.Instant; import java.time.Instant;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class ShortenedUrlModel. * The Class ShortenedUrlModel.
*/ */
@Getter
@Setter
public class ShortenedUrlModel { public class ShortenedUrlModel {
private String code; private String code;
@@ -20,166 +24,4 @@ public class ShortenedUrlModel {
private boolean queryParameters; private boolean queryParameters;
private boolean newPassword; private boolean newPassword;
/**
* Gets the code.
*
* @return the code
*/
public String getCode() {
return code;
}
/**
* Sets the code.
*
* @param code the new code
*/
public void setCode(String code) {
this.code = code;
}
/**
* Gets the new code.
*
* @return the new code
*/
public String getNewCode() {
return newCode;
}
/**
* 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() {
return url;
}
/**
* 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() {
return note;
}
/**
* 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() {
return expires;
}
/**
* 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() {
return password;
}
/**
* Sets the password.
*
* @param password the new password
*/
public void setPassword(String password) {
this.password = password;
}
/**
* Gets the password 2.
*
* @return the password 2
*/
public String getPassword2() {
return password2;
}
/**
* Sets the password 2.
*
* @param password2 the new password 2
*/
public void setPassword2(String password2) {
this.password2 = password2;
}
/**
* Checks if is query parameters.
*
* @return true, if is query parameters
*/
public boolean isQueryParameters() {
return queryParameters;
}
/**
* Sets the query parameters.
*
* @param queryParameters the new query parameters
*/
public void setQueryParameters(boolean queryParameters) {
this.queryParameters = queryParameters;
}
/**
* Checks if is new password.
*
* @return true, if is new password
*/
public boolean isNewPassword() {
return newPassword;
}
/**
* Sets the new password.
*
* @param newPassword the new new password
*/
public void setNewPassword(boolean newPassword) {
this.newPassword = newPassword;
}
} }
@@ -5,14 +5,6 @@ package de.bstly.we.urlshortener.model;
import java.time.Instant; import java.time.Instant;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
@@ -20,6 +12,15 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import de.bstly.we.businesslogic.support.AbstractModelEventListener; import de.bstly.we.businesslogic.support.AbstractModelEventListener;
import de.bstly.we.model.UserData; import de.bstly.we.model.UserData;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;
import lombok.Getter;
import lombok.Setter;
/** /**
* The Class ShortenedUrl. * The Class ShortenedUrl.
@@ -27,6 +28,8 @@ import de.bstly.we.model.UserData;
@Entity @Entity
@Table(name = "shortened_urls") @Table(name = "shortened_urls")
@EntityListeners(AbstractModelEventListener.class) @EntityListeners(AbstractModelEventListener.class)
@Getter
@Setter
public class ShortenedUrl implements UserData { public class ShortenedUrl implements UserData {
@Id @Id
@@ -50,157 +53,7 @@ public class ShortenedUrl implements UserData {
@Transient @Transient
private boolean hasPassword; private boolean hasPassword;
/**
* Gets the code.
*
* @return the code
*/
public String getCode() {
return code;
}
/**
* 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() {
return owner;
}
/**
* 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() {
return url;
}
/**
* 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() {
return expires;
}
/**
* Sets the expires.
*
* @param expires the new expires
*/
public void setExpires(Instant expires) {
this.expires = expires;
}
/**
* Gets the password hash.
*
* @return the password hash
*/
public String getPasswordHash() {
return passwordHash;
}
/**
* 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() {
return link;
}
/**
* 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() {
return note;
}
/**
* Sets the note.
*
* @param note the new note
*/
public void setNote(String note) {
this.note = note;
}
/**
* Checks if is query parameters.
*
* @return true, if is query parameters
*/
public boolean isQueryParameters() {
return queryParameters;
}
/**
* Sets the query parameters.
*
* @param queryParameters the new query parameters
*/
public void setQueryParameters(boolean queryParameters) {
this.queryParameters = queryParameters;
}
/**
* Checks if is checks for password.
*
* @return true, if is checks for password
*/
public boolean isHasPassword() { public boolean isHasPassword() {
return StringUtils.hasText(passwordHash); return StringUtils.hasText(passwordHash);
} }
} }