public virtual IReplicationReference ProduceReference(object obj, object unused,
                                                              string unused2)
        {
            if (obj == null)
            {
                return(null);
            }
            if (_referencesByObject != null)
            {
                Db4oReplicationReferenceImpl existingNode = _referencesByObject.Find(obj);
                if (existingNode != null)
                {
                    return(existingNode);
                }
            }
            // TODO: Why refresh here? Try without and run all tests!
            Refresh(obj);
            IObjectInfo objectInfo = _container.GetObjectInfo(obj);

            if (objectInfo == null)
            {
                return(null);
            }
            Db4oUUID uuid = objectInfo.GetUUID();

            if (uuid == null)
            {
                throw new ArgumentNullException();
            }
            Db4oReplicationReferenceImpl newNode = new Db4oReplicationReferenceImpl(objectInfo
                                                                                    , obj);

            AddReference(newNode);
            return(newNode);
        }
 //empty in File Provider
 private void AddReference(Db4oReplicationReferenceImpl newNode)
 {
     if (_referencesByObject == null)
     {
         _referencesByObject = newNode;
     }
     else
     {
         _referencesByObject = _referencesByObject.Add(newNode);
     }
 }
        public virtual IReplicationReference ReferenceNewObject(object obj, IReplicationReference
                                                                counterpartReference, IReplicationReference referencingObjCounterPartRef, string
                                                                fieldName)
        {
            IDrsUUID uuid = counterpartReference.Uuid();

            if (uuid == null)
            {
                return(null);
            }
            byte[]       signature            = uuid.GetSignaturePart();
            long         longPart             = uuid.GetLongPart();
            long         version              = counterpartReference.Version();
            Db4oDatabase db                   = _signatureMap.Produce(signature, 0);
            Db4oReplicationReferenceImpl @ref = new Db4oReplicationReferenceImpl(obj, db, longPart
                                                                                 , version);

            AddReference(@ref);
            return(@ref);
        }
 public virtual void ClearAllReferences()
 {
     _referencesByObject = null;
 }
            public void Visit(object obj)
            {
                Db4oReplicationReferenceImpl node = (Db4oReplicationReferenceImpl)obj;

                visitor.Visit(node);
            }
 public virtual void RollbackReplication()
 {
     _container.Rollback();
     _referencesByObject = null;
 }
		public virtual void ClearAllReferences()
		{
			_referencesByObject = null;
		}
		public virtual IReplicationReference ReferenceNewObject(object obj, IReplicationReference
			 counterpartReference, IReplicationReference referencingObjCounterPartRef, string
			 fieldName)
		{
			IDrsUUID uuid = counterpartReference.Uuid();
			if (uuid == null)
			{
				return null;
			}
			byte[] signature = uuid.GetSignaturePart();
			long longPart = uuid.GetLongPart();
			long version = counterpartReference.Version();
			Db4oDatabase db = _signatureMap.Produce(signature, 0);
			Db4oReplicationReferenceImpl @ref = new Db4oReplicationReferenceImpl(obj, db, longPart
				, version);
			AddReference(@ref);
			return @ref;
		}
		//empty in File Provider
		private void AddReference(Db4oReplicationReferenceImpl newNode)
		{
			if (_referencesByObject == null)
			{
				_referencesByObject = newNode;
			}
			else
			{
				_referencesByObject = _referencesByObject.Add(newNode);
			}
		}
		public virtual IReplicationReference ProduceReference(object obj, object unused, 
			string unused2)
		{
			if (obj == null)
			{
				return null;
			}
			if (_referencesByObject != null)
			{
				Db4oReplicationReferenceImpl existingNode = _referencesByObject.Find(obj);
				if (existingNode != null)
				{
					return existingNode;
				}
			}
			// TODO: Why refresh here? Try without and run all tests!
			Refresh(obj);
			IObjectInfo objectInfo = _container.GetObjectInfo(obj);
			if (objectInfo == null)
			{
				return null;
			}
			Db4oUUID uuid = objectInfo.GetUUID();
			if (uuid == null)
			{
				throw new ArgumentNullException();
			}
			Db4oReplicationReferenceImpl newNode = new Db4oReplicationReferenceImpl(objectInfo
				, obj);
			AddReference(newNode);
			return newNode;
		}
		public virtual void RollbackReplication()
		{
			_container.Rollback();
			_referencesByObject = null;
		}