generated from it-at-m/oss-repository-en-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mdas 674 implementierung s3 eai endpunkt archivierung (#29)
* ✨ MDAS-674 Add rest resource. * ♻️ MDAS-674 Add DB connection and entity * ♻️ MDAS-674 Add bucket or bucket-archive file list * ♻️ MDAS-674 Add move file to archive * ♻️ MDAS-674 Rename path to archive * ♻️ MDAS-674 Put archive HTTP Status 204 * 📝 MDAS-674 Releasenotes complemented * ♻️ MDAS-674 Pull request issues implemented * ♻️ MDAS-674 Pull request issues implemented * ♻️ MDAS-674 Pull request issues implemented * ♻️ MDAS-674 Pull request issues implemented * ♻️ MDAS-674 Pull request issues implemented * ♻️ MDAS-674 Pull request issues implemented
- Loading branch information
Showing
28 changed files
with
839 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* The MIT License | ||
* Copyright © 2023 Landeshauptstadt München | it@M | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
package de.muenchen.mobidam.domain; | ||
|
||
import static java.sql.Types.VARCHAR; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.MappedSuperclass; | ||
import java.io.Serializable; | ||
import java.util.UUID; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
import org.hibernate.annotations.GenericGenerator; | ||
import org.hibernate.annotations.JdbcTypeCode; | ||
|
||
@MappedSuperclass | ||
@NoArgsConstructor | ||
@Getter | ||
@Setter | ||
@ToString | ||
@EqualsAndHashCode | ||
public abstract class BaseEntity implements Cloneable, Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@Column(name = "id", length = 36) | ||
@Id | ||
@GeneratedValue(generator = "uuid") | ||
@GenericGenerator(name = "uuid", strategy = "uuid2") | ||
@JdbcTypeCode(VARCHAR) | ||
private UUID id; | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/de/muenchen/mobidam/domain/MobidamArchive.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c): it@M - Dienstleister für Informations- und Telekommunikationstechnik | ||
* der Landeshauptstadt München, 2023 | ||
*/ | ||
package de.muenchen.mobidam.domain; | ||
|
||
import jakarta.persistence.*; | ||
import jakarta.validation.constraints.NotEmpty; | ||
import java.time.LocalDate; | ||
import lombok.*; | ||
|
||
/** | ||
* This class represents a the mobidam archive entity. | ||
* All files archived in S3 have a database entry. | ||
*/ | ||
@Entity | ||
@Table(name = "Archive", schema = "mdass3eai") | ||
@Getter | ||
@Setter | ||
@ToString(callSuper = true) | ||
@EqualsAndHashCode(callSuper = true) | ||
@NoArgsConstructor | ||
public class MobidamArchive extends BaseEntity { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@Column(nullable = false) | ||
@NotEmpty | ||
private String bucket; | ||
@Column(nullable = false) | ||
@NotEmpty | ||
private String path; | ||
@Column(nullable = false) | ||
@NotEmpty | ||
private LocalDate creation; | ||
@Column(nullable = false) | ||
@NotEmpty | ||
private LocalDate expiration; | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/de/muenchen/mobidam/repository/ArchiveRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package de.muenchen.mobidam.repository; | ||
|
||
import de.muenchen.mobidam.domain.MobidamArchive; | ||
import java.util.UUID; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface ArchiveRepository extends JpaRepository<MobidamArchive, UUID> { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.