From 64ba7ed0422c019b68e5e31cfa6b7023f106eb67 Mon Sep 17 00:00:00 2001 From: Jared Whiklo Date: Thu, 14 Mar 2019 17:30:59 -0500 Subject: [PATCH] Reverts unnecessary pom.xml update and adds camel dependency updates and fixes. * This reverts commit aced86b113c2fe6601e80bad1e3da8feb194d56e. * Makes updates to pom * Bump to camel 2.20.0 and makes required updates. --- pom.xml | 28 ++++++------------- .../java/org/fcrepo/camel/FcrepoEndpoint.java | 10 +++---- .../java/org/fcrepo/camel/FcrepoProducer.java | 9 +++--- .../org/fcrepo/camel/integration/KarafIT.java | 20 ++++++------- 4 files changed, 27 insertions(+), 40 deletions(-) diff --git a/pom.xml b/pom.xml index 5824553..078fbe5 100644 --- a/pom.xml +++ b/pom.xml @@ -37,20 +37,22 @@ github - 5.15.5 - 2.19.5 - [2.19.5,3) + 5.14.0 + 2.20.0 + [2.20,3) 2.4 - 3.8.1 + 3.7 4.5.2 - 4.2.2 + 4.0.6 3.1.1 1.10.8 - 4.13.1 + 4.8.0 1.7.20 - 4.3.22.RELEASE + 4.2.5.RELEASE 5.0.1 0.4.0 + + 2.18.1 1.10 @@ -206,12 +208,6 @@ camel-test-karaf ${camel.version} test - - - org.ops4j.pax.exam - pax-exam - - @@ -345,16 +341,10 @@ ${fcrepo.dynamic.stomp.port} ${commons.codec.version} ${commons.csv.version} - ${commons.lang3.version} - ${camel.version} ${dexx-collection.version} ${httpclient.version} ${httpcore.version} ${jsonld.version} - ${jena.version} - ${jsonld.version} - ${fcrepo-java-client.version} - ${thrift.version} ${karaf.ssh.port} ${karaf.rmiRegistry.port} diff --git a/src/main/java/org/fcrepo/camel/FcrepoEndpoint.java b/src/main/java/org/fcrepo/camel/FcrepoEndpoint.java index bbab69d..f51ce88 100644 --- a/src/main/java/org/fcrepo/camel/FcrepoEndpoint.java +++ b/src/main/java/org/fcrepo/camel/FcrepoEndpoint.java @@ -155,7 +155,7 @@ public FcrepoConfiguration getConfiguration() { /** * configuration setter - * + * * @param config The FcrepoConfiguration */ public void setConfiguration(final FcrepoConfiguration config) { @@ -222,7 +222,7 @@ public String getAccept() { /** * contentType setter - * + * * @param type the mime-type used with Content-Type headers */ @ManagedAttribute(description = "Content-Type: Header") @@ -242,7 +242,7 @@ public String getContentType() { /** * authUsername setter - * + * * @param username used for repository authentication */ @ManagedAttribute(description = "Username for authentication") @@ -262,7 +262,7 @@ public String getAuthUsername() { /** * authPassword setter - * + * * @param password used for repository authentication */ @ManagedAttribute(description = "Password for authentication") @@ -282,7 +282,7 @@ public String getAuthPassword() { /** * authHost setter - * + * * @param host realm used for repository authentication */ @ManagedAttribute(description = "Hostname for authentication") diff --git a/src/main/java/org/fcrepo/camel/FcrepoProducer.java b/src/main/java/org/fcrepo/camel/FcrepoProducer.java index e629f1a..8941c1d 100644 --- a/src/main/java/org/fcrepo/camel/FcrepoProducer.java +++ b/src/main/java/org/fcrepo/camel/FcrepoProducer.java @@ -79,11 +79,11 @@ public class FcrepoProducer extends DefaultProducer { private static final String REPOSITORY = "http://fedora.info/definitions/v4/repository#"; - private FcrepoEndpoint endpoint; + private final FcrepoEndpoint endpoint; private FcrepoClient fcrepoClient; - private TransactionTemplate transactionTemplate; + private final TransactionTemplate transactionTemplate; public static final Map PREFER_PROPERTIES; @@ -141,12 +141,13 @@ public FcrepoProducer(final FcrepoEndpoint endpoint) { public void process(final Exchange exchange) throws FcrepoOperationFailedException { if (exchange.isTransacted()) { transactionTemplate.execute(new TransactionCallbackWithoutResult() { + @Override protected void doInTransactionWithoutResult(final TransactionStatus status) { final DefaultTransactionStatus st = (DefaultTransactionStatus)status; final FcrepoTransactionObject tx = (FcrepoTransactionObject)st.getTransaction(); try { doRequest(exchange, tx.getSessionId()); - } catch (FcrepoOperationFailedException ex) { + } catch (final FcrepoOperationFailedException ex) { throw new TransactionSystemException( "Error executing fcrepo request in transaction: ", ex); } @@ -367,7 +368,7 @@ private static Object extractResponseBodyAsStream(final InputStream is, final Ex IOHelper.copyAndCloseInput(is, cos); // When the InputStream is closed, the CachedOutputStream will be closed return cos.newStreamCache(); - } catch (IOException ex) { + } catch (final IOException ex) { LOGGER.debug("Error extracting body from http request", ex); return null; } diff --git a/src/test/java/org/fcrepo/camel/integration/KarafIT.java b/src/test/java/org/fcrepo/camel/integration/KarafIT.java index a738a4c..fbea1ed 100644 --- a/src/test/java/org/fcrepo/camel/integration/KarafIT.java +++ b/src/test/java/org/fcrepo/camel/integration/KarafIT.java @@ -62,20 +62,14 @@ public Option[] config() { final String fcrepoCamelBundle = "file:" + getBaseDir() + "/target/" + artifactName + ".jar"; final String commonsCodecVersion = cm.getProperty("commons.codec.version"); final String commonsCsvVersion = cm.getProperty("commons.csv.version"); - final String commonsLang3Version = cm.getProperty("commons.lang3.version"); final String dexxVersion = cm.getProperty("dexx.version"); final String httpclientVersion = cm.getProperty("httpclient.version"); final String httpcoreVersion = cm.getProperty("httpcore.version"); final String jsonldVersion = cm.getProperty("jsonld.version"); - final String jenaOsgiVersion = cm.getProperty("jena.osgi.version"); - final String javaClientVersion = cm.getProperty("fcrepo.client.version"); - - final String thriftVersion = cm.getProperty("thrift.version"); final String rmiRegistryPort = cm.getProperty("karaf.rmiRegistry.port"); final String rmiServerPort = cm.getProperty("karaf.rmiServer.port"); final String sshPort = cm.getProperty("karaf.ssh.port"); - return new Option[] { karafDistributionConfiguration() .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf") @@ -91,17 +85,19 @@ public Option[] config() { editConfigurationFilePut("etc/org.apache.karaf.shell.cfg", "sshPort", sshPort), features(maven().groupId("org.apache.karaf.features").artifactId("standard") .versionAsInProject().classifier("features").type("xml"), "scr"), - features(getCamelKarafFeatureUrl(), "camel-blueprint", "camel-spring", "camel-jackson"), + features(maven().groupId("org.apache.camel.karaf").artifactId("apache-camel") + .type("xml").classifier("features").versionAsInProject(), "camel", + "camel-blueprint", "camel-spring", "camel-jackson"), mavenBundle().groupId("org.apache.camel").artifactId("camel-test-karaf").versionAsInProject(), mavenBundle().groupId("commons-codec").artifactId("commons-codec").version(commonsCodecVersion), mavenBundle().groupId("org.apache.commons").artifactId("commons-csv").version(commonsCsvVersion), - mavenBundle().groupId("org.apache.commons").artifactId("commons-lang3").version(commonsLang3Version), - mavenBundle().groupId("org.apache.httpcomponents").artifactId("httpclient-osgi").version(httpclientVersion), - mavenBundle().groupId("org.apache.httpcomponents").artifactId("httpcore-osgi").version(httpcoreVersion), - mavenBundle().groupId("org.apache.jena").artifactId("jena-osgi").version(jenaOsgiVersion), + mavenBundle().groupId("org.apache.commons").artifactId("commons-lang3").versionAsInProject(), + mavenBundle().groupId("org.apache.httpcomponents").artifactId("httpclient-osgi").versionAsInProject(), + mavenBundle().groupId("org.apache.httpcomponents").artifactId("httpcore-osgi").versionAsInProject(), + mavenBundle().groupId("org.apache.jena").artifactId("jena-osgi").versionAsInProject(), mavenBundle().groupId("com.github.jsonld-java").artifactId("jsonld-java").version(jsonldVersion), mavenBundle().groupId("org.apache.thrift").artifactId("libthrift").version(thriftVersion), - mavenBundle().groupId("org.fcrepo.client").artifactId("fcrepo-java-client").version(javaClientVersion), + mavenBundle().groupId("org.fcrepo.client").artifactId("fcrepo-java-client").versionAsInProject(), mavenBundle().groupId("com.github.andrewoma.dexx").artifactId("collection").version(dexxVersion), bundle(fcrepoCamelBundle).start() };