Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
stylesquare

fcrepo-webapp

Fedora Fedora RESTful HTTP API uses the open source Jersey RESTful Web Services framework that provides support for JAX-RS APIs and serves as a JAX-RS (JSR 311 & JSR 339) Reference Implementation. The jersey servlet dispatcher is configured in The jersey servlet dispatcher is configured in web.xml as  as follows:

Code Block
languagexml
titleweb.xml
<servlet>
	  <servlet-name>jersey-servlet</servlet-name>
	  <servlet-class>comclass>org.sunglassfish.jersey.spi.spring.container.servlet.SpringServlet<ServletContainer</servlet-class>
	  <init-param>
		    <param-name>comname>javax.sunws.jersey.config.property.packages<rs.Application</param-name>
		    <param-value>org.fcrepo</param-value>
	</init-param>
	<init-param>
		<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
		<param-value>true<fcrepo.http.commons.FedoraApplication</param-value>
	  </init-param>
	  <load-on-startup>1</load-on-startup>
</servlet>

...

The following spring files exist in a directory as configured in web.xml, which contains a context-param element with param-name "contextConfigLocation".  The param-value points to your a spring context configuration files, file "WEB-INF/classes/spring/*repository.xml". This configuration file imports a settings file located in the same directory or the file specified by system property fcrepo.spring.configuration. Note that these files are in the source tree under fcrepo-webapp/src/main/resources/spring and copied to WEB-INF/classes upon build.

fcrepo-webapp/src/main/resources/spring

...

repository.xml

  • here you can specify the repository.json file to be loaded as the repositoryConfiguration, as well as the bean for repository factory and metricsthis imports all the settings from either the file specified in the system property fcrepo.spring.configuration or the provided configuration file fcrepo-config.xml
Code Block
languagexml
titlerepo.xml
<bean name "modeshapeRepofactory" class= "org.fcrepo.kernel.spring.ModeshapeRepositoryFactoryBean">
	<property name="repositoryConfiguration" value  <!-- Master context for fcrepo4. -->
  <import resource="${fcrepo.modeshapespring.configuration:classpath:/spring/fcrepo-config/single/repository.jsonxml}"/>
</bean>

rest.xml

fcrepo-config.xml

This is where you configure your Fedora instance, including:

  • specify the repository.json file to be loaded as the repositoryConfiguration or use the fcrepo.modeshape.configuration system property.
  • bean for repository factory and metrics
  • bean bean implementation for InternalIdentifierConverter (identifier  translationChain),   StoragePolicyDecisionPointImpl, SessionFactory, and base-packages to auto scan into spring

...

  • bean implementation for eventing - observer, filter, event bus

jms.xml

  • here you can specify the implementation for processing events

generator.xml

  • beans implementation for datastream generation, ex: dublin core

security.xml

  • config for transactions
  • bean implementation for OAuth security

transactions.xml

  • Specify the config for transactions

minter.xml

...

  • minting identifiers

It is recommended to use the provided fcrepo-config.xml as a starting point for your customization.

fcrepo4/fcrepo-configs/src/main/resources/config

...

Fedora 4 uses Modeshape, a JCR implementation. We distribute a handful of known-good configurations for Modeshape and Infinispan, although we anticipate configuration tuning for deployment environments will be common.

https://github.com/ModeShape/modeshape/blob/master/modeshape-jcr/src/main/resources/org/modeshape/jcr/repository-config-schema.json

http://docs.jboss.org/infinispan/5.3/configdocs/

Modeshape Configurations

Repository Config Options

These configuration files are copied to WEB-INF/classes from fcrepo-configs/src/main/resources upon build.

...

cacheSize

  • The cacheSize option may be set to specify the size of the Modeshape node cache.  The default value is 10,000, and increasing this value can improve performance, particularly for the Many Members performance issue.  See the example configuration files, such as file-simple/repository.json

...

  • Our default Modeshape configuration.  for an example.

/config/

...

clustered-

...

mysql/repository.json

  • Default configuration with servlet authentication enabled

    Configuration for clustered repositories with a centralized MySQL object store.

/config/

...

file-simple/repository.json

  • Default configuration with repository clustering enabled. By default, uses /config/infinispan/clustered/infinispan.xml persistence configuration.

Infinispan configurations

These configuration files are copied to WEB-INF/classes from fcrepo-configs/src/main/resources upon build.

/config/infinispan/leveldb-default/infinispan.xml

  • Default configuration with leveldb object storage

/config/infinispan/leveldb/infinispan.xml

  • Configuration with leveldb object storage and filecachestore object storage

/config/infinispan/clustered/infinispan.xml

  • Example clustering configuration. Replicates object storage, distributes 2 copies of binary storage.

/config/infinispan/file/infinispan.xml

  • Configuration with filecachestore

/config/infinispam/ram/infinispan.xml

  • In-memory configuration for object storage (useful for testing)

Repository Config Options

 
Code Block
fcrepo.modeshape.query.enabled:true
fcrepo.modeshape.query.mode:sync

Fedora 4 uses the Modeshape query index to power administrative search APIs. It can be disabled (or switched to asynchronous mode) to improve performance (see below).

