2929import java .security .KeyManagementException ;
3030import java .security .NoSuchAlgorithmException ;
3131import java .security .SecureRandom ;
32+ import java .util .Collections ;
3233import java .util .HashMap ;
3334import java .util .HashSet ;
3435import java .util .Iterator ;
@@ -961,38 +962,38 @@ public boolean isSessionClosed(@Nullable Session session) {
961962 }
962963
963964 /**
964- * Request a {@link MediaStatus} from the application with the specified
965- * {@link Session}, using {@value #DEFAULT_RESPONSE_TIMEOUT} as the timeout
966- * value.
965+ * Request a list of {@link MediaStatus}es from the application with the
966+ * specified {@link Session}, using {@value #DEFAULT_RESPONSE_TIMEOUT} as
967+ * the timeout value.
967968 *
968969 * @param session the {@link Session} to use.
969- * @return The resulting {@link MediaStatus}.
970+ * @return The resulting {@link List} of {@link MediaStatus}.
970971 * @throws IOException If the response times out or an error occurs during
971972 * the operation.
972973 *
973974 * @apiNote This operation is blocking.
974975 */
975- @ Nullable
976- public MediaStatus getMediaStatus (@ Nonnull Session session ) throws IOException {
976+ @ Nonnull
977+ public List < MediaStatus > getMediaStatus (@ Nonnull Session session ) throws IOException {
977978 return getMediaStatus (session , DEFAULT_RESPONSE_TIMEOUT );
978979 }
979980
980981 /**
981- * Request a {@link MediaStatus} from the application with the specified
982- * {@link Session}.
982+ * Request a list of {@link MediaStatus}es from the application with the
983+ * specified {@link Session}.
983984 *
984985 * @param session the {@link Session} to use.
985986 * @param responseTimeout the response timeout in milliseconds. If zero or
986987 * negative, {@value #DEFAULT_RESPONSE_TIMEOUT} will be used.
987- * @return The resulting {@link MediaStatus}.
988+ * @return The resulting {@link List} of {@link MediaStatus}.
988989 * @throws IllegalArgumentException If {@code session} is {@code null}.
989990 * @throws IOException If the response times out or an error occurs during
990991 * the operation.
991992 *
992993 * @apiNote This operation is blocking.
993994 */
994- @ Nullable
995- public MediaStatus getMediaStatus (@ Nonnull Session session , long responseTimeout ) throws IOException {
995+ @ Nonnull
996+ public List < MediaStatus > getMediaStatus (@ Nonnull Session session , long responseTimeout ) throws IOException {
996997 requireNotNull (session , "session" );
997998 MediaStatusResponse status = send (
998999 session ,
@@ -1003,7 +1004,10 @@ public MediaStatus getMediaStatus(@Nonnull Session session, long responseTimeout
10031004 MediaStatusResponse .class ,
10041005 responseTimeout
10051006 );
1006- return status == null || status .getStatuses ().isEmpty () ? null : status .getStatuses ().get (0 );
1007+ if (status == null ) {
1008+ return Collections .emptyList ();
1009+ }
1010+ return status .getStatuses ();
10071011 }
10081012
10091013 /**
0 commit comments