Esempio n. 1
0
 internal virtual NeoDatis.Odb.Core.Layers.Layer3.IBaseIdentification GetParameters
     (bool canWrite)
 {
     NeoDatis.Odb.Core.Layers.Layer3.IBaseIdentification p = fsiToApplyWriteActions.GetParameters
                                                                 ();
     if (p is NeoDatis.Odb.Core.Layers.Layer3.IOFileParameter)
     {
         NeoDatis.Odb.Core.Layers.Layer3.IOFileParameter ifp = (NeoDatis.Odb.Core.Layers.Layer3.IOFileParameter
                                                                )fsiToApplyWriteActions.GetParameters();
         System.Text.StringBuilder buffer = new System.Text.StringBuilder(ifp.GetDirectory
                                                                              ()).Append("/").Append(ifp.GetCleanFileName()).Append("-").Append(creationDateTime
                                                                                                                                                ).Append("-").Append(session.GetId()).Append(".transaction");
         return(new NeoDatis.Odb.Core.Layers.Layer3.IOFileParameter(buffer.ToString(), canWrite
                                                                    , ifp.GetUserName(), ifp.GetPassword()));
     }
     if (p is NeoDatis.Odb.Core.Layers.Layer3.IOSocketParameter)
     {
         NeoDatis.Odb.Core.Layers.Layer3.IOSocketParameter sp = (NeoDatis.Odb.Core.Layers.Layer3.IOSocketParameter
                                                                 )fsiToApplyWriteActions.GetParameters();
         return(new NeoDatis.Odb.Core.Layers.Layer3.IOSocketParameter(sp.GetDestinationHost
                                                                          (), sp.GetPort(), sp.GetBaseIdentifier(), NeoDatis.Odb.Core.Layers.Layer3.IOSocketParameter
                                                                      .TypeTransaction, creationDateTime, null, null));
     }
     throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.UnsupportedIoType
                                                .AddParameter(p.GetType().FullName));
 }
Esempio n. 2
0
 private void CheckFileAccess(bool canWrite, string fileName)
 {
     lock (this)
     {
         if (fsi == null)
         {
             NeoDatis.Odb.Core.Layers.Layer3.IBaseIdentification p = null;
             // to unable direct junit test of FileSystemInterface
             if (fsiToApplyWriteActions == null)
             {
                 p = new NeoDatis.Odb.Core.Layers.Layer3.IOFileParameter(fileName, canWrite, null,
                                                                         null);
             }
             else
             {
                 p = GetParameters(canWrite);
             }
             // To enable unit test
             if (session != null)
             {
                 isLocal = session.GetStorageEngine().IsLocal();
             }
             fsi = new NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.LocalFileSystemInterface("transaction"
                                                                                            , session, p, false, NeoDatis.Odb.OdbConfiguration.GetDefaultBufferSizeForTransaction
                                                                                                ());
         }
     }
 }
 public ServerFileSystemInterface(string name, NeoDatis.Odb.Core.Layers.Layer3.IBaseIdentification
                                  parameters, bool canLog, int bufferSize) : base(name, parameters, canLog, bufferSize
                                                                                  )
 {
     sessionManager = NeoDatis.Odb.OdbConfiguration.GetCoreProvider().GetClientServerSessionManager
                          ();
 }
Esempio n. 4
0
 /// <summary>The database file name</summary>
 /// <></>
 public AbstractStorageEngine(NeoDatis.Odb.Core.Layers.Layer3.IBaseIdentification
                              parameters)
 {
     this.provider           = NeoDatis.Odb.OdbConfiguration.GetCoreProvider();
     this.baseIdentification = parameters;
     Init();
 }
		public FileSystemInterface(string name, NeoDatis.Odb.Core.Layers.Layer3.IBaseIdentification
			 parameters, bool canLog, int bufferSize)
		{
			this.name = name;
			this.parameters = parameters;
			this.canLog = canLog;
			NeoDatis.Odb.Core.ICoreProvider provider = NeoDatis.Odb.OdbConfiguration.GetCoreProvider
				();
			this.io = provider.GetIO(name, parameters, bufferSize);
			this.byteArrayConverter = provider.GetByteArrayConverter();
		}
Esempio n. 6
0
 public FileSystemInterface(string name, NeoDatis.Odb.Core.Layers.Layer3.IBaseIdentification
                            parameters, bool canLog, int bufferSize)
 {
     this.name       = name;
     this.parameters = parameters;
     this.canLog     = canLog;
     NeoDatis.Odb.Core.ICoreProvider provider = NeoDatis.Odb.OdbConfiguration.GetCoreProvider
                                                    ();
     this.io = provider.GetIO(name, parameters, bufferSize);
     this.byteArrayConverter = provider.GetByteArrayConverter();
 }
Esempio n. 7
0
 public virtual string GetName()
 {
     NeoDatis.Odb.Core.Layers.Layer3.IBaseIdentification p = fsiToApplyWriteActions.GetParameters
                                                                 ();
     if (p is NeoDatis.Odb.Core.Layers.Layer3.IOFileParameter)
     {
         NeoDatis.Odb.Core.Layers.Layer3.IOFileParameter ifp = (NeoDatis.Odb.Core.Layers.Layer3.IOFileParameter
                                                                )fsiToApplyWriteActions.GetParameters();
         System.Text.StringBuilder buffer = new System.Text.StringBuilder(ifp.GetCleanFileName
                                                                              ()).Append("-").Append(creationDateTime).Append("-").Append(session.GetId()).Append
                                                (".transaction");
         return(buffer.ToString());
     }
     if (p is NeoDatis.Odb.Core.Layers.Layer3.IOSocketParameter)
     {
         NeoDatis.Odb.Core.Layers.Layer3.IOSocketParameter sp = (NeoDatis.Odb.Core.Layers.Layer3.IOSocketParameter
                                                                 )fsiToApplyWriteActions.GetParameters();
         return(sp.GetBaseIdentifier());
     }
     throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.UnsupportedIoType
                                                .AddParameter(p.GetType().FullName));
 }
Esempio n. 8
0
 public LocalFileSystemInterface(string name, NeoDatis.Odb.Core.Transaction.ISession
                                 session, NeoDatis.Odb.Core.Layers.Layer3.IBaseIdentification parameters, bool canLog
                                 , int bufferSize) : base(name, parameters, canLog, bufferSize)
 {
     this.session = session;
 }
Esempio n. 9
0
 public ServerStorageEngine(NeoDatis.Odb.Core.Layers.Layer3.IBaseIdentification parameters
                            ) : base(parameters)
 {
 }