Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "CDO Server Configuration"

(Element repository)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
__TOC__
+
This article has moved: [[CDO Server Configuration Reference]]
<br>
+
==Example==
+
This section shows an example XML configuration file for the CDO server. It must be located in the folder that you declared via system property <code>net4j.config</code>. The subsequent section explains the used [[#Element cdoServer|XML Elements]]. You can also click directly on the links in the XML file to navigate to the respective descriptions.
+
 
+
  <?xml version="1.0" encoding="UTF-8"?>
+
  <[[#Element cdoServer|'''cdoServer''']]>
+
+
    <[[#Element acceptor|'''acceptor''']] type="tcp" listenAddr="0.0.0.0" port="2036">
+
      <font color="green">''&lt;!--''</font>
+
      <font color="green">''<[[#Element negotiator |negotiator]] type="challenge" description="/temp/users.db"/> ''</font>
+
      <font color="green">''--&gt;''</font>
+
    </'''acceptor'''>
+
 
+
    <[[#Element repository|'''repository''']] name="repo1">
+
      <'''property''' name="[[#Property overrideUUID|overrideUUID]]" value="1ff5d226-b1f0-40fb-aba2-0c31b38c764f"/>
+
      <'''property''' name="[[#Property supportingAudits|supportingAudits]]" value="true"/>
+
      <'''property''' name="[[#Property supportingRevisionDeltas|supportingRevisionDeltas]]" value="true"/>
+
      <'''property''' name="[[#Property verifyingRevisions|verifyingRevisions]]" value="false"/>
+
      <'''property''' name="[[#Property currentLRUCapacity|currentLRUCapacity]]" value="10000"/>
+
      <'''property''' name="[[#Property revisedLRUCapacity|revisedLRUCapacity]]" value="100"/>
+
     
+
      <[[#Element store|'''store''']] type="db">
+
        <font color="green">''&lt;!-- type: horizontal | vertical | <any user-contributed type>--&gt;''</font>
+
        <[[#Element mappingStrategy|'''mappingStrategy''']] type="horizontal">
+
          <font color="green">''&lt;!-- ONE_TABLE_PER_REFERENCE | ONE_TABLE_PER_CLASS | ONE_TABLE_PER_PACKAGE | ONE_TABLE_PER_REPOSITORY | LIKE_ATTRIBUTES --&gt;''</font>
+
          <'''property''' name="[[#Property toManyReferences|toManyReferences]]" value="ONE_TABLE_PER_REFERENCE"/>
+
 
+
          <font color="green">''&lt;!-- LIKE_ATTRIBUTES | LIKE_TO_MANY_REFERENCES--&gt;''</font>
+
          <'''property''' name="[[#Property toOneReferences|toOneReferences]]" value="LIKE_ATTRIBUTES"/>
+
         
+
          <font color="green">''&lt;!-- MODEL | STRATEGY--&gt;''</font>
+
          <'''property''' name="[[#Property mappingPrecedence|mappingPrecedence]]" value="MODEL"/>
+
        </'''mappingStrategy'''>
+
       
+
        <[[#Element dbAdapter|'''dbAdapter''']] name="derby-embedded"/>
+
        <[[#Element dataSource|'''dataSource''']] class="org.apache.derby.jdbc.EmbeddedDataSource"
+
          databaseName="/temp/cdodb1"
+
          createDatabase="create"/>
+
 
+
        <font color="green">''&lt;!--<dbAdapter name="hsqldb"/>''</font>
+
        <font color="green">''<dataSource'' class="org.eclipse.net4j.db.hsqldb.HSQLDBDataSource"''</font>
+
          <font color="green">''database="jdbc:hsqldb:mem:cdodb1"''</font>
+
          <font color="green">''user="sa"/>--&gt;''</font>
+
 
+
        <font color="green">''&lt;!--<dbAdapter name="mysql"/>''</font>
+
        <font color="green">''<dataSource'' class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"''</font>
+
          <font color="green">''url="jdbc:mysql://localhost/cdodb1"''</font>
+
          <font color="green">''user="sa"/>--&gt;''</font>
+
 
+
        <font color="green">''&lt;!--<dbAdapter name="postgresql"/>''</font>
+
        <font color="green">''<dataSource'' class="org.postgresql.ds.PGSimpleDataSource"''</font>
+
          <font color="green">''url="jdbc:postgresql://localhost:5432/cdo"''</font>
+
          <font color="green">''databaseName="cdo"''</font>
+
          <font color="green">''user="cdo"''</font>
+
          <font color="green">''password="cdo"/>--&gt;''</font>
+
      </'''store'''>
+
    </'''repository'''>
+
 
+
  </'''cdoServer'''>
+
<br>
+
 
+
==Element cdoServer==
+
The root element of the <code>cdo-server.xml</code> file. It can contain zero, one or several [[#Element acceptor|'''acceptor''']] elements and zero, one or several [[#Element repository|'''repository''']] elements.
+
<br>
+
 
+
===Element acceptor===
+
Defines an [http://download.eclipse.org/modeling/emft/net4j/javadoc/0.8.0/org/eclipse/net4j/IAcceptor.html|<code>IAcceptor</code>] instance. Please refer to the [[Net4j]] documentation for details about acceptors and connectors.
+
 
+
The <code>type</code> attribute corresponds to the type of an acceptor factory that is contributed via the <code>org.eclipse.net4j.util.factories</code> extension point with a product group of <code>org.eclipse.net4j.acceptors</code>. The remaining attributes depend on the specified type attribute value. The following values are possible with the shipped distribution (subject to user supplied extension):
+
 
+
* '''tcp:''' Acceptor for fast, new I/O based socket connections. The following additional attributes are recognized:
+
** '''listenAddr:''' The network address the server socket shall be bound to. A value of <code>"0.0.0.0"</code> is the default (whole attribute can be omitted) and tells the socket to listen on ''all'' available addresses.
+
** '''port:''' The network port the server socket shall be bound to. A value of <code>"2036"</code> is the default (whole attribute can be omitted).
+
 
+
* '''jvm:''' Acceptor for JVM internal (non-socket based ) connections. ''Currently not supported by the <code>Net4Configurator</code>''.
+
 
+
The acceptor element can contain zero or one [[#Element negotiator|negotiator]] element(s).
+
 
+
Please note that the acceptor element is likely to be moved to a separate Net4j configuration file in the future.
+
<br>
+
 
+
====Element negotiator====
+
Defines an [http://download.eclipse.org/modeling/emft/net4j/javadoc/0.8.0/org/eclipse/net4j/util/security/INegotiator.html|<code>INegotiator</code>] instance to be used by the connectors created by an acceptor (defined by the enclosing [[#Element acceptor|acceptor]] element). Please refer to the [[Net4j]] documentation for details about negotiators and the pluggable security concept that can be used for authentication and authorization.
+
 
+
The <code>type</code> attribute corresponds to the type of a negotiator factory that is contributed via the <code>org.eclipse.net4j.util.factories</code> extension point with a product group of <code>org.eclipse.net4j.negotiators</code>. The remaining attributes depend on the specified type attribute value. The following values are possible with the shipped distribution (subject to user supplied extension):
+
* '''challenge:''' Negotiator for simple yet effective and cryptographically secure challenge/response based negotiations. The following additional attributes are recognized:
+
** '''description:''' The absolute path to a file in the local file system that contains the credentials of the users in the form <code>userid: password</code>.
+
<br>
+
 
+
===Element repository===
+
Defines an [http://download.eclipse.org/modeling/emft/cdo/javadoc/0.8.0/org/eclipse/emf/cdo/server/IRepository.html|<code>IRepository</code>] instance. Please refer to [[CDO Server]] for details about repositories and sessions.
+
 
+
The <code>name</code> attribute uniquely identifies a repository in the scope of a repository configurator.
+
 
+
The repository element can contain several property elements (see below) and must contain exactly one [[#Element store|store]] element.
+
<br>
+
 
+
====Property overrideUUID====
+
Specifies a constant UUID for the repository. If omitted the repository will be created with a random UUID. The format of an override UUID is not further specified but should respect the file naming conventions of the used operating system.
+
 
+
Overriding the default random UUID can be useful if you have scripts that operate on the file system folder that is created on the server for each repository and named after the repository UUID.
+
<br>
+
 
+
====Property supportingAudits====
+
Specifies whether the repository will support audit views or not. Please note that a repository can only support audit views if its store supports audit views as well:
+
 
+
{| style="background:LightYellow" border="1" cell-padding="4"
+
|-
+
! Store Implementation
+
! Allowed Values&nbsp;
+
! Default Value&nbsp;
+
|-
+
| <tt>org.eclipse.emf.cdo.server.internal.db.DBStore</tt>
+
| <tt>true</tt>
+
| <tt>true</tt>
+
|-
+
| <tt>org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore</tt>
+
| <tt>false</tt>
+
| <tt>false</tt>
+
|-
+
| <tt>org.eclipse.emf.cdo.server.internal.objectivity.ObjectivityStore</tt> ''(to be done)''
+
| <tt>false</tt>
+
| <tt>false</tt>
+
|}
+
 
+
The shipped DB store does support audit views. Note also that it will not delete or update rows for modified objects if audits are supported. All revised state of the repository will be kept in the DB which can result in databases growing very large!
+
<br>
+
 
+
====Property supportingRevisionDeltas====
+
Specifies whether the repository will pass changed revisions to its store in the form of revision deltas (as received from the protocol layer) or as whole revisions. Allowed values as well as the default value are store implementation specific:
+
 
+
{| style="background:LightYellow" border="1" cell-padding="4"
+
|-
+
! Store Implementation
+
! Allowed Values&nbsp;
+
! Default Value&nbsp;
+
|-
+
| <tt>org.eclipse.emf.cdo.server.internal.db.DBStore</tt>
+
| <tt>false</tt>
+
| <tt>false</tt>
+
|-
+
| <tt>org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore</tt>
+
| <tt>false</tt>
+
| <tt>false</tt>
+
|-
+
| <tt>org.eclipse.emf.cdo.server.internal.objectivity.ObjectivityStore</tt> ''(to be done)''
+
| <tt>true</tt>
+
| <tt>true</tt>
+
|}
+
<br>
+
 
+
====Property verifyingRevisions====
+
Specifies whether the repository will verify cached revisions or not. Allowed values are:
+
* <code>'''true'''</code>
+
* <code>'''false'''</code> (default)
+
 
+
Verifying a cached revision means to verify if the underlying store has got a newer revision of the same object. This can only happen if the store data can be modified externally, that is without going through the repository.
+
 
+
Please note that a repository can be considerably slowed down if configured to verify all revisions!
+
<br>
+
 
+
====Property currentLRUCapacity====
+
Specifies the capacity of the fixed size cache for ''current'' revisions in the repository. A revision is called ''current'' if it is not ''revised''.
+
<br>
+
 
+
====Property revisedLRUCapacity====
+
Specifies the capacity of the fixed size cache for ''revised'' revisions in the repository. A revision is called ''revised'' if one or more newer revisions of the same object do exist.
+
<br>
+
 
+
===Element store===
+
Defines an [http://download.eclipse.org/modeling/emft/cdo/javadoc/0.8.0/org/eclipse/emf/cdo/server/IStore.html|<code>IStore</code>] instance. Please refer to [[CDO Storage Framework]] for details about stores, store readers and store writers.
+
 
+
The <code>type</code> attribute corresponds to the type of a store factory that is contributed via the <code>org.eclipse.emf.cdo.server.storeFactory</code> extension point. The remaining attributes depend on the specified type attribute value. The following values are possible with the shipped distribution (subject to user supplied extension):
+
* '''noop:''' Store that does nothing. A repository with a noop store can function properly as long as the the server is not restarted and the internal caches do not run full so that revisions get evicted and discarded. No additional attributes are recognized.
+
* '''db:''' Store that connects via JDBC to a relational database and manages persistent revisions and models through a built-in O/R mapper. A DB store element can contain the following nested elements:
+
** [[#Element mappingStrategy|'''mappingStrategy''']]
+
** [[#Element dbAdapter|'''dbAdapter''']]
+
** [[#Element dataSoure|'''dataSoure''']]
+
<br>
+
 
+
====Element mappingStrategy====
+
This element is recognized by DB stores and defines the overall mapping strategy of the built-in O/R mapper.
+
 
+
The <code>type</code> attribute corresponds to the type of a mapping strategy factory that is contributed via the <code>org.eclipse.emf.cdo.server.db.mappingStrategies</code> extension point. The following values are possible with the shipped distribution (subject to user supplied extension):
+
* '''horizontal:''' Mapping strategy that creates one DB table per concrete model class. The following nested property elements are recognized:
+
** [[#Element toManyReferences|'''toManyReferences''']]
+
** [[#Element toOneReferences|'''toOneReferences''']]
+
** [[#Element mappingPrecedence|'''mappingPrecedence''']]
+
* '''vertical:''' Mapping strategy that creates one DB table per class in the model hierarchy. ''This type is currently not supported''. The following nested property elements will be recognized:
+
** [[#Element toManyReferences|'''toManyReferences''']]
+
** [[#Element toOneReferences|'''toOneReferences''']]
+
** [[#Element mappingPrecedence|'''mappingPrecedence''']]
+
<br>
+
 
+
=====Property toManyReferences=====
+
Specifies how the built-in O/R mapper will handle to-many references (collections). The following values are recognized:
+
* '''ONE_TABLE_PER_REFERENCE:''' Each to-many reference of the model will get its own DB table.
+
* '''ONE_TABLE_PER_CLASS:''' All to-many references of a model class will share a single DB table.
+
* '''ONE_TABLE_PER_PACKAGE:''' All to-many references of a model package will share a single DB table.
+
* '''ONE_TABLE_PER_REPOSITORY:''' All to-many references of all model classes i the repository will share a single DB table.
+
* '''LIKE_ATTRIBUTES:''' Collections will be serialized to a BLOB column in the same DB table that the attributes of the containing model class are stored in. ''This option is currently not supported''.
+
<br>
+
 
+
=====Property toOneReferences=====
+
Specifies how the built-in O/R mapper will handle to-one references. The following values are recognized:
+
* '''LIKE_ATTRIBUTES:''' Single references will be stored in a CDOID column in the same DB table that the attributes of the containing model class are stored in. This option is the default option.
+
* '''LIKE_TO_MANY_REFERENCES:''' Single references will be handled in the same way as specified for to-many references. ''This option is currently not supported''.
+
<br>
+
 
+
=====Property mappingPrecedence=====
+
''Currently not supported''.
+
<br>
+
 
+
====Element dbAdapter====
+
Defines the [http://download.eclipse.org/modeling/emft/net4j/javadoc/0.8.0/org/eclipse/net4j/db/IDBAdapter.html|<code>IDBAdapter</code>] instance of the store. Please refer to [[Net4j DB Framework]] for details about DB adapters and SQL dialects.
+
 
+
The <code>type</code> attribute corresponds to the name of a DB adapter factory that is contributed via the <code>org.eclipse.net4j.db.dbAdapters</code> extension point. No additional attributes are recognized.
+
 
+
The DB adapter must match the database specified in the [[#Element dataSource|dataSource]] element.
+
<br>
+
 
+
====Element dataSource====
+
Defines the [http://java.sun.com/javase/6/docs/api/javax/sql/DataSource.html|<code>DataSource</code>] instance of the store.
+
 
+
The <code>class</code> attribute corresponds to the fully qualified name of the data source class. Please refer to your DB manual for details about the supported data sources and their attributes.
+
<br>
+
<br>
+
----
+
Wikis: [[CDO Server]] | [[CDO]] | [[Net4j]] | [[EMF]] | [[Eclipse]]
+

Latest revision as of 09:56, 6 August 2008

This article has moved: CDO Server Configuration Reference

Back to the top