All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.yamcs.protobuf.activities.ActivitiesApiClient Maven / Gradle / Ivy

There is a newer version: 5.10.9
Show newest version
package org.yamcs.protobuf.activities;

import org.yamcs.api.MethodHandler;
import org.yamcs.api.Observer;

@javax.annotation.processing.Generated(value = "org.yamcs.maven.ServiceGenerator", date = "2025-02-13T11:12:59.913378809Z")
public class ActivitiesApiClient extends AbstractActivitiesApi {

    private final MethodHandler handler;

    public ActivitiesApiClient(MethodHandler handler) {
        this.handler = handler;
    }

    /**
     * 
     *  List activities
     * 
*/ @Override public final void listActivities(Void ctx, ListActivitiesRequest request, Observer observer) { handler.call( getDescriptorForType().getMethods().get(0), request, ListActivitiesResponse.getDefaultInstance(), observer); } /** *
     *  Get an activity
     * 
*/ @Override public final void getActivity(Void ctx, GetActivityRequest request, Observer observer) { handler.call( getDescriptorForType().getMethods().get(1), request, ActivityInfo.getDefaultInstance(), observer); } /** *
     *  Get the activity log
     * 
*/ @Override public final void getActivityLog(Void ctx, GetActivityLogRequest request, Observer observer) { handler.call( getDescriptorForType().getMethods().get(2), request, GetActivityLogResponse.getDefaultInstance(), observer); } /** *
     *  Start an activity
     * 
     *  The request body allows for the execution of arbitrary activities.
     *  The following activity types are included in the core Yamcs module:
     * 
     *  .. rubric:: Command
     * 
     *  Execute a single command
     * 
     *  ``type`` (string)
     *      Set to ``COMMAND``.
     * 
     *  ``args`` (map)
     *      Map accepting the following options:
     * 
     *      ``command``
     *          **Required.** Qualified name of a command
     * 
     *      ``args`` (map)
     *          Named arguments, if the command requires any
     * 
     *      ``extra`` (map)
     *          Extra command options
     * 
     *      ``processor`` (string)
     *          Optional processor name. If not provided, Yamcs defaults
     *          to any processor it can find with commanding enabled.
     * 
     *  Example:
     * 
     *  .. code-block:: json
     * 
     *      {
     *          "type": "COMMAND",
     *          "args": {
     *              "command": "/YSS/SIMULATOR/SWITCH_VOLTAGE_ON",
     *              "args": {
     *                  "voltage_num": 3
     *              },
     *              "processor": "realtime"
     *          }
     *      }
     * 
     *  .. rubric:: Command Stack
     * 
     *  Execute a command stack
     * 
     *  ``type`` (string)
     *      Set to ``COMMAND_STACK``.
     * 
     *  ``args`` (map)
     *      Map accepting the following options:
     * 
     *      ``bucket``
     *          **Required.** The name of the bucket containg the stack
     * 
     *      ``stack``
     *          **Required.** The name of the stack object inside the bucket
     * 
     *      ``processor`` (string)
     *          Optional processor name. If not provided, Yamcs defaults
     *          to any processor it can find with commanding enabled.
     * 
     *  Example:
     * 
     *  .. code-block:: json
     * 
     *      {
     *          "type": "COMMAND_STACK",
     *          "args": {
     *              "bucket": "mybucket",
     *              "stack": "mystack.ycs",
     *              "processor": "realtime"
     *          }
     *      }
     * 
     *  .. rubric:: Script
     * 
     *  Run a script
     * 
     *  ``type`` (string)
     *      Set to ``SCRIPT``.
     *  ``args`` (map)
     *      Map accepting the following options:
     * 
     *      ``script``
     *          **Required.** Script identifier.
     * 
     *          This should be the relative path to an executable file in one of the
     *          search locations. When unconfigured, the default search location is
     *          :file:`etc/scripts/` relative to the Yamcs working directory.
     * 
     *      ``args`` (string or string[])
     *          Script arguments
     * 
     *      ``processor`` (string)
     *          If provided, this information is passed to the script in an environment
     *          variable ``YAMCS_PROCESSOR``.
     * 
     *  Example:
     * 
     *  .. code-block:: json
     * 
     *      {
     *          "type": "SCRIPT",
     *          "args": {
     *              "script": "simulate_los.py",
     *              "args": "--duration 60",
     *              "processor": "realtime"
     *          }
     *      }
     * 
*/ @Override public final void startActivity(Void ctx, StartActivityRequest request, Observer observer) { handler.call( getDescriptorForType().getMethods().get(3), request, ActivityInfo.getDefaultInstance(), observer); } /** *
     *  Cancel an ongoing activity
     * 
*/ @Override public final void cancelActivity(Void ctx, CancelActivityRequest request, Observer observer) { handler.call( getDescriptorForType().getMethods().get(4), request, ActivityInfo.getDefaultInstance(), observer); } /** *
     *  Mark an ongoing activity as completed.
     * 
     *  This method may only be used with manual activities.
     * 
*/ @Override public final void completeManualActivity(Void ctx, CompleteManualActivityRequest request, Observer observer) { handler.call( getDescriptorForType().getMethods().get(5), request, ActivityInfo.getDefaultInstance(), observer); } /** *
     *  Receive activity status updates
     * 
*/ @Override public final void subscribeGlobalStatus(Void ctx, SubscribeGlobalStatusRequest request, Observer observer) { handler.call( getDescriptorForType().getMethods().get(6), request, GlobalActivityStatus.getDefaultInstance(), observer); } /** *
     *  Receive activity updates
     * 
*/ @Override public final void subscribeActivities(Void ctx, SubscribeActivitiesRequest request, Observer observer) { handler.call( getDescriptorForType().getMethods().get(7), request, ActivityInfo.getDefaultInstance(), observer); } /** *
     *  Receive activity log updates
     * 
*/ @Override public final void subscribeActivityLog(Void ctx, SubscribeActivityLogRequest request, Observer observer) { handler.call( getDescriptorForType().getMethods().get(8), request, ActivityLogInfo.getDefaultInstance(), observer); } /** *
     *  List available executors
     * 
*/ @Override public final void listExecutors(Void ctx, ListExecutorsRequest request, Observer observer) { handler.call( getDescriptorForType().getMethods().get(9), request, ListExecutorsResponse.getDefaultInstance(), observer); } /** *
     *  List scripts available for activities of type SCRIPT
     * 
*/ @Override public final void listScripts(Void ctx, ListScriptsRequest request, Observer observer) { handler.call( getDescriptorForType().getMethods().get(10), request, ListScriptsResponse.getDefaultInstance(), observer); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy