T - public class ChargedAllocationFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord> extends SequenceAllocationFactory<T> implements ChargedAllocationManager<AllocationKey<T>,T>
AllocationFactory but also implements UsageRecordListener to accumulate usage effectively acting as
an aggregation usage record with user defined time bounds. These aggregated properties can be paired with a manager edited value to
represent an allocation constraint. However Additional unconstrained properties can also be accumulated.
The property master.table-name defines the name of the UsageProducer where aggregated values come from.
The index properties and completion time are used to tie UsageRecords from the master table to ChargedAllocationFactory.ChargedAllocationRecords
Fields that match properties in the master producer generate accumulation properties (with the same property tag) other fields are normal allocations.
Usage is accumulated in ALL allocations that match the target record. Each ChargedAllocationFactory.ChargedAllocationRecord therefore represents a
separate constraint rather than a set of allocations to be accumulated. The allocation records have to be constrained to be
non-overlapping in order to represent a
single sequence of allocations. Usage without any enclosing allocation is ignored
Enforcement of the constraint is a separate issue.
The accumulated properties are intended to produce quicker results that querying the UsageProducer directly for every report,
though this is also an option.
| Modifier and Type | Class and Description |
|---|---|
static class |
ChargedAllocationFactory.ChargedAllocationRecord |
class |
ChargedAllocationFactory.ChargedAllocationTableRegistry |
class |
ChargedAllocationFactory.RegenerateAllTransition |
class |
ChargedAllocationFactory.RegenerateTransition
transition to regenerate the accumulated values
|
SequenceAllocationFactory.SequenceCreationValidatorAllocationFactory.AllocationDelete, AllocationFactory.AllocationEdit, AllocationFactory.AllocationRecord, AllocationFactory.AllocationValidator, AllocationFactory.AllocationView, AllocationFactory.CreateAllocation, AllocationFactory.ListenerCreateValidator, AllocationFactory.ListenerUpdateValidator, AllocationFactory.ReturnIndexTransitionParseUsageRecordFactory.ParseTableRegistry, ParseUsageRecordFactory.RescanTableTransition<P extends ParseUsageRecordFactory>UsageRecordFactory.UseDataObjectPropertyFactory.DataObjectTableRegistryuk.ac.ed.epcc.webapp.model.data.DataObjectFactory.CounterMapper, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.DataObjectAcceptFilter, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.DataObjectInput, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.DataObjectIntegerInput, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.DestFilter<T extends uk.ac.ed.epcc.webapp.model.data.DataObject>, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.ExistsMapper, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.FilterAdapter, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.FilterCounter, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.FilterExists, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.FilterIterator, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.FilterSet, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.Finder, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.MatchFilter, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.ReferenceAcceptFilter<R extends uk.ac.ed.epcc.webapp.Indexed,T extends uk.ac.ed.epcc.webapp.model.data.DataObject>, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.ReferencedAdapter<I extends uk.ac.ed.epcc.webapp.Indexed>, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.ReferenceIterator<I extends uk.ac.ed.epcc.webapp.Indexed>, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.RemoteFilter<T extends uk.ac.ed.epcc.webapp.model.data.DataObject>, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.SortingDataObjectInput, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.TimeAcceptFilter<T extends uk.ac.ed.epcc.webapp.model.data.DataObject>, uk.ac.ed.epcc.webapp.model.data.DataObjectFactory.TimeFilterINDEX, VALUE_COLTEXTINSERTED_TIMESTAMP, logAUTO_CUTOFF_FEATURE, cutoffsAUTO_CREATE_TABLES_FEATURE, resALLOCATION_ADMIN| Constructor and Description |
|---|
ChargedAllocationFactory(uk.ac.ed.epcc.webapp.AppContext c,
java.lang.String table) |
ChargedAllocationFactory(uk.ac.ed.epcc.webapp.AppContext c,
java.lang.String table,
UsageProducer<UsageRecordFactory.Use> master_factory) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addTransitions(java.util.LinkedHashMap<AllocationKey<T>,uk.ac.ed.epcc.webapp.forms.transition.Transition<T>> res) |
protected void |
customAccessors(AccessorMap<T> map,
MultiFinder finder)
Extension point to allow custom Accessors and the corresponding PropertyFinders to be added.
|
protected boolean |
editEnds() |
java.lang.String |
endListenerParse()
End a batch parse this de-allocates any temporary storage and
and perform any final operations.
|
java.util.Set<PropertyTag<? extends java.lang.Number>> |
getAccumulations() |
java.util.Map<PropertyTag<? extends java.lang.Number>,PropertyTag<? extends java.lang.Number>> |
getConstraints()
This maps accumulation properties to an allocation property that is an allocation limit
on the accumulated property.
|
protected java.util.Set<PropertyTag> |
getListProperties()
get the set of properties shown in the index list
|
java.util.Iterator<T> |
getMatches(PropertyContainer c)
get all allocations that match a
PropertyContainer |
protected java.util.Set<PropertyTag<? extends java.lang.Number>> |
getSplitProperties()
get the set of properties that need to be divided on a record split
|
protected java.util.Set<PropertyTag> |
getSummaryProperties()
get the set of properties to be show in the summary table
|
protected java.util.Set<java.lang.String> |
getSupress() |
java.lang.Class<? super T> |
getTarget() |
protected java.util.Set<PropertyTag<? extends java.lang.Number>> |
makeAccumulations()
make the set of accumulated properties
|
protected java.util.Set<PropertyTag<? extends java.lang.Number>> |
makeAllocationProperties() |
protected uk.ac.ed.epcc.webapp.model.data.DataObject |
makeBDO(uk.ac.ed.epcc.webapp.model.data.Repository.Record res) |
protected java.util.Map<PropertyTag<? extends java.lang.Number>,PropertyTag<? extends java.lang.Number>> |
makeConstraints() |
protected ChargedAllocationFactory.ChargedAllocationTableRegistry |
makeTableRegistry() |
protected java.util.LinkedHashMap<AllocationKey<T>,uk.ac.ed.epcc.webapp.forms.transition.Transition<T>> |
makeTransitions() |
void |
notifyCreated(T rec) |
void |
notifyModified(T rec,
java.lang.String details) |
void |
notifySplit(T first,
T second) |
void |
postCreate(PropertyContainer props,
UsageRecord rec)
once record has been committed apply any side effects such as budget
charging.
|
void |
preDelete(UsageRecord rec)
perform any operations required prior to an existing record being
deleted, such as budget refunds
|
protected void |
regenerate(T record)
recalculate charged values from scratch for a record
|
void |
regenerateAll()
regenerate all records
|
void |
setEnd(T period,
java.util.Date d) |
void |
setStart(T period,
java.util.Date d) |
void |
startListenerParse()
Start a batch parse.
|
addCreationValidator, canChangeEnd, canChangeStart, canMerge, getNextInSequence, isEmpty, merge, sameSequenceaccept, addIndexTable, addUpdateValidator, addValueToTable, allowTransition, buildCreationForm, buildFilterForm, canModify, canSplit, canView, checkCreate, getAllocationProperties, getDateInput, getEditMarker, getFilterSelector, getHelp, getID, getIndexProperties, getLabel, getLogContent, getOptional, getOverlapSelector, getSelectors, getSummaryContent, getSummaryTable, getTarget, getTargetName, getTopContent, getTransition, getTransitionProvider, getTransitions, getTranslations, lookupTransition, makeIndexProperties, makeListeners, notifyAggregate, notifyDeleted, notifyMerge, roundSplitValue, splitgetDescription, makePlugInOwnerallowReplace, bootstrapTable, commitRecord, deleteRecord, endParse, findDuplicate, getAccessorMap, getDefaultTableSpecification, getFinder, getParser, getPolicies, isComplete, makeParseTarget, parse, prepareRecord, release, rescan, resetStructure, splitRecords, startParse, updateRecordgetDerivedProperties, getImplemenationInfo, getIndexedReductionMap, getPeriodFilter, getReduction, getReductionMapcompatible, compatible, find, getFilter, getFilter, getIterator, getIterator, getNullFilter, getOrderFilter, getProperties, getRecordCount, getRelationFilter, getSelectClauseFilter, getSQLExpression, getValues, hasProperty, updategetTableTransitionID, getTableTransitionRegistryall, allowPreSelect, canCreate, canUpdate, customiseForm, equals, exists, find, find, find, find, find, getAllIterator, getComposite, getComposites, getConfigTag, getContext, getCount, getDefaults, getFormCreator, getFormUpdate, getIndex, getInput, getInput, getIterator, getLogger, getMaxIdentifierLength, getNullable, getOrder, getProperty, getReferenced, getReferenceFieldType, getResult, getSelectFilter, getTag, getUniqueIdName, hashCode, isMine, isMine, isMyReference, isValid, makeBDO, makeObject, makeRecord, makeReference, makeReference, makeSet, OrderBy, postCreateTableSetup, restrictDefaultInput, setContext, setContext, setContextWithMake, setProperty, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddIndexTable, buildCreationForm, buildFilterForm, getFilterSelector, getIndexPropertiesgetImplemenationInfo, hasPropertycompatiblecompatible, getIterator, getIterator, getRecordCount, getValuesgetFindergetIndexedReductionMap, getReduction, getReductionMapcanView, getHelp, getLogContent, getTopContentgetID, getTargetaccept, allowTransition, getSummaryContent, getTargetName, getTransition, getTransitions, lookupTransitioncanSplit, getDateInput, getEditMarker, splitgetDerivedProperties, getTagpublic ChargedAllocationFactory(uk.ac.ed.epcc.webapp.AppContext c,
java.lang.String table)
public ChargedAllocationFactory(uk.ac.ed.epcc.webapp.AppContext c,
java.lang.String table,
UsageProducer<UsageRecordFactory.Use> master_factory)
protected void customAccessors(AccessorMap<T> map, MultiFinder finder)
ParseUsageRecordFactorycustomAccessors in class ParseUsageRecordFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>map - AccessorMap modifiedfinder - MultiFinder modifiedpublic final java.util.Set<PropertyTag<? extends java.lang.Number>> getAccumulations()
protected java.util.Set<PropertyTag<? extends java.lang.Number>> makeAccumulations()
public final java.util.Map<PropertyTag<? extends java.lang.Number>,PropertyTag<? extends java.lang.Number>> getConstraints()
protected java.util.Map<PropertyTag<? extends java.lang.Number>,PropertyTag<? extends java.lang.Number>> makeConstraints()
protected java.util.Set<PropertyTag> getSummaryProperties()
AllocationFactorygetSummaryProperties in class AllocationFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>protected java.util.Set<PropertyTag> getListProperties()
AllocationFactorygetListProperties in class AllocationFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>protected java.util.Set<PropertyTag<? extends java.lang.Number>> getSplitProperties()
AllocationFactorygetSplitProperties in class AllocationFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>protected java.util.Set<PropertyTag<? extends java.lang.Number>> makeAllocationProperties()
makeAllocationProperties in class AllocationFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>protected uk.ac.ed.epcc.webapp.model.data.DataObject makeBDO(uk.ac.ed.epcc.webapp.model.data.Repository.Record res)
throws uk.ac.ed.epcc.webapp.model.data.Exceptions.DataFault
makeBDO in class AllocationFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>uk.ac.ed.epcc.webapp.model.data.Exceptions.DataFaultpublic java.lang.Class<? super T> getTarget()
getTarget in interface uk.ac.ed.epcc.webapp.model.data.reference.IndexedProducer<T extends ChargedAllocationFactory.ChargedAllocationRecord>getTarget in interface uk.ac.ed.epcc.webapp.Targetted<T extends ChargedAllocationFactory.ChargedAllocationRecord>getTarget in class AllocationFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>protected java.util.LinkedHashMap<AllocationKey<T>,uk.ac.ed.epcc.webapp.forms.transition.Transition<T>> makeTransitions()
makeTransitions in class AllocationFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>protected boolean editEnds()
editEnds in class AllocationFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>protected void addTransitions(java.util.LinkedHashMap<AllocationKey<T>,uk.ac.ed.epcc.webapp.forms.transition.Transition<T>> res)
protected void regenerate(T record) throws java.lang.Exception
java.lang.Exceptionrecord - public void regenerateAll()
throws java.lang.Exception
java.lang.Exceptionpublic java.util.Iterator<T> getMatches(PropertyContainer c) throws InvalidPropertyException, uk.ac.ed.epcc.webapp.model.data.Exceptions.DataFault, uk.ac.ed.epcc.webapp.jdbc.expr.CannotFilterException
PropertyContainerInvalidPropertyExceptionuk.ac.ed.epcc.webapp.model.data.Exceptions.DataFaultuk.ac.ed.epcc.webapp.jdbc.expr.CannotFilterExceptionc - public void startListenerParse()
UsageRecordListenerstartListenerParse in interface UsageRecordListenerpublic java.lang.String endListenerParse()
UsageRecordListenerendListenerParse in interface UsageRecordListenerpublic void postCreate(PropertyContainer props, UsageRecord rec) throws java.lang.Exception
UsageRecordListenerpostCreate in interface UsageRecordListenerjava.lang.Exceptionprops - Full set of properties from the parse stagerec - The actual committed recordpublic void preDelete(UsageRecord rec) throws java.lang.Exception
UsageRecordListenerpreDelete in interface UsageRecordListenerjava.lang.Exceptionprotected ChargedAllocationFactory.ChargedAllocationTableRegistry makeTableRegistry()
makeTableRegistry in class ParseUsageRecordFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>protected java.util.Set<java.lang.String> getSupress()
getSupress in class uk.ac.ed.epcc.webapp.model.data.DataObjectFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>public void notifySplit(T first, T second)
notifySplit in class AllocationFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>public void notifyCreated(T rec)
notifyCreated in class AllocationFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>public void setStart(T period, java.util.Date d) throws java.lang.Exception
setStart in interface uk.ac.ed.epcc.webapp.model.period.SequenceManager<T extends ChargedAllocationFactory.ChargedAllocationRecord>setStart in class SequenceAllocationFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>java.lang.Exceptionpublic void setEnd(T period, java.util.Date d) throws java.lang.Exception
setEnd in interface uk.ac.ed.epcc.webapp.model.period.SequenceManager<T extends ChargedAllocationFactory.ChargedAllocationRecord>setEnd in class SequenceAllocationFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>java.lang.Exceptionpublic void notifyModified(T rec, java.lang.String details)
notifyModified in class AllocationFactory<T extends ChargedAllocationFactory.ChargedAllocationRecord>