Skip to content

new feature: object uploading on AWS S3 cloud#6

Merged
jlisok merged 4 commits intomasterfrom
feature/content-aws-writer
Jul 1, 2020
Merged

new feature: object uploading on AWS S3 cloud#6
jlisok merged 4 commits intomasterfrom
feature/content-aws-writer

Conversation

@jlisok
Copy link
Copy Markdown
Owner

@jlisok jlisok commented Jun 18, 2020

No description provided.

@jlisok jlisok requested a review from mohard June 18, 2020 15:49

private final URI uri;
private final UUID id;
private final String BUCKET_NAME;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camel case for class fields

public AwsInfo(String bucketName, String keyName) {
BUCKET_NAME = bucketName;
KEY_NAME = keyName;
uri = URI.create(BUCKET_NAME + "/" + KEY_NAME);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s3://

.withCredentials(new AWSStaticCredentialsProvider(awsSecurityCredentials.getCredentials()))
.withRegion(region)
.build();
} catch (Throwable e) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too broad catch

class BucketCreatorTest {

private static AmazonS3 awsClient;
private static String additionalBucket = "com.justyna.lisok.factory.content-bucket-test";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

randomize the name

@Test
void createNonExistingStorageContainersWhenBucketExists() throws AwsContentWritingException {
//given
AwsInfo info = new AwsInfo("com.justyna.lisok.factory.content-bucket", "content.json");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensure the bucket really exists


public class PresignedUrlRequest {

public GeneratePresignedUrlRequest generateRequest(AwsInfo info, Date expiration) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


public class ServerObjectsManagementService<RawContent, Content> {

ContentSendingService<RawContent, Content, ContentStorage<String>> sendingService;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private final


public class TimeCalculator {

public Date calculateExpirationTime(Instant now, Duration duration) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return Instant

@@ -19,11 +19,12 @@ public JsonAwsWriter(AmazonS3 awsClient) {

@Override
public void writeContent(ContentStorage<String> json, AwsInfo awsInfo) throws AwsContentWritingException {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interface does not enforce that there is always one element in ContentStorage json,

@jlisok jlisok merged commit 3b2c27d into master Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants