Constructor
new CatalogStore(catalogNamespace)
Parameters:
| Name | Type | Description |
|---|---|---|
catalogNamespace |
string | The catalog track's namespace, with its fields joined by "/". A track that declares no namespace inherits it, which is what makes a track named with and without its namespace the same track. |
- Source:
Members
MAX_PENDING_ :number
How many catalog Objects may be held waiting for the ones before them.
They only wait for a gap to fill, which takes one round trip; a store that
keeps growing is waiting for an Object that is never coming.
Type:
- number
- Source:
group_ :bigint
The Group the current catalog comes from, or null before the first
independent catalog.
Type:
- bigint
- Source:
nextObject_ :bigint
The Object ID of the next delta to apply in the current Group.
Type:
- bigint
- Source:
pending_ :Map<string, shaka.msf.CatalogStore.Entry_>
Documents that cannot be applied yet, keyed by their Location.
Type:
- Map<string, shaka.msf.CatalogStore.Entry_>
- Source:
Methods
checkVersion_(catalognon-null)
Refuses a catalog of a version this parser does not understand, which MSF
forbids reading at all.
The "draft-XX" convention MSF asks for while it is an Internet-Draft is
understood, as is 1, the version the finished format will carry. A
catalog with no version at all is read, with a warning: the field is
required, but refusing it would say nothing more useful.
Parameters:
| Name | Type | Description |
|---|---|---|
catalog |
msfCatalog.Catalog |
- Source:
contentOf_(catalognon-null) → {string}
What a catalog says, minus when it was generated: a publisher republishes
an unchanged catalog in a new Group so that it does not fall out of the
caches of a delivery network, and that is not a change.
Parameters:
| Name | Type | Description |
|---|---|---|
catalog |
msfCatalog.Catalog |
- Source:
Returns:
- Type
- string
key_(group, object) → {string}
Parameters:
| Name | Type | Description |
|---|---|---|
group |
bigint | |
object |
bigint |
- Source:
Returns:
- Type
- string
override_(basenon-null, fieldsnon-null) → {msfCatalog.Track}
A copy of a track with the fields of another laid over it, minus the
fields that only address the parent.
Parameters:
| Name | Type | Description |
|---|---|---|
base |
msfCatalog.Track | |
fields |
msfCatalog.Track |
- Source:
Returns:
- Type
- msfCatalog.Track
apply_(entry) → {boolean}
Parameters:
| Name | Type | Description |
|---|---|---|
entry |
shaka.msf.CatalogStore.Entry_ |
- Source:
Returns:
Whether the catalog changed.
- Type
- boolean
applyDelta_(catalognon-null, deltanon-null) → {msfCatalog.Catalog}
Applies a delta update to a catalog, returning the result. The catalog
passed in is left alone.
Parameters:
| Name | Type | Description |
|---|---|---|
catalog |
msfCatalog.Catalog | |
delta |
msfCatalog.Catalog |
- Source:
Returns:
- Type
- msfCatalog.Catalog
applyOperation_(catalognon-null, op, tracknon-null)
Parameters:
| Name | Type | Description |
|---|---|---|
catalog |
msfCatalog.Catalog | |
op |
string | |
track |
msfCatalog.Track |
- Source:
drain_() → {boolean}
Applies every held document that has become applicable.
- Source:
Returns:
Whether the catalog changed.
- Type
- boolean
findParent_(catalognon-null, tracknon-null) → {msfCatalog.Track}
The track a "clone" or "update" names as its parent.
MSF names it with parentName, but its own "update" example names it with
name instead, so that is accepted when parentName is missing.
Parameters:
| Name | Type | Description |
|---|---|---|
catalog |
msfCatalog.Catalog | |
track |
msfCatalog.Track |
- Source:
Returns:
- Type
- msfCatalog.Track
getCatalog() → {msfCatalog.Catalog}
The catalog as of the last Object applied, or null before an independent
catalog has arrived.
- Source:
Returns:
- Type
- msfCatalog.Catalog
indexOf_(catalognon-null, namespace, name) → {number}
Parameters:
| Name | Type | Description |
|---|---|---|
catalog |
msfCatalog.Catalog | |
namespace |
string | undefined | |
name |
string |
- Source:
Returns:
- Type
- number
push(location, documentnon-null) → {boolean}
Adds the document carried by a catalog Object.
Parameters:
| Name | Type | Description |
|---|---|---|
location |
{group: bigint, object: bigint} | |
document |
msfCatalog.Catalog |
- Source:
Returns:
Whether the catalog changed.
- Type
- boolean
takeNext_() → {shaka.msf.CatalogStore.Entry_}
Removes and returns the held document that comes next, which is either
the next delta of the current Group or the independent catalog of the
newest Group that has one, whichever is newer.
- Source:
Returns:
update_(entry)
Makes the catalog what an Object says it is.
Parameters:
| Name | Type | Description |
|---|---|---|
entry |
shaka.msf.CatalogStore.Entry_ |
- Source: