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

org.yamcs.protobuf.AbstractMdbApi Maven / Gradle / Ivy

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

import com.google.protobuf.Descriptors.MethodDescriptor;
import com.google.protobuf.Descriptors.ServiceDescriptor;
import com.google.protobuf.Message;
import org.yamcs.api.Api;
import org.yamcs.api.HttpBody;
import org.yamcs.api.Observer;
import org.yamcs.protobuf.Mdb.AlgorithmInfo;
import org.yamcs.protobuf.Mdb.BatchGetParametersRequest;
import org.yamcs.protobuf.Mdb.BatchGetParametersResponse;
import org.yamcs.protobuf.Mdb.CommandInfo;
import org.yamcs.protobuf.Mdb.ContainerInfo;
import org.yamcs.protobuf.Mdb.ExportJavaMissionDatabaseRequest;
import org.yamcs.protobuf.Mdb.GetAlgorithmRequest;
import org.yamcs.protobuf.Mdb.GetCommandRequest;
import org.yamcs.protobuf.Mdb.GetContainerRequest;
import org.yamcs.protobuf.Mdb.GetMissionDatabaseRequest;
import org.yamcs.protobuf.Mdb.GetParameterRequest;
import org.yamcs.protobuf.Mdb.GetParameterTypeRequest;
import org.yamcs.protobuf.Mdb.GetSpaceSystemRequest;
import org.yamcs.protobuf.Mdb.ListAlgorithmsRequest;
import org.yamcs.protobuf.Mdb.ListAlgorithmsResponse;
import org.yamcs.protobuf.Mdb.ListCommandsRequest;
import org.yamcs.protobuf.Mdb.ListCommandsResponse;
import org.yamcs.protobuf.Mdb.ListContainersRequest;
import org.yamcs.protobuf.Mdb.ListContainersResponse;
import org.yamcs.protobuf.Mdb.ListParameterTypesRequest;
import org.yamcs.protobuf.Mdb.ListParameterTypesResponse;
import org.yamcs.protobuf.Mdb.ListParametersRequest;
import org.yamcs.protobuf.Mdb.ListParametersResponse;
import org.yamcs.protobuf.Mdb.ListSpaceSystemsRequest;
import org.yamcs.protobuf.Mdb.ListSpaceSystemsResponse;
import org.yamcs.protobuf.Mdb.MissionDatabase;
import org.yamcs.protobuf.Mdb.ParameterInfo;
import org.yamcs.protobuf.Mdb.ParameterTypeInfo;
import org.yamcs.protobuf.Mdb.SpaceSystemInfo;

// @javax.annotation.processing.Generated(value = "org.yamcs.protoc.ServiceGenerator", date = "2019-11-25T14:47:49.657Z")
public abstract class AbstractMdbApi implements Api {

    /**
     * Get a mission database
     */
    public abstract void getMissionDatabase(T ctx, GetMissionDatabaseRequest request, Observer observer);

    /**
     * Export a java serialized dump of the mission database
     */
    public abstract void exportJavaMissionDatabase(T ctx, ExportJavaMissionDatabaseRequest request, Observer observer);

    /**
     * List space systems
     */
    public abstract void listSpaceSystems(T ctx, ListSpaceSystemsRequest request, Observer observer);

    /**
     * Get a space system
     */
    public abstract void getSpaceSystem(T ctx, GetSpaceSystemRequest request, Observer observer);

    /**
     * List parameters
     */
    public abstract void listParameters(T ctx, ListParametersRequest request, Observer observer);

    /**
     * Get a parameter
     */
    public abstract void getParameter(T ctx, GetParameterRequest request, Observer observer);

    /**
     * Batch get of multiple parameters
     */
    public abstract void batchGetParameters(T ctx, BatchGetParametersRequest request, Observer observer);

    /**
     * List parameter types
     */
    public abstract void listParameterTypes(T ctx, ListParameterTypesRequest request, Observer observer);

    /**
     * Get a parameter type
     */
    public abstract void getParameterType(T ctx, GetParameterTypeRequest request, Observer observer);

    /**
     * List containers
     */
    public abstract void listContainers(T ctx, ListContainersRequest request, Observer observer);

    /**
     * Get a container
     */
    public abstract void getContainer(T ctx, GetContainerRequest request, Observer observer);

    /**
     * List commands
     */
    public abstract void listCommands(T ctx, ListCommandsRequest request, Observer observer);

    /**
     * Get a command
     */
    public abstract void getCommand(T ctx, GetCommandRequest request, Observer observer);

    /**
     * List algorithms
     */
    public abstract void listAlgorithms(T ctx, ListAlgorithmsRequest request, Observer observer);

    /**
     * Get an algorithm
     */
    public abstract void getAlgorithm(T ctx, GetAlgorithmRequest request, Observer observer);

    @Override
    public final ServiceDescriptor getDescriptorForType() {
        return Mdb.getDescriptor().getServices().get(0);
    }

    @Override
    public final Message getRequestPrototype(MethodDescriptor method) {
        if (method.getService() != getDescriptorForType()) {
            throw new IllegalArgumentException("Method not contained by this service.");
        }
        switch (method.getIndex()) {
        case 0:
            return GetMissionDatabaseRequest.getDefaultInstance();
        case 1:
            return ExportJavaMissionDatabaseRequest.getDefaultInstance();
        case 2:
            return ListSpaceSystemsRequest.getDefaultInstance();
        case 3:
            return GetSpaceSystemRequest.getDefaultInstance();
        case 4:
            return ListParametersRequest.getDefaultInstance();
        case 5:
            return GetParameterRequest.getDefaultInstance();
        case 6:
            return BatchGetParametersRequest.getDefaultInstance();
        case 7:
            return ListParameterTypesRequest.getDefaultInstance();
        case 8:
            return GetParameterTypeRequest.getDefaultInstance();
        case 9:
            return ListContainersRequest.getDefaultInstance();
        case 10:
            return GetContainerRequest.getDefaultInstance();
        case 11:
            return ListCommandsRequest.getDefaultInstance();
        case 12:
            return GetCommandRequest.getDefaultInstance();
        case 13:
            return ListAlgorithmsRequest.getDefaultInstance();
        case 14:
            return GetAlgorithmRequest.getDefaultInstance();
        default:
            throw new IllegalStateException();
        }
    }

    @Override
    public final Message getResponsePrototype(MethodDescriptor method) {
        if (method.getService() != getDescriptorForType()) {
            throw new IllegalArgumentException("Method not contained by this service.");
        }
        switch (method.getIndex()) {
        case 0:
            return MissionDatabase.getDefaultInstance();
        case 1:
            return HttpBody.getDefaultInstance();
        case 2:
            return ListSpaceSystemsResponse.getDefaultInstance();
        case 3:
            return SpaceSystemInfo.getDefaultInstance();
        case 4:
            return ListParametersResponse.getDefaultInstance();
        case 5:
            return ParameterInfo.getDefaultInstance();
        case 6:
            return BatchGetParametersResponse.getDefaultInstance();
        case 7:
            return ListParameterTypesResponse.getDefaultInstance();
        case 8:
            return ParameterTypeInfo.getDefaultInstance();
        case 9:
            return ListContainersResponse.getDefaultInstance();
        case 10:
            return ContainerInfo.getDefaultInstance();
        case 11:
            return ListCommandsResponse.getDefaultInstance();
        case 12:
            return CommandInfo.getDefaultInstance();
        case 13:
            return ListAlgorithmsResponse.getDefaultInstance();
        case 14:
            return AlgorithmInfo.getDefaultInstance();
        default:
            throw new IllegalStateException();
        }
    }

    @Override
    @SuppressWarnings("unchecked")
    public final void callMethod(MethodDescriptor method, T ctx, Message request, Observer future) {
        if (method.getService() != getDescriptorForType()) {
            throw new IllegalArgumentException("Method not contained by this service.");
        }
        switch (method.getIndex()) {
        case 0:
            getMissionDatabase(ctx, (GetMissionDatabaseRequest) request, (Observer)(Object) future);
            return;
        case 1:
            exportJavaMissionDatabase(ctx, (ExportJavaMissionDatabaseRequest) request, (Observer)(Object) future);
            return;
        case 2:
            listSpaceSystems(ctx, (ListSpaceSystemsRequest) request, (Observer)(Object) future);
            return;
        case 3:
            getSpaceSystem(ctx, (GetSpaceSystemRequest) request, (Observer)(Object) future);
            return;
        case 4:
            listParameters(ctx, (ListParametersRequest) request, (Observer)(Object) future);
            return;
        case 5:
            getParameter(ctx, (GetParameterRequest) request, (Observer)(Object) future);
            return;
        case 6:
            batchGetParameters(ctx, (BatchGetParametersRequest) request, (Observer)(Object) future);
            return;
        case 7:
            listParameterTypes(ctx, (ListParameterTypesRequest) request, (Observer)(Object) future);
            return;
        case 8:
            getParameterType(ctx, (GetParameterTypeRequest) request, (Observer)(Object) future);
            return;
        case 9:
            listContainers(ctx, (ListContainersRequest) request, (Observer)(Object) future);
            return;
        case 10:
            getContainer(ctx, (GetContainerRequest) request, (Observer)(Object) future);
            return;
        case 11:
            listCommands(ctx, (ListCommandsRequest) request, (Observer)(Object) future);
            return;
        case 12:
            getCommand(ctx, (GetCommandRequest) request, (Observer)(Object) future);
            return;
        case 13:
            listAlgorithms(ctx, (ListAlgorithmsRequest) request, (Observer)(Object) future);
            return;
        case 14:
            getAlgorithm(ctx, (GetAlgorithmRequest) request, (Observer)(Object) future);
            return;
        default:
            throw new IllegalStateException();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy