D
- public class DataObjectDataProducer<D extends DataObjectDataProducer.MimeData> extends DataObjectFactory<D> implements SettableServeDataProducer, AnonymisingFactory
SettableServeDataProducer
implemented as a database table.
It is intended to be a straightforward replacement for SessionDataProducer
trading off database space and overhead for memory in the user session.
Note that if sessions are being persisted to the database then the
SessionDataProducer
will also consume database space though this will automatically be reclaimed
at the end of the session.
It can also be extended to provide more sophisticated access control
Each item of data belongs to a single user and expires after a specified dateDataProducerHeartbeatListener
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Modifier and Type | Class and Description |
---|---|
static class |
DataObjectDataProducer.MimeData |
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
AUTO_CREATE_TABLES_FEATURE, COMPOSITES_SUFFIX, REJECT_MULTIPLE_RESULT_FEATURE, res
DEFAULT_SERVE_DATA_TAG
Constructor and Description |
---|
DataObjectDataProducer(AppContext c,
java.lang.String tag) |
Modifier and Type | Method and Description |
---|---|
void |
anonymise() |
void |
clean() |
MimeStreamData |
getData(SessionService user,
java.util.List<java.lang.String> path)
Get a MimeStreamData corresponding to the data to be served
This method also implements access control and returns null if access is denied.
|
TableSpecification |
getDefaultTableSpecification(AppContext c,
java.lang.String tag)
Get the default table specification if the table is to be created.
|
java.lang.String |
getDownloadName(SessionService user,
java.util.List<java.lang.String> path)
get a download file-name to be added to a download link.
|
DataObjectDataProducer.MimeData |
getMimeData(SessionService user,
java.util.List<java.lang.String> path) |
protected D |
makeBDO(Repository.Record res)
Construct a new Blank DataObject of the correct Class
This method takes a Record as an argument.
|
java.util.List<java.lang.String> |
setData(MimeStreamData data)
Store a MimeStreamData object generating a new path location
|
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, getTarget, getTranslations, getUniqueIdName, hasComposite, hashCode, isMine, isMine, isMyReference, isValid, 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
public DataObjectDataProducer(AppContext c, java.lang.String tag)
public TableSpecification getDefaultTableSpecification(AppContext c, java.lang.String tag)
DataObjectFactory
getDefaultTableSpecification
in class DataObjectFactory<D extends DataObjectDataProducer.MimeData>
c
- AppContexttag
- String table name.public void clean()
public DataObjectDataProducer.MimeData getMimeData(SessionService user, java.util.List<java.lang.String> path) throws java.lang.Exception
java.lang.Exception
public MimeStreamData getData(SessionService user, java.util.List<java.lang.String> path) throws java.lang.Exception
ServeDataProducer
SessionService
may not have a current person set so you have to check for
null SessionService
and null AppUser
as well as the users permissions.getData
in interface ServeDataProducer
java.lang.Exception
public java.lang.String getDownloadName(SessionService user, java.util.List<java.lang.String> path) throws java.lang.Exception
ServeDataProducer
MimeStreamData.getName()
if ServeDataProducer.getData(SessionService, List)
returns a non-null value.
However this method may be called by display content generation code so if the result is generated on the fly it might be possible to generate the download name in
a more lightweight fashion. It should also work to always return null thought he browser will use the last part of the selection path as the downloadgetDownloadName
in interface ServeDataProducer
java.lang.Exception
public java.util.List<java.lang.String> setData(MimeStreamData data)
SettableServeDataProducer
setData
in interface SettableServeDataProducer
data
- Data to addprotected D makeBDO(Repository.Record res) throws DataFault
DataObjectFactory
makeBDO
in class DataObjectFactory<D extends DataObjectDataProducer.MimeData>
res
- Record to create object fromDataFault
public void anonymise() throws DataFault
anonymise
in interface AnonymisingFactory
DataFault