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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

## General Information

An object storage with support of **S3** and without vendor limitations.
An object storage with support of **S3** and **GCS** without vendor limitations.

Features:
* Has easy-to-use well-designed API
* Ignores **S3** limitations(**file size** and **performance**) making interaction with storage vendors seamless
* Ignores **S3** and **GCS** limitations(**file size** and **performance**) making interaction with storage vendors seamless
* Provides opportunity to work with different vendors using the same **ObjectStorage** instance
* Has integrated data processing optimizations and excessive monitoring opportunities
* Provides configurable data backups per vendor in the same workspace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,19 @@ public void process() throws BackupPeriodRetrievalFailureException {
contentRetrievalProviderUnit.getLocation(), content));
}

try {
workspaceFacade.addBackupFile(
workspaceUnitKey,
workspaceFacade.createFileUnitKey(properties.getWorkspaceContentBackupUnit()),
folderContentUnits);
} catch (FileCreationFailureException e) {
StateService.getBackupProcessorGuard().unlock();
if (!folderContentUnits.isEmpty()) {
try {
workspaceFacade.addBackupFile(
workspaceUnitKey,
workspaceFacade.createFileUnitKey(properties.getWorkspaceContentBackupUnit()),
folderContentUnits);
} catch (FileCreationFailureException e) {
StateService.getBackupProcessorGuard().unlock();

logger.error(e.getMessage());
logger.error(e.getMessage());

return;
return;
}
}

telemetryService.increaseCurrentBackupsAmount();
Expand Down
4 changes: 2 additions & 2 deletions api-server/src/main/openapi/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ paths:
application/zip:
schema:
type: string
format: binary
format: byte
400:
description: Content object was not retrieved
/v1/content/backup/download:
Expand All @@ -154,7 +154,7 @@ paths:
application/zip:
schema:
type: string
format: binary
format: byte
400:
description: Content backup was not retrieved
/v1/content/object/clean:
Expand Down
2 changes: 1 addition & 1 deletion cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
<auth>false</auth>
<typeMappings>
<typeMapping>binary=byte[]</typeMapping>
<typeMapping>file=byte[]</typeMapping>
<typeMapping>file=File</typeMapping>
</typeMappings>
<configOptions>
<additionalModelTypeAnnotations>@lombok.Data @lombok.AllArgsConstructor(staticName = "of")</additionalModelTypeAnnotations>
Expand Down
30 changes: 16 additions & 14 deletions cli/src/main/java/com/objectstorage/App.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package com.objectstorage;

import com.objectstorage.entity.PropertiesEntity;
import com.objectstorage.service.client.content.download.DownloadContentClientService;
import com.objectstorage.service.client.info.version.VersionInfoClientService;
import com.objectstorage.service.command.BaseCommandService;
import com.objectstorage.service.command.external.clean.CleanExternalCommandService;
import com.objectstorage.service.command.external.clean.object.CleanObjectExternalCommandService;
import com.objectstorage.service.command.external.cleanall.CleanAllExternalCommandService;
import com.objectstorage.service.command.external.content.ContentExternalCommandService;
import com.objectstorage.service.command.external.download.DownloadExternalCommandService;
import com.objectstorage.service.command.external.download.backup.DownloadBackupExternalCommandService;
import com.objectstorage.service.command.external.download.object.DownloadObjectExternalCommandService;
import com.objectstorage.service.command.external.apply.ApplyExternalCommandService;
import com.objectstorage.service.command.external.topology.TopologyExternalCommandService;
import com.objectstorage.service.command.external.upload.object.UploadObjectExternalCommandService;
import com.objectstorage.service.command.external.withdraw.WithdrawExternalCommandService;
import com.objectstorage.service.command.external.version.VersionExternalCommandService;
import com.objectstorage.service.command.internal.health.HealthCheckInternalCommandService;
import com.objectstorage.service.config.ConfigService;
import com.objectstorage.service.visualization.VisualizationService;
import com.objectstorage.service.visualization.label.apply.ApplyCommandVisualizationLabel;
import com.objectstorage.service.visualization.label.clean.CleanCommandVisualizationLabel;
import com.objectstorage.service.visualization.label.clean.object.CleanObjectCommandVisualizationLabel;
import com.objectstorage.service.visualization.label.cleanall.CleanAllCommandVisualizationLabel;
import com.objectstorage.service.visualization.label.content.ContentCommandVisualizationLabel;
import com.objectstorage.service.visualization.label.download.DownloadCommandVisualizationLabel;
import com.objectstorage.service.visualization.label.topology.TopologyCommandVisualizationLabel;
import com.objectstorage.service.visualization.label.download.backup.DownloadBackupCommandVisualizationLabel;
import com.objectstorage.service.visualization.label.download.object.DownloadObjectCommandVisualizationLabel;
import com.objectstorage.service.visualization.label.upload.object.UploadObjectCommandVisualizationLabel;
import com.objectstorage.service.visualization.label.withdraw.WithdrawCommandVisualizationLabel;
import com.objectstorage.service.visualization.label.version.VersionCommandVisualizationLabel;
import com.objectstorage.service.visualization.state.VisualizationState;
Expand All @@ -41,11 +41,12 @@
BaseCommandService.class,
ApplyExternalCommandService.class,
WithdrawExternalCommandService.class,
CleanExternalCommandService.class,
CleanObjectExternalCommandService.class,
CleanAllExternalCommandService.class,
ContentExternalCommandService.class,
DownloadExternalCommandService.class,
TopologyExternalCommandService.class,
DownloadObjectExternalCommandService.class,
DownloadBackupExternalCommandService.class,
UploadObjectExternalCommandService.class,
VersionExternalCommandService.class,
VersionExternalCommandService.class,
HealthCheckInternalCommandService.class,
Expand All @@ -56,11 +57,12 @@
ConfigService.class,
ApplyCommandVisualizationLabel.class,
WithdrawCommandVisualizationLabel.class,
CleanCommandVisualizationLabel.class,
CleanObjectCommandVisualizationLabel.class,
CleanAllCommandVisualizationLabel.class,
ContentCommandVisualizationLabel.class,
DownloadCommandVisualizationLabel.class,
TopologyCommandVisualizationLabel.class,
DownloadObjectCommandVisualizationLabel.class,
DownloadBackupCommandVisualizationLabel.class,
UploadObjectCommandVisualizationLabel.class,
VersionCommandVisualizationLabel.class,
VisualizationService.class,
VisualizationState.class
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.objectstorage.converter;

import com.objectstorage.dto.ProcessedCredentialsDto;
import com.objectstorage.entity.ConfigEntity;
import com.objectstorage.model.CredentialsFieldsExternal;
import com.objectstorage.model.CredentialsFieldsFull;
Expand All @@ -9,7 +10,7 @@
/**
* Represents config credentials to ObjectStorage API Server content credentials converter.
*/
public class ConfigCredentialsToContentCredentialsConverter {
public class ConfigCredentialsToContentCredentialsConverter<T> {

/**
* Converts given config credentials to context exporter.
Expand All @@ -19,12 +20,15 @@ public class ConfigCredentialsToContentCredentialsConverter {
* @return converted context exporter.
*/
public static CredentialsFieldsFull convert(
ConfigEntity.Service.Provider provider, ConfigEntity.Service.Credentials configCredentials) {
ConfigEntity.Service.Provider provider, ProcessedCredentialsDto configCredentials) {
return switch (provider) {
case EXPORTER -> null;
case GIT_GITHUB -> CredentialsFieldsFull.of(
case S3 -> CredentialsFieldsFull.of(
CredentialsFieldsInternal.of(configCredentials.getId()),
CredentialsFieldsExternal.of(configCredentials.getToken()));
CredentialsFieldsExternal.of(
configCredentials.getFile(), configCredentials.getRegion()));
case GCS -> CredentialsFieldsFull.of(
CredentialsFieldsInternal.of(configCredentials.getId()),
CredentialsFieldsExternal.of(configCredentials.getFile(), null));
};
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public static Provider convert(ConfigEntity.Service.Provider configProvider) {
.filter(element -> Objects.equals(element.toString(), configProvider.toString()))
.map(Enum::name)
.toList()
.get(0));
.getFirst());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.objectstorage.converter;

import com.objectstorage.entity.ConfigEntity;
import com.objectstorage.model.Provider;

import java.util.Arrays;
import java.util.Objects;

/**
* Represents selected provider to ObjectStorage API Server content provider converter.
*/
public class SelectedProviderToContentProviderConverter {

/**
* Converts given config provider to content provider.
*
* @param selectedProvider given selected provider to be converted.
* @return converted content provider.
*/
public static Provider convert(String selectedProvider) {
return Provider.valueOf(
Arrays.stream(ConfigEntity.Service.Provider.values())
.toList()
.stream()
.filter(element -> Objects.equals(element.toString(), selectedProvider))
.map(Enum::name)
.toList()
.getFirst());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.objectstorage.entity.ConfigEntity;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* Represents input for clean external command.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.objectstorage.dto;

import com.objectstorage.model.ContentApplication;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* Represents content application request details.
*/
@Getter
@AllArgsConstructor(staticName = "of")
public class ContentApplicationRequestDto {
private String authorization;

private ContentApplication contentApplication;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.objectstorage.dto;

import com.objectstorage.model.ContentCleanup;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* Represents content cleanup request details.
*/
@Getter
@AllArgsConstructor(staticName = "of")
public class ContentCleanupRequestDto {
private String authorization;

private ContentCleanup contentCleanup;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.objectstorage.dto;

import com.objectstorage.model.ContentBackupDownload;
import com.objectstorage.model.ContentObjectDownload;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* Represents content download backup request details.
*/
@Getter
@AllArgsConstructor(staticName = "of")
public class ContentDownloadBackupRequestDto {
private String authorization;

private ContentBackupDownload contentBackupDownload;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.objectstorage.dto;

import com.objectstorage.model.ContentCleanup;
import com.objectstorage.model.ContentObjectDownload;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* Represents content download object request details.
*/
@Getter
@AllArgsConstructor(staticName = "of")
public class ContentDownloadObjectRequestDto {
private String authorization;

private ContentObjectDownload contentObjectDownload;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.objectstorage.dto;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.io.File;

/**
* Represents content upload object request details.
*/
@Getter
@AllArgsConstructor(staticName = "of")
public class ContentUploadObjectRequestDto {
private String authorization;

private String location;

private File file;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import lombok.Getter;

/**
* Represents input for download external command.
* Represents input for download backup external command.
*/
@Getter
@AllArgsConstructor(staticName = "of")
public class DownloadExternalCommandDto {
public class DownloadBackupExternalCommandDto {
private ConfigEntity config;

private String outputLocation;
Expand Down
Loading
Loading