Commit 2edbe1bf authored by Riegel's avatar Riegel
Browse files

Build: Remove CityDoctorWebService module

parent 04387e46
package de.hft.stuttgart.citydoctor2.webservice.model;
import java.util.List;
public class AvailableChecksReturnType {
private List<CheckReturnType> geometricChecks;
private List<CheckReturnType> semanticChecks;
public List<CheckReturnType> getGeometricChecks() {
return geometricChecks;
}
public void setGeometricChecks(List<CheckReturnType> geometricChecks) {
this.geometricChecks = geometricChecks;
}
public List<CheckReturnType> getSemanticChecks() {
return semanticChecks;
}
public void setSemanticChecks(List<CheckReturnType> semanticChecks) {
this.semanticChecks = semanticChecks;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model;
import java.util.ArrayList;
import java.util.List;
import de.hft.stuttgart.citydoctor2.webservice.model.entities.WebBuilding;
public class BuildingReference {
private int id;
private String gmlId;
private double width;
private List<ErrorReference> errors = new ArrayList<>();
public static BuildingReference of(WebBuilding ref) {
return new BuildingReference(ref.getId(), ref.getGmlId(), ref.getModelWidth());
}
public BuildingReference(int id, String gmlId, double width) {
super();
this.id = id;
this.gmlId = gmlId;
this.width = width;
}
public double getWidth() {
return width;
}
public void setWidth(double width) {
this.width = width;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getGmlId() {
return gmlId;
}
public void setGmlId(String gmlId) {
this.gmlId = gmlId;
}
public List<ErrorReference> getErrors() {
return errors;
}
public void setErrors(List<ErrorReference> errors) {
this.errors = errors;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model;
public class BuildingReferenceWithErrorIndicator extends BuildingReference {
private boolean hasErrors;
public BuildingReferenceWithErrorIndicator(int id, String gmlId, double width, boolean hasErrors) {
super(id, gmlId, width);
this.hasErrors = hasErrors;
}
public boolean isHasErrors() {
return hasErrors;
}
public void setHasErrors(boolean hasErrors) {
this.hasErrors = hasErrors;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model;
import java.util.ArrayList;
import java.util.List;
public class BuildingsReturnType {
private long from;
private long to;
private List<BuildingReference> buildings = new ArrayList<>();
public long getFrom() {
return from;
}
public void setFrom(long from) {
this.from = from;
}
public long getTo() {
return to;
}
public void setTo(long to) {
this.to = to;
}
public List<BuildingReference> getBuildings() {
return buildings;
}
public void setBuildings(List<BuildingReference> buildings) {
this.buildings = buildings;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model;
import java.util.ArrayList;
import java.util.List;
import de.hft.stuttgart.citydoctor2.check.DefaultParameter;
public class CheckReturnType {
private String name;
private List<DefaultParameter> parameters = new ArrayList<>();
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<DefaultParameter> getParameters() {
return parameters;
}
public void setParameters(List<DefaultParameter> parameters) {
this.parameters = parameters;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model;
import de.hft.stuttgart.citydoctor2.webservice.model.entities.WebError;
public class ErrorReference {
private int id;
private String name;
public static ErrorReference of(WebError err) {
return new ErrorReference(err.getId(), err.getName());
}
private ErrorReference(int id, String name) {
super();
this.id = id;
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model;
public class FeatureValidationStatusReturnValue {
private int featureId;
private boolean hasError;
public FeatureValidationStatusReturnValue() {
}
public FeatureValidationStatusReturnValue(int featureId, boolean hasError) {
super();
this.featureId = featureId;
this.hasError = hasError;
}
public int getFeatureId() {
return featureId;
}
public void setFeatureId(int featureId) {
this.featureId = featureId;
}
public boolean isHasError() {
return hasError;
}
public void setHasError(boolean hasError) {
this.hasError = hasError;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model;
import java.time.LocalDateTime;
public class LoginSuccessfulReturnType {
private String token;
private LocalDateTime expires;
private int userId;
public LoginSuccessfulReturnType(String token, LocalDateTime expires, int userId) {
this.token = token;
this.expires = expires;
this.userId = userId;
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public LocalDateTime getExpires() {
return expires;
}
public void setExpires(LocalDateTime expires) {
this.expires = expires;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model;
import java.util.ArrayList;
import java.util.List;
public class ModelReference {
private int id;
private String name;
private ParseStatus status;
private List<ValidationReference> validations = new ArrayList<>();
public ModelReference(int id, String name, ParseStatus status) {
super();
this.id = id;
this.name = name;
this.status = status;
}
public List<ValidationReference> getValidations() {
return validations;
}
public void setValidations(List<ValidationReference> validations) {
this.validations = validations;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ParseStatus getStatus() {
return status;
}
public void setStatus(ParseStatus status) {
this.status = status;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model;
public enum ParseStatus {
PARSING, ERROR, OK
}
package de.hft.stuttgart.citydoctor2.webservice.model;
import de.hft.stuttgart.citydoctor2.webservice.model.entities.Validation;
public class ValidationReference {
private int id;
private String name;
private ValidationStatus status;
public static ValidationReference of(Validation valid) {
return new ValidationReference(valid.getId(), valid.getName(), valid.getStatus());
}
public ValidationReference(int id, String name, ValidationStatus status) {
super();
this.id = id;
this.name = name;
this.status = status;
}
public ValidationStatus getStatus() {
return status;
}
public void setStatus(ValidationStatus status) {
this.status = status;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model;
public enum ValidationStatus {
PARSING, VALIDATING, OK, ERROR
}
package de.hft.stuttgart.citydoctor2.webservice.model.entities;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "feature_validation_status")
public class FeatureValidationStatus {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(AccessType.PROPERTY)
private int id;
@JoinColumn(name = "feature_id")
@NotNull
@ManyToOne
private WebBuilding feature;
@JoinColumn(name = "validation_id")
@NotNull
@ManyToOne
private Validation validation;
@Column(name = "has_error")
private boolean hasError;
@Column(name = "was_validated")
private boolean wasValidated;
public WebBuilding getFeature() {
return feature;
}
public void setFeature(WebBuilding feature) {
this.feature = feature;
}
public Validation getValidation() {
return validation;
}
public void setValidation(Validation validation) {
this.validation = validation;
}
public boolean isHasError() {
return hasError;
}
public void setHasError(boolean hasError) {
this.hasError = hasError;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public boolean isWasValidated() {
return wasValidated;
}
public void setWasValidated(boolean wasValidated) {
this.wasValidated = wasValidated;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model.entities;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "gml_files")
public class GmlFile {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(AccessType.PROPERTY)
private int id;
@Column(name = "file_path", length = 1024)
private String filePath;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model.entities;
import java.time.LocalDateTime;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "token")
public class Token {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(AccessType.PROPERTY)
private int id;
@ManyToOne
@JoinColumn(name = "user_id")
@NotNull
private User user;
@NotNull
private String address;
@NotNull
@Column(name = "token")
private String tokenString;
@NotNull
private LocalDateTime expires;
@Override
public String toString() {
return "Token [id=" + id + ", user=" + user + ", address=" + address + ", token=" + tokenString + ", expires="
+ expires + "]";
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getTokenString() {
return tokenString;
}
public void setTokenString(String tokenString) {
this.tokenString = tokenString;
}
public LocalDateTime getExpires() {
return expires;
}
public void setExpires(LocalDateTime expires) {
this.expires = expires;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model.entities;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(AccessType.PROPERTY)
private int id;
@Column(unique = true, length = 200)
@NotNull
private String mail;
@Column(name = "pw_hash")
@NotNull
private String passwordHash;
@NotNull
@Column(length = 16)
private String salt;
@OneToMany(mappedBy = "owner")
private List<WebCityDoctorModel> ownedModels = new ArrayList<>();
public List<WebCityDoctorModel> getOwnedModels() {
return ownedModels;
}
public void setOwnedModels(List<WebCityDoctorModel> ownedModels) {
this.ownedModels = ownedModels;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getMail() {
return mail;
}
public void setMail(String mail) {
this.mail = mail;
}
public String getPasswordHash() {
return passwordHash;
}
public void setPasswordHash(String passwordHash) {
this.passwordHash = passwordHash;
}
public String getSalt() {
return salt;
}
public void setSalt(String salt) {
this.salt = salt;
}
@Override
public String toString() {
return "User [id=" + id + ", mail=" + mail + ", passwordHash=" + passwordHash + ", salt=" + salt + "]";
}
}
package de.hft.stuttgart.citydoctor2.webservice.model.entities;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import de.hft.stuttgart.citydoctor2.webservice.model.ValidationStatus;
@Entity
@Table(name = "validations")
public class Validation {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(AccessType.PROPERTY)
private int id;
@ManyToOne
@NotNull
private WebCityDoctorModel model;
@NotNull
private ValidationStatus status;
@NotNull
private String name;
@OneToMany(mappedBy = "validation", orphanRemoval = true)
private List<WebError> errors = new ArrayList<>();
@OneToMany(mappedBy = "validation", orphanRemoval = true)
private List<FeatureValidationStatus> errorStatus = new ArrayList<>();
@Column(name = "pdf_report")
private byte[] pdfReport;
@Column(name = "xml_report")
private byte[] xmlReport;
public Validation() {
}
public Validation(@NotNull WebCityDoctorModel model, @NotNull ValidationStatus status, @NotNull String name) {
super();
this.model = model;
this.status = status;
this.name = name;
}
public List<FeatureValidationStatus> getErrorStatus() {
return errorStatus;
}
public void setErrorStatus(List<FeatureValidationStatus> errorStatus) {
this.errorStatus = errorStatus;
}
public List<WebError> getErrors() {
return errors;
}
public void setErrors(List<WebError> errors) {
this.errors = errors;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public WebCityDoctorModel getModel() {
return model;
}
public void setModel(WebCityDoctorModel model) {
this.model = model;
}
public ValidationStatus getStatus() {
return status;
}
public void setStatus(ValidationStatus status) {
this.status = status;
}
public byte[] getPdfReport() {
return pdfReport;
}
public void setPdfReport(byte[] pdfReport) {
this.pdfReport = pdfReport;
}
public byte[] getXmlReport() {
return xmlReport;
}
public void setXmlReport(byte[] xmlReport) {
this.xmlReport = xmlReport;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model.entities;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;
@Entity
@Table(name = "building_reference")
@Indexed
public class WebBuilding {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(AccessType.PROPERTY)
private int id;
@JoinColumn(name = "model_id")
@NotNull
@ManyToOne
private WebCityDoctorModel model;
@Column(name = "gml_id")
@NotNull
@Field
private String gmlId;
@Column(name = "model_width")
private double modelWidth;
@Column(name = "view_data")
@Basic(fetch = FetchType.LAZY)
private byte[] viewData;
@OneToMany(mappedBy = "building", orphanRemoval = true)
private List<WebError> errors = new ArrayList<>();
@OneToMany(mappedBy = "feature", orphanRemoval = true)
private List<FeatureValidationStatus> errorStatus = new ArrayList<>();
public List<WebError> getErrors() {
return errors;
}
public void setErrors(List<WebError> errors) {
this.errors = errors;
}
public double getModelWidth() {
return modelWidth;
}
public void setModelWidth(double modelWidth) {
this.modelWidth = modelWidth;
}
public List<FeatureValidationStatus> getErrorStatus() {
return errorStatus;
}
public void setErrorStatus(List<FeatureValidationStatus> errorStatus) {
this.errorStatus = errorStatus;
}
public byte[] getViewData() {
return viewData;
}
public void setViewData(byte[] viewData) {
this.viewData = viewData;
}
public WebCityDoctorModel getModel() {
return model;
}
public void setModel(WebCityDoctorModel model) {
this.model = model;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getGmlId() {
return gmlId;
}
public void setGmlId(String gmlId) {
this.gmlId = gmlId;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model.entities;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import de.hft.stuttgart.citydoctor2.webservice.model.ParseStatus;
@Entity
@Table(name = "web_city_doctor_model")
public class WebCityDoctorModel {
@SuppressWarnings("unused")
private static Logger logger = LogManager.getLogger(WebCityDoctorModel.class);
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(AccessType.PROPERTY)
private int id;
@NotNull
@Column(name = "file_name")
private String fileName;
@NotNull
@Column(name = "parse_status")
private ParseStatus status;
@NotNull
@ManyToOne
private User owner;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private GmlFile zipFile;
@OneToMany(mappedBy = "model", orphanRemoval = true)
private List<WebBuilding> buildings = new ArrayList<>();
@OneToMany(mappedBy = "model", orphanRemoval = true)
private List<Validation> validations = new ArrayList<>();
public List<Validation> getValidations() {
return validations;
}
public void setValidations(List<Validation> validations) {
this.validations = validations;
}
public List<WebBuilding> getBuildings() {
return buildings;
}
public void setBuildings(List<WebBuilding> buildings) {
this.buildings = buildings;
}
public GmlFile getZipFile() {
return zipFile;
}
public void setZipFile(GmlFile zipFile) {
this.zipFile = zipFile;
}
public User getOwner() {
return owner;
}
public void setOwner(User owner) {
this.owner = owner;
}
public ParseStatus getStatus() {
return status;
}
public void setStatus(ParseStatus status) {
this.status = status;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}
package de.hft.stuttgart.citydoctor2.webservice.model.entities;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.validation.constraints.NotNull;
@Entity
public class WebError {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(AccessType.PROPERTY)
private int id;
@NotNull
private String name;
@JoinColumn(name = "building_id")
@NotNull
@ManyToOne
private WebBuilding building;
@ManyToOne
@NotNull
private Validation validation;
public Validation getValidation() {
return validation;
}
public void setValidation(Validation validation) {
this.validation = validation;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public WebBuilding getBuilding() {
return building;
}
public void setBuilding(WebBuilding building) {
this.building = building;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment