@Override public FilterReturnCode processRequest(Operation op, OperationProcessingContext context) { if (op.getAction() == Action.POST) { handlePatchPostPut(service, op); } return FilterReturnCode.CONTINUE_PROCESSING; } });
private String buildLogTransactionUpdateMsg(Operation request, ServiceDocument currentState) { return String.format( "Transaction %s set on service %s: operation: %s, previous transaction: %s", request.getTransactionId(), this.service.getSelfLink(), request.getAction(), currentState.documentTransactionId); }
@Override public void handleRequest(Operation op) { if (op.getAction() != Action.GET) { Operation.failActionNotSupported(op); return; } super.handleRequest(op); }
@Override public void handleRequest(Operation op) { if (op.getAction() != Action.POST) { Operation.failActionNotSupported(op); return; } handlePost(op); }
@Override public FilterReturnCode processRequest(Operation op, OperationProcessingContext context) { if (Action.PATCH == op.getAction()) { op.fail(new IllegalArgumentException()); return FilterReturnCode.FAILED_STOP_PROCESSING; } return FilterReturnCode.CONTINUE_PROCESSING; } }
@Override public void handleDelete(Operation delete) { ContainerNetworkState currentState = getState(delete); CompositeComponentNotifier.notifyCompositionComponents(this, currentState.compositeComponentLinks, delete.getAction()); super.handleDelete(delete); }
@Override public void handleRequest(Operation op) { if (op.getAction() == Action.DELETE && op.getUri().getQuery() == null && !op.getAuthorizationContext().isSystemUser()) { op.fail(Operation.STATUS_CODE_FORBIDDEN); return; } super.handleRequest(op); } }
private void logTransactionConflict(Operation request, ServiceDocument currentState) { this.service .getHost() .log(Level.INFO, "Transaction %s conflicts on service %s: operation: %s, current state transaction: %s", request.getTransactionId(), this.service.getSelfLink(), request.getAction(), currentState.documentTransactionId); }
/** * Set common tags for tracing spans on an operation. */ public static void setSpanTags(Operation operation, ActiveSpan span) { span.setTag(Tags.HTTP_METHOD.getKey(), operation.getAction().toString()); span.setTag(Tags.HTTP_URL.getKey(), operation.getUri().toString()); } }
@Override public void handleRequest(Operation op) { if (op.getAction() == Action.GET) { handleGet(op); } else { Operation.failActionNotSupported(op); } }
@Override public void handleRequest(Operation op) { if (op.getAction() == Action.POST) { handlePost(op); } else { Operation.failActionNotSupported(op); } }
@Override public void handleRequest(Operation op) { if (op.getAction() == Action.PATCH) { op.complete(); return; } super.handleRequest(op); } }
@Override public void sendRequest(Operation op) { assertEquals(Action.DELETE, op.getAction()); assertEquals(uri, op.getUri().toString()); } });
@Override public void handleRequest(Operation op) { if (op.getAction() == Action.DELETE && op.getUri().getPath().equals(getSelfLink())) { super.handleRequest(op); return; } AuthorizationContextServiceHelper.populateAuthContext(op, this.context); } }
@Override public void handleRequest(Operation op) { if (op.getAction() == Action.DELETE && op.getUri().getPath().equals(getSelfLink())) { super.handleRequest(op); return; } AuthorizationContextServiceHelper.populateAuthContext(op, this.context); } }
public static DeferredResult<Void> handleFactoryOp(Service service, Operation op) { if (op.getAction() != Action.POST) { return DeferredResult.completed(null); } if (op.getAuthorizationContext() != null && op.getAuthorizationContext().isSystemUser()) { return DeferredResult.completed(null); } return handleClusterServiceOp(service, op) .thenCompose(ignore -> setProjectLinkAsTenantLink(service, op)); }