PING RMI Store Server

From HiWiki

(Redirected from PING RMI Server Store)
Jump to: navigation, search

PING Discovery: Pilot implementasjon og utforskning av PING -> Implementation -> PING RMI Store Server

Contents

Overview

Properties:

  • Java RMI
  • BerkeleyDB
  • Pluggable
  • Encryption

The store server is based on Java RMI and uses a BerkeleyDB for storage. It presents the methods in OSStoreServer.java to the PingServlet, and stores the data in specified store locations (see installation guide).

Encryption

The stored data in the servlet demo is not encrypted, but this can be achieved quite easily in two different ways:

  • Let the PingServlet manage encryption/decryption.
  • Let the store encrypt all incoming data.

If you choose the first alternative, the PingServlet encrypts all incoming data before it is sent to the RMI server store. Naturally the PingServlet also decrypts data it receives from the store before it is sent to the client. This method has the advantage that the keystore and the encrypted data are kept at separate locations. To achieve this, check out our Installation guide. There is also a nice how-to in the ping-users e-mail list.

The other alternative is to keep the keystore at the same location as the data and let the store handle encryption/decryption. We have not tried this, but it should be quite easy. Check out the script startStore.sh or AccountCreator.java for instructions. Since there is no encryption of the data at the PingServlet, no SecureStoreExtensions are needed in the responders.xml file.

The keystore generated by KeyStoreGenerator.java in the installation guide contains a 128 bit AES (128 bit block cipher) symmetric key. Optionally one can also create a HMAC (keyed-hash message authentication code) key using the HmacSHA1 algorithm. These are the default values in the KeyStoreGenerator.java code; one can replace the different algorithms as described in Java Cryptography Extension Reference Guide.

Java RMI and illustrative class diagram of the store

Below are some diagrams illustrating communication and class relations:

Image:rmi.jpg



Image:clazz.jpg

How the store is created

Image:storeDaemon.jpg

Package Descriptions

Image:Example.jpg

org.chip.ping.iostore

  • Store.java
  • StoreException.java
  • StoreFailedRetryException.java
  • StoreFailoverException.java
  • StoreNotWritableException.java
  • TransactionalStore.java

Store and TransactionalStore are the most important classes. A new version of the TransactionalStore is created for each new transaction. When the transaction commits/aborts the version should no longer be used.

org.chip.ping.audit

  • Auditer.java
  • FineGrainedAuditer.java

The following text has been borrowed from the source code:
Defines the Auditer interface and provides a Factory class for creating new Auditers or obtaining existing ones. Also included in this package is the reference implementation's auditing class that writes audit messages to a file.

org.chip.ping.iostore.file

  • FileStorage.java

The following text has been borrowed from the source code:
Provides an implementation of a file-system based data storage layer.

org.chip.ping.iostore.berkeleydb

  • OSStore.java
  • OSStoreClient.java
  • OSStoreDaemon.java
  • OSStoreServer.java
  • OSStoreServerImpl.java

These are the most important classes. OSStoreDaemon starts up the RMI store and OSStore accesses the database. The RMI diagram together with the class diagram should give a good idea of how this is working.

org.chip.ping.iostore.extension

  • StoreExtension.java

The following text has been borrowed from the source code:
A StoreExtension exists to "massage" the key/value pairs that go into the Store. They can manipulate the keys or values at will, knowing that keys are manipulated only in one direction, while values are manipulated on their way in and on their way out, potentially in different ways (e.g. encrypt/decrypt).