-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #23 - Refactored container/website creation to make sure Accoun…
…t can return Websites too
- Loading branch information
1 parent
75a0e6b
commit d15f4d4
Showing
11 changed files
with
146 additions
and
42 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
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
9 changes: 9 additions & 0 deletions
9
src/main/java/org/javaswift/joss/client/core/ContainerFactory.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.client.core; | ||
|
||
import org.javaswift.joss.model.Container; | ||
|
||
public interface ContainerFactory<N extends Container> { | ||
|
||
public N create(AbstractAccount account, String containerName); | ||
|
||
} |
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
14 changes: 14 additions & 0 deletions
14
src/main/java/org/javaswift/joss/client/impl/ContainerFactoryImpl.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,14 @@ | ||
package org.javaswift.joss.client.impl; | ||
|
||
import org.javaswift.joss.client.core.AbstractAccount; | ||
import org.javaswift.joss.client.core.ContainerFactory; | ||
import org.javaswift.joss.model.Container; | ||
|
||
public class ContainerFactoryImpl implements ContainerFactory<Container> { | ||
|
||
@Override | ||
public Container create(AbstractAccount account, String containerName) { | ||
return new ContainerImpl((AccountImpl)account, containerName, account.isAllowCaching()); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/org/javaswift/joss/client/impl/WebsiteFactoryImpl.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,14 @@ | ||
package org.javaswift.joss.client.impl; | ||
|
||
import org.javaswift.joss.client.core.AbstractAccount; | ||
import org.javaswift.joss.client.core.ContainerFactory; | ||
import org.javaswift.joss.model.Website; | ||
|
||
public class WebsiteFactoryImpl implements ContainerFactory<Website> { | ||
|
||
@Override | ||
public Website create(AbstractAccount account, String containerName) { | ||
return new WebsiteImpl((AccountImpl)account, containerName, account.isAllowCaching()); | ||
} | ||
|
||
} |
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
14 changes: 14 additions & 0 deletions
14
src/main/java/org/javaswift/joss/client/mock/ContainerFactoryMock.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,14 @@ | ||
package org.javaswift.joss.client.mock; | ||
|
||
import org.javaswift.joss.client.core.AbstractAccount; | ||
import org.javaswift.joss.client.core.ContainerFactory; | ||
import org.javaswift.joss.model.Container; | ||
|
||
public class ContainerFactoryMock implements ContainerFactory<Container> { | ||
|
||
@Override | ||
public Container create(AbstractAccount account, String containerName) { | ||
return new ContainerMock((AccountMock)account, containerName); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/org/javaswift/joss/client/mock/WebsiteFactoryMock.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,14 @@ | ||
package org.javaswift.joss.client.mock; | ||
|
||
import org.javaswift.joss.client.core.AbstractAccount; | ||
import org.javaswift.joss.client.core.ContainerFactory; | ||
import org.javaswift.joss.model.Website; | ||
|
||
public class WebsiteFactoryMock implements ContainerFactory<Website> { | ||
|
||
@Override | ||
public Website create(AbstractAccount account, String containerName) { | ||
return new WebsiteMock((AccountMock)account, containerName); | ||
} | ||
|
||
} |
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
30 changes: 21 additions & 9 deletions
30
src/test/java/org/javaswift/joss/client/core/ContainerCacheTest.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