Code Block
fcrepo.modeshape.index.location:target/indexes
fcrepo.infinispan.cache_configuration:config/infinispan/leveldb-default/infinispan.xml

Fedora 4 can be configured to use different Infinispan configurations. By default, Fedora 4 configurations use the leveldb-default configuration.

Code Block
fcrepo.ispn.repo.CacheDirPath:target/FedoraRepository/storage
  • Configuration for file-based object store for testing, not recommended for production. 

/config/jdbc-mysql/repository.json 

  • Configuration for MySQL-based object store. 

/config/jdbc-postgresql/repository.json

  • Configuration for PostgreSQL-based object store.

/config/servlet-auth/repository.json

  • Configuration with servlet authentication enabled.

Fedora 4 will store object properties to the configured backend datastoreFedora 4 will store object properties to fcrepo.ispn.repo.CacheDirPath. These probably won't be very large, and should be stored on fast disk. The object properties are stored as binary JSON documents within the given cache store configuration.

Binary storage

Code Block
fcrepo.binary-store-path.directory:target/binaries
fcrepo.ispn.binary.CacheDirPath:target/FedoraRepositoryBinaryData/storage

fcrepo.ispn.binary.CacheDirPath:target/FedoraRepositoryBinaryData/storage - path to store binary content (when it's stored in infinispan e.g. /config/infinispan/clustered/infinispan.xml)

Fedora 4 stores binary content separately (to one of the above paths, depending on configuration). These files are stored hashed by the content SHA-1 hash. 

Performance considerations

If your application does not use the query index (which powers basic administrative search, and the simple fcr:sparql endpoint), you can significantly improve repository performance by disabling indexing, or using asynchronous indexing instead.


Parallel stream processing

Code Block
fcrepo.modeshape.query.mode = async
fcrepo.modeshape.query.enabled = false
SettingAverage (s)Median (s)Standard
Deviation 
mode=async0.07810.06800.0477
enabled=false0.07360.06300.0445
mode=sync0.16890.1480.0685

 

Different Infinispan configurations can also have an impact on repository performance. 

 

Infinispan ConfigurationAverageMedianStandard
Deviation 
filecachestore0.11210.1050.0313
leveldb0.07360.06300.0445
leveldb with async persistence0.06100.05500.0220
RAM0.05170.04800.0148
leveldb with file binary store *0.06440.05700.0196
Total0.07030.05900.0318

* default configuration

Fedora Node Types - node definitions in terms of namespace properties

Defining .cnd files such as these in repository.json will register namespaces and node types found within:

fcrepo4/fcrepo-kernel/src/main/resources/fedora-node-types.cnd

fcrepo4/fcrepo-auth-roles-common/src/main/resources/cnd/access-control.cnd

...

streaming.parallel:false


If you are running Fedora on a multiprocessor machine you can level parallel processing across single requests by turning this option on.   Parallel processing of streams can boost the retrieval speeds of the RDF associated with objects with large numbers of inlinks (ie dependent objects with memberOf associations).  Enabling this option in conjunction with increasing with cacheSize parameter in your repository.json file can boost retrieval speeds significantly.

Skolemizing to Hash-URIs

Code Block
fcrepo.bnode.hash-uri=<true|false>

With this property set to 'true', Fedora will skolemize incoming blank nodes to hash-URIs (with UUID fragments) on the base URI to which the request was addressed. By default this feature is turned off for backwards compatibility.

Other module resources

fcrepo-module-auth-xacml

This XACML Authorization Delegate Module is based on the design documented here: XACML Authorization Delegate

/src/main/resources/policies

AdminPermissionPolicySet.xml

  • policy set for the admin role

AdminRolePolicySet.xml

  • define the policies for the admin role

GlobalPermissionPolicySet.xml

  • policy set for the basic role

GlobalRolesPolicySet.xml

  • define the policies for the basic role

PreventReadingMasterFilesPolicySet.xml

  • policy set that prevents access to any files with the mime type "image/tiff" that have the "http://example.com/mixins#master" type (example-mixins:master mixin)

ReadNormalNodePermissionPolicySet.xml

  • policy set for reading normal nodes

ReadOnlyExceptToLocalPolicySet.xml

  • policy set that prevents all repository-changing actions by all but those a localhost or on an internal network.

ReaderRolePolicySet.xml

  • define the policies for the reader role

WriteNormalNodePermissionPolicySet.xml

  • policy set for writing normals nodes.

WriterRolePolicySet.xml

  • define the policies for writing the normal nodes

/src/main/resources/cnd

xacml-policy.cnd

  • namespace properties to enable  XACML authorization

fcrepo-jms-indexer-pluggable

This is an indexer that listens to the Fedora JMS topic, retrieves a message including pid and eventType, looks up object properties, gets and passes the transformed or untransformed properties on to any number of registered handlers.

/fcrepo-jms-indexer-webapp/src/main/resources/spring

indexer-core.xml

  • bean implementation for HttpSolrServer, SolrIndexer and IndexerGroup (SparqlIndexer, FileSerializer)

indexer-events.xml

  • config for jms messaging with ActiveMQ

/fcrepo-jms-indexer-webapp/src/main/resources

logback.xml

  • logging configuration

/fcrepo-jms-indexer-core/src/main/resources

 indexing.cnd

...