Permalink
Browse files

yank a bunch of unused JAX-B models out of http-commons

  • Loading branch information...
1 parent 7b4e883 commit 9b2d02946c6128271031f3f4cecb611b870e2902 @cbeer cbeer committed May 20, 2013
@@ -1,78 +0,0 @@
-
-package org.fcrepo.provider;
-
-import static org.slf4j.LoggerFactory.getLogger;
-
-import java.io.StringWriter;
-import java.util.Properties;
-
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.VelocityEngine;
-import org.fcrepo.jaxb.responses.access.DescribeRepository;
-import org.fcrepo.jaxb.search.FieldSearchResult;
-import org.slf4j.Logger;
-
-/**
- * Resolves the view to be used
- * @author Vincent Nguyen
- *
- */
-public class VelocityViewer {
-
- private VelocityEngine velocityEngine;
-
- private static final Logger logger = getLogger(VelocityViewer.class);
-
- public VelocityViewer() {
- try {
- // Load the velocity properties from the class path
- final Properties properties = new Properties();
- properties.load(getClass().getClassLoader().getResourceAsStream(
- "velocity.properties"));
-
- // Create and initialize the template engine
- velocityEngine = new VelocityEngine(properties);
- } catch (final Exception e) {
- logger.warn("Exception rendering Velocity template: {}", e);
- }
- }
-
- public String getRepoInfo(final DescribeRepository repoinfo) {
- try {
- // Build a context to hold the model
- final VelocityContext velocityContext = new VelocityContext();
- velocityContext.put("repo", repoinfo);
-
- // Execute the template
- final StringWriter writer = new StringWriter();
- velocityEngine.mergeTemplate("views/repo-info.vm", "utf-8",
- velocityContext, writer);
-
- // Return the result
- return writer.toString();
- } catch (final Exception e) {
- logger.warn("Exception rendering Velocity template: {}", e);
- }
- return null;
- }
-
- public String getFieldSearch(final FieldSearchResult results) {
- try {
- // Build a context to hold the model
- final VelocityContext velocityContext = new VelocityContext();
- velocityContext.put("results", results);
-
- // Execute the template
- final StringWriter writer = new StringWriter();
- velocityEngine.mergeTemplate("views/search-results-form.vm",
- "utf-8", velocityContext, writer);
-
- // Return the result
- return writer.toString();
- } catch (final Exception e) {
- logger.warn("Exception rendering Velocity template: {}", e);
- }
- return null;
- }
-
-}
@@ -5,10 +5,6 @@
import java.io.UnsupportedEncodingException;
import java.util.concurrent.TimeUnit;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
@@ -20,10 +16,6 @@
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.PoolingClientConnectionManager;
import org.apache.http.util.EntityUtils;
-import org.fcrepo.jaxb.responses.access.ObjectDatastreams;
-import org.fcrepo.jaxb.responses.access.ObjectProfile;
-import org.fcrepo.jaxb.responses.management.DatastreamFixity;
-import org.fcrepo.jaxb.responses.management.DatastreamProfile;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
@@ -37,23 +29,13 @@
protected Logger logger;
- protected JAXBContext context;
-
protected String OBJECT_PATH = "objects";
@Before
public void setLogger() {
logger = LoggerFactory.getLogger(this.getClass());
}
- @Before
- public void setContext() throws JAXBException {
- context =
- JAXBContext.newInstance(ObjectProfile.class,
- ObjectDatastreams.class, DatastreamProfile.class,
- DatastreamFixity.class);
- }
-
protected static final int SERVER_PORT = Integer.parseInt(System
.getProperty("test.port", "8080"));
@@ -121,12 +103,4 @@ protected int getStatus(final HttpUriRequest method)
return result;
}
- protected ObjectProfile getObject(final String pid)
- throws ClientProtocolException, IOException, JAXBException {
- final HttpGet get = new HttpGet(serverAddress + "objects/" + pid);
- get.setHeader("Accept", "text/xml");
- final HttpResponse resp = execute(get);
- final Unmarshaller um = context.createUnmarshaller();
- return (ObjectProfile) um.unmarshal(resp.getEntity().getContent());
- }
}
@@ -1,113 +0,0 @@
-package org.fcrepo.jaxb.responses.access;
-
-import static org.fcrepo.services.functions.GetClusterConfiguration.CACHE_MODE;
-import static org.fcrepo.services.functions.GetClusterConfiguration.CLUSTER_MEMBERS;
-import static org.fcrepo.services.functions.GetClusterConfiguration.CLUSTER_NAME;
-import static org.fcrepo.services.functions.GetClusterConfiguration.CLUSTER_SIZE;
-import static org.fcrepo.services.functions.GetClusterConfiguration.NODE_ADDRESS;
-import static org.fcrepo.services.functions.GetClusterConfiguration.NODE_VIEW;
-import static org.fcrepo.services.functions.GetClusterConfiguration.PHYSICAL_ADDRESS;
-
-import java.util.Map;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-@XmlType(name = "clusterConfiguration")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class DescribeCluster {
-
- @XmlElement
- public String cacheMode;
-
- @XmlElement
- public String clusterName;
-
- @XmlElement
- public String nodeAddress;
-
- @XmlElement
- public String physicalAddress;
-
- @XmlElement
- public String nodeView;
-
- @XmlElement
- public String clusterSize;
-
- @XmlElement
- public String clusterMembers;
-
- public DescribeCluster() {
-
- }
-
- public DescribeCluster(Map<String, String> in) {
- this.setCacheMode(in.get(CACHE_MODE));
- this.setClusterMembers(in.get(CLUSTER_MEMBERS));
- this.setClusterName(in.get(CLUSTER_NAME));
- this.setClusterSize(in.get(CLUSTER_SIZE));
- this.setNodeAddress(in.get(NODE_ADDRESS));
- this.setNodeView(in.get(NODE_VIEW));
- this.setPhysicalAddress(in.get(PHYSICAL_ADDRESS));
- }
-
- //Getters and setters mainly used for velocity template access
- public String getCacheMode() {
- return cacheMode;
- }
-
- public void setCacheMode(String cacheMode) {
- this.cacheMode = cacheMode;
- }
-
- public String getClusterName() {
- return clusterName;
- }
-
- public void setClusterName(String clusterName) {
- this.clusterName = clusterName;
- }
-
- public String getNodeAddress() {
- return nodeAddress;
- }
-
- public void setNodeAddress(String nodeAddress) {
- this.nodeAddress = nodeAddress;
- }
-
- public String getPhysicalAddress() {
- return physicalAddress;
- }
-
- public void setPhysicalAddress(String physicalAddress) {
- this.physicalAddress = physicalAddress;
- }
-
- public String getNodeView() {
- return nodeView;
- }
-
- public void setNodeView(String nodeView) {
- this.nodeView = nodeView;
- }
-
- public String getClusterSize() {
- return clusterSize;
- }
-
- public void setClusterSize(String clusterSize) {
- this.clusterSize = clusterSize;
- }
-
- public String getClusterMembers() {
- return clusterMembers;
- }
-
- public void setClusterMembers(String clusterMembers) {
- this.clusterMembers = clusterMembers;
- }
-}
@@ -1,84 +0,0 @@
-
-package org.fcrepo.jaxb.responses.access;
-
-import java.net.URI;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement(name = "fedoraRepository")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class DescribeRepository {
-
- public static final String FEDORA_VERSION = "4.0-modeshape-candidate";
-
- @XmlElement
- public URI repositoryBaseURL;
-
- @XmlElement
- protected String repositoryVersion = FEDORA_VERSION;
-
- @XmlElement
- public Long numberOfObjects;
-
- @XmlElement
- public Long repositorySize;
-
- @XmlElement(name = "sampleOAI-URL")
- public URI sampleOAIURL;
-
- @XmlElement(name = "clusterConfiguration", nillable = true)
- public DescribeCluster clusterConfiguration = null;
-
- public URI getRepositoryBaseURL() {
- return repositoryBaseURL;
- }
-
- public void setRepositoryBaseURL(final URI repositoryBaseURL) {
- this.repositoryBaseURL = repositoryBaseURL;
- }
-
- public String getRepositoryVersion() {
- return repositoryVersion;
- }
-
- public void setRepositoryVersion(final String repositoryVersion) {
- this.repositoryVersion = repositoryVersion;
- }
-
- public Long getNumberOfObjects() {
- return numberOfObjects;
- }
-
- public void setNumberOfObjects(final Long numberOfObjects) {
- this.numberOfObjects = numberOfObjects;
- }
-
- public Long getRepositorySize() {
- return repositorySize;
- }
-
- public void setRepositorySize(final Long repositorySize) {
- this.repositorySize = repositorySize;
- }
-
- public URI getSampleOAIURL() {
- return sampleOAIURL;
- }
-
- public void setSampleOAIURL(final URI sampleOAIURL) {
- this.sampleOAIURL = sampleOAIURL;
- }
-
- public DescribeCluster getClusterConfiguration() {
- return clusterConfiguration;
- }
-
- public void setClusterConfiguration(DescribeCluster describeCluster) {
- if(describeCluster != null)
- this.clusterConfiguration = describeCluster;
- }
-
-}
@@ -1,39 +0,0 @@
-
-package org.fcrepo.jaxb.responses.access;
-
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-@XmlRootElement(name = "objectDatastreams")
-public class ObjectDatastreams {
-
- @XmlElement(name = "datastream")
- public Set<DatastreamElement> datastreams;
-
- @XmlType(name = "datastream")
- public static class DatastreamElement {
-
- @XmlAttribute
- public String dsid;
-
- @XmlAttribute
- public String label;
-
- @XmlAttribute
- public String mimeType;
-
- public DatastreamElement(final String dsid, final String label,
- final String mimeType) {
- this.dsid = dsid;
- this.label = label;
- this.mimeType = mimeType;
- }
-
- public DatastreamElement() {
- }
- }
-}
Oops, something went wrong.

0 comments on commit 9b2d029

Please sign in to comment.