H
- public abstract class AbstractMessageHandlerFactory<H extends AbstractMessageHandlerFactory.Provider> extends DataObjectFactory<H> implements MessageHandlerFactory
MessageHandlerFactory
s where the
message data is stored directly in the table not via a reference to
a remote table. This is primarily an example class and for use in
unit tests but may be useful as a base class for some use-cases.
It will need to be extended to add additional fields nedded to specify the access control logic and
how to populate the initial message
EachModifier and Type | Class and Description |
---|---|
class |
AbstractMessageHandlerFactory.Composer |
class |
AbstractMessageHandlerFactory.Handler |
static class |
AbstractMessageHandlerFactory.Provider |
static class |
AbstractMessageHandlerFactory.Status |
DataObjectFactory.AbstractDataObjectInput, DataObjectFactory.AbstractFinder<X>, DataObjectFactory.DataObjectAcceptFilter, DataObjectFactory.DataObjectInput, DataObjectFactory.DataObjectIntegerInput, DataObjectFactory.DestAcceptFilter<T extends DataObject>, DataObjectFactory.FilterAdapter, DataObjectFactory.FilterCounter, DataObjectFactory.FilterExists, DataObjectFactory.FilterIterator, DataObjectFactory.FilterSelector, DataObjectFactory.FilterSet, DataObjectFactory.Finder, DataObjectFactory.MakeRemoteFilterVisitor<R extends DataObject>, DataObjectFactory.MatchFilter, DataObjectFactory.ReferencedAdapter<I extends Indexed>, DataObjectFactory.ReferenceIterator<I extends Indexed>, DataObjectFactory.SortingDataObjectInput, DataObjectFactory.TimeAcceptFilter<T extends DataObject>, DataObjectFactory.TimeFilter
Modifier and Type | Field and Description |
---|---|
protected static AbstractMessageHandlerFactory.Status.Value |
ABANDONED |
protected static AbstractMessageHandlerFactory.Status.Value |
COMPOSE |
protected static AbstractMessageHandlerFactory.Status.Value |
SENT |
AUTO_CREATE_TABLES_FEATURE, COMPOSITES_SUFFIX, REJECT_MULTIPLE_RESULT_FEATURE, res
Constructor and Description |
---|
AbstractMessageHandlerFactory(AppContext conn,
java.lang.String table) |
Modifier and Type | Method and Description |
---|---|
boolean |
canEdit(H h,
SessionService<?> user) |
boolean |
canRead(H h,
SessionService<?> user) |
protected TableSpecification |
getDefaultTableSpecification(AppContext c,
java.lang.String table)
Get the default table specification if the table is to be created.
|
MessageHandler |
getHandler(java.util.LinkedList<java.lang.String> path,
SessionService<?> user)
Locate a
MessageHandler by id number
This method also does access control. |
MessageHandler |
getHandler(SessionService<?> user,
H h) |
java.lang.Class<H> |
getTarget()
Get a bound on the type of object produced by this factory for run-time checking.
|
all, allowPreSelect, canCreate, canUpdate, checkComposite, convertToDestinationFilter, customiseForm, equals, exists, find, find, find, find, find, getAllIterator, getComposite, getComposites, getComposites, getConfigTag, getContext, getCount, getDefaultRelationshipFilter, getDefaults, getDestFilter, getExcludeFilter, getFieldConstraints, getFieldHelp, getFilter, getFilter, getFilter, getFinalSelectFilter, getFinalTableSpecification, getFindFilter, getFormCreator, getFormUpdate, getID, getIndex, getInput, getInput, getInput, getLogger, getMaxIdentifierLength, getNullable, getOptional, getOrder, getProperty, getReferenced, getReferenceFieldType, getReferenceFieldType, getRemoteFilter, getRemoteSQLFilter, getResult, getResult, getSelectFilter, getSelector, getSelector, getSelectors, getSupress, getTableSpecification, getTableStructureContributers, getTag, getTranslations, getUniqueIdName, hasComposite, hashCode, isMine, isMine, isMyReference, isValid, makeBDO, makeBDO, makeObject, makeRecord, makeReference, makeReference, matches, narrowSelector, narrowSelector, observeComposite, OrderBy, postCreateTableSetup, postSetContext, release, restrictDefaultInput, setComposites, setContext, setContext, setContextWithMake, setProperty, toString, updateTable
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getContext
protected static final AbstractMessageHandlerFactory.Status.Value COMPOSE
protected static final AbstractMessageHandlerFactory.Status.Value SENT
protected static final AbstractMessageHandlerFactory.Status.Value ABANDONED
public AbstractMessageHandlerFactory(AppContext conn, java.lang.String table)
public MessageHandler getHandler(java.util.LinkedList<java.lang.String> path, SessionService<?> user)
MessageHandlerFactory
MessageHandler
by id number
This method also does access control.
If the user only has read permission
a simple MessageHandler should be returned.
If the user has edit permission a MessageComposer should be returned.
Otherwise this method returns null.
The path may contain additional path elements after the MessageHandler
is
identified.getHandler
in interface MessageHandlerFactory
path
- path identifier for MessageComposers from this Factoryuser
- AppUSer making requestpublic MessageHandler getHandler(SessionService<?> user, H h)
user
- h
- public boolean canRead(H h, SessionService<?> user)
public boolean canEdit(H h, SessionService<?> user)
public java.lang.Class<H> getTarget()
DataObjectFactory
IndexedProducer.getTarget()
. Normally this method should be overridden
each time we make a sub-class that narrows the produced type. However
checks should still pass if the super-type method is retained.getTarget
in interface IndexedProducer<H extends AbstractMessageHandlerFactory.Provider>
getTarget
in interface Targetted<H extends AbstractMessageHandlerFactory.Provider>
getTarget
in class DataObjectFactory<H extends AbstractMessageHandlerFactory.Provider>
protected TableSpecification getDefaultTableSpecification(AppContext c, java.lang.String table)
DataObjectFactory
getDefaultTableSpecification
in class DataObjectFactory<H extends AbstractMessageHandlerFactory.Provider>
c
- AppContexttable
- String table name.