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

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

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

import com.google.protobuf.Descriptors.MethodDescriptor;
import com.google.protobuf.Descriptors.ServiceDescriptor;
import com.google.protobuf.Empty;
import com.google.protobuf.Message;
import com.google.protobuf.Timestamp;
import org.yamcs.api.Api;
import org.yamcs.api.Observer;

@javax.annotation.processing.Generated(value = "org.yamcs.maven.ServiceGenerator", date = "2025-02-13T11:12:59.909912507Z")
@SuppressWarnings("unchecked")
public abstract class AbstractTimeApi implements Api {

    /**
     * 
     *  Get UTC leap seconds
     * 
*/ public abstract void getLeapSeconds(T ctx, Empty request, Observer observer); /** *
     *  Set (simulation) time of an instance
     * 
*/ public abstract void setTime(T ctx, SetTimeRequest request, Observer observer); /** *
     *  Receive time updates
     * 
*/ public abstract void subscribeTime(T ctx, SubscribeTimeRequest request, Observer observer); @Override public final ServiceDescriptor getDescriptorForType() { return TimeServiceProto.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 Empty.getDefaultInstance(); case 1: return SetTimeRequest.getDefaultInstance(); case 2: return SubscribeTimeRequest.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 LeapSecondsTable.getDefaultInstance(); case 1: return Empty.getDefaultInstance(); case 2: return Timestamp.getDefaultInstance(); default: throw new IllegalStateException(); } } @Override 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: getLeapSeconds(ctx, (Empty) request, (Observer)(Object) future); return; case 1: setTime(ctx, (SetTimeRequest) request, (Observer)(Object) future); return; case 2: subscribeTime(ctx, (SubscribeTimeRequest) request, (Observer)(Object) future); return; default: throw new IllegalStateException(); } } @Override public final Observer callMethod(MethodDescriptor method, T ctx, Observer future) { if (method.getService() != getDescriptorForType()) { throw new IllegalArgumentException("Method not contained by this service."); } switch (method.getIndex()) { default: throw new IllegalStateException(); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy