
org.yamcs.protobuf.AbstractClearanceApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yamcs-api Show documentation
Show all versions of yamcs-api Show documentation
Used by external clients to communicate with Yamcs
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 org.yamcs.api.Api;
import org.yamcs.api.Observer;
@javax.annotation.processing.Generated(value = "org.yamcs.maven.ServiceGenerator", date = "2025-02-13T11:12:59.914476628Z")
@SuppressWarnings("unchecked")
public abstract class AbstractClearanceApi implements Api {
/**
*
* List clearances
*
*/
public abstract void listClearances(T ctx, Empty request, Observer observer);
/**
*
* Update a user's clearance
*
*/
public abstract void updateClearance(T ctx, UpdateClearanceRequest request, Observer observer);
/**
*
* Delete a user's clearance
*
*/
public abstract void deleteClearance(T ctx, DeleteClearanceRequest request, Observer observer);
/**
*
* Receive updates on own clearance
*
*/
public abstract void subscribeClearance(T ctx, Empty request, Observer observer);
@Override
public final ServiceDescriptor getDescriptorForType() {
return ClearanceServiceProto.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 UpdateClearanceRequest.getDefaultInstance();
case 2:
return DeleteClearanceRequest.getDefaultInstance();
case 3:
return Empty.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 ListClearancesResponse.getDefaultInstance();
case 1:
return ClearanceInfo.getDefaultInstance();
case 2:
return Empty.getDefaultInstance();
case 3:
return ClearanceInfo.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:
listClearances(ctx, (Empty) request, (Observer)(Object) future);
return;
case 1:
updateClearance(ctx, (UpdateClearanceRequest) request, (Observer)(Object) future);
return;
case 2:
deleteClearance(ctx, (DeleteClearanceRequest) request, (Observer)(Object) future);
return;
case 3:
subscribeClearance(ctx, (Empty) 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