94 lines
1.7 KiB
C#
94 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using ln.types.odb.values;
|
|
|
|
namespace ln.types.odb.ng.storage.bases
|
|
{
|
|
public abstract class ChainedStorage : IStorage
|
|
{
|
|
public IStorage Storage { get; }
|
|
|
|
public bool IsOpen => Storage.IsOpen;
|
|
|
|
public ChainedStorage(IStorage storage)
|
|
{
|
|
Storage = storage;
|
|
}
|
|
|
|
public virtual bool Open()
|
|
{
|
|
return Storage.Open();
|
|
}
|
|
|
|
public virtual void Close()
|
|
{
|
|
Storage.Close();
|
|
}
|
|
|
|
public virtual Document Load(Guid documentID)
|
|
{
|
|
return Storage.Load(documentID);
|
|
}
|
|
|
|
public virtual void Save(Document document)
|
|
{
|
|
Storage.Save(document);
|
|
}
|
|
|
|
public virtual bool LockDocument(Guid documentID)
|
|
{
|
|
return Storage.LockDocument(documentID);
|
|
}
|
|
|
|
public virtual bool ReleaseDocument(Guid documentID)
|
|
{
|
|
return Storage.ReleaseDocument(documentID);
|
|
}
|
|
|
|
public virtual void SaveRelease(Document document)
|
|
{
|
|
Storage.SaveRelease(document);
|
|
}
|
|
|
|
public virtual void Delete(Guid documentID)
|
|
{
|
|
Storage.Delete(documentID);
|
|
}
|
|
|
|
public virtual bool Contains(Guid documentID)
|
|
{
|
|
return Storage.Contains(documentID);
|
|
}
|
|
|
|
public virtual IEnumerable<Guid> GetDocumentIDs()
|
|
{
|
|
return Storage.GetDocumentIDs();
|
|
}
|
|
|
|
public virtual IEnumerable<Guid> GetDocumentIDs(string path, Predicate<ODBEntity> predicate)
|
|
{
|
|
return Storage.GetDocumentIDs(path, predicate);
|
|
}
|
|
|
|
public virtual DateTime GetStorageTimestamp(Guid documentID)
|
|
{
|
|
return Storage.GetStorageTimestamp(documentID);
|
|
}
|
|
|
|
public virtual void EnsureIndex(params string[] path)
|
|
{
|
|
Storage.EnsureIndex(path);
|
|
}
|
|
|
|
public virtual void Dispose()
|
|
{
|
|
Storage.Dispose();
|
|
}
|
|
|
|
public bool GetDocumentLocked(Guid documentID)
|
|
{
|
|
return Storage.GetDocumentLocked(documentID);
|
|
}
|
|
}
|
|
}
|