-
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.
Feature: implement Backup Service (#18)
* fix: fixed bugs * fix: fixed bugs * fix: fixed bugs * fix: fixed bugs * fix: fixed bugs * fix: fixed bugs * fix: fixed bugs * fix: fixed bugs * fix: fixed bugs
- Loading branch information
1 parent
a9319e0
commit 0687917
Showing
34 changed files
with
1,194 additions
and
474 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
32 changes: 32 additions & 0 deletions
32
.../objectstorage/converter/ContentCompoundUnitsToValidationSecretsApplicationConverter.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,32 @@ | ||
package com.objectstorage.converter; | ||
|
||
import com.objectstorage.dto.ContentCompoundUnitDto; | ||
import com.objectstorage.model.ValidationSecretsApplication; | ||
import com.objectstorage.model.ValidationSecretsUnit; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Represents content compounds units to validation secrets application converter; | ||
*/ | ||
public class ContentCompoundUnitsToValidationSecretsApplicationConverter { | ||
|
||
/** | ||
* Converts given content compound units to validation secrets application. | ||
* | ||
* @param contentCompoundUnits given content compounds units. | ||
* @return converted validation secrets application. | ||
*/ | ||
public static ValidationSecretsApplication convert(List<ContentCompoundUnitDto> contentCompoundUnits) { | ||
List<ValidationSecretsUnit> validationSecretsUnits = new ArrayList<>(); | ||
|
||
contentCompoundUnits.forEach( | ||
element -> validationSecretsUnits.add( | ||
ValidationSecretsUnit.of( | ||
element.getProvider(), | ||
element.getCredentials()))); | ||
|
||
return ValidationSecretsApplication.of(validationSecretsUnits); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...e/converter/RepositoryContentApplicationUnitsToValidationSecretsApplicationConverter.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,34 @@ | ||
package com.objectstorage.converter; | ||
|
||
import com.objectstorage.dto.ContentCompoundUnitDto; | ||
import com.objectstorage.dto.RepositoryContentApplicationUnitDto; | ||
import com.objectstorage.model.ValidationSecretsApplication; | ||
import com.objectstorage.model.ValidationSecretsUnit; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Represents repository content application units to validation secrets application converter; | ||
*/ | ||
public class RepositoryContentApplicationUnitsToValidationSecretsApplicationConverter { | ||
|
||
/** | ||
* Converts given content compound units to validation secrets application. | ||
* | ||
* @param repositoryContentApplicationUnits given repository content application units. | ||
* @return converted validation secrets application. | ||
*/ | ||
public static ValidationSecretsApplication convert( | ||
List<RepositoryContentApplicationUnitDto> repositoryContentApplicationUnits) { | ||
List<ValidationSecretsUnit> validationSecretsUnits = new ArrayList<>(); | ||
|
||
repositoryContentApplicationUnits.forEach( | ||
element -> validationSecretsUnits.add( | ||
ValidationSecretsUnit.of( | ||
element.getProvider(), | ||
element.getCredentials()))); | ||
|
||
return ValidationSecretsApplication.of(validationSecretsUnits); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
api-server/src/main/java/com/objectstorage/dto/ContentCompoundUnitDto.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,29 @@ | ||
package com.objectstorage.dto; | ||
|
||
import com.objectstorage.model.CredentialsFieldsFull; | ||
import com.objectstorage.model.Provider; | ||
import com.objectstorage.model.ValidationSecretsUnit; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
/** | ||
* Represents content compound unit dto. | ||
*/ | ||
@Getter | ||
@AllArgsConstructor(staticName = "of") | ||
public class ContentCompoundUnitDto { | ||
/** | ||
* Represents root location for internal file system. | ||
*/ | ||
private RepositoryContentUnitDto repositoryContentUnitDto; | ||
|
||
/** | ||
* Represents provider. | ||
*/ | ||
private Provider provider; | ||
|
||
/** | ||
* Represents full credentials fields. | ||
*/ | ||
private CredentialsFieldsFull credentials; | ||
} |
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
23 changes: 23 additions & 0 deletions
23
api-server/src/main/java/com/objectstorage/dto/FolderContentUnitDto.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,23 @@ | ||
package com.objectstorage.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.io.InputStream; | ||
|
||
/** | ||
* Represents folder content unit. | ||
*/ | ||
@Getter | ||
@AllArgsConstructor(staticName = "of") | ||
public class FolderContentUnitDto { | ||
/** | ||
* Represents folder entity name. | ||
*/ | ||
private String location; | ||
|
||
/** | ||
* Represents folder entity content. | ||
*/ | ||
private byte[] content; | ||
} |
28 changes: 28 additions & 0 deletions
28
api-server/src/main/java/com/objectstorage/dto/RepositoryContentApplicationUnitDto.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,28 @@ | ||
package com.objectstorage.dto; | ||
|
||
import com.objectstorage.model.CredentialsFieldsFull; | ||
import com.objectstorage.model.Provider; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
/** | ||
* Represents repository content application unit. | ||
*/ | ||
@Getter | ||
@AllArgsConstructor(staticName = "of") | ||
public class RepositoryContentApplicationUnitDto { | ||
/** | ||
* Represents root location for internal file system. | ||
*/ | ||
private String root; | ||
|
||
/** | ||
* Represents provider. | ||
*/ | ||
private Provider provider; | ||
|
||
/** | ||
* Represents full credentials fields. | ||
*/ | ||
private CredentialsFieldsFull credentials; | ||
} |
23 changes: 0 additions & 23 deletions
23
api-server/src/main/java/com/objectstorage/dto/RepositoryTemporateUnitDto.java
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
api-server/src/main/java/com/objectstorage/dto/TemporateContentUnitDto.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,36 @@ | ||
package com.objectstorage.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
/** | ||
* Represents repository content unit. | ||
*/ | ||
@Getter | ||
@AllArgsConstructor(staticName = "of") | ||
public class TemporateContentUnitDto { | ||
/** | ||
* Represents provider. | ||
*/ | ||
private Integer provider; | ||
|
||
/** | ||
* Represents se. | ||
*/ | ||
private Integer secret; | ||
|
||
/** | ||
* Represents file location. | ||
*/ | ||
private String location; | ||
|
||
/** | ||
* Represents file hash. | ||
*/ | ||
private String hash; | ||
|
||
/** | ||
* Represents created at timestamp. | ||
*/ | ||
private Long createdAt; | ||
} |
21 changes: 21 additions & 0 deletions
21
api-server/src/main/java/com/objectstorage/dto/VendorObjectListingDto.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,21 @@ | ||
package com.objectstorage.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
/** | ||
* Represents vendor object listing. | ||
*/ | ||
@Getter | ||
@AllArgsConstructor(staticName = "of") | ||
public class VendorObjectListingDto { | ||
/** | ||
* Represent location. | ||
*/ | ||
private String location; | ||
|
||
/** | ||
* Represents created at timestamp. | ||
*/ | ||
private Long createdAt; | ||
} |
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
21 changes: 0 additions & 21 deletions
21
...rc/main/java/com/objectstorage/exception/FileUnitsLocationsRetrievalFailureException.java
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
api-server/src/main/java/com/objectstorage/exception/FileUnitsRetrievalFailureException.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,21 @@ | ||
package com.objectstorage.exception; | ||
|
||
import java.io.IOException; | ||
import java.util.Arrays; | ||
import java.util.Formatter; | ||
|
||
/** | ||
* Represents exception used when file units retrieval operation fails. | ||
*/ | ||
public class FileUnitsRetrievalFailureException extends IOException { | ||
public FileUnitsRetrievalFailureException() { | ||
this(""); | ||
} | ||
|
||
public FileUnitsRetrievalFailureException(Object... message) { | ||
super( | ||
new Formatter() | ||
.format("File units retrieval operation failed: %s", Arrays.stream(message).toArray()) | ||
.toString()); | ||
} | ||
} |
Oops, something went wrong.