Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #5 - CommandFactory applied to Container
- Loading branch information
1 parent
c5e7204
commit 07f75ed
Showing
26 changed files
with
195 additions
and
64 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
1 change: 1 addition & 0 deletions
1
src/main/java/org/javaswift/joss/command/impl/account/ListContainersCommandImpl.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
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
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
46 changes: 46 additions & 0 deletions
46
src/main/java/org/javaswift/joss/command/impl/factory/ContainerCommandFactoryImpl.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,46 @@ | ||
package org.javaswift.joss.command.impl.factory; | ||
|
||
import org.apache.http.client.HttpClient; | ||
import org.javaswift.joss.command.impl.container.*; | ||
import org.javaswift.joss.command.impl.identity.access.AccessImpl; | ||
import org.javaswift.joss.command.shared.container.*; | ||
import org.javaswift.joss.command.shared.factory.ContainerCommandFactory; | ||
import org.javaswift.joss.headers.Header; | ||
import org.javaswift.joss.instructions.ListInstructions; | ||
import org.javaswift.joss.model.Account; | ||
import org.javaswift.joss.model.Container; | ||
|
||
import java.util.Collection; | ||
|
||
public class ContainerCommandFactoryImpl implements ContainerCommandFactory { | ||
|
||
@Override | ||
public ContainerInformationCommand createContainerInformationCommand(Account account, HttpClient httpClient, AccessImpl access, Container container) { | ||
return new ContainerInformationCommandImpl(account, httpClient, access, container); | ||
} | ||
|
||
@Override | ||
public ContainerMetadataCommand createContainerMetadataCommand(Account account, HttpClient httpClient, AccessImpl access, Container container, Collection<? extends Header> headers) { | ||
return new ContainerMetadataCommandImpl(account, httpClient, access, container, headers); | ||
} | ||
|
||
@Override | ||
public ContainerRightsCommand createContainerRightsCommand(Account account, HttpClient httpClient, AccessImpl access, Container container, boolean publicContainer) { | ||
return new ContainerRightsCommandImpl(account, httpClient, access, container, publicContainer); | ||
} | ||
|
||
@Override | ||
public CreateContainerCommand createCreateContainerCommand(Account account, HttpClient httpClient, AccessImpl access, Container container) { | ||
return new CreateContainerCommandImpl(account, httpClient, access, container); | ||
} | ||
|
||
@Override | ||
public DeleteContainerCommand createDeleteContainerCommand(Account account, HttpClient httpClient, AccessImpl access, Container container) { | ||
return new DeleteContainerCommandImpl(account, httpClient, access, container); | ||
} | ||
|
||
@Override | ||
public ListObjectsCommand createListObjectsCommand(Account account, HttpClient httpClient, AccessImpl access, Container container, ListInstructions listInstructions) { | ||
return new ListObjectsCommandImpl(account, httpClient, access, container, listInstructions); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...nd/impl/account/ContainerListElement.java → .../shared/account/ContainerListElement.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
7 changes: 7 additions & 0 deletions
7
src/main/java/org/javaswift/joss/command/shared/container/ContainerInformationCommand.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,7 @@ | ||
package org.javaswift.joss.command.shared.container; | ||
|
||
import org.javaswift.joss.command.shared.core.Command; | ||
import org.javaswift.joss.information.ContainerInformation; | ||
|
||
public interface ContainerInformationCommand extends Command<ContainerInformation> { | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/org/javaswift/joss/command/shared/container/ContainerMetadataCommand.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,6 @@ | ||
package org.javaswift.joss.command.shared.container; | ||
|
||
import org.javaswift.joss.command.shared.core.Command; | ||
|
||
public interface ContainerMetadataCommand extends Command<Object> { | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/org/javaswift/joss/command/shared/container/ContainerRightsCommand.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,6 @@ | ||
package org.javaswift.joss.command.shared.container; | ||
|
||
import org.javaswift.joss.command.shared.core.Command; | ||
|
||
public interface ContainerRightsCommand extends Command<String[]> { | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/org/javaswift/joss/command/shared/container/CreateContainerCommand.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,6 @@ | ||
package org.javaswift.joss.command.shared.container; | ||
|
||
import org.javaswift.joss.command.shared.core.Command; | ||
|
||
public interface CreateContainerCommand extends Command<Object> { | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/org/javaswift/joss/command/shared/container/DeleteContainerCommand.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,6 @@ | ||
package org.javaswift.joss.command.shared.container; | ||
|
||
import org.javaswift.joss.command.shared.core.Command; | ||
|
||
public interface DeleteContainerCommand extends Command<String[]> { | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/org/javaswift/joss/command/shared/container/ListObjectsCommand.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,9 @@ | ||
package org.javaswift.joss.command.shared.container; | ||
|
||
import org.javaswift.joss.command.shared.core.Command; | ||
import org.javaswift.joss.model.StoredObject; | ||
|
||
import java.util.Collection; | ||
|
||
public interface ListObjectsCommand extends Command<Collection<StoredObject>> { | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/org/javaswift/joss/command/shared/factory/ContainerCommandFactory.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 org.javaswift.joss.command.shared.factory; | ||
|
||
import org.apache.http.client.HttpClient; | ||
import org.javaswift.joss.command.impl.identity.access.AccessImpl; | ||
import org.javaswift.joss.command.shared.container.*; | ||
import org.javaswift.joss.headers.Header; | ||
import org.javaswift.joss.instructions.ListInstructions; | ||
import org.javaswift.joss.model.Account; | ||
import org.javaswift.joss.model.Container; | ||
|
||
import java.util.Collection; | ||
|
||
public interface ContainerCommandFactory { | ||
|
||
ContainerInformationCommand createContainerInformationCommand(Account account, HttpClient httpClient, | ||
AccessImpl access, Container container); | ||
|
||
ContainerMetadataCommand createContainerMetadataCommand(Account account, HttpClient httpClient, | ||
AccessImpl access, Container container, | ||
Collection<? extends Header> headers); | ||
|
||
ContainerRightsCommand createContainerRightsCommand(Account account, HttpClient httpClient, AccessImpl access, | ||
Container container, boolean publicContainer); | ||
|
||
CreateContainerCommand createCreateContainerCommand(Account account, HttpClient httpClient, | ||
AccessImpl access, Container container); | ||
|
||
DeleteContainerCommand createDeleteContainerCommand(Account account, HttpClient httpClient, | ||
AccessImpl access, Container container); | ||
|
||
ListObjectsCommand createListObjectsCommand(Account account, HttpClient httpClient, AccessImpl access, | ||
Container container, ListInstructions listInstructions); | ||
|
||
} |
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
1 change: 1 addition & 0 deletions
1
src/test/java/org/javaswift/joss/command/impl/account/ContainerListingTest.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
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.