org.jmythapi.protocol.events
Interface IRecordingUpdateEvent<E extends Enum<E>>

Type Parameters:
E - the properties of the event.
All Superinterfaces:
Cloneable, IMythEvent<E>, IPropertyAware<E>, IRecordingEvent<E>, ISendable, IVersionable
All Known Subinterfaces:
IRecordingListChangeUpdate, IUpdateProgInfo
All Known Implementing Classes:
RecordingListChangeUpdate, UpdateProgInfo

public interface IRecordingUpdateEvent<E extends Enum<E>>
extends IRecordingEvent<E>

Backend Event - Recording - Properties Updated.

See Also:
IRecordingListChangeUpdate, IUpdateProgInfo

Method Summary
 Integer getChannelID()
          Gets the channel ID of the recording.
 IProgramInfo getProgramInfo()
          Gets the info object of the changed recording.
 Date getRecordingStartTime()
          Gets the recording start time.
 String getUniqueRecordingID()
          Gets the unique ID of the changed recording.
 EnumMap<IProgramInfo.Props,Object[]> getUpdatedProperties(IProgramInfo oldProgramInfo)
          Compares a previous version of the recording with the changed version.
 
Methods inherited from interface org.jmythapi.protocol.events.IMythEvent
getEventName
 
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
 
Methods inherited from interface org.jmythapi.protocol.ISendable
getPacket
 

Method Detail

getChannelID

Integer getChannelID()
Gets the channel ID of the recording.

Specified by:
getChannelID in interface IRecordingEvent<E extends Enum<E>>
Returns:
the channel ID.

getRecordingStartTime

Date getRecordingStartTime()
Gets the recording start time.

Specified by:
getRecordingStartTime in interface IRecordingEvent<E extends Enum<E>>
Returns:
the recording start time.

getUniqueRecordingID

String getUniqueRecordingID()
Gets the unique ID of the changed recording.

Specified by:
getUniqueRecordingID in interface IRecordingEvent<E extends Enum<E>>
Returns:
the unique recording ID.
See Also:
EncodingUtils.generateId(Integer, Date)

getProgramInfo

IProgramInfo getProgramInfo()
Gets the info object of the changed recording.

Returns:
the changed recording

getUpdatedProperties

EnumMap<IProgramInfo.Props,Object[]> getUpdatedProperties(IProgramInfo oldProgramInfo)
Compares a previous version of the recording with the changed version.

This function compares each property of the recordings and returns a map containing all changed properties

Usage Example:


    EnumMap<IProgramInfo.Props,Object[]> diffMap = ((IRecordingListChangeUpdate)event).getUpdatedProperties(oldRecording);
    
    // pring changes
    System.out.println(String.format(
       "%d properties of recording changed:",
       Integer.valueOf(diffMap.size()), recording.getBaseName()
    ));							
    for(Entry<IProgramInfo.Props,Object[]> entry : diffMap.entrySet()) {
       IProgramInfo.Props property = entry.getKey();
       Object[] values = entry.getValue();
       System.out.println(String.format(
          "\r\n   %s: %s -> %s",
          property, values[0],values[1]
       ));
    }						 	
 

Parameters:
oldProgramInfo - a previous version of the recording
Returns:
a map containing all found differences
See Also:
PropertyAwareUtils.compare(IPropertyAware, IPropertyAware)


Copyright © 2008-2013. All Rights Reserved.