public RequestBrokerFactoryService() { super(RequestBrokerState.class); super.toggleOption(ServiceOption.PERSISTENCE, true); super.toggleOption(ServiceOption.REPLICATION, true); }
@Override public void handleGet(Operation get) { OperationUtil.transformProjectHeaderToFilterQuery(get); super.handleGet(get); } }
super.handlePost(op); return;
@Override public void handleRequest(Operation op) { // Workaround for invalid json document for container-descriptions during upgrade // VBV-1845 if (op.getAction() == Action.POST && op.hasPragmaDirective(Operation.PRAGMA_DIRECTIVE_FROM_MIGRATION_TASK)) { try { op.getBody(this.stateType); } catch (IllegalArgumentException | JsonSyntaxException e) { if (e.getMessage().contains("Unparseable JSON body") || e.getMessage().contains("IllegalStateException")) { logWarning( "Incorrect json structure detected for container-description document during migration: %s. Document will be skipped", op.getBodyRaw()); op.setBody(null).complete(); } else { throw e; } } super.handleRequest(op); } else { super.handleRequest(op); } } }
@Override protected String buildDefaultChildSelfLink(ServiceDocument document) { if (document == null) { throw new IllegalArgumentException("Body is required"); } ExtensibilitySubscription state = (ExtensibilitySubscription) document; // upon service restart a body with only documentSelfLink populated is received if (state.task != null) { return ExtensibilitySubscriptionService.constructKey(state); } if (state.documentSelfLink != null) { return state.documentSelfLink; } return super.buildDefaultChildSelfLink(); } }
@Override public void authorizeRequest(Operation op) { if (isPublicProjectsAccess(op)) { op.complete(); return; } super.authorizeRequest(op); }
@Override public void handleGet(Operation get) { OperationUtil.transformProjectHeaderToFilterQuery(get); super.handleGet(get); } }
super.handlePost(post); return; } else { if (registries.isEmpty()) { super.handlePost(post); } else { if (!post.hasPragmaDirective(Operation.PRAGMA_DIRECTIVE_FROM_MIGRATION_TASK)) { "compute.registry.host.address.already.exists")); } else { super.handlePost(post);
@Override public void handleRequest(Operation op) { if (isPublicProjectsAccess(op)) { // Set system authorization and add expand query if not present. if (!UriUtils.hasODataExpandParamValue(op.getUri())) { op.setUri(UriUtils.extendUriWithQuery(op.getUri(), UriUtils.URI_PARAM_ODATA_EXPAND_NO_DOLLAR_SIGN, Boolean.TRUE.toString())); } setAuthorizationContext(op, getSystemAuthorizationContext()); op.nestCompletion(this::filterNonPublicProjects); } else if (op.getAction() == Action.GET && UriUtils.hasODataExpandParamValue(op.getUri())) { op.nestCompletion(this::expandGetResults); } // Latest xenon does not expand the result when there is a query parameter. Harbor rely on // this if (op.getAction() == Action.GET && UriUtils.hasODataQueryParams(op.getUri())) { op.setUri(UriUtils.buildExpandLinksQueryUri(op.getUri())); } super.handleRequest(op); }
public CompositeDescriptionFactoryService() { super(CompositeDescription.class); super.toggleOption(ServiceOption.PERSISTENCE, true); super.toggleOption(ServiceOption.REPLICATION, true); super.toggleOption(ServiceOption.IDEMPOTENT_POST, true); }
@Override public void handleGet(Operation get) { OperationUtil.transformProjectHeaderToFilterQuery(get); super.handleGet(get); } }
+ "does not exist")); } else { super.handlePost(post);
public CompositionTaskFactoryService() { super(CompositionTaskState.class); super.toggleOption(ServiceOption.PERSISTENCE, true); super.toggleOption(ServiceOption.REPLICATION, true); }
@Override public void handleGet(Operation get) { OperationUtil.transformProjectHeaderToFilterQuery(get); super.handleGet(get); } }
public CompositeComponentFactoryService() { super(CompositeComponent.class); super.toggleOption(ServiceOption.PERSISTENCE, true); super.toggleOption(ServiceOption.REPLICATION, true); super.toggleOption(ServiceOption.IDEMPOTENT_POST, true); }
@Override public void handleGet(Operation get) { OperationUtil.transformProjectHeaderToFilterQuery(get); super.handleGet(get); } }
public RequestStatusFactoryService() { super(RequestStatus.class); super.toggleOption(ServiceOption.PERSISTENCE, true); super.toggleOption(ServiceOption.REPLICATION, true); super.toggleOption(ServiceOption.IDEMPOTENT_POST, true); }
@Override public void handleGet(Operation get) { OperationUtil.transformProjectHeaderToFilterQuery(get); super.handleGet(get); } }
public CompositionSubTaskFactoryService() { super(CompositionSubTaskState.class); super.toggleOption(ServiceOption.PERSISTENCE, true); super.toggleOption(ServiceOption.REPLICATION, true); }
@Override public void handleGet(Operation get) { OperationUtil.transformProjectHeaderToFilterQuery(get); super.handleGet(get); } }