public override IHasId Get(IStoredObjectId soId) { if (!this.AllowedOperations.Has(StoreOperation.Get)) throw new InvalidOperationException("operation masked"); return this.Decorated.Get(soId); }
//override all of the store functions, adding audit public override IHasId Get(IStoredObjectId soId) { var val = this.Decorated.Get(soId); this.BuildAndSaveAuditPoint(StoredItemAccessMode.Read, val); return(val); }
public override IHasId Get(IStoredObjectId soId) { if (!this.AllowedOperations.Has(StoreOperation.Get)) { throw new InvalidOperationException("operation masked"); } return(this.Decorated.Get(soId)); }
public virtual IHasId Get(IStoredObjectId soId) { //#if DEBUG // Debug.WriteLine(string.Format("Id:{0} Thread:{1} Type:{2} Store get starts {3}", (this as IHasId).With(o => o.Id).With(o => o.ToString()), Thread.CurrentThread.ManagedThreadId, this.GetType().FullName, soId.With(x => x.ToString()))); //#endif var rv = this.Decorated.Get(soId); //#if DEBUG // Debug.WriteLine(string.Format("Id:{0} Thread:{1} Type:{2} Store get returns {3}", (this as IHasId).With(o => o.Id).With(o => o.ToString()), Thread.CurrentThread.ManagedThreadId, this.GetType().FullName, rv.With(x => x.GetStoredObjectId().ToString()))); //#endif return(rv); }
public override IHasId Get(IStoredObjectId soId) { var retval = this.Decorated.Get(soId); StoredObjectId id = StoredObjectId.New(soId.ObjectType, soId.ObjectId); if (this.TouchExpirable(id)) { return(retval); } return(null); }
public override IHasId Get(IStoredObjectId soId) { var uow = this.GetOperationIntercept.Perform(soId); if (uow.Error != null) { var errorStack = string.Join(Environment.NewLine, uow.LogEntries.ToArray()); this.Logger.LogError("intercept error", errorStack, uow.Error); throw new InvalidOperationException("intercept error", uow.Error); } return(uow.ProcessedResult); }
public virtual IHasId Get(IStoredObjectId soId) { IHasId rv = null; //#if DEBUG // Debug.WriteLine(string.Format("Id:{0} Thread:{1} Type:{2} Store getting {3}", (this as IHasId).With(o => o.Id).With(o => o.ToString()), Thread.CurrentThread.ManagedThreadId, this.GetType().FullName, soId.With(x => x.ToString()))); //#endif this.Dictionary.TryGetValue(StoredObjectId.New(soId.ObjectType, soId.ObjectId), out rv); //#if DEBUG // Debug.WriteLine(string.Format("Id:{0} Thread:{1} Type:{2} Store get returns {3}", (this as IHasId).With(o => o.Id).With(o => o.ToString()), Thread.CurrentThread.ManagedThreadId, this.GetType().FullName, rv.With(x => x.GetStoredObjectId().ToString()))); //#endif return(rv); }
public virtual IHasId Get(IStoredObjectId soId) { IHasId rv = null; //#if DEBUG // Debug.WriteLine(string.Format("Id:{0} Thread:{1} Type:{2} Store getting {3}", (this as IHasId).With(o => o.Id).With(o => o.ToString()), Thread.CurrentThread.ManagedThreadId, this.GetType().FullName, soId.With(x => x.ToString()))); //#endif this.Dictionary.TryGetValue(StoredObjectId.New(soId.ObjectType, soId.ObjectId), out rv); //#if DEBUG // Debug.WriteLine(string.Format("Id:{0} Thread:{1} Type:{2} Store get returns {3}", (this as IHasId).With(o => o.Id).With(o => o.ToString()), Thread.CurrentThread.ManagedThreadId, this.GetType().FullName, rv.With(x => x.GetStoredObjectId().ToString()))); //#endif return rv; }
public override Core.Identifying.IHasId Get(IStoredObjectId soId) { this.Logger.LogVerbose("Get started", null); try { return(Decorated.Get(soId)); } catch (Exception ex) { this.Logger.LogError(ex.Message, null, ex); throw; } finally { this.Logger.LogVerbose("Get completed", null); } }
public override Core.Identifying.IHasId Get(IStoredObjectId soId) { this.Logger.LogVerbose("Get started", null); try { return Decorated.Get(soId); } catch (Exception ex) { this.Logger.LogError(ex.Message, null, ex); throw; } finally { this.Logger.LogVerbose("Get completed", null); } }
/// <summary> /// gets the property of type T with the name of the IHasId.Id value /// </summary> /// <typeparam name="T"></typeparam> /// <param name="iHasId"></param> /// <returns></returns> public virtual IHasId Get(IStoredObjectId soId) { if (soId == null) { return(null); } //get the store item (our native format) StoredObjectId key = StoredObjectId.New(soId.ObjectType, soId.ObjectId); var item = this.JSONObject.Get <SerializedIHasId>(key.ToString()); //return the nested object if (item == null) { return(null); } return(item.GetStoredItem()); }
/// <summary> /// looks for the object but if it isn't there it will be created /// </summary> /// <typeparam name="T"></typeparam> /// <param name="id"></param> /// <returns></returns> public override IHasId Get(IStoredObjectId soId) { var retval = this.Decorated.Get(soId); //not here if (retval == null) { //build it lock (this._stateLock) { var factoryLogic = this.Factory.Perform(soId) as LogicOfTo <IStoredObjectId, IHasId>; retval = factoryLogic.Result; //save it if (retval != null) { this.SaveItem(retval); } } } return(retval); }
/// <summary> /// looks for the object but if it isn't there it will be created /// </summary> /// <typeparam name="T"></typeparam> /// <param name="id"></param> /// <returns></returns> public override IHasId Get(IStoredObjectId soId) { var retval = this.Decorated.Get(soId); //not here if (retval == null) { //build it lock (this._stateLock) { var factoryLogic = this.Factory.Perform(soId) as LogicOfTo<IStoredObjectId, IHasId>; retval = factoryLogic.Result; //save it if (retval != null) { this.SaveItem(retval); } } } return retval; }
public override IHasId Get(IStoredObjectId soId) { var retval = this.CachingStore.Get(soId); if (retval == null) { //hit the actual store lock (this._stateLock) { retval = this.Decorated.Get(soId); //something is here, save it in the cache if (retval != null) { this.CachingStore.SaveItem(retval); } } } return(retval); }
public override IHasId Get(IStoredObjectId soId) { var retval = this.CachingStore.Get(soId); if (retval == null) { //hit the actual store lock (this._stateLock) { retval = this.Decorated.Get(soId); //something is here, save it in the cache if (retval != null) { this.CachingStore.SaveItem(retval); } } } return retval; }
public override IHasId Get(IStoredObjectId soId) { var retval = this.Decorated.Get(soId); StoredObjectId id = StoredObjectId.New(soId.ObjectType, soId.ObjectId); if (this.TouchExpirable(id)) return retval; return null; }
public IHasId Get(IStoredObjectId soId) { return(this.Store.Get(soId)); }
public override IHasId Get(IStoredObjectId soId) { var uow = this.GetOperationIntercept.Perform(soId); if (uow.Error != null) { var errorStack = string.Join(Environment.NewLine, uow.LogEntries.ToArray()); this.Logger.LogError("intercept error", errorStack, uow.Error); throw new InvalidOperationException("intercept error", uow.Error); } return uow.ProcessedResult; }