Skip to content

Commit 789ecb9

Browse files
committed
Simplified the API somewhat
1 parent a65c841 commit 789ecb9

File tree

3 files changed

+314
-160
lines changed

3 files changed

+314
-160
lines changed

src/main/java/org/digitalmediaserver/cast/CastDevice.java

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -735,25 +735,20 @@ public ReceiverStatus launchApplication(String applicationId, boolean synchronou
735735
* specified application ID.
736736
*
737737
* @param applicationId the application ID for the application to launch.
738-
* @param synchronous {@code true} to make this call block until a response
739-
* is received or times out, {@code false} to make it return
740-
* immediately always returning {@code null}.
741-
* @param responseTimeout the response timeout in milliseconds if
742-
* {@code synchronous} is {@code true}. If zero or negative,
743-
* {@link Channel#DEFAULT_RESPONSE_TIMEOUT} will be used.
744-
* @return The resulting {@link ReceiverStatus} or {@code null} if
745-
* {@code synchronous} is {@code false}.
738+
* @param responseTimeout the response timeout in milliseconds. If zero or
739+
* negative, {@link Channel#DEFAULT_RESPONSE_TIMEOUT} will be
740+
* used.
741+
* @return The resulting {@link ReceiverStatus}.
746742
* @throws SocketException If the {@link Channel} is closed and
747743
* {@code autoReconnect} is {@code false}.
748744
* @throws IOException If the response times out or an error occurs during
749745
* the operation.
750746
*
751-
* @apiNote This operation is blocking if {@code synchronous} is
752-
* {@code true}, otherwise non-blocking.
747+
* @apiNote This operation is blocking.
753748
*/
754-
@Nullable
755-
public ReceiverStatus launch(String applicationId, boolean synchronous, long responseTimeout) throws IOException {
756-
return channel().launch(applicationId, synchronous, responseTimeout);
749+
@Nonnull
750+
public ReceiverStatus launch(String applicationId, long responseTimeout) throws IOException {
751+
return channel().launch(applicationId, responseTimeout);
757752
}
758753

759754
/**
@@ -785,29 +780,20 @@ public ReceiverStatus stopApplication(@Nullable Application application, boolean
785780
* Asks the cast device to stop the specified {@link Application}.
786781
*
787782
* @param application the {@link Application} to stop.
788-
* @param synchronous {@code true} to make this call block until a response
789-
* is received or times out, {@code false} to make it return
790-
* immediately always returning {@code null}.
791-
* @param responseTimeout the response timeout in milliseconds if
792-
* {@code synchronous} is {@code true}. If zero or negative,
793-
* {@link Channel#DEFAULT_RESPONSE_TIMEOUT} will be used.
794-
* @return The resulting {@link ReceiverStatus} or {@code null} if
795-
* {@code synchronous} is {@code false}.
783+
* @param responseTimeout the response timeout in milliseconds. If zero or
784+
* negative, {@link Channel#DEFAULT_RESPONSE_TIMEOUT} will be
785+
* used.
786+
* @return The resulting {@link ReceiverStatus}.
796787
* @throws SocketException If the {@link Channel} is closed and
797788
* {@code autoReconnect} is {@code false}.
798789
* @throws IOException If the response times out or an error occurs during
799790
* the operation.
800791
*
801-
* @apiNote This operation is blocking if {@code synchronous} is
802-
* {@code true}, otherwise non-blocking.
792+
* @apiNote This operation is blocking.
803793
*/
804-
@Nullable
805-
public ReceiverStatus stopApplication(
806-
@Nonnull Application application,
807-
boolean synchronous,
808-
long responseTimeout
809-
) throws IOException {
810-
return channel().stopApplication(application, synchronous, responseTimeout);
794+
@Nonnull
795+
public ReceiverStatus stopApplication(@Nonnull Application application, long responseTimeout) throws IOException {
796+
return channel().stopApplication(application, responseTimeout);
811797
}
812798

813799
/**

0 commit comments

Comments
 (0)