001: ///////////////////////////////////////////////////////////////////////////////
002: //
003: // Copyright (C) 2003-@year@ by Thomas M. Hazel, MyOODB (www.myoodb.org)
004: //
005: // All Rights Reserved
006: //
007: // This program is free software; you can redistribute it and/or modify
008: // it under the terms of the GNU General Public License and GNU Library
009: // General Public License as published by the Free Software Foundation;
010: // either version 2, or (at your option) any later version.
011: //
012: // This program is distributed in the hope that it will be useful,
013: // but WITHOUT ANY WARRANTY; without even the implied warranty of
014: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
015: // GNU General Public License and GNU Library General Public License
016: // for more details.
017: //
018: // You should have received a copy of the GNU General Public License
019: // and GNU Library General Public License along with this program; if
020: // not, write to the Free Software Foundation, 675 Mass Ave, Cambridge,
021: // MA 02139, USA.
022: //
023: ///////////////////////////////////////////////////////////////////////////////
024: package org.myoodb.collectable;
025:
026: public class LogStoreDbImpl extends StoreCollectionDbImpl implements
027: LogStore {
028: public LogStoreDbImpl() {
029: }
030:
031: protected Object getContainerIndex(Object start) {
032: Object retval = super .getContainerIndex(start);
033: return (retval != null) ? retval : (long) -1;
034: }
035:
036: public LogObject addLogObject(LogObject logObject) {
037: long time = logObject.getTime();
038: if (time == -1) {
039: ///* XXX: debug
040: if (logObject.isExplicitLock() == true) {
041: throw new org.myoodb.exception.PermissionException(
042: "LogObject cannot be part of a transaction");
043: }
044: //*/
045:
046: time = LogObjectDbImpl.getSynchronizedLocalTime();
047: logObject.setTime(time);
048: }
049:
050: return (LogObject) super .addStoreObject(logObject);
051: }
052:
053: public LogObject removeLogObject(LogObject logObject) {
054: return (LogObject) super .removeStoreObject(logObject);
055: }
056:
057: public LogObject removeLogObject(long time) {
058: return (LogObject) super .removeStoreObject(time);
059: }
060:
061: public LogObject getFirstLogObject() {
062: return (LogObject) super .getFirstStoreObject();
063: }
064:
065: public LogObject getLastLogObject() {
066: return (LogObject) super .getLastStoreObject();
067: }
068:
069: public LogObject getLogObject(long time) {
070: return (LogObject) super .getStoreObject(time);
071: }
072:
073: public java.util.ArrayList getLogKeys() {
074: return super .getStoreObjectKeys();
075: }
076:
077: public java.util.ArrayList getLogKeys(long start, long end) {
078: return super .getStoreObjectKeys(start, end);
079: }
080:
081: public java.util.ArrayList getLogObjects() {
082: return super .getStoreObjects();
083: }
084:
085: public java.util.ArrayList getLogObjects(long start, long end) {
086: return super .getStoreObjects(start, end);
087: }
088:
089: public java.util.ArrayList getLogObjects(long start, long end,
090: Class type) {
091: return super .getStoreObjects(start, end, type);
092: }
093:
094: public java.util.ArrayList getLogObjects(long start, int number,
095: Direction direction) {
096: return super .getStoreObjects(start, number, direction);
097: }
098:
099: public java.util.ArrayList getLogObjects(long start, int number,
100: Direction direction, Class type) {
101: return super .getStoreObjects(start, number, direction, type);
102: }
103:
104: public String toString() {
105: return "LogStore: " + getStoreSize();
106: }
107: }
|