org.jmythapi.protocol.response
Interface IRecordingsPending

All Superinterfaces:
Cloneable, IPropertyAware<IRecordingsPending.Props>, IRecordings, Iterable<IProgramInfo>, IVersionable
All Known Implementing Classes:
RecordingsPending

public interface IRecordingsPending
extends IRecordings, IVersionable, IPropertyAware<IRecordingsPending.Props>

An interface to get all pending recordings of a MythTV backend.

This object represents the response to a IBackend.queryAllPending() request.
This interface is property-aware. See the properties-list for all properties of this interface.

Use getConflictsCount() to get the amount of recordings with the status CONFLICT.

See Also:
IBackend.queryAllPending(), QUERY_GETALLPENDING

Nested Class Summary
static class IRecordingsPending.Props
          The properties of an IRecordingsPending response.
 
Method Summary
 int getConflictsCount()
          Gets the amount of conflicts between all pending recordings.
 int getMinutesToNextRecording()
          Gets the minutes to the next pending recording.
 Date getNextPendingRecordingDate()
          Gets the date of the next pending recording.
 Map<Integer,IProgramInfo> getNextPendingRecordings()
          This function returns the earliest pending recording for each recorder.
 Map<Integer,Date> getNextPendingRecordingsDates()
          This function returns the earliest recording-start time for each recorder.
 boolean hasConflicts()
          Checks if there are any conflicts between all pending recordings.
 
Methods inherited from interface org.jmythapi.protocol.response.IRecordings
getProgramInfoList, getProgramInfoList, isEmpty, iterator, iterator, size
 
Methods inherited from interface org.jmythapi.IVersionable
getVersionNr
 
Methods inherited from interface org.jmythapi.IPropertyAware
getProperties, getProperty, getPropertyClass, getPropertyCount, getPropertyIndex, getPropertyMap, getPropertyValue, getPropertyValue, getPropertyValueObject, getPropertyValues, setPropertyValue, setPropertyValue, setPropertyValueObject
 

Method Detail

getConflictsCount

int getConflictsCount()
Gets the amount of conflicts between all pending recordings.

Returns:
how many conflicts were detected between the pending recordings

hasConflicts

boolean hasConflicts()
Checks if there are any conflicts between all pending recordings.

Returns:
true if there are any conflicts

getNextPendingRecordings

Map<Integer,IProgramInfo> getNextPendingRecordings()
                                                   throws IOException
This function returns the earliest pending recording for each recorder.

Returns:
a map containing the recorder-id as key and the earliest next recording as value.
Throws:
IOException

getNextPendingRecordingsDates

Map<Integer,Date> getNextPendingRecordingsDates()
                                                throws IOException
This function returns the earliest recording-start time for each recorder.

Usage example:


 
       IBackend backend = ....;     // an already connected backend
       
       // get all pending recordings
       IRecordingsPending pendingRecords = backend.queryAllPending();
       
       // get next recording start times
       Map<Integer,Date> nextRecordingDates = pendingRecords.getNextPendingRecordingDates();
       for(Entry<Integer,Date> nextRecordingDate : nextRecordingDates.entrySet()) {
          System.out.println(String.format(
             "Recorder %02d will start a recording at %2$tF %2$tT.",
             nextRecordingDate.getKey(),
             nextRecordingDate.getValue()
          ));
       }
  

Returns:
a map containing the recorder-id as key and the start-time of the earliest next recording as value. If there is no pending recording an empty map is returned.
Throws:
IOException
See Also:
getNextPendingRecordings()

getNextPendingRecordingDate

Date getNextPendingRecordingDate()
                                 throws IOException
Gets the date of the next pending recording.

Returns:
the date of the next pending recording or null if there is no pending recording.
Throws:
IOException

getMinutesToNextRecording

int getMinutesToNextRecording()
                              throws IOException
Gets the minutes to the next pending recording.

Returns:
the minutes to the next pending recording or -1 if there is no pending recording.
Throws:
IOException


Copyright © 2008-2013. All Rights Reserved.