Package de.sfuhrm.radiorecorder
Class ConsumerContext
- java.lang.Object
-
- de.sfuhrm.radiorecorder.ConsumerContext
-
public class ConsumerContext extends Object
Immutable context common to all consumers. Holds the data necessary to record or play one stream from one radio station.- Author:
- Stephan Fuhrmann
-
-
Constructor Summary
Constructors Constructor Description ConsumerContext(int id, URL url, File directory, Params params)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Long>getAbortAfter()Get the amount of bytes after which to abort.StringgetCastReceiver()The cast device to cast to.HttpConnectionBuilderFactory.HttpClientTypegetHttpClient()The client type to use.longgetMinFree()Get minimum free bytes.Mixer.InfogetMixerInfo()The mixer to play on.URLgetProxy()The HTTP proxy to use or NULL.intgetTimeout()Get the read/connect timeout in millis.booleanisPlaying()Whether to play or store.booleanisReconnect()Reconnect forever.booleanisSongNames()Whether to name the files after the metadata retrieved.
-
-
-
Method Detail
-
getTimeout
public int getTimeout()
Get the read/connect timeout in millis.- Returns:
- the timeout in milliseconds.
-
getMinFree
public long getMinFree()
Get minimum free bytes.- Returns:
- minimum number of free bytes on disk.
-
getAbortAfter
public Optional<Long> getAbortAfter()
Get the amount of bytes after which to abort.- Returns:
- optional maximum of bytes after which to abort writing to write to disk.
-
isPlaying
public boolean isPlaying()
Whether to play or store.
-
isSongNames
public boolean isSongNames()
Whether to name the files after the metadata retrieved.
-
isReconnect
public boolean isReconnect()
Reconnect forever.
-
getCastReceiver
public String getCastReceiver()
The cast device to cast to.
-
getMixerInfo
public Mixer.Info getMixerInfo()
The mixer to play on.
-
getHttpClient
public HttpConnectionBuilderFactory.HttpClientType getHttpClient()
The client type to use.
-
getProxy
public URL getProxy()
The HTTP proxy to use or NULL.
-
-