Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
minor: first pass at cleaning up checkstyle warnings
  • Loading branch information
Edwin Shin committed Feb 23, 2013
1 parent 448d54f commit 062873d
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 35 deletions.
@@ -1,4 +1,4 @@
package org.fcrepo.modeshape.audit;
package org.fcrepo.audit;

import javax.jcr.RepositoryException;
import javax.jcr.observation.Event;
Expand All @@ -12,6 +12,12 @@
*/
public interface Auditor {

/**
*
* @param e The {@Event} to record.
*
* @throws RepositoryException
*/
@Subscribe
public void recordEvent(Event e) throws RepositoryException;
void recordEvent(Event e) throws RepositoryException;
}
@@ -1,4 +1,4 @@
package org.fcrepo.modeshape.audit;
package org.fcrepo.audit;

import static org.fcrepo.utils.EventType.getEventName;

Expand All @@ -17,14 +17,14 @@
*/
public class LogbackAuditor implements Auditor {

Logger logger = LoggerFactory.getLogger(LogbackAuditor.class);

/**
*
/**
* Logger for this class.
*/
private Logger logger = LoggerFactory.getLogger(LogbackAuditor.class);

@Override
@Subscribe
public void recordEvent(Event e) throws RepositoryException {
public void recordEvent(final Event e) throws RepositoryException {
logger.info(e.getUserID() + " " + getEventName(e.getType()) + " "
+ e.getPath());
}
Expand Down
5 changes: 5 additions & 0 deletions fcrepo-audit/src/main/java/org/fcrepo/audit/package-info.java
@@ -0,0 +1,5 @@
/**
Audit module code.
*/

package org.fcrepo.audit;
@@ -1,4 +1,4 @@
package org.fcrepo.modeshape.audit;
package org.fcrepo.audit;

import static org.mockito.Matchers.argThat;
import static org.mockito.Mockito.mock;
Expand All @@ -21,7 +21,6 @@

import com.google.common.eventbus.EventBus;


public class LogbackAuditorTest {

private int jcrEventType = 1;
Expand Down Expand Up @@ -58,11 +57,12 @@ public void testEventAuditing() throws Exception {

verify(mockAppender).doAppend(
(ILoggingEvent) argThat(new ArgumentMatcher<Object>() {
@Override
public boolean matches(final Object argument) {
return ((LoggingEvent) argument).getFormattedMessage()
.contains("jdoe node added /foo/bar");
}
}));

@Override
public boolean matches(final Object argument) {
return ((LoggingEvent) argument).getFormattedMessage()
.contains("jdoe node added /foo/bar");
}
}));
}
}
@@ -1,3 +1,4 @@

package org.fcrepo.generator.dublincore;

import static org.modeshape.jcr.api.JcrConstants.JCR_CONTENT;
Expand All @@ -14,7 +15,7 @@ public class IndexFromWellKnownPath extends AbstractIndexer {
private String wellKnownPath;

@Override
public InputStream getStream(Node node) {
public InputStream getStream(final Node node) {

try {
return getContentInputStream(node);
Expand All @@ -25,11 +26,13 @@ public InputStream getStream(Node node) {
}
}

private InputStream getContentInputStream(Node node) throws RepositoryException {
if(node.hasNode(this.wellKnownPath)) {
private InputStream getContentInputStream(final Node node)
throws RepositoryException {
if (node.hasNode(this.wellKnownPath)) {
final Node dc = node.getNode(this.wellKnownPath);

Binary binary = dc.getNode(JCR_CONTENT).getProperty(JCR_DATA).getBinary();
Binary binary =
dc.getNode(JCR_CONTENT).getProperty(JCR_DATA).getBinary();

return binary.getStream();
} else {
Expand Down
7 changes: 4 additions & 3 deletions fcrepo-kernel/src/main/java/org/fcrepo/Datastream.java
Expand Up @@ -64,14 +64,15 @@ public String getLabel() throws RepositoryException {

Property labels = node.getProperty(DC_TITLE);
String label;
if (!labels.isMultiple())
if (!labels.isMultiple()) {
label = node.getProperty(DC_TITLE).getString();
else {
} else {
label = on('/').join(map(labels.getValues(), value2string));
}
return label;
} else
} else {
return "";
}

}

Expand Down
Expand Up @@ -2,6 +2,6 @@

public interface PidMinter {

public String mintPid() ;
public String mintPid();

}
Expand Up @@ -108,7 +108,7 @@ public static Set<String> getObjectNames() throws RepositoryException {
}

@PostConstruct
public void getSession() {
public final void getSession() {
try {
readOnlySession = repo.login();
} catch (RepositoryException e) {
Expand All @@ -117,7 +117,7 @@ public void getSession() {
}

@PreDestroy
public void logoutSession() {
public final void logoutSession() {
readOnlySession.logout();
}

Expand Down
33 changes: 24 additions & 9 deletions pom.xml
Expand Up @@ -21,8 +21,6 @@
<activemq.version>5.7.0</activemq.version>
<cxf.version>2.7.2</cxf.version>
<modeshape.version>3.1.2.Final</modeshape.version>
<infinispan.version>5.2.1.Final</infinispan.version>
<jgroups.version>3.2.6.Final</jgroups.version>
<slf4j.version>1.7.2</slf4j.version>
<spring.version>3.2.0.RELEASE</spring.version>

Expand All @@ -45,11 +43,10 @@

<dependencyManagement>
<dependencies>
<!-- Import the ModeShape BOM for embedded usage. This adds to the
"dependenciesManagement" section defaults for all of the modules we might
need, but we still have to include in the "dependencies" section the modules
we DO need. The benefit is that we don't have to specify the versions of
any of those modules. -->
<!-- Import the ModeShape BOM for embedded usage. This adds to the "dependenciesManagement"
section defaults for all of the modules we might need, but we still have to include
in the "dependencies" section the modules we DO need. The benefit is that we don't
have to specify the versions of any of those modules. -->
<dependency>
<groupId>org.modeshape.bom</groupId>
<artifactId>modeshape-bom-embedded</artifactId>
Expand Down Expand Up @@ -133,12 +130,12 @@
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<version>${infinispan.version}</version>
<version>5.2.0.Final</version>
</dependency>
<dependency>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
<version>${jgroups.version}</version>
<version>3.2.6.Final</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -249,6 +246,24 @@
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.2</version>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.13</version>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.3.1</version>
Expand Down

0 comments on commit 062873d

Please sign in to comment.