java.lang.Object
org.jempeg.empeg.protocol.ProtocolClient
- public class ProtocolClient
- extends java.lang.Object
ProtocolClient defines the protocol
communication layer at a higher level
than Request. ProtocolClient exposes
all of the core processes that can be
performed via the Empeg protocol.
- Version:
- $Revision: 1.17 $
|
Method Summary |
void |
checkDatabaseAvailability()
|
void |
checkMedia()
|
void |
checkProtocolVersion()
|
void |
close()
|
protected void |
close0(boolean _wasOpen)
|
void |
deleteDatabases()
|
void |
deleteFID(long _fid)
|
void |
deleteFID(long _fid,
long _idMask)
|
void |
enableWrite(boolean _writeAccess)
|
protected void |
errorAction(java.lang.Throwable _t,
int _retries)
|
protected void |
fireProgressReported(int _activity,
long _current,
long _maximum)
|
void |
fsck(java.lang.String _drive)
|
ConnectionIfc |
getConnection()
|
org.jempeg.empeg.protocol.packet.StatFSResponsePacket |
getDiskInfo()
|
java.lang.String |
getPlayerConfiguration()
|
PlayerIdentity |
getPlayerIdentity()
|
java.lang.String |
getPlayerType()
|
org.jempeg.empeg.protocol.event.ProtocolListenerIfc |
getProtocolListener()
|
int[] |
getProtocolVersion()
|
void |
getProtocolVersion0(Request _request)
|
PlayerVersionInfo |
getVersionInfo()
|
byte[] |
grabScreen()
|
protected void |
internalRestart(long _param,
boolean _waitForCompletion)
|
boolean |
isUnitConnected()
|
void |
lockUI(boolean _lock)
|
void |
open()
|
protected boolean |
open0()
|
void |
playerFID(long _fid)
|
long |
prepareFID(long _fid,
long _size)
|
void |
readFID(long _fid,
java.io.OutputStream _os)
Reads the bytes from the empeg for the given _fid and writes them out to the
given OutputStream. |
byte[] |
readFIDPartial(long _fid,
long _offset,
long _requiredSize)
|
byte[] |
readFIDToMemory(long _fid)
|
void |
rebuildPlayerDatabase(long _options)
|
void |
restartPlayer(boolean _autoSlumber)
|
void |
restartPlayer(boolean _autoSlumber,
boolean _waitForCompletion)
|
void |
restartUnit(boolean _autoSlumber)
|
void |
restartUnit(boolean _autoSlumber,
boolean _waitForCompletion)
|
void |
retrieveDatabases(org.jempeg.empeg.protocol.event.TuneDatabaseListenerIfc _listener)
|
void |
retrieveTagIndex(org.jempeg.empeg.protocol.event.TuneDatabaseListenerIfc _listener)
|
void |
sendCommand(long _command)
|
void |
sendCommand(long _command,
long _parameter0)
|
void |
sendCommand(long _command,
long _parameter0,
long _parameter1)
|
void |
sendCommand(long _command,
long _parameter0,
long _parameter1,
java.lang.String _parameter2)
|
void |
setMaximumRetryCount(int _maximumRetryCount)
|
void |
setPlayerConfiguration(java.lang.String _configStr)
|
void |
setPlayState(long _playState)
|
org.jempeg.empeg.protocol.event.ProtocolListenerIfc |
setProtocolListener(org.jempeg.empeg.protocol.event.ProtocolListenerIfc _listener)
|
void |
setSlumber(boolean _slumber)
|
long |
statFID(long _fid)
|
void |
waitForPlayer(int _retries)
|
void |
waitForUnitConnected()
|
void |
waitForUnitConnected(long _timeout)
|
void |
writeFID(long _fid,
java.io.InputStream _is,
long _size)
|
void |
writeFID(long _fid,
long _initialOffset,
java.io.InputStream _is,
long _size)
Reads all the bytes from the given InputStream and writes them to the given
_fid on the empeg (starting at the _initialOffset on the empeg). |
void |
writeFIDFromMemory(long _fid,
byte[] _bytes)
|
void |
writeFIDPartial(long _fid,
long _initialOffset,
byte[] _bytes)
|
void |
writeFIDPartial(long _fid,
long _initialOffset,
byte[] _bytes,
int _offset,
int _length)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_MAX_RETRIES
public static final int DEFAULT_MAX_RETRIES
- See Also:
- Constant Field Values
PROTOCOL_VERSION_MAJOR
public static final int PROTOCOL_VERSION_MAJOR
- See Also:
- Constant Field Values
PROTOCOL_VERSION_MINOR
public static final int PROTOCOL_VERSION_MINOR
- See Also:
- Constant Field Values
myConn
private ConnectionIfc myConn
myProtocolVersionMajor
private int myProtocolVersionMajor
myProtocolVersionMinor
private int myProtocolVersionMinor
myMaximumRetryCount
private int myMaximumRetryCount
myListener
private org.jempeg.empeg.protocol.event.ProtocolListenerIfc myListener
ProtocolClient
public ProtocolClient(ConnectionIfc _conn)
ProtocolClient
public ProtocolClient(ConnectionIfc _conn,
int _maximumRetryCount)
setProtocolListener
public org.jempeg.empeg.protocol.event.ProtocolListenerIfc setProtocolListener(org.jempeg.empeg.protocol.event.ProtocolListenerIfc _listener)
getProtocolListener
public org.jempeg.empeg.protocol.event.ProtocolListenerIfc getProtocolListener()
getConnection
public ConnectionIfc getConnection()
open
public void open()
throws java.io.IOException
close
public void close()
throws java.io.IOException
fireProgressReported
protected void fireProgressReported(int _activity,
long _current,
long _maximum)
setMaximumRetryCount
public void setMaximumRetryCount(int _maximumRetryCount)
getPlayerConfiguration
public java.lang.String getPlayerConfiguration()
throws java.io.IOException
statFID
public long statFID(long _fid)
throws java.io.IOException
readFIDPartial
public byte[] readFIDPartial(long _fid,
long _offset,
long _requiredSize)
throws java.io.IOException
readFIDToMemory
public byte[] readFIDToMemory(long _fid)
throws java.io.IOException
readFID
public void readFID(long _fid,
java.io.OutputStream _os)
throws java.io.IOException
- Reads the bytes from the empeg for the given _fid and writes them out to the
given OutputStream. Use ByteArrayOutputStream to read into memory.
prepareFID
public long prepareFID(long _fid,
long _size)
throws java.io.IOException
writeFIDPartial
public void writeFIDPartial(long _fid,
long _initialOffset,
byte[] _bytes,
int _offset,
int _length)
throws java.io.IOException
writeFIDPartial
public void writeFIDPartial(long _fid,
long _initialOffset,
byte[] _bytes)
throws java.io.IOException
writeFIDFromMemory
public void writeFIDFromMemory(long _fid,
byte[] _bytes)
throws java.io.IOException
writeFID
public void writeFID(long _fid,
java.io.InputStream _is,
long _size)
throws java.io.IOException
writeFID
public void writeFID(long _fid,
long _initialOffset,
java.io.InputStream _is,
long _size)
throws java.io.IOException
- Reads all the bytes from the given InputStream and writes them to the given
_fid on the empeg (starting at the _initialOffset on the empeg). Use ByteArrayInputStream for in-memory arrays.
checkDatabaseAvailability
public void checkDatabaseAvailability()
throws java.io.IOException
retrieveTagIndex
public void retrieveTagIndex(org.jempeg.empeg.protocol.event.TuneDatabaseListenerIfc _listener)
throws java.io.IOException
deleteDatabases
public void deleteDatabases()
throws java.io.IOException
retrieveDatabases
public void retrieveDatabases(org.jempeg.empeg.protocol.event.TuneDatabaseListenerIfc _listener)
throws java.io.IOException
isUnitConnected
public boolean isUnitConnected()
checkProtocolVersion
public void checkProtocolVersion()
throws java.io.IOException
waitForPlayer
public void waitForPlayer(int _retries)
throws java.io.IOException
waitForUnitConnected
public void waitForUnitConnected()
throws java.io.IOException
waitForUnitConnected
public void waitForUnitConnected(long _timeout)
throws java.io.IOException
enableWrite
public void enableWrite(boolean _writeAccess)
throws java.io.IOException
rebuildPlayerDatabase
public void rebuildPlayerDatabase(long _options)
throws java.io.IOException
deleteFID
public void deleteFID(long _fid)
throws java.io.IOException
deleteFID
public void deleteFID(long _fid,
long _idMask)
throws java.io.IOException
getDiskInfo
public org.jempeg.empeg.protocol.packet.StatFSResponsePacket getDiskInfo()
throws java.io.IOException
fsck
public void fsck(java.lang.String _drive)
throws java.io.IOException
checkMedia
public void checkMedia()
throws java.io.IOException
sendCommand
public void sendCommand(long _command)
throws java.io.IOException
sendCommand
public void sendCommand(long _command,
long _parameter0)
throws java.io.IOException
sendCommand
public void sendCommand(long _command,
long _parameter0,
long _parameter1)
throws java.io.IOException
sendCommand
public void sendCommand(long _command,
long _parameter0,
long _parameter1,
java.lang.String _parameter2)
throws java.io.IOException
restartPlayer
public void restartPlayer(boolean _autoSlumber)
throws java.io.IOException
restartPlayer
public void restartPlayer(boolean _autoSlumber,
boolean _waitForCompletion)
throws java.io.IOException
restartUnit
public void restartUnit(boolean _autoSlumber)
throws java.io.IOException
restartUnit
public void restartUnit(boolean _autoSlumber,
boolean _waitForCompletion)
throws java.io.IOException
internalRestart
protected void internalRestart(long _param,
boolean _waitForCompletion)
throws java.io.IOException
lockUI
public void lockUI(boolean _lock)
throws java.io.IOException
setSlumber
public void setSlumber(boolean _slumber)
throws java.io.IOException
playerFID
public void playerFID(long _fid)
throws java.io.IOException
setPlayState
public void setPlayState(long _playState)
throws java.io.IOException
grabScreen
public byte[] grabScreen()
throws java.io.IOException
open0
protected boolean open0()
throws java.io.IOException
close0
protected void close0(boolean _wasOpen)
throws java.io.IOException
getPlayerType
public java.lang.String getPlayerType()
throws java.io.IOException
getVersionInfo
public PlayerVersionInfo getVersionInfo()
throws java.io.IOException
getProtocolVersion0
public void getProtocolVersion0(Request _request)
throws java.io.IOException
getProtocolVersion
public int[] getProtocolVersion()
throws java.io.IOException
setPlayerConfiguration
public void setPlayerConfiguration(java.lang.String _configStr)
throws java.io.IOException
getPlayerIdentity
public PlayerIdentity getPlayerIdentity()
throws java.io.IOException
errorAction
protected void errorAction(java.lang.Throwable _t,
int _retries)
throws java.io.IOException