Commit fac48864 authored by acoburn's avatar acoburn
Browse files

normalize host/port configuration for repo services

parent d913b709
......@@ -10,6 +10,11 @@ jms.brokerUrl=tcp://localhost:61616
# The camel URI for the incoming message stream.
input.stream=activemq:topic:fedora
# The rest endpoint components
rest.host=localhost
rest.port=9101
rest.prefix=/idiomatic
# The RDF property to use as an external identifier
id.property=dc:identifier
......
......@@ -23,7 +23,6 @@ import static org.fcrepo.camel.JmsHeaders.IDENTIFIER;
import org.apache.camel.Exchange;
import org.apache.camel.LoggingLevel;
import org.apache.camel.Processor;
import org.apache.camel.PropertyInject;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.builder.xml.Namespaces;
......@@ -35,9 +34,6 @@ import org.apache.camel.builder.xml.Namespaces;
*/
public class EventRouter extends RouteBuilder {
@PropertyInject(value = "rest.port", defaultValue = "9081")
private String port;
/**
* Configure the message route workflow.
*/
......
......@@ -13,8 +13,9 @@
<cm:property name="error.maxRedeliveries" value="10"/>
<cm:property name="jms.brokerUrl" value="tcp://localhost:61616"/>
<cm:property name="input.stream" value="activemq:topic:fedora"/>
<cm:property name="rest.prefix" value="idiomatic"/>
<cm:property name="rest.port" value="9080"/>
<cm:property name="rest.host" value="localhost"/>
<cm:property name="rest.prefix" value="/idiomatic"/>
<cm:property name="rest.port" value="9101"/>
<cm:property name="id.property" value="dc:identifier"/>
<cm:property name="id.namespace" value="http://purl.org/dc/elements/1.1/"/>
<cm:property name="id.prefix" value=""/>
......@@ -39,7 +40,7 @@
<package>edu.amherst.acdc.idiomatic</package>
<restConfiguration component="jetty" host="localhost" port="{{rest.port}}"/>
<restConfiguration component="jetty" host="{{rest.host}}" port="{{rest.port}}"/>
<route id="MinterRoute">
<description>Create a freshly minted ID</description>
......
......@@ -56,7 +56,7 @@ The path to the `convert` utility
The port on which the service is made availalbe
rest.port=9081
rest.port=9105
The hostname on which the service is available
......
# HTTP Port
rest.host=localhost
rest.port=9081
rest.port=9105
rest.prefix=/image
# Path to convert utility
......
......@@ -10,7 +10,7 @@
<!-- OSGI blueprint property placeholder -->
<cm:property-placeholder persistent-id="edu.amherst.acdc.image.service" update-strategy="reload">
<cm:default-properties>
<cm:property name="rest.port" value="9081"/>
<cm:property name="rest.port" value="9105"/>
<cm:property name="rest.prefix" value="/image"/>
<cm:property name="rest.host" value="localhost"/>
<cm:property name="fcrepo.baseUrl" value="localhost:8080/fcrepo/rest"/>
......
......@@ -180,6 +180,9 @@
<portName>fcrepo.dynamic.stomp.port</portName>
<portName>karaf.jsonld.port</portName>
<portName>karaf.template.port</portName>
<portName>karaf.metadata.port</portName>
<portName>karaf.image.port</portName>
<portName>karaf.idiomatic.port</portName>
<portName>karaf.rmiRegistry.port</portName>
<portName>karaf.rmiServer.port</portName>
<portName>karaf.ssh.port</portName>
......@@ -211,6 +214,9 @@
<project.build.outputDirectory>${project.build.outputDirectory}</project.build.outputDirectory>
<karaf.jsonld.port>${karaf.jsonld.port}</karaf.jsonld.port>
<karaf.template.port>${karaf.template.port}</karaf.template.port>
<karaf.idiomatic.port>${karaf.idiomatic.port}</karaf.idiomatic.port>
<karaf.metadata.port>${karaf.metadata.port}</karaf.metadata.port>
<karaf.image.port>${karaf.image.port}</karaf.image.port>
<karaf.ssh.port>${karaf.ssh.port}</karaf.ssh.port>
<karaf.rmiRegistry.port>${karaf.rmiRegistry.port}</karaf.rmiRegistry.port>
<karaf.rmiServer.port>${karaf.rmiServer.port}</karaf.rmiServer.port>
......
......@@ -114,7 +114,7 @@ public class AcrepoJsonLDIT extends AbstractOSGiIT {
final String baseUrl = "http://localhost:" + System.getProperty("fcrepo.port") + "/fcrepo/rest";
final String baseSvcUrl = "http://localhost:" + System.getProperty("karaf.jsonld.port") + "/jsonld";
assertTrue(options(baseSvcUrl).contains("owl:equivalentClass fedora:Binary"));
assertTrue(options(baseSvcUrl).contains("owl:equivalentClass fedora:Resource"));
rangeClosed(1, 3).mapToObj(x -> post(baseUrl).replace(baseUrl, "")).forEach(id -> {
final ObjectMapper mapper = new ObjectMapper();
......
......@@ -54,6 +54,11 @@ public class AcrepoServicesIT extends AbstractOSGiIT {
final String rmiRegistryPort = cm.getProperty("karaf.rmiRegistry.port");
final String rmiServerPort = cm.getProperty("karaf.rmiServer.port");
final String sshPort = cm.getProperty("karaf.ssh.port");
final String idiomaticPort = cm.getProperty("karaf.idiomatic.port");
final String metadataPort = cm.getProperty("karaf.metadata.port");
final String templatePort = cm.getProperty("karaf.template.port");
final String jsonldPort = cm.getProperty("karaf.jsonld.port");
final String imagePort = cm.getProperty("karaf.image.port");
return new Option[] {
karafDistributionConfiguration()
......@@ -76,6 +81,12 @@ public class AcrepoServicesIT extends AbstractOSGiIT {
"acrepo-jsonld-service", "acrepo-jsonld-osgi", "acrepo-template-mustache",
"acrepo-image-service"),
editConfigurationFilePut("etc/edu.amherst.acdc.jsonld.service.cfg", "rest.port", jsonldPort),
editConfigurationFilePut("etc/edu.amherst.acdc.template.mustache.cfg", "rest.port", templatePort),
editConfigurationFilePut("etc/edu.amherst.acdc.xml.metadata.cfg", "rest.port", metadataPort),
editConfigurationFilePut("etc/edu.amherst.acdc.idiomatic.cfg", "rest.port", idiomaticPort),
editConfigurationFilePut("etc/edu.amherst.acdc.image.service.cfg", "rest.port", imagePort),
editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort", rmiRegistryPort),
editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", rmiServerPort),
editConfigurationFilePut("etc/org.apache.karaf.shell.cfg", "sshPort", sshPort)
......
......@@ -44,7 +44,15 @@ The location of the JSON-LD context document
The port on which the service is made availalbe
rest.port=13431
rest.port=9102
The hostname for the service
rest.host=localhost
The REST prefix
rest.prefix=/jsonld
By editing this file, any currently running routes will be immediately redeployed
with the new values.
......
......@@ -3,7 +3,7 @@ error.maxRedeliveries=10
# HTTP Port
rest.host=localhost
rest.port=13421
rest.port=9102
rest.prefix=/jsonld
# JSON Context file
......
......@@ -11,7 +11,7 @@
<cm:property-placeholder persistent-id="edu.amherst.acdc.jsonld.service" update-strategy="reload">
<cm:default-properties>
<cm:property name="error.maxRedeliveries" value="10"/>
<cm:property name="rest.port" value="13431"/>
<cm:property name="rest.port" value="9102"/>
<cm:property name="rest.prefix" value="/jsonld"/>
<cm:property name="rest.host" value="localhost"/>
<cm:property name="jsonld.context" value="https://acdc.amherst.edu/jsonld/models.json"/>
......
......@@ -26,8 +26,6 @@
<cm:property-placeholder persistent-id="edu.amherst.acdc.mint" update-strategy="reload" >
<cm:default-properties>
<cm:property name="minter.length" value="7"/>
<cm:property name="rest.prefix" value="/mint"/>
<cm:property name="rest.port" value="9030"/>
</cm:default-properties>
</cm:property-placeholder>
......
......@@ -6,7 +6,7 @@ This service renders fedora resources using a Mustache template.
The service becomes available over HTTP on the configured port. For example,
in order to retrieve a MODS version of the resource `a/b/c`:
curl localhost:9070/template/a/b/c
curl localhost:9103/template/a/b/c
Building
--------
......@@ -40,7 +40,15 @@ In the event of failure, the maximum number of times a redelivery will be attemp
The port on which the service is available
rest.port=13433
rest.port=9103
The hostname for the service
rest.host=localhost
The prefix for the service
rest.prefix=/template
The fedora baseUrl value
......@@ -58,14 +66,6 @@ The json+ld context file
jsonld.context=https://acdc.amherst.edu/jsonld/context.json
The riak caching datastore host
riak.host=localhost:8098
The riak caching datastore bucket name
riak.bucket=fcrepo
By editing this file, any currently running routes will be immediately redeployed
with the new values.
......
......@@ -3,7 +3,7 @@ error.maxRedeliveries=10
# The port on which the service is made available
rest.host=localhost
rest.port=13433
rest.port=9103
rest.prefix=/template
# The fedora baseUrl
......
......@@ -12,7 +12,7 @@
<cm:default-properties>
<cm:property name="error.maxRedeliveries" value="10"/>
<cm:property name="rest.host" value="localhost"/>
<cm:property name="rest.port" value="13433"/>
<cm:property name="rest.port" value="9103"/>
<cm:property name="rest.prefix" value="/template"/>
<cm:property name="mustache.template" value="edu/amherst/acdc/template/mustache/template.mustache"/>
<cm:property name="mustache.contentType" value="text/html"/>
......
......@@ -8,11 +8,11 @@ pluggable XSLT 2.0 documents.
The service becomes available over HTTP on the configured port. For example,
in order to retrieve a MODS version of the resource `a/b/c`:
curl localhost:9070/mods/a/b/c
curl localhost:9104/mods/a/b/c
And the DC version:
curl localhost:9070/dc/a/b/c
curl localhost:9104/dc/a/b/c
Building
--------
......@@ -21,10 +21,6 @@ To build this project use
mvn install
To run the project you can execute the following Maven goal
mvn camel:run
Deploying in OSGi
-----------------
......@@ -35,8 +31,6 @@ command from its shell:
feature:repo-add mvn:edu.amherst.acdc/repository-services/LATEST/xml/features
feature:install acrepo-xml-metadata
Or by copying the compiled bundle into `$KARAF_HOME/deploy`.
Configuration
-------------
......@@ -62,7 +56,11 @@ be loaded from the classpath.
The port on which the service is available
rest.port=9070
rest.port=9104
The hostname for the service
rest.host=localhost
The fedora baseUrl value
......
......@@ -2,7 +2,8 @@
error.maxRedeliveries=10
# The port on which the service is made available
rest.port=9070
rest.port=9104
rest.host=localhost
# The fedora baseUrl
fcrepo.baseUrl=localhost:8080/fcrepo/rest
......
......@@ -41,7 +41,7 @@ public class EventRouter extends RouteBuilder {
.maximumRedeliveries("{{error.maxRedeliveries}}")
.log("Event Routing Error: ${routeId}");
from("jetty:http://0.0.0.0:{{rest.port}}/dc?" +
from("jetty:http://{{rest.host}}:{{rest.port}}/dc?" +
"matchOnUriPrefix=true&httpMethodRestrict=GET&sendServerVersion=false")
.routeId("DcTransformation")
.to("direct:getResource")
......@@ -51,7 +51,7 @@ public class EventRouter extends RouteBuilder {
.log(LoggingLevel.INFO, "Converting resource to DC/XML: ${headers[CamelFcrepoIdentifier]}")
.to("xslt:{{dc.xslt}}?saxon=true");
from("jetty:http://0.0.0.0:{{rest.port}}/mods?" +
from("jetty:http://{{rest.host}}:{{rest.port}}/mods?" +
"matchOnUriPrefix=true&httpMethodRestrict=GET&sendServerVersion=false")
.routeId("ModsTransformation")
.to("direct:getResource")
......
......@@ -11,7 +11,8 @@
<cm:property-placeholder persistent-id="edu.amherst.acdc.xml.metadata" update-strategy="reload">
<cm:default-properties>
<cm:property name="error.maxRedeliveries" value="10"/>
<cm:property name="rest.port" value="9070"/>
<cm:property name="rest.port" value="9104"/>
<cm:property name="rest.host" value="localhost"/>
<cm:property name="mods.xslt" value="edu/amherst/acdc/xml/metadata/rdf2mods.xsl"/>
<cm:property name="dc.xslt" value="edu/amherst/acdc/xml/metadata/rdf2dc.xsl"/>
<cm:property name="fcrepo.baseUrl" value="localhost:8080/fcrepo/rest"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment