eu.beesoft.abeona
Class Database

java.lang.Object
  extended by eu.beesoft.abeona.Database

public final class Database
extends java.lang.Object

Represents simple database for Product instances.


Method Summary
 Product getProduct(java.lang.Integer id)
          Returns copy of Product instance with given id..
 java.util.List<Product> getProducts()
          Returns copies of all Product instances contained in database.
 void store(Product product)
          Stores given Product instance to database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getProducts

public java.util.List<Product> getProducts()
Returns copies of all Product instances contained in database.

Returns:
all Product instances

getProduct

public Product getProduct(java.lang.Integer id)
Returns copy of Product instance with given id..

Parameters:
id - identifier of searched product
Returns:
instance of Product with id == productId or null if no one matches

store

public void store(Product product)
Stores given Product instance to database. Product is checked for name, public and private key values. Database is stored to disk file in [user.home]/abeona directory.

Parameters:
product - Object to store