| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
|
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | 1 | package org.vostokframework.application.cache |
| 30 | |
{ |
| 31 | |
import org.as3utils.StringUtil; |
| 32 | |
import org.vostokframework.VostokIdentification; |
| 33 | |
import org.vostokframework.domain.assets.AssetType; |
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
public class CachedAssetData |
| 41 | |
{ |
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | |
private var _bytesTotal:int; |
| 46 | |
private var _data:*; |
| 47 | |
private var _identification:VostokIdentification; |
| 48 | |
private var _latency:int; |
| 49 | |
private var _queueIdentification:VostokIdentification; |
| 50 | |
private var _src:String; |
| 51 | |
private var _totalTime:int; |
| 52 | |
private var _type:AssetType; |
| 53 | |
|
| 54 | |
public function get bytesTotal():int { return _bytesTotal; } |
| 55 | |
|
| 56 | |
public function set bytesTotal(value:int):void |
| 57 | |
{ |
| 58 | 0 | if (value < 1) throw new ArgumentError("Value must be greater than zero. Received: <" + value + ">"); |
| 59 | 0 | _bytesTotal = value; |
| 60 | 0 | } |
| 61 | |
|
| 62 | |
public function get data():* { return _data; } |
| 63 | |
|
| 64 | |
public function get identification():VostokIdentification { return _identification; } |
| 65 | |
|
| 66 | |
public function get latency():int { return _latency; } |
| 67 | |
|
| 68 | |
public function set latency(value:int):void |
| 69 | |
{ |
| 70 | 0 | if (value < 1) throw new ArgumentError("Value must be greater than zero. Received: <" + value + ">"); |
| 71 | 0 | _latency = value; |
| 72 | 0 | } |
| 73 | |
|
| 74 | |
public function get queueIdentification():VostokIdentification { return _queueIdentification; } |
| 75 | |
|
| 76 | |
public function get src():String { return _src; } |
| 77 | |
|
| 78 | |
public function get totalTime():int { return _totalTime; } |
| 79 | |
|
| 80 | |
public function set totalTime(value:int):void |
| 81 | |
{ |
| 82 | 0 | if (value < 1) throw new ArgumentError("Value must be greater than zero. Received: <" + value + ">"); |
| 83 | 0 | _totalTime = value; |
| 84 | 0 | } |
| 85 | |
|
| 86 | |
public function get type():AssetType { return _type; } |
| 87 | |
|
| 88 | |
|
| 89 | |
|
| 90 | |
|
| 91 | |
|
| 92 | |
|
| 93 | |
|
| 94 | |
public function CachedAssetData(identification:VostokIdentification, queueIdentification:VostokIdentification, data:*, type:AssetType, src:String) |
| 95 | 1 | { |
| 96 | 1 | if (!identification) throw new ArgumentError("Argument <identification> must not be null."); |
| 97 | 1 | if (!queueIdentification) throw new ArgumentError("Argument <queueIdentification> must not be null."); |
| 98 | 1 | if (!data) throw new ArgumentError("Argument <data> must not be null."); |
| 99 | 1 | if (!type) throw new ArgumentError("Argument <type> must not be null."); |
| 100 | 1 | if (StringUtil.isBlank(src)) throw new ArgumentError("Argument <src> must not be null nor an empty String."); |
| 101 | |
|
| 102 | 1 | _identification = identification; |
| 103 | 1 | _queueIdentification = queueIdentification; |
| 104 | 1 | _data = data; |
| 105 | 1 | _type = type; |
| 106 | 1 | _src = src; |
| 107 | 1 | } |
| 108 | |
|
| 109 | |
} |
| 110 | |
|
| 111 | |
} |