org.starhope.appius.util
Interface DataRecord

All Superinterfaces:
com.whirlycott.cache.Cacheable, CTime, HasSubversionRevision
All Known Subinterfaces:
AbstractItem, DataRecordSet<T>, UserListEntry
All Known Implementing Classes:
AvatarBodyFormat, AvatarClass, BadMailList, BadMailRecord, CapabilityRecords, Currency, DamageArea, Enrolment, EventOutcomeRecord, EventRecord, EventType, GenericItemReference, Inventory, InventoryItem, InventoryItemType, ItemCollection, ItemEffectsType, MailAddressRecord, MedalRecord, Notification, NotificationSet, Parent, Passport, Persephone2AppConfig, PersonRecord, RarityRating, Room, RoomLayer, SimpleDataEnum, SimpleDataRecord, SimpleDataRecordSet, SimpleUserListEntry, StringRecord, StringSet, TheServers, UserEnrolment, UserHouse, UserItemCollection, UserPreferenceRecord, UserRecord, UserStat, Wallet, ZoneServerRecord

public interface DataRecord
extends CTime, HasSubversionRevision, com.whirlycott.cache.Cacheable

A data record of some kind that is instantiated from a backing storage medium (e.g. file, database record, or even an RPC)

Author:
twheys@gmail.com, brpocock@star-hope.org

Method Summary
 void checkStale()
          Indicates that a data record is stale and needs to be refreshed
 int getCacheableID()
          Note that all records must have either a numeric ID ( getCacheableID() or a string identifier ( getCacheableIdent() or both.
 String getCacheableIdent()
          Note that all records must have either a numeric ID ( getCacheableID() or a string identifier ( getCacheableIdent() or both.
 RecordLoader<? extends DataRecord> getRecordLoader()
           
 boolean isBeingLoaded()
          WRITEME: Document this method brpocock@star-hope.org
 void markAsLoaded()
          WRITEME: Document this method brpocock@star-hope.org
 void markAsSaved()
          Record the current time as the time last saved
 void setRecordLoader(RecordLoader<? extends DataRecord> loader)
           
 
Methods inherited from interface org.starhope.appius.util.CTime
getTimeLastChanged, getTimeLastSaved
 
Methods inherited from interface org.starhope.util.HasSubversionRevision
getSubversionRevision
 
Methods inherited from interface com.whirlycott.cache.Cacheable
onRemove, onRetrieve, onStore
 

Method Detail

getCacheableID

int getCacheableID()
                   throws NotFoundException
Note that all records must have either a numeric ID ( getCacheableID() or a string identifier ( getCacheableIdent() or both.

Returns:
an unique ID number
Throws:
NotFoundException - if the item doesn't have a distinct numeric ID

getCacheableIdent

String getCacheableIdent()
                         throws NotFoundException
Note that all records must have either a numeric ID ( getCacheableID() or a string identifier ( getCacheableIdent() or both.

Returns:
an unique identifier string
Throws:
NotFoundException - if the item doesn't have a distinct string identifier

getRecordLoader

RecordLoader<? extends DataRecord> getRecordLoader()
Returns:
The record loader used to instantiate (and save) this data record

isBeingLoaded

boolean isBeingLoaded()
WRITEME: Document this method brpocock@star-hope.org

Returns:
WRITEME

markAsLoaded

void markAsLoaded()
WRITEME: Document this method brpocock@star-hope.org


markAsSaved

void markAsSaved()
Record the current time as the time last saved


setRecordLoader

void setRecordLoader(RecordLoader<? extends DataRecord> loader)
Parameters:
loader - The record loader that should be used to save this data record

checkStale

void checkStale()
Indicates that a data record is stale and needs to be refreshed