HERAS-AF Forum
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 20, 2012, 11:27:29 am

Login with username, password and session length
Search:     Advanced search
Welcome to the HERAS-AF Forum...
373 Posts in 89 Topics by 272 Members
Latest Member: Jasmine
* Home Help Search Login Register
+  HERAS-AF Forum
|-+  HERAS-AF XACML (0.x, "old")
| |-+  HERAS-AF XACML (Moderator: Florian Huonder)
| | |-+  Using another Database
« previous next »
Pages: [1] Print
Author Topic: Using another Database  (Read 821 times)
René Eggenschwiler
Administrator
Jr. Member
*****
Posts: 63



View Profile
« on: July 08, 2009, 10:07:12 am »

Hi Christina

We just used PostgreSQL as a default database for us.
This is for testing purpose and integration testing purpose only.
In the future we plan to replace postgres with an in-memory database (like HSQLDB) for testing.

If you want to use another database that very easy to do. E.g. have a look at:
http://svn.herasaf.org/herasaf-xacml/trunk/herasaf-xacml-integrationtests/src/test/resources/config/TestXMLPersistenceManager.xml

You can simply reconfigure:

         <sb:bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
      <sb:property name="driverClassName" value="org.postgresql.Driver" />
      <sb:property name="url" value="jdbc:postgresql://localhost:5432/xacmltest" />
      <sb:property name="username" value="xacml" />
      <sb:property name="password" value="xacml" />
   </sb:bean>

and the statements in:
       <persistenceManager id="persistenceManager">
      <dataSource>dataSource</dataSource>
      <evaluatables>
         <selectAllStatement>SELECT evaluatable FROM evaluatables;</selectAllStatement>
         <selectStatement>
            SELECT evaluatable FROM evaluatables WHERE evaluatableId
            = :id;
         </selectStatement>

Create a database with a table like:
CREATE TABLE evaluatables (
          evaluatableId VARCHAR(255) PRIMARY KEY,
        evaluatableVersion VARCHAR(255) NOT NULL,
          evaluatable BYTEA NOT NULL
        );

CREATE INDEX evaluatableIdIndex ON evaluatables (evaluatableId);
CREATE INDEX versionIndex ON evaluatables (evaluatableversion);

Just provide the JDBC driver in your maven pom files and everything should be up and running.

I hope this helps you.
Regards,
René
« Last Edit: July 08, 2009, 10:13:26 am by René Eggenschwiler » Logged
ccunningham
Newbie
*
Posts: 6


View Profile
« Reply #1 on: July 08, 2009, 10:57:25 am »

Hi René,

We were hoping to use a non-jdbc backend such as a hierarchical xml database. From looking through the documentation / code and at how the policies are indexed, I don't think this is going to be an easy option.

Regards,

Christina
Logged
René Eggenschwiler
Administrator
Jr. Member
*****
Posts: 63



View Profile
« Reply #2 on: July 08, 2009, 11:53:47 am »

Hi Christina,

You are most probalby right. Using another non-JDBC based database would take more effort then just adapting the persistence.xml config.

But still you can implement/change the persistence to a hierachrical xml database.

For that you need to implement
http://svn.herasaf.org/herasaf-xacml/trunk/herasaf-xacml-persistence/src/main/java/org/herasaf/xacml/pdp/persistence/PersistenceManager.java

If you need more customizing on policy persistence to benefit from all features of hierarchical xml database, you could also implement custom locators and indexer.

We would appreciate any extensions you like to do on our code base. If you like you can provide patches to us which we evaluate and merge into our trunk if it fits into our codebase.
You can also make feature requests in our bugtracker if you like: http://jira.herasaf.org.

Because we are quiet short on resources we can't directly put full effort to feature requests, but we will definetly have a look at it.
We are anyway open to any kind of discussions about feautures and anything related to our codebase.

Regards,
René
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!