@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo)) { return super.equals(obj); } io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo other = (io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo) obj; boolean result = true; result = result && getScope() .equals(other.getScope()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + SCOPE_FIELD_NUMBER; hash = (53 * hash) + getScope().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getScopeBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, scope_); } unknownFields.writeTo(output); }
this.controllerService.createScope(ScopeInfo.newBuilder().setScope(SCOPE1).build(), result); Assert.assertEquals(result.get().getStatus(), CreateScopeStatus.Status.SUCCESS);
break; default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
RPCAsyncCallback<DeleteScopeStatus> callback = new RPCAsyncCallback<>(requestId, "deleteScope"); new ControllerClientTagger(client).withTag(requestId, "deleteScope", scopeName) .deleteScope(ScopeInfo.newBuilder().setScope(scopeName).build(), callback); return callback.getFuture(); }, this.executor);
RPCAsyncCallback<CreateScopeStatus> callback = new RPCAsyncCallback<>(requestId, "createScope"); new ControllerClientTagger(client).withTag(requestId, "createScope", scopeName) .createScope(ScopeInfo.newBuilder().setScope(scopeName).build(), callback); return callback.getFuture(); }, this.executor);
@io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "deleteScope", requestType = io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo.class, responseType = io.pravega.controller.stream.api.grpc.v1.Controller.DeleteScopeStatus.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor<io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo, io.pravega.controller.stream.api.grpc.v1.Controller.DeleteScopeStatus> getDeleteScopeMethod() { io.grpc.MethodDescriptor<io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo, io.pravega.controller.stream.api.grpc.v1.Controller.DeleteScopeStatus> getDeleteScopeMethod; if ((getDeleteScopeMethod = ControllerServiceGrpc.getDeleteScopeMethod) == null) { synchronized (ControllerServiceGrpc.class) { if ((getDeleteScopeMethod = ControllerServiceGrpc.getDeleteScopeMethod) == null) { ControllerServiceGrpc.getDeleteScopeMethod = getDeleteScopeMethod = io.grpc.MethodDescriptor.<io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo, io.pravega.controller.stream.api.grpc.v1.Controller.DeleteScopeStatus>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName( "io.pravega.controller.stream.api.grpc.v1.ControllerService", "deleteScope")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( io.pravega.controller.stream.api.grpc.v1.Controller.DeleteScopeStatus.getDefaultInstance())) .setSchemaDescriptor(new ControllerServiceMethodDescriptorSupplier("deleteScope")) .build(); } } } return getDeleteScopeMethod; }
@io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "createScope", requestType = io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo.class, responseType = io.pravega.controller.stream.api.grpc.v1.Controller.CreateScopeStatus.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor<io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo, io.pravega.controller.stream.api.grpc.v1.Controller.CreateScopeStatus> getCreateScopeMethod() { io.grpc.MethodDescriptor<io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo, io.pravega.controller.stream.api.grpc.v1.Controller.CreateScopeStatus> getCreateScopeMethod; if ((getCreateScopeMethod = ControllerServiceGrpc.getCreateScopeMethod) == null) { synchronized (ControllerServiceGrpc.class) { if ((getCreateScopeMethod = ControllerServiceGrpc.getCreateScopeMethod) == null) { ControllerServiceGrpc.getCreateScopeMethod = getCreateScopeMethod = io.grpc.MethodDescriptor.<io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo, io.pravega.controller.stream.api.grpc.v1.Controller.CreateScopeStatus>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName( "io.pravega.controller.stream.api.grpc.v1.ControllerService", "createScope")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( io.pravega.controller.stream.api.grpc.v1.Controller.CreateScopeStatus.getDefaultInstance())) .setSchemaDescriptor(new ControllerServiceMethodDescriptorSupplier("createScope")) .build(); } } } return getCreateScopeMethod; }
@Override public void deleteScope(ScopeInfo request, StreamObserver<DeleteScopeStatus> responseObserver) { if (request.getScope().equals("scope1")) { responseObserver.onNext(DeleteScopeStatus.newBuilder().setStatus( DeleteScopeStatus.Status.SUCCESS).build()); responseObserver.onCompleted(); } else if (request.getScope().equals("scope2")) { responseObserver.onNext(DeleteScopeStatus.newBuilder().setStatus( DeleteScopeStatus.Status.FAILURE).build()); responseObserver.onCompleted(); } else if (request.getScope().equals("scope3")) { responseObserver.onNext(DeleteScopeStatus.newBuilder() .setStatus(DeleteScopeStatus.Status.SCOPE_NOT_EMPTY) .build()); responseObserver.onCompleted(); } else if (request.getScope().equals("scope4")) { responseObserver.onNext(DeleteScopeStatus.newBuilder() .setStatus(DeleteScopeStatus.Status.SCOPE_NOT_FOUND) .build()); responseObserver.onCompleted(); } else { responseObserver.onError(Status.INTERNAL.withDescription("Server error").asRuntimeException()); } } };
@Override public void createScope(ScopeInfo request, StreamObserver<CreateScopeStatus> responseObserver) { if (request.getScope().equals("scope1")) { responseObserver.onNext(CreateScopeStatus.newBuilder().setStatus( CreateScopeStatus.Status.SUCCESS).build()); responseObserver.onCompleted(); } else if (request.getScope().equals("scope2")) { responseObserver.onNext(CreateScopeStatus.newBuilder().setStatus( CreateScopeStatus.Status.FAILURE).build()); responseObserver.onCompleted(); } else if (request.getScope().equals("scope3")) { responseObserver.onNext(CreateScopeStatus.newBuilder() .setStatus(CreateScopeStatus.Status.INVALID_SCOPE_NAME) .build()); responseObserver.onCompleted(); } else if (request.getScope().equals("scope4")) { responseObserver.onNext(CreateScopeStatus.newBuilder() .setStatus(CreateScopeStatus.Status.SCOPE_EXISTS) .build()); responseObserver.onCompleted(); } else { responseObserver.onError(Status.INTERNAL.withDescription("Server error").asRuntimeException()); } }
public io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo getDefaultInstanceForType() { return io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo.getDefaultInstance(); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
public static final Controller.ScopeInfo createScopeInfo(final String scope) { Exceptions.checkNotNullOrEmpty(scope, "scope"); return Controller.ScopeInfo.newBuilder().setScope(scope).build(); }
@Override public void deleteScope(ScopeInfo request, StreamObserver<DeleteScopeStatus> responseObserver) { RequestTag requestTag = requestTracker.initializeAndTrackRequestTag(requestIdGenerator.get(), "deleteScope", request.getScope()); log.info(requestTag.getRequestId(), "deleteScope called for scope {}.", request.getScope()); authenticateExecuteAndProcessResults(() -> this.authHelper.checkAuthorization(request.getScope(), AuthHandler.Permissions.READ_UPDATE), delegationToken -> controllerService.deleteScope(request.getScope()), responseObserver, requestTag); }
@Override public void createScope(ScopeInfo request, StreamObserver<CreateScopeStatus> responseObserver) { RequestTag requestTag = requestTracker.initializeAndTrackRequestTag(requestIdGenerator.get(), "createScope", request.getScope()); log.info(requestTag.getRequestId(), "createScope called for scope {}.", request.getScope()); authenticateExecuteAndProcessResults(() -> this.authHelper.checkAuthorization(request.getScope(), AuthHandler.Permissions.READ_UPDATE), delegationToken -> controllerService.createScope(request.getScope()), responseObserver, requestTag); }
public io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo build() { io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getScopeBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, scope_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public Builder mergeFrom(io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo other) { if (other == io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo.getDefaultInstance()) return this; if (!other.getScope().isEmpty()) { scope_ = other.scope_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
public io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo buildPartial() { io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo result = new io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo(this); result.scope_ = scope_; onBuilt(); return result; }