org.jmythapi.protocol.events.impl
Class AMythEvent<E extends Enum<E>>

java.lang.Object
  extended by org.jmythapi.impl.AData<E>
      extended by org.jmythapi.protocol.response.impl.AMythResponse<E>
          extended by org.jmythapi.protocol.events.impl.AMythEvent<E>
All Implemented Interfaces:
Cloneable, IPropertyAware<E>, IVersionable, IMythEvent<E>, ISendable, IMythResponse<E>
Direct Known Subclasses:
AskRecording, ClearSettingsCache, ClientErrorEvent, CommflagStart, DoneRecording, DownloadFileFinished, DownloadFileUpdate, LiveTvChainUpdate, PixmapGenerated, RecordingListChangeAdd, RecordingListChangeAny, RecordingListChangeDelete, RecordingListChangeUpdate, ResetIdleTime, ScheduleChange, ShutdownCountdown, SystemEvent, UpdateFileSize, UpdateProgInfo, VideoList

public abstract class AMythEvent<E extends Enum<E>>
extends AMythResponse<E>
implements IMythEvent<E>


Field Summary
 
Fields inherited from class org.jmythapi.impl.AData
logger, propsClass, protoVersion, respArgs
 
Constructor Summary
AMythEvent(Class<E> propsClass, IMythPacket packet)
           
AMythEvent(ProtocolVersion protoVersion, Class<E> propsClass, String eventName, List<String> eventArguments)
           
 
Method Summary
protected
<T> T
decodeProperty(Class<T> dataType, String dataValue)
           
protected
<S,T> String
encodeProperty(Class<S> propObjectType, S propValue, Class<T> propStringType, String propDefaultValue)
           
static List<String> extractArgumentsList(IMythPacket packet)
           
 String extractEventName(IMythPacket packet)
           
 String getEventName()
          Gets the name of the backend event.
 IMythPacket getPacket()
          Converts this response-object into a IMythPacket.
 String toString()
          Returns the content of this data object as a formatted string.
 
Methods inherited from class org.jmythapi.protocol.response.impl.AMythResponse
checkSize, getExpectedSize, getProperties, getProperty, getPropertyIndex
 
Methods inherited from class org.jmythapi.impl.AData
clone, equals, getPropertyClass, getPropertyCount, getPropertyMap, getPropertyValue, getPropertyValue, getPropertyValueObject, getPropertyValueObject, getPropertyValues, getVersionNr, hashCode, init, postProcessArguments, setPropertyValue, setPropertyValue, setPropertyValueObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jmythapi.IPropertyAware
getProperties, getProperty, getPropertyClass, getPropertyCount, getPropertyIndex, getPropertyMap, getPropertyValue, getPropertyValue, getPropertyValueObject, getPropertyValues, setPropertyValue, setPropertyValue, setPropertyValueObject
 
Methods inherited from interface org.jmythapi.IVersionable
getVersionNr
 

Constructor Detail

AMythEvent

public AMythEvent(Class<E> propsClass,
                  IMythPacket packet)

AMythEvent

public AMythEvent(ProtocolVersion protoVersion,
                  Class<E> propsClass,
                  String eventName,
                  List<String> eventArguments)
Method Detail

extractArgumentsList

public static List<String> extractArgumentsList(IMythPacket packet)

extractEventName

public String extractEventName(IMythPacket packet)

getEventName

public String getEventName()
Description copied from interface: IMythEvent
Gets the name of the backend event.

Specified by:
getEventName in interface IMythEvent<E extends Enum<E>>
Returns:
the event name

decodeProperty

protected <T> T decodeProperty(Class<T> dataType,
                               String dataValue)
Overrides:
decodeProperty in class AMythResponse<E extends Enum<E>>

encodeProperty

protected <S,T> String encodeProperty(Class<S> propObjectType,
                                      S propValue,
                                      Class<T> propStringType,
                                      String propDefaultValue)
Overrides:
encodeProperty in class AMythResponse<E extends Enum<E>>

getPacket

public IMythPacket getPacket()
Description copied from class: AMythResponse

Converts this response-object into a IMythPacket.

Specified by:
getPacket in interface ISendable
Overrides:
getPacket in class AMythResponse<E extends Enum<E>>
Returns:
a packet object that can be send over network

toString

public String toString()
Description copied from class: AData

Returns the content of this data object as a formatted string.

E.g.
 <0>TOTAL_RAM_MB: 1002 | <1>FREE_RAM_MB: 474 | <2>TOTAL_VM_MB: 853 | <3>FREE_VM_MB: 853
 

Overrides:
toString in class AData<E extends Enum<E>>


Copyright © 2008-2013. All Rights Reserved.