T - public class AllocationFactory<T extends AllocationFactory.AllocationRecord> extends ConfigUsageRecordFactory<T> implements AllocationManager<AllocationKey<T>,T>
ConfigUsageRecordFactory to allow full use of policies and to allow allocations to be parsed
from an external source.
The main difference is that allocations also provide mechanisms for the data to be edited manually.
The funding stream is identified by a set of Index properties (references)
numerical properties are taken as allocations| Modifier and Type | Class and Description |
|---|---|
class |
AllocationFactory.AllocationDelete |
class |
AllocationFactory.AllocationEdit
Transition to edit Allocation records
|
static class |
AllocationFactory.AllocationRecord |
class |
AllocationFactory.AllocationValidator |
class |
AllocationFactory.AllocationView |
class |
AllocationFactory.CreateAllocation
Transition to create allocation records
|
class |
AllocationFactory.ListenerCreateValidator |
class |
AllocationFactory.ListenerUpdateValidator |
class |
AllocationFactory.ReturnIndexTransition |
ParseUsageRecordFactory.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.TimeFilter| Modifier and Type | Field and Description |
|---|---|
static AllocationKey |
INDEX |
protected static java.lang.String |
VALUE_COL |
TEXTINSERTED_TIMESTAMP, logAUTO_CUTOFF_FEATURE, cutoffsAUTO_CREATE_TABLES_FEATURE, resALLOCATION_ADMIN| Constructor and Description |
|---|
AllocationFactory(uk.ac.ed.epcc.webapp.AppContext c,
java.lang.String table) |
| Modifier and Type | Method and Description |
|---|---|
<R> R |
accept(uk.ac.ed.epcc.webapp.forms.transition.TransitionFactoryVisitor<R,T,AllocationKey<T>> vis) |
protected void |
addCreationValidator(uk.ac.ed.epcc.webapp.forms.Form f) |
uk.ac.ed.epcc.webapp.content.Table<java.lang.String,T> |
addIndexTable(uk.ac.ed.epcc.webapp.content.Table<java.lang.String,T> tab,
T target)
Add the Index HTML for an Allocation.
|
protected void |
addUpdateValidator(uk.ac.ed.epcc.webapp.forms.Form f,
T o) |
protected <X,C,R> void |
addValueToTable(T target,
uk.ac.ed.epcc.webapp.content.Table<C,R> tab,
C col,
R row,
PropertyTag<X> t) |
boolean |
allowTransition(uk.ac.ed.epcc.webapp.AppContext c,
T target,
AllocationKey<T> key) |
void |
buildCreationForm(uk.ac.ed.epcc.webapp.forms.Form f,
uk.ac.ed.epcc.webapp.time.Period p,
PropertyMap defaults)
build a creation form that takes default index values.
|
void |
buildFilterForm(uk.ac.ed.epcc.webapp.forms.Form filter_form)
build a form to generate a filtered view of allocations
|
boolean |
canMerge(T first,
T last) |
protected void |
canModify(T orig,
PropertyMap map) |
void |
canSplit(T orig,
java.util.Date d) |
boolean |
canView(T target,
uk.ac.ed.epcc.webapp.session.SessionService<?> sess) |
protected void |
checkCreate(PropertyContainer map)
Check a proposed creation against the listeners
|
protected boolean |
editEnds() |
protected java.util.Set<PropertyTag<? extends java.lang.Number>> |
getAllocationProperties()
get the set of properties used as allocations.
|
uk.ac.ed.epcc.webapp.forms.inputs.TimeStampMultiInput |
getDateInput()
Get the correct input to use for the date fields
|
java.util.Date |
getEditMarker() |
RecordSelector |
getFilterSelector(uk.ac.ed.epcc.webapp.forms.Form f)
parse the filter form to generate a corresponding selector
|
java.lang.String |
getHelp(AllocationKey<T> key) |
java.lang.String |
getID(T target) |
java.util.Set<ReferenceTag> |
getIndexProperties()
get the set of properties used to classify allocations
|
protected <X> java.lang.String |
getLabel(PropertyTag<X> t) |
protected java.util.Set<PropertyTag> |
getListProperties()
get the set of properties shown in the index list
|
<X extends uk.ac.ed.epcc.webapp.content.ContentBuilder> |
getLogContent(X cb,
T target,
uk.ac.ed.epcc.webapp.session.SessionService<?> sess) |
protected java.util.Set<java.lang.String> |
getOptional() |
RecordSelector |
getOverlapSelector(uk.ac.ed.epcc.webapp.time.TimePeriod p,
PropertyContainer cont) |
protected java.util.Map<java.lang.String,java.lang.Object> |
getSelectors() |
protected java.util.Set<PropertyTag<? extends java.lang.Number>> |
getSplitProperties()
get the set of properties that need to be divided on a record split
|
<X extends uk.ac.ed.epcc.webapp.content.ContentBuilder> |
getSummaryContent(uk.ac.ed.epcc.webapp.AppContext c,
X hb,
T target) |
protected java.util.Set<PropertyTag> |
getSummaryProperties()
get the set of properties to be show in the summary table
|
protected uk.ac.ed.epcc.webapp.content.Table<java.lang.String,java.lang.String> |
getSummaryTable(T target) |
java.lang.Class<? super T> |
getTarget() |
T |
getTarget(java.lang.String id) |
java.lang.String |
getTargetName() |
<X extends uk.ac.ed.epcc.webapp.content.ContentBuilder> |
getTopContent(X cb,
T target,
uk.ac.ed.epcc.webapp.session.SessionService<?> sess) |
uk.ac.ed.epcc.webapp.forms.transition.Transition<T> |
getTransition(T target,
AllocationKey<T> key) |
protected AllocationPeriodTransitionProvider |
getTransitionProvider() |
java.util.Set<AllocationKey<T>> |
getTransitions(T target) |
protected java.util.Map<java.lang.String,java.lang.String> |
getTranslations() |
AllocationKey<T> |
lookupTransition(T target,
java.lang.String name) |
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.Set<ReferenceTag> |
makeIndexProperties() |
java.util.Set<AllocationListener<T>> |
makeListeners(uk.ac.ed.epcc.webapp.AppContext c,
java.lang.String table) |
protected java.util.LinkedHashMap<AllocationKey<T>,uk.ac.ed.epcc.webapp.forms.transition.Transition<T>> |
makeTransitions() |
void |
notifyAggregate(T rec,
PropertyContainer props,
boolean add)
Method to track charging in sub-classes
|
void |
notifyCreated(T rec) |
void |
notifyDeleted(T rec) |
void |
notifyMerge(T first,
T second) |
void |
notifyModified(T rec,
java.lang.String details) |
void |
notifySplit(T first,
T second) |
protected java.lang.Number |
roundSplitValue(PropertyTag tag,
java.lang.Number total,
java.lang.Number value)
perform per property rounding in a sub-class
|
T |
split(T orig,
java.util.Date d) |
getDescription, makePlugInOwnerallowReplace, bootstrapTable, commitRecord, customAccessors, deleteRecord, endParse, findDuplicate, getAccessorMap, getDefaultTableSpecification, getFinder, getParser, getPolicies, isComplete, makeParseTarget, makeTableRegistry, 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, getSupress, 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, waitgetImplemenationInfo, hasPropertycompatiblecompatible, getIterator, getIterator, getRecordCount, getValuesgetFindergetIndexedReductionMap, getReduction, getReductionMapgetDerivedProperties, getTagprotected static final java.lang.String VALUE_COL
public static final AllocationKey INDEX
public AllocationFactory(uk.ac.ed.epcc.webapp.AppContext c,
java.lang.String table)
public java.lang.Class<? super T> getTarget()
getTarget in interface uk.ac.ed.epcc.webapp.model.data.reference.IndexedProducer<T extends AllocationFactory.AllocationRecord>getTarget in interface uk.ac.ed.epcc.webapp.Targetted<T extends AllocationFactory.AllocationRecord>getTarget in class UsageRecordFactory<T extends AllocationFactory.AllocationRecord>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 UsageRecordFactory<T extends AllocationFactory.AllocationRecord>uk.ac.ed.epcc.webapp.model.data.Exceptions.DataFaultpublic java.util.Set<AllocationListener<T>> makeListeners(uk.ac.ed.epcc.webapp.AppContext c, java.lang.String table)
protected void addCreationValidator(uk.ac.ed.epcc.webapp.forms.Form f)
protected void addUpdateValidator(uk.ac.ed.epcc.webapp.forms.Form f,
T o)
protected AllocationPeriodTransitionProvider getTransitionProvider()
protected java.util.LinkedHashMap<AllocationKey<T>,uk.ac.ed.epcc.webapp.forms.transition.Transition<T>> makeTransitions()
public void buildCreationForm(uk.ac.ed.epcc.webapp.forms.Form f,
uk.ac.ed.epcc.webapp.time.Period p,
PropertyMap defaults)
throws uk.ac.ed.epcc.webapp.forms.exceptions.TransitionException
AllocationManagerbuildCreationForm in interface AllocationManager<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>uk.ac.ed.epcc.webapp.forms.exceptions.TransitionExceptionpublic uk.ac.ed.epcc.webapp.forms.inputs.TimeStampMultiInput getDateInput()
getDateInput in interface uk.ac.ed.epcc.webapp.model.period.SplitManager<T extends AllocationFactory.AllocationRecord>protected java.util.Map<java.lang.String,java.lang.Object> getSelectors()
getSelectors in class DataObjectPropertyFactory<T extends AllocationFactory.AllocationRecord>public java.lang.String getTargetName()
getTargetName in interface uk.ac.ed.epcc.webapp.forms.transition.TransitionFactory<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>public boolean allowTransition(uk.ac.ed.epcc.webapp.AppContext c,
T target,
AllocationKey<T> key)
allowTransition in interface uk.ac.ed.epcc.webapp.forms.transition.TransitionFactory<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>public java.lang.String getID(T target)
getID in interface uk.ac.ed.epcc.webapp.forms.transition.TransitionProvider<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>protected java.util.Set<PropertyTag> getSummaryProperties()
public <X extends uk.ac.ed.epcc.webapp.content.ContentBuilder> X getSummaryContent(uk.ac.ed.epcc.webapp.AppContext c,
X hb,
T target)
getSummaryContent in interface uk.ac.ed.epcc.webapp.forms.transition.TransitionFactory<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>protected uk.ac.ed.epcc.webapp.content.Table<java.lang.String,java.lang.String> getSummaryTable(T target)
public T getTarget(java.lang.String id)
getTarget in interface uk.ac.ed.epcc.webapp.forms.transition.TransitionProvider<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>public uk.ac.ed.epcc.webapp.forms.transition.Transition<T> getTransition(T target, AllocationKey<T> key)
getTransition in interface uk.ac.ed.epcc.webapp.forms.transition.TransitionFactory<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>public java.util.Set<AllocationKey<T>> getTransitions(T target)
getTransitions in interface uk.ac.ed.epcc.webapp.forms.transition.TransitionFactory<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>public AllocationKey<T> lookupTransition(T target, java.lang.String name)
lookupTransition in interface uk.ac.ed.epcc.webapp.forms.transition.TransitionFactory<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>public void buildFilterForm(uk.ac.ed.epcc.webapp.forms.Form filter_form)
buildFilterForm in interface AllocationManager<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>public final java.util.Set<ReferenceTag> getIndexProperties()
getIndexProperties in interface AllocationManager<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>protected java.util.Set<ReferenceTag> makeIndexProperties()
protected final java.util.Set<PropertyTag<? extends java.lang.Number>> getAllocationProperties()
protected java.util.Set<PropertyTag<? extends java.lang.Number>> makeAllocationProperties()
protected java.util.Set<PropertyTag> getListProperties()
public RecordSelector getFilterSelector(uk.ac.ed.epcc.webapp.forms.Form f)
getFilterSelector in interface AllocationManager<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>public RecordSelector getOverlapSelector(uk.ac.ed.epcc.webapp.time.TimePeriod p, PropertyContainer cont) throws InvalidPropertyException
InvalidPropertyExceptionpublic uk.ac.ed.epcc.webapp.content.Table<java.lang.String,T> addIndexTable(uk.ac.ed.epcc.webapp.content.Table<java.lang.String,T> tab, T target)
AllocationManageraddIndexTable in interface AllocationManager<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>tab - Tableprotected final <X> java.lang.String getLabel(PropertyTag<X> t)
protected final <X,C,R> void addValueToTable(T target, uk.ac.ed.epcc.webapp.content.Table<C,R> tab, C col, R row, PropertyTag<X> t)
public boolean canView(T target, uk.ac.ed.epcc.webapp.session.SessionService<?> sess)
canView in interface uk.ac.ed.epcc.webapp.forms.transition.ViewTransitionFactory<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>public <X extends uk.ac.ed.epcc.webapp.content.ContentBuilder> X getLogContent(X cb,
T target,
uk.ac.ed.epcc.webapp.session.SessionService<?> sess)
getLogContent in interface uk.ac.ed.epcc.webapp.forms.transition.ViewTransitionFactory<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>public java.lang.String getHelp(AllocationKey<T> key)
getHelp in interface uk.ac.ed.epcc.webapp.forms.transition.ViewTransitionFactory<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>protected java.util.Set<java.lang.String> getOptional()
getOptional in class uk.ac.ed.epcc.webapp.model.data.DataObjectFactory<T extends AllocationFactory.AllocationRecord>public <X extends uk.ac.ed.epcc.webapp.content.ContentBuilder> X getTopContent(X cb,
T target,
uk.ac.ed.epcc.webapp.session.SessionService<?> sess)
getTopContent in interface uk.ac.ed.epcc.webapp.forms.transition.ViewTransitionFactory<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>public <R> R accept(uk.ac.ed.epcc.webapp.forms.transition.TransitionFactoryVisitor<R,T,AllocationKey<T>> vis)
accept in interface uk.ac.ed.epcc.webapp.forms.transition.TransitionFactory<AllocationKey<T extends AllocationFactory.AllocationRecord>,T extends AllocationFactory.AllocationRecord>protected java.util.Map<java.lang.String,java.lang.String> getTranslations()
getTranslations in class uk.ac.ed.epcc.webapp.model.data.DataObjectFactory<T extends AllocationFactory.AllocationRecord>protected java.util.Set<PropertyTag<? extends java.lang.Number>> getSplitProperties()
protected java.lang.Number roundSplitValue(PropertyTag tag, java.lang.Number total, java.lang.Number value)
tag - value - public T split(T orig, java.util.Date d) throws java.lang.Exception
split in interface uk.ac.ed.epcc.webapp.model.period.SplitManager<T extends AllocationFactory.AllocationRecord>java.lang.Exceptionpublic java.util.Date getEditMarker()
getEditMarker in interface uk.ac.ed.epcc.webapp.model.period.SplitManager<T extends AllocationFactory.AllocationRecord>protected boolean editEnds()
public void notifyCreated(T rec)
public void notifyDeleted(T rec)
public void notifyModified(T rec, java.lang.String details)
public void notifyAggregate(T rec, PropertyContainer props, boolean add)
rec - allocation being updatedprops - properties of accounting recordadd - addition or removalprotected void canModify(T orig, PropertyMap map) throws ListenerObjection
ListenerObjectionmap - protected void checkCreate(PropertyContainer map) throws ListenerObjection
ListenerObjectionmap - public void canSplit(T orig, java.util.Date d) throws uk.ac.ed.epcc.webapp.forms.exceptions.ValidateException
canSplit in interface uk.ac.ed.epcc.webapp.model.period.SplitManager<T extends AllocationFactory.AllocationRecord>uk.ac.ed.epcc.webapp.forms.exceptions.ValidateException