From 231a00ac55c77f3c6c18ba4b9547677172cea6ca Mon Sep 17 00:00:00 2001 From: Jared Whiklo Date: Wed, 6 Mar 2019 21:57:45 -0600 Subject: [PATCH 1/3] Revert "FCREPO-2987: Updates fcrepo-parent version to 5.0.1 (#149)" This reverts commit aced86b113c2fe6601e80bad1e3da8feb194d56e. --- pom.xml | 30 ++++++------------- .../java/org/fcrepo/camel/FcrepoEndpoint.java | 2 +- .../java/org/fcrepo/camel/FcrepoProducer.java | 2 +- .../org/fcrepo/camel/integration/KarafIT.java | 16 ++++------ 4 files changed, 16 insertions(+), 34 deletions(-) diff --git a/pom.xml b/pom.xml index 5824553..d3bed25 100644 --- a/pom.xml +++ b/pom.xml @@ -6,14 +6,14 @@ org.fcrepo fcrepo-parent - 5.0.1 + 4.7.5 org.fcrepo.camel fcrepo-camel bundle - 5.0.0-SNAPSHOT + 4.6.0-SNAPSHOT Fcrepo Camel Component Camel Component for interacting with a Fedora Repository @@ -37,18 +37,18 @@ github - 5.15.5 - 2.19.5 - [2.19.5,3) + 5.14.0 + 2.18.2 + [2.18,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 @@ -206,12 +206,6 @@ camel-test-karaf ${camel.version} test - - - org.ops4j.pax.exam - pax-exam - - @@ -345,16 +339,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..b2f1d78 100644 --- a/src/main/java/org/fcrepo/camel/FcrepoEndpoint.java +++ b/src/main/java/org/fcrepo/camel/FcrepoEndpoint.java @@ -99,7 +99,7 @@ public boolean isSingleton() { * @return a transaction template */ public TransactionTemplate createTransactionTemplate() { - final TransactionTemplate transactionTemplate; + TransactionTemplate transactionTemplate; if (getTransactionManager() != null) { transactionTemplate = new TransactionTemplate(getTransactionManager()); diff --git a/src/main/java/org/fcrepo/camel/FcrepoProducer.java b/src/main/java/org/fcrepo/camel/FcrepoProducer.java index e629f1a..88d733e 100644 --- a/src/main/java/org/fcrepo/camel/FcrepoProducer.java +++ b/src/main/java/org/fcrepo/camel/FcrepoProducer.java @@ -166,7 +166,7 @@ private void doRequest(final Exchange exchange, final String transaction) throws LOGGER.debug("Fcrepo Request [{}] with method [{}]", url, method); - final FcrepoResponse response; + FcrepoResponse response; switch (method) { case PATCH: diff --git a/src/test/java/org/fcrepo/camel/integration/KarafIT.java b/src/test/java/org/fcrepo/camel/integration/KarafIT.java index a738a4c..a57aecf 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") @@ -95,13 +89,13 @@ public Option[] config() { 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() }; From acf6bdf851caa00a42977bc4b65ea8fa29f1644f Mon Sep 17 00:00:00 2001 From: Jared Whiklo Date: Fri, 8 Mar 2019 11:07:19 -0600 Subject: [PATCH 2/3] Changes to pom --- pom.xml | 6 ++++-- src/main/java/org/fcrepo/camel/FcrepoEndpoint.java | 12 ++++++------ src/main/java/org/fcrepo/camel/FcrepoProducer.java | 11 ++++++----- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index d3bed25..1234583 100644 --- a/pom.xml +++ b/pom.xml @@ -6,14 +6,14 @@ org.fcrepo fcrepo-parent - 4.7.5 + 5.0.1 org.fcrepo.camel fcrepo-camel bundle - 4.6.0-SNAPSHOT + 5.0.0-SNAPSHOT Fcrepo Camel Component Camel Component for interacting with a Fedora Repository @@ -51,6 +51,8 @@ 4.2.5.RELEASE 5.0.1 0.4.0 + + 2.18.1 1.10 diff --git a/src/main/java/org/fcrepo/camel/FcrepoEndpoint.java b/src/main/java/org/fcrepo/camel/FcrepoEndpoint.java index b2f1d78..f51ce88 100644 --- a/src/main/java/org/fcrepo/camel/FcrepoEndpoint.java +++ b/src/main/java/org/fcrepo/camel/FcrepoEndpoint.java @@ -99,7 +99,7 @@ public boolean isSingleton() { * @return a transaction template */ public TransactionTemplate createTransactionTemplate() { - TransactionTemplate transactionTemplate; + final TransactionTemplate transactionTemplate; if (getTransactionManager() != null) { transactionTemplate = new TransactionTemplate(getTransactionManager()); @@ -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 88d733e..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); } @@ -166,7 +167,7 @@ private void doRequest(final Exchange exchange, final String transaction) throws LOGGER.debug("Fcrepo Request [{}] with method [{}]", url, method); - FcrepoResponse response; + final FcrepoResponse response; switch (method) { case PATCH: @@ -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; } From 4996d3f430dc33cb26addf09d4a54df1b327588b Mon Sep 17 00:00:00 2001 From: Jared Whiklo Date: Thu, 14 Mar 2019 13:08:03 -0500 Subject: [PATCH 3/3] Bump to camel 2.20.0 --- pom.xml | 4 ++-- src/test/java/org/fcrepo/camel/integration/KarafIT.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 1234583..078fbe5 100644 --- a/pom.xml +++ b/pom.xml @@ -38,8 +38,8 @@ 5.14.0 - 2.18.2 - [2.18,3) + 2.20.0 + [2.20,3) 2.4 3.7 4.5.2 diff --git a/src/test/java/org/fcrepo/camel/integration/KarafIT.java b/src/test/java/org/fcrepo/camel/integration/KarafIT.java index a57aecf..fbea1ed 100644 --- a/src/test/java/org/fcrepo/camel/integration/KarafIT.java +++ b/src/test/java/org/fcrepo/camel/integration/KarafIT.java @@ -85,7 +85,9 @@ 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),