Skip to content

Commit

Permalink
Add new camel serialization tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Bethany Seeger authored and Andrew Woods committed Dec 13, 2015
1 parent 4c1d6cf commit 4198ccc
Show file tree
Hide file tree
Showing 15 changed files with 1,180 additions and 0 deletions.
101 changes: 101 additions & 0 deletions fcrepo-serialization/README.md
@@ -0,0 +1,101 @@
#Fedora Serialization Service

This application implements serialization feature for fedora objects that
can be used to serialize objects in a plain text format to disk.


##Building

To build this project use

MAVEN_OPTS="-Xmx1024m" mvn install

##Running from the command line

To run the project you can execute the following Maven goal

mvn camel:run

##Deploying in OSGi

This project can be deployed in an OSGi container. For example using
[Apache ServiceMix](http://servicemix.apache.org/) or
[Apache Karaf](http://karaf.apache.org). You can run the following
command from its shell:

feature:repo-add mvn:org.fcrepo.camel/fcrepo-camel-toolbox/LATEST/xml/features
feature:install fcrepo-serialization

##Deploying in Tomcat/Jetty

If you intend to deploy this application in a web container such as Tomcat or Jetty,
please refer to the documentation in the
[fcrepo-camel-webapp](https://github.com/fcrepo4-ext/fcrepo-camel-toolbox/tree/master/fcrepo-camel-webapp)
project.

##Configuration

This application can be configured by creating a file in
`$KARAF_HOME/etc/org.fcrepo.camel.serialization.cfg`. The following
values are available for configuration:

In the event of failure, the maximum number of times a re-delivery will be attempted.

error.maxRedeliveries=10

If the fedora repository requires authentication, the following values
can be set:

fcrepo.authUsername=<username>
fcrepo.authPassword=<password>
fcrepo.authHost=<host realm>

The baseUrl for the fedora repository.

fcrepo.baseUrl=localhost:8080/fcrepo/rest

The JMS connection URI, used as a default input stream (queue).

jms.brokerUrl=tcp://localhost:61616

The camel URI for the incoming message stream.

input.stream=activemq:topic:fedora

The camel URI for handling re-serialization events.

serialization.stream=activemq:queue:serialization

The directory to store the metadata files in.

serialization.descriptions=file:///tmp/descriptions

The directory to store the binary files in, if writing them to disk.

serialization.binaries=file:///tmp/binaries

The flag for whether or not to write binaries to disk. If you would
like to include binaries in serialization, set this property to `true`.

serialization.includeBinaries=false

The format the metadata files will be written in.

serialization.mimeType=text/turtle

The file extension that will be used for the metadata files.

serialization.extension=ttl

The location of the internal Audit trail if using the `fcrepo-audit` extension module.
Nodes at this location will not be serialized.

audit.container=/audit

By editing this file, any currently running routes will be immediately redeployed
with the new values.

For more help see the Apache Camel documentation

http://camel.apache.org/

277 changes: 277 additions & 0 deletions fcrepo-serialization/pom.xml
@@ -0,0 +1,277 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">


<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>fcrepo-camel-toolbox</artifactId>
<groupId>org.fcrepo.camel</groupId>
<version>4.4.1-SNAPSHOT</version>
</parent>

<artifactId>fcrepo-serialization</artifactId>
<packaging>bundle</packaging>

<name>Fedora Serialization Service</name>
<description>Camel-based object serialization service</description>

<properties>
<osgi.export.packages>org.fcrepo.camel.serialization;version=${project.version}</osgi.export.packages>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</dependency>

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-blueprint</artifactId>
</dependency>

<dependency>
<groupId>org.fcrepo.camel</groupId>
<artifactId>fcrepo-camel</artifactId>
</dependency>

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-exec</artifactId>
</dependency>

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
</dependency>

<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-camel</artifactId>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>

<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>

<!-- Testing & Camel Plugin -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-blueprint</artifactId>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>

<dependency>
<groupId>com.jayway.awaitility</groupId>
<artifactId>awaitility</artifactId>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
</dependency>

<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-fuseki</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<defaultGoal>install</defaultGoal>

<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>

<!-- to generate the MANIFEST-FILE of the bundle -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>

<!-- to run the example using mvn camel:run -->
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
</plugin>

<!-- reserve network ports for integration testing -->
<!-- add configuration file to artifact set for OSGi deployment -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<configuration>
<portNames>
<portName>fcrepo.dynamic.test.port</portName>
<portName>fcrepo.dynamic.jms.port</portName>
<portName>fcrepo.dynamic.stomp.port</portName>
<portName>jetty.dynamic.stop.port</portName>
</portNames>
</configuration>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>src/main/cfg/org.fcrepo.camel.serialization.cfg</file>
<type>cfg</type>
<classifier>configuration</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>

<!-- integration testing -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<argLine>${jacoco.agent.it.arg}</argLine>
<systemPropertyVariables>
<fcrepo.dynamic.jms.port>${fcrepo.dynamic.jms.port}</fcrepo.dynamic.jms.port>
<fcrepo.dynamic.stomp.port>${fcrepo.dynamic.stomp.port}</fcrepo.dynamic.stomp.port>
<fcrepo.dynamic.test.port>${fcrepo.dynamic.test.port}</fcrepo.dynamic.test.port>
<jetty.dynamic.test.port>${jetty.dynamic.test.port}</jetty.dynamic.test.port>
</systemPropertyVariables>
</configuration>
</plugin>

<!-- Launch jetty for integration testing with Fedora -->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<systemProperties>
<force>true</force>
<systemProperty>
<name>fcrepo.home</name>
<value>${project.build.directory}/fcrepo-data</value>
</systemProperty>
<systemProperty>
<name>fcrepo.dynamic.jms.port</name>
<value>${fcrepo.dynamic.jms.port}</value>
</systemProperty>
<systemProperty>
<name>fcrepo.dynamic.stomp.port</name>
<value>${fcrepo.dynamic.stomp.port}</value>
</systemProperty>
</systemProperties>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopKey>STOP</stopKey>
<stopPort>${jetty.dynamic.stop.port}</stopPort>
<daemon>true</daemon>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>stop</goal>
<goal>start</goal>
</goals>
<configuration>
<httpConnector>
<port>${fcrepo.dynamic.test.port}</port>
</httpConnector>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
<contextHandlers>
<contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
<war>${project.build.directory}/fcrepo.war</war>
<contextPath>/fcrepo</contextPath>
</contextHandler>
</contextHandlers>
</configuration>
</execution>

<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>

<!--Bring in fcrepo webapp for integration testing-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${dependency.plugin.version}</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
<outputDirectory>${project.build.directory}</outputDirectory>
<destFileName>fcrepo.war</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>

</project>

0 comments on commit 4198ccc

Please sign in to comment.