Skip to content

Commit

Permalink
SAK-29519 - Final cleanups per pull request comments
Browse files Browse the repository at this point in the history
  • Loading branch information
botimer committed Jul 1, 2015
1 parent 514b24c commit 8b4af01
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 31 deletions.
3 changes: 2 additions & 1 deletion cloud-content/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
target/
target/
nb-configuration.xml
14 changes: 11 additions & 3 deletions cloud-content/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
The cloud implementation of FileSystemHandler. This implementation writes and
reads files to and from cloud storage including OpenStack-Swift and S3.

## Authors

This module is based on
[contributions](https://github.com/OpenCollabZA/sakai-openstack-swift)
from OpenCollab under the
[Educational Community License v2.0](http://opensource.org/licenses/ECL-2.0).
It is also contains contributions from Longsight, Inc.

## Usage

Clone and build this module like any other Sakai modules. It can be cloned into
an existing working copy or somewhere parallel. You must use the `sakai:deploy`
Maven goal to deploy the component pack.
Build this module like any other Sakai modules. You must use the `sakai:deploy`
Maven goal to deploy the component pack as usual. It is included in the default
profile of the top-level build as well.

To use cloud rather than the default file/database storage, settings must be
configured in two places:
Expand Down
18 changes: 0 additions & 18 deletions cloud-content/impl/nb-configuration.xml

This file was deleted.

11 changes: 8 additions & 3 deletions cloud-content/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
<packaging>jar</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jclouds.version>1.9.0</jclouds.version>
</properties>

Expand All @@ -30,6 +27,14 @@
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>

<!-- jclouds dependencies -->
<!-- Package these directly in the impl/component -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package coza.opencollab.sakai.cloudcontent;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.io.Closeables;
Expand Down Expand Up @@ -420,19 +422,30 @@ class ContainerAndName {
}

/**
* A simple implementation that does nothing.
* A simple implementation that uses typical commons-logging.
*/
class DefaultLogger implements Logger{
class DefaultLogger implements Logger {

private Log log = LogFactory.getLog(SwiftFileSystemHandler.class);

@Override
public void warningOnAccountSize(long warningLimitInBytes, long bytesUsed) {}
public void warningOnAccountSize(long warningLimitInBytes, long bytesUsed) {
log.warn("Warning on Swift account size -- warningLimit: " + warningLimitInBytes + ", bytesUsed: " + bytesUsed);
}

@Override
public void errorOnAccountSize(long maxSizeInBytes, long bytesUsed) {}
public void errorOnAccountSize(long maxSizeInBytes, long bytesUsed) {
log.error("Error on Swift account size -- maxSize: " + maxSizeInBytes + ", bytesUsed: " + bytesUsed);
}

@Override
public void warningOnContainerSize(long warningLimitInBytes, long bytesUsed) {}
public void warningOnContainerSize(long warningLimitInBytes, long bytesUsed) {
log.warn("Warning on Swift container size -- warningLimit: " + warningLimitInBytes + ", bytesUsed: " + bytesUsed);
}

@Override
public void errorOnContainerSize(long maxSizeInBytes, long bytesUsed) {}
public void errorOnContainerSize(long maxSizeInBytes, long bytesUsed) {
log.error("Error on Swift container size -- maxSize: " + maxSizeInBytes + ", bytesUsed: " + bytesUsed);
}
};
}
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<module>citations</module>
<module>common</module>
<module>config</module>
<module>cloud-content</module>
<module>content</module>
<module>content-review</module>
<module>courier</module>
Expand Down Expand Up @@ -137,6 +138,7 @@
<module>clogdashboardintegration</module>
<module>common</module>
<module>config</module>
<module>cloud-content</module>
<module>content</module>
<module>content-review</module>
<module>courier</module>
Expand Down

0 comments on commit 8b4af01

Please sign in to comment.