Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
get compile/test to work with Jersey2 artifacts
-- Switch to Jersey 2
-- Get rid of the bespoke InjectableSession classes
-- Remove the Spring-specific Component annotation from the JAXRS resources
  • Loading branch information
barmintor committed Nov 7, 2013
1 parent 53ba9c8 commit 6903c9e
Show file tree
Hide file tree
Showing 58 changed files with 286 additions and 497 deletions.
21 changes: 7 additions & 14 deletions fcrepo-auth-common/pom.xml
Expand Up @@ -48,20 +48,13 @@
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>com.sun.jersey.jersey-test-framework</groupId>
<artifactId>jersey-test-framework-grizzly2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<version>${jersey.version}</version>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>jersey-test-framework-provider-grizzly2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-grizzly2-servlet</artifactId>
<version>2.0</version>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -92,8 +85,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-grizzly2</artifactId>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-grizzly2-servlet</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -105,9 +98,9 @@
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-spring</artifactId>
<dependency>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-spring3</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
20 changes: 2 additions & 18 deletions fcrepo-auth-oauth/pom.xml
Expand Up @@ -82,21 +82,11 @@
<artifactId>grizzly-http-servlet</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-grizzly2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-spring</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -118,14 +108,8 @@
</exclusions>
</dependency>
<dependency>
<groupId>com.sun.jersey.jersey-test-framework</groupId>
<artifactId>jersey-test-framework-grizzly2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<version>${jersey.version}</version>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>jersey-test-framework-provider-grizzly2</artifactId>
<scope>test</scope>
</dependency>
<!-- Playing with ordered loading for tests -->
Expand Down
8 changes: 4 additions & 4 deletions fcrepo-generator-dc/pom.xml
Expand Up @@ -81,8 +81,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-grizzly2</artifactId>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-grizzly2-servlet</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -91,8 +91,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-spring</artifactId>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-spring3</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Expand Up @@ -23,6 +23,7 @@
import java.util.List;

import javax.annotation.Resource;
import javax.inject.Inject;
import javax.jcr.PathNotFoundException;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
Expand Down Expand Up @@ -51,7 +52,7 @@ public class DublinCoreGenerator extends AbstractResource {
@Resource
List<DCGenerator> dcgenerators;

@InjectedSession
@Inject
protected Session session;

/**
Expand Down
5 changes: 5 additions & 0 deletions fcrepo-http-api/pom.xml
Expand Up @@ -83,6 +83,11 @@
<artifactId>jersey-test-framework-provider-grizzly2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
Expand Down
Expand Up @@ -31,6 +31,7 @@
import java.util.Date;
import java.util.List;

import javax.inject.Inject;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
Expand All @@ -55,20 +56,17 @@
import org.fcrepo.http.commons.api.rdf.HttpGraphSubjects;
import org.fcrepo.http.commons.domain.Range;
import org.fcrepo.http.commons.responses.RangeRequestInputStream;
import org.fcrepo.http.commons.session.InjectedSession;
import org.fcrepo.kernel.Datastream;
import org.fcrepo.kernel.exception.InvalidChecksumException;
import org.slf4j.Logger;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.codahale.metrics.annotation.Timed;

/**
* Content controller for adding, reading, and manipulating
* binary streams
*/
@Component
@Scope("prototype")
@Path("/{path: .*}/fcr:content")
public class FedoraContent extends AbstractResource {
Expand All @@ -77,7 +75,7 @@ public class FedoraContent extends AbstractResource {

public static final int PARTIAL_CONTENT = 206;

@InjectedSession
@Inject
protected Session session;

private final Logger logger = getLogger(FedoraContent.class);
Expand Down
Expand Up @@ -33,6 +33,7 @@
import java.util.Date;
import java.util.List;

import javax.inject.Inject;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.RepositoryException;
Expand All @@ -59,7 +60,6 @@
import org.glassfish.jersey.media.multipart.MultiPart;
import org.fcrepo.http.commons.AbstractResource;
import org.fcrepo.http.commons.api.rdf.HttpGraphSubjects;
import org.fcrepo.http.commons.session.InjectedSession;
import org.fcrepo.kernel.Datastream;
import org.fcrepo.kernel.exception.InvalidChecksumException;
import org.fcrepo.kernel.utils.ContentDigest;
Expand All @@ -78,7 +78,7 @@
@Path("/{path: .*}/fcr:datastreams")
public class FedoraDatastreams extends AbstractResource {

@InjectedSession
@Inject
protected Session session;

private final Logger logger = getLogger(FedoraDatastreams.class);
Expand Down
Expand Up @@ -23,6 +23,7 @@
import java.io.OutputStream;
import java.util.List;

import javax.inject.Inject;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.ws.rs.DefaultValue;
Expand All @@ -36,26 +37,22 @@
import javax.ws.rs.core.StreamingOutput;

import org.fcrepo.http.commons.AbstractResource;
import org.fcrepo.http.commons.session.InjectedSession;
import org.fcrepo.serialization.FedoraObjectSerializer;
import org.fcrepo.serialization.SerializerUtil;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
* Serialization for nodes
*/
@Component
@Scope("prototype")
@Path("/{path: .*}/fcr:export")
public class FedoraExport extends AbstractResource {

@Autowired
@Inject
protected SerializerUtil serializers;

@InjectedSession
@Inject
protected Session session;

private final Logger logger = getLogger(this.getClass());
Expand Down
Expand Up @@ -41,6 +41,7 @@
import static org.fcrepo.kernel.RdfLexicon.SEARCH_TERMS;
import static org.slf4j.LoggerFactory.getLogger;

import javax.inject.Inject;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.servlet.http.HttpServletResponse;
Expand All @@ -57,11 +58,9 @@
import org.fcrepo.http.commons.AbstractResource;
import org.fcrepo.http.commons.api.rdf.HttpGraphSubjects;
import org.fcrepo.http.commons.responses.HtmlTemplate;
import org.fcrepo.http.commons.session.InjectedSession;
import org.fcrepo.jcr.FedoraJcrTypes;
import org.slf4j.Logger;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.codahale.metrics.annotation.Timed;
import com.hp.hpl.jena.query.Dataset;
Expand All @@ -75,13 +74,12 @@
* @author ajs6f
*/

@Component
@Scope("prototype")
@Path("/fcr:search")
public class FedoraFieldSearch extends AbstractResource implements
FedoraJcrTypes {

@InjectedSession
@Inject
protected Session session;

private static final Logger LOGGER = getLogger(FedoraFieldSearch.class);
Expand Down
Expand Up @@ -27,6 +27,7 @@

import java.util.List;

import javax.inject.Inject;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.ws.rs.GET;
Expand All @@ -40,10 +41,8 @@

import org.fcrepo.http.commons.AbstractResource;
import org.fcrepo.http.commons.api.rdf.HttpGraphSubjects;
import org.fcrepo.http.commons.session.InjectedSession;
import org.fcrepo.kernel.Datastream;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.codahale.metrics.annotation.Timed;
import com.hp.hpl.jena.query.Dataset;
Expand All @@ -54,12 +53,11 @@
* @author ajs6f
* @date Jun 12, 2013
*/
@Component
@Scope("prototype")
@Path("/{path: .*}/fcr:fixity")
public class FedoraFixity extends AbstractResource {

@InjectedSession
@Inject
protected Session session;

/**
Expand Down
Expand Up @@ -36,6 +36,7 @@
import java.util.Collection;
import java.util.List;

import javax.inject.Inject;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.ws.rs.DefaultValue;
Expand All @@ -50,9 +51,7 @@

import org.fcrepo.http.commons.AbstractResource;
import org.fcrepo.http.commons.api.rdf.HttpGraphSubjects;
import org.fcrepo.http.commons.session.InjectedSession;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.codahale.metrics.annotation.Timed;
import com.hp.hpl.jena.query.Dataset;
Expand All @@ -65,12 +64,11 @@
* @author ajs6f
* @author cbeer
*/
@Component
@Scope("prototype")
@Path("/{path: .*}/fcr:pid")
public class FedoraIdentifiers extends AbstractResource {

@InjectedSession
@Inject
protected Session session;

/**
Expand Down
Expand Up @@ -25,6 +25,7 @@
import java.net.URISyntaxException;
import java.util.List;

import javax.inject.Inject;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.ws.rs.DefaultValue;
Expand All @@ -37,26 +38,23 @@

import org.fcrepo.http.commons.AbstractResource;
import org.fcrepo.http.commons.api.rdf.HttpGraphSubjects;
import org.fcrepo.http.commons.session.InjectedSession;
import org.fcrepo.kernel.exception.InvalidChecksumException;
import org.fcrepo.serialization.SerializerUtil;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
* Import serialized objects at a given endpoint
*
* @author ajs6f
* @author cbeer
*/
@Component
@Scope("prototype")
@Path("/{path: .*}/fcr:import")
public class FedoraImport extends AbstractResource {

@InjectedSession
@Inject
protected Session session;

@Autowired
Expand Down

0 comments on commit 6903c9e

Please sign in to comment.