Package com.wowza.wms.mediacache.model
Interface IMediaCacheItem
- 
 public interface IMediaCacheItemIMediaCacheItem
- 
- 
Field SummaryFields Modifier and Type Field Description static StringPROPS_ITEM_LASTMODIFIEDstatic StringPROPS_ITEM_LENGTHstatic StringPROPS_ITEM_MEDIANAMEstatic StringPROPS_SOURCE_BLOCKSIZEstatic StringPROPS_SOURCE_NAME
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddPendingWrites(com.wowza.wms.mediacache.model.MediaCacheBlockPtr blockPtr)Add the block to the list of pending writeslongblockSize()Get the block size configured for this itemvoidclose()Close the itemvoiddecPendingWriteCount()Decrement the pending write countbooleanexists()Return if the item existslonggetBlockCount()Get the block countcom.wowza.wms.mediacache.model.MediaCacheBlockPtrgetBlockPtr(long offset, long length)Get a block pointer for the offset and length givenlonggetBlockSize()Get the block size for the itemcom.wowza.wms.mediacache.model.MediaCacheItemInfogetInfo()Get the MediaCacheItemInfo object for this itemStringgetLocalPath()Get the local path for the itemintgetLockCount()Get the current lock countlonggetMaxTimeToLive()Get the maximum time to live for the itemIMediaCacheSourcegetMediaCacheSource()Gets the MediaCache source for the itemjava.io.FilegetMediaFile()Get the file pointed to for this CacheItemStringgetMediaName()Get the MediaName for this itemlonggetMinTimeToLive()Get the minimum time to live for the itemlonggetPendingWriteCount()Get the pending write countcom.wowza.wms.mediacache.model.MediaCacheBlockPtrgetPendingWrites(long blockId)Get the block from the list of pending writesIMediaCacheStoreItemgetStoreItem()Get the store item object for this itemIMediaCacheStoreItemgetStoreItem(boolean doLoad)Get the item from the store.edu.emory.mathcs.backport.java.util.concurrent.locks.WMSReadWriteLockgetSyncLock()Get the WMSReadWriteLock objectvoidincPendingWriteCount()Increment the pending write countbooleaninit(String mediaName, IMediaCacheStoreItem storeItem)Initialize the itembooleanisBlockInCache(long block)Check if the block needed is already cachedbooleanisLocal()Return if the item is localbooleanisReadAheadTrigger(long pos, int threshold)Determine if the read ahead should occurlonglastModified()Get the last modified time of the itemlonglength()Get the length of the itemintlock()Add to lock count for itemlongposToBlock(long pos)Convert the position given into a block numbervoidpreload()Start the readahead systemlongread(com.wowza.wms.mediacache.model.MediaCacheReadContext readContext, long foffset, byte[] buffer, long boffset, long length)Reads data using the read context and returns the byte count readcom.wowza.wms.mediacache.model.MediaCacheReadResultread(com.wowza.wms.mediacache.model.MediaCacheReadContext readContext, long foffset, long length)Reads data using the read context and returns a MediaCacheReadResult objectvoidreadAhead()Read ahead for all pending read ahead objectscom.wowza.wms.mediacache.model.MediaCacheBlockPtrremovePendingWrites(long blockId)Remove the block from list of pending writesvoidsaveBlock(com.wowza.wms.mediacache.model.MediaCacheBlockPtr blockPtr)Save the block provided by the block pointer objectvoidsetLastModified(long lastModified)Set the last modified time of the itemvoidsetLastRelease(long lastRelease)Set the last release time of the itemvoidsetLength(long length)Set the length of the itemvoidsetLocal(boolean isLocal)Set if the item is localvoidsetLocalPath(String localPath)Set the local path for the itemvoidsetMaxTimeToLive(long maxTimeToLive)Set the maximum time to live for the itemvoidsetMediaCacheSource(IMediaCacheSource mediaCacheSource)Sets the MediaCache source for the itemvoidsetMediaName(String name)Set the MediaName for this itemvoidsetMinTimeToLive(long minTimeToLive)Set the minimum time to live for the itemvoidsetReadAheadCount(int readAheadCount)Set the number of blocks to get on readheadvoidtiggerReadAhead(long pos)Cause a read aheadintunlock()Remove from lock count from itembooleanvalidate()Validate this itembooleanvalidate(java.util.Properties props)Validate this item with your own properties
 
- 
- 
- 
Field Detail- 
PROPS_ITEM_LENGTHstatic final String PROPS_ITEM_LENGTH - See Also:
- Constant Field Values
 
 - 
PROPS_ITEM_LASTMODIFIEDstatic final String PROPS_ITEM_LASTMODIFIED - See Also:
- Constant Field Values
 
 - 
PROPS_ITEM_MEDIANAMEstatic final String PROPS_ITEM_MEDIANAME - See Also:
- Constant Field Values
 
 - 
PROPS_SOURCE_NAMEstatic final String PROPS_SOURCE_NAME - See Also:
- Constant Field Values
 
 - 
PROPS_SOURCE_BLOCKSIZEstatic final String PROPS_SOURCE_BLOCKSIZE - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getMediaCacheSourceIMediaCacheSource getMediaCacheSource() Gets the MediaCache source for the item- Returns:
- IMediaCacheSource
 
 - 
setMediaCacheSourcevoid setMediaCacheSource(IMediaCacheSource mediaCacheSource) Sets the MediaCache source for the item- Parameters:
- mediaCacheSource-
 
 - 
lockint lock() Add to lock count for item- Returns:
- int
 
 - 
unlockint unlock() Remove from lock count from item- Returns:
- int
 
 - 
getLockCountint getLockCount() Get the current lock count- Returns:
- int
 
 - 
getSyncLockedu.emory.mathcs.backport.java.util.concurrent.locks.WMSReadWriteLock getSyncLock() Get the WMSReadWriteLock object- Returns:
- WMSReadWriteLock
 
 - 
initboolean init(String mediaName, IMediaCacheStoreItem storeItem)Initialize the item- Parameters:
- mediaName-
- storeItem-
- Returns:
- boolean - false failed to init, true success
 
 - 
closevoid close() Close the item
 - 
getBlockPtrcom.wowza.wms.mediacache.model.MediaCacheBlockPtr getBlockPtr(long offset, long length)Get a block pointer for the offset and length given- Parameters:
- offset-
- length-
- Returns:
- MediaCacheBlockPtr
 
 - 
saveBlockvoid saveBlock(com.wowza.wms.mediacache.model.MediaCacheBlockPtr blockPtr) Save the block provided by the block pointer object- Parameters:
- blockPtr-
 
 - 
readAheadvoid readAhead() Read ahead for all pending read ahead objects
 - 
getMediaFilejava.io.File getMediaFile() Get the file pointed to for this CacheItem- Returns:
- File
 
 - 
isBlockInCacheboolean isBlockInCache(long block) Check if the block needed is already cached- Parameters:
- block-
- Returns:
- boolean - cached is true, not cached false
 
 - 
blockSizelong blockSize() Get the block size configured for this item- Returns:
- long
 
 - 
validateboolean validate() Validate this item- Returns:
- boolean - valid is true, not valid is false
 
 - 
validateboolean validate(java.util.Properties props) Validate this item with your own properties- Parameters:
- props-
- Returns:
- boolean - valid is true, not valid is false
 
 - 
getInfocom.wowza.wms.mediacache.model.MediaCacheItemInfo getInfo() Get the MediaCacheItemInfo object for this item- Returns:
- MediaCacheItemInfo
 
 - 
getMediaNameString getMediaName() Get the MediaName for this item- Returns:
- String
 
 - 
setMediaNamevoid setMediaName(String name) Set the MediaName for this item- Parameters:
- name-
 
 - 
getStoreItemIMediaCacheStoreItem getStoreItem() Get the store item object for this item- Returns:
- IMediaCacheStoreItem
 
 - 
getStoreItemIMediaCacheStoreItem getStoreItem(boolean doLoad) Get the item from the store. If doLoad is set to true or the item is already loaded then the item is returned, otherwise a new store item is returned- Parameters:
- doLoad-
- Returns:
- IMediaCacheStoreItem
 
 - 
addPendingWritesvoid addPendingWrites(com.wowza.wms.mediacache.model.MediaCacheBlockPtr blockPtr) Add the block to the list of pending writes- Parameters:
- blockPtr-
 
 - 
removePendingWritescom.wowza.wms.mediacache.model.MediaCacheBlockPtr removePendingWrites(long blockId) Remove the block from list of pending writes- Parameters:
- blockId-
- Returns:
- MediaCacheBlockPtr
 
 - 
getPendingWritescom.wowza.wms.mediacache.model.MediaCacheBlockPtr getPendingWrites(long blockId) Get the block from the list of pending writes- Parameters:
- blockId-
- Returns:
- MediaCacheBlockPtr
 
 - 
incPendingWriteCountvoid incPendingWriteCount() Increment the pending write count
 - 
decPendingWriteCountvoid decPendingWriteCount() Decrement the pending write count
 - 
getPendingWriteCountlong getPendingWriteCount() Get the pending write count- Returns:
- long
 
 - 
getMinTimeToLivelong getMinTimeToLive() Get the minimum time to live for the item- Returns:
- long
 
 - 
setMinTimeToLivevoid setMinTimeToLive(long minTimeToLive) Set the minimum time to live for the item- Parameters:
- minTimeToLive-
 
 - 
getMaxTimeToLivelong getMaxTimeToLive() Get the maximum time to live for the item- Returns:
- long
 
 - 
setMaxTimeToLivevoid setMaxTimeToLive(long maxTimeToLive) Set the maximum time to live for the item- Parameters:
- maxTimeToLive-
 
 - 
getBlockSizelong getBlockSize() Get the block size for the item- Returns:
- long
 
 - 
getBlockCountlong getBlockCount() Get the block count- Returns:
- long
 
 - 
isReadAheadTriggerboolean isReadAheadTrigger(long pos, int threshold)Determine if the read ahead should occur- Parameters:
- pos-
- threshold-
- Returns:
- boolean - readahead true, no readahead false
 
 - 
tiggerReadAheadvoid tiggerReadAhead(long pos) Cause a read ahead- Parameters:
- pos-
 
 - 
setReadAheadCountvoid setReadAheadCount(int readAheadCount) Set the number of blocks to get on readhead- Parameters:
- readAheadCount-
 
 - 
posToBlocklong posToBlock(long pos) Convert the position given into a block number- Parameters:
- pos-
- Returns:
- long
 
 - 
preloadvoid preload() Start the readahead system
 - 
getLocalPathString getLocalPath() Get the local path for the item- Returns:
- String
 
 - 
setLocalPathvoid setLocalPath(String localPath) Set the local path for the item- Parameters:
- localPath-
 
 - 
isLocalboolean isLocal() Return if the item is local- Returns:
- boolean - local is true, not local is false
 
 - 
setLocalvoid setLocal(boolean isLocal) Set if the item is local- Parameters:
- isLocal-
 
 - 
existsboolean exists() Return if the item exists- Returns:
- boolean - exists is true, does not exist is false
 
 - 
lengthlong length() Get the length of the item- Returns:
- long
 
 - 
setLengthvoid setLength(long length) Set the length of the item- Parameters:
- length-
 
 - 
lastModifiedlong lastModified() Get the last modified time of the item- Returns:
- long
 
 - 
setLastModifiedvoid setLastModified(long lastModified) Set the last modified time of the item- Parameters:
- lastModified-
 
 - 
setLastReleasevoid setLastRelease(long lastRelease) Set the last release time of the item- Parameters:
- lastRelease-
 
 - 
readlong read(com.wowza.wms.mediacache.model.MediaCacheReadContext readContext, long foffset, byte[] buffer, long boffset, long length)Reads data using the read context and returns the byte count read- Parameters:
- readContext-
- foffset-
- buffer-
- boffset-
- length-
- Returns:
- long
 
 - 
readcom.wowza.wms.mediacache.model.MediaCacheReadResult read(com.wowza.wms.mediacache.model.MediaCacheReadContext readContext, long foffset, long length)Reads data using the read context and returns a MediaCacheReadResult object- Parameters:
- readContext-
- foffset-
- length-
- Returns:
- MediaCacheReadResult
 
 
- 
 
-