1 package com.daffodilwoods.daffodildb.server.datasystem.indexsystem; 2 3 import com.daffodilwoods.daffodildb.server.datasystem.interfaces._DataSystem; 4 import com.daffodilwoods.daffodildb.server.datasystem.interfaces._Database; 5 import com.daffodilwoods.database.resource.DException; 6 import java.util.Properties ; 7 import java.util.HashMap ; 8 9 public class ReadOnlyTempIndexSystem implements _DataSystem { 10 11 HashMap readOnlyTempIndexDatabaseMap; 12 13 public ReadOnlyTempIndexSystem() { 14 readOnlyTempIndexDatabaseMap = new HashMap (); 15 } 16 17 public synchronized _Database getDatabase(String databaseName) throws DException { 18 _Database database = (ReadOnlyTempIndexDatabase) 19 readOnlyTempIndexDatabaseMap.get(databaseName); 20 if (database != null) 21 return database; 22 database = new ReadOnlyTempIndexDatabase(); 23 readOnlyTempIndexDatabaseMap.put(databaseName, database); 24 return database; 25 } 26 27 public void createDatabase(String string, Properties properties) throws DException { 28 29 } 30 31 public synchronized void dropDatabase(String databaseName) throws DException { 32 removeDatabase(databaseName); 33 } 34 35 public synchronized void removeDatabase(String databaseName) throws DException { 36 readOnlyTempIndexDatabaseMap.remove(databaseName); 37 } 38 } 39 | Popular Tags |