public class LinkPolicy extends BaseUsageRecordPolicy implements SummaryProvider, uk.ac.ed.epcc.webapp.jdbc.table.TransitionSource<uk.ac.ed.epcc.webapp.jdbc.table.TableTransitionTarget>
One table is defined as the primary table and data is loaded to this table first.
This policy is added to the secondary table. It will generate a SkipRecord exception if a corresponding
primary record is not found (This is to protect against the data being loaded out of sequence).
This will prevent this policy from working with a IncrementalPropertyContainerParser
Configuration Properties:
Note that as the mapping between primary and secondary tables is expected to be one-to-one, at the very least this makes joins inefficient but there may also be serious performance and memory problems if the secondary table is used in code written assuming small classifier tables. Properties that may be used to group queries should therefore be duplicated in the primary table where they can be set by the PostCreate method.
| Modifier and Type | Class and Description |
|---|---|
class |
LinkPolicy.SetRemoteAction |
class |
LinkPolicy.SetRemoteTransition |
| Constructor and Description |
|---|
LinkPolicy() |
| Modifier and Type | Method and Description |
|---|---|
void |
getTableTransitionSummary(uk.ac.ed.epcc.webapp.content.ContentBuilder hb,
uk.ac.ed.epcc.webapp.session.SessionService operator) |
java.util.Map<uk.ac.ed.epcc.webapp.model.data.transition.TransitionKey<uk.ac.ed.epcc.webapp.jdbc.table.TableTransitionTarget>,uk.ac.ed.epcc.webapp.forms.transition.Transition<uk.ac.ed.epcc.webapp.jdbc.table.TableTransitionTarget>> |
getTransitions() |
PropertyFinder |
initFinder(uk.ac.ed.epcc.webapp.AppContext ctx,
PropertyFinder prev,
java.lang.String table)
Generate a PropertyFinder that will find any PropertyTag generated by this class.
|
void |
parse(PropertyMap rec)
Generate additional properties based on properties from the basic parse
and previously applied Policies
|
void |
postCreate(PropertyContainer props,
UsageRecord r)
once record has been committed apply any side effects such as budget
charging.
|
allowReplace, preDeleteendParse, getDerivedProperties, modifyDefaultTableSpecification, startParse, uniqueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitendParse, getDerivedProperties, modifyDefaultTableSpecification, startParsepublic PropertyFinder initFinder(uk.ac.ed.epcc.webapp.AppContext ctx, PropertyFinder prev, java.lang.String table)
PropertyContainerUpdaterAll properties defined at run-time should have their PropertyTag objects constructed by the time the first call to this method returns. As some parsers properties will generate different things depending on the other properties already in scope this method is passed a PropertyFinder for any properties that may already be in scope. This will include any default parameters specified when the data was uploaded and any properties generated from the database meta-data. Though it is perfectly legal to return a PropertyFinder that returns a superset of the generated properties the only requirement is that the returned finder can find any property that this classes parse method may actually generate values for. So Normally the contents of the super-finder are not included in the result unless these values are actually generated by the parse. If values are generated then a MultiFinder can be populated with the PropertyRegistrys from the generated properties
initFinder in interface PropertyContainerUpdaterprev - PropertyFinder for the higher levels in the call chain.table - String name of the destination table in case per-table customisation is neededpublic void parse(PropertyMap rec) throws AccountingParseException
PropertyContainerPolicyparse in interface PropertyContainerPolicyparse in class BasePolicyAccountingParseExceptionrec - PropertyMap being modifiedpublic void postCreate(PropertyContainer props, UsageRecord r) throws java.lang.Exception
UsageRecordPolicypostCreate in interface UsageRecordPolicypostCreate in class BaseUsageRecordPolicyjava.lang.Exceptionprops - Full set of properties from the parse stager - The actual committed recordpublic void getTableTransitionSummary(uk.ac.ed.epcc.webapp.content.ContentBuilder hb,
uk.ac.ed.epcc.webapp.session.SessionService operator)
getTableTransitionSummary in interface SummaryProviderpublic java.util.Map<uk.ac.ed.epcc.webapp.model.data.transition.TransitionKey<uk.ac.ed.epcc.webapp.jdbc.table.TableTransitionTarget>,uk.ac.ed.epcc.webapp.forms.transition.Transition<uk.ac.ed.epcc.webapp.jdbc.table.TableTransitionTarget>> getTransitions()
getTransitions in interface uk.ac.ed.epcc.webapp.jdbc.table.TransitionSource<uk.ac.ed.epcc.webapp.jdbc.table.TableTransitionTarget>