org.jmythapi.protocol.request
Class AMythRequest

java.lang.Object
  extended by org.jmythapi.protocol.request.AMythRequest
All Implemented Interfaces:
IVersionable, ISendable, IMythRequest

public class AMythRequest
extends Object
implements IMythRequest

The implementation of a MythTV-protocol request.


Constructor Summary
AMythRequest(IMythCommand command)
           
AMythRequest(IMythCommand command, List<String> requestArgs)
           
AMythRequest(IMythCommand command, String... requestArgs)
           
 
Method Summary
 IMythCommand getCommand()
          Gets the request-command.
 IMythPacket getPacket()
          Converts the object into a packet that can be send over network.
 List<String> getRequestArguments()
          Gets additional request-arguments.
 ProtocolVersion getVersionNr()
          Gets the protocol-version of an object.
static IMythRequest readFrom(IMythPacket packet)
           
static IMythRequest readFrom(ProtocolVersion protoVersion, InputStream input)
           
static IMythRequest readFrom(ProtocolVersion protoVersion, String input)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AMythRequest

public AMythRequest(IMythCommand command)

AMythRequest

public AMythRequest(IMythCommand command,
                    String... requestArgs)

AMythRequest

public AMythRequest(IMythCommand command,
                    List<String> requestArgs)
Method Detail

getCommand

public IMythCommand getCommand()
Description copied from interface: IMythRequest
Gets the request-command.

A command itself consists of a mandatory name and optional command arguments, e.g.GET_FREE_RECORDER_COUNT or ANN Playback MythTvPlayer 0.

Specified by:
getCommand in interface IMythRequest
Returns:
the command of the request object

getRequestArguments

public List<String> getRequestArguments()
Description copied from interface: IMythRequest
Gets additional request-arguments.

Specified by:
getRequestArguments in interface IMythRequest
Returns:
additional request arguments.

readFrom

public static final IMythRequest readFrom(ProtocolVersion protoVersion,
                                          String input)

readFrom

public static final IMythRequest readFrom(ProtocolVersion protoVersion,
                                          InputStream input)
                                   throws IOException
Throws:
IOException

readFrom

public static final IMythRequest readFrom(IMythPacket packet)
                                   throws IllegalArgumentException
Throws:
IllegalArgumentException

getPacket

public IMythPacket getPacket()
Description copied from interface: ISendable
Converts the object into a packet that can be send over network.

Specified by:
getPacket in interface ISendable
Returns:
a packet object that can be send over network

toString

public String toString()
Overrides:
toString in class Object

getVersionNr

public ProtocolVersion getVersionNr()
Description copied from interface: IVersionable
Gets the protocol-version of an object.

Specified by:
getVersionNr in interface IVersionable
Returns:
the version a given object was created for.


Copyright © 2008-2013. All Rights Reserved.