YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.share.RendererStateMap Class Reference

The per-renderer state of the server-side time range management of ONE share. More...

Collaboration diagram for de.yaacc.share.RendererStateMap:
Collaboration graph

Classes

class  State
 What is known about one renderer.
 

Public Member Functions

 RendererStateMap (int max)
 
synchronized State get (String deviceId)
 
synchronized State create (String deviceId, long initialTimeMs)
 
synchronized boolean update (String deviceId, long timeMs, boolean paused)
 Sets the playback time and pause flag of an EXISTING state.
 
synchronized int size ()
 
synchronized void clear ()
 

Static Public Attributes

static final int DEFAULT_MAX = 8
 Renderers per share.
 

Detailed Description

The per-renderer state of the server-side time range management of ONE share.

Bounded: at most max renderers; when a new one arrives the least recently used is dropped. A state is created only for a valid device id (RendererIdPolicy) and only by create; get and update never create one, so lookups with unknown ids cannot grow the map. The map lives inside the share's target, so it disappears with the share. Thread safe.

Constructor & Destructor Documentation

◆ RendererStateMap()

de.yaacc.share.RendererStateMap.RendererStateMap ( int max)
Exceptions
IllegalArgumentExceptionif max is not positive

Member Function Documentation

◆ create()

synchronized State de.yaacc.share.RendererStateMap.create ( String deviceId,
long initialTimeMs )
Returns
the existing state, or a new one starting at initialTimeMs (dropping the least recently used if the map is full); null for an invalid id

Referenced by de.yaacc.share.ServerSideSeeking.plan().

Here is the caller graph for this function:

◆ get()

synchronized State de.yaacc.share.RendererStateMap.get ( String deviceId)
Returns
the state, or null if there is none or the id is invalid; never creates one

Referenced by de.yaacc.share.ServerSideSeeking.plan().

Here is the caller graph for this function:

◆ update()

synchronized boolean de.yaacc.share.RendererStateMap.update ( String deviceId,
long timeMs,
boolean paused )

Sets the playback time and pause flag of an EXISTING state.

Returns
false if there is no state for the id (nothing is created)

Member Data Documentation

◆ DEFAULT_MAX

final int de.yaacc.share.RendererStateMap.DEFAULT_MAX = 8
static

Renderers per share.

With at most ShareRegistry#DEFAULT_MAX_ACTIVE shares the whole process holds at most 64 states.


The documentation for this class was generated from the following file: