Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Features:
* Provides configurable data backups per vendor in the same workspace
* Makes user interaction similar to filesystem

! A mapping of file system to external vendor providers.

![](./docs/high-level-design.png)

![](./docs/detailed-design.png)
Expand Down
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);
}
}
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);
}
}
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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.List;

/**
* Represents dto used to represent the earliest temporate content.
*/
@Getter
@AllArgsConstructor(staticName = "of")
public class EarliestTemporateContentDto {
/**
* Represents target provider.
* Represents content compound units.
*/
private ValidationSecretsApplication validationSecretsApplication;
private List<ContentCompoundUnitDto> contentCompoundUnits;

/**
* Represents file location.
Expand Down
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;
}
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;
}

This file was deleted.

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;
}
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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,34 +56,6 @@ public static class Security {
*/
@Getter
public static class TemporateStorage {
/**
* Represents all supported content formats, which can be used by ObjectStorage
* Temporate Storage.
*/
@Getter
public enum Format {
@JsonProperty("zip")
ZIP("zip"),

@JsonProperty("tar")
TAR("tar");

private final String value;

Format(String value) {
this.value = value;
}

public String toString() {
return value;
}
}

@Valid
@NotNull
@JsonProperty("format")
public Format format;

@NotNull
@JsonProperty("frequency")
public String frequency;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public class PropertiesEntity {
@ConfigProperty(name = "workspace.content.backup.directory")
String workspaceContentBackupDirectory;

@ConfigProperty(name = "workspace.content.backup.unit")
String workspaceContentBackupUnit;

@ConfigProperty(name = "workspace.compression.file.name")
String workspaceCompressionFileName;

Expand Down

This file was deleted.

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());
}
}
Loading
Loading