当前位置: 首页>>代码示例>>Java>>正文


Java Operation.createDelete方法代码示例

本文整理汇总了Java中com.vmware.xenon.common.Operation.createDelete方法的典型用法代码示例。如果您正苦于以下问题:Java Operation.createDelete方法的具体用法?Java Operation.createDelete怎么用?Java Operation.createDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vmware.xenon.common.Operation的用法示例。


在下文中一共展示了Operation.createDelete方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteSubnetState

import com.vmware.xenon.common.Operation; //导入方法依赖的package包/类
private DeferredResult<ResourceState> deleteSubnetState(ResourceState stateToDelete) {

            if (stateToDelete == null) {
                // The AWS subnet deletion has failed. See deleteAWSSubnet method.
                // Do not delete SubnetState and continue with Instance deletion.
                return DeferredResult.completed(stateToDelete);
            }

            AWSInstanceService.this.logInfo(() -> String.format("Deleting Subnet state [%s]"
                            + " 'created-by' [%s]", stateToDelete.documentSelfLink,
                    this.context.computeRequest.resourceLink()));

            Operation delOp = Operation.createDelete(AWSInstanceService.this,
                    stateToDelete.documentSelfLink);

            return AWSInstanceService.this.sendWithDeferredResult(delOp)
                    .thenApply(ignore -> stateToDelete);
        }
 
开发者ID:vmware,项目名称:photon-model,代码行数:19,代码来源:AWSInstanceService.java

示例2: deleteDiskState

import com.vmware.xenon.common.Operation; //导入方法依赖的package包/类
/**
 * Finish the disk delete operation by cleaning up the disk reference in the system.
 */
private void deleteDiskState(AWSDiskContext ctx, AwsDiskStage next) {
    List<Operation> ops = new ArrayList<>();

    Operation op1 = Operation.createDelete(this, ctx.disk.documentSelfLink);
    ops.add(op1);

    // Clean up disk description link if it is present.
    if (ctx.disk.customProperties != null && !ctx.disk.customProperties.isEmpty()) {
        String diskDescLink = ctx.disk.customProperties.get(PhotonModelConstants.TEMPLATE_DISK_LINK);
        if (diskDescLink != null) {
            Operation op2 = Operation.createDelete(this, diskDescLink);
            ops.add(op2);
        }
    }
    OperationJoin.create(ops)
            .setCompletion((o, e) -> {
                if (e != null && !e.isEmpty()) {
                    handleStages(ctx, new Throwable(Utils.toString(e)));
                    return;
                }
                handleStages(ctx, next);
            })
            .sendWith(this);
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:28,代码来源:AWSDiskService.java

示例3: testDeleteRequestHeader

import com.vmware.xenon.common.Operation; //导入方法依赖的package包/类
@Test
public void testDeleteRequestHeader() throws Throwable {
    EndpointService.EndpointState startState = buildValidStartState();
    EndpointService.EndpointState returnState = postServiceSynchronously(
            EndpointService.FACTORY_LINK,
            startState, EndpointState.class);

    Operation deleteOperation = Operation
            .createDelete(UriUtils.buildUri(this.host, returnState.documentSelfLink));
    // custom header is not set in delete request, expect failure
    this.host.sendAndWaitExpectFailure(deleteOperation);

    // set custom header
    deleteOperation.addRequestHeader(ENDPOINT_REMOVAL_REQUEST_REFERRER_NAME,
            ENDPOINT_REMOVAL_REQUEST_REFERRER_VALUE);
    // custom header is set in delete request, expect success
    this.host.sendAndWaitExpectSuccess(deleteOperation);
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:19,代码来源:EndpointServiceTest.java

示例4: testDeletePragmaDirective

import com.vmware.xenon.common.Operation; //导入方法依赖的package包/类
@Test
public void testDeletePragmaDirective() throws Throwable {
    EndpointService.EndpointState startState = buildValidStartState();
    EndpointService.EndpointState returnState = postServiceSynchronously(
            EndpointService.FACTORY_LINK,
            startState, EndpointState.class);

    Operation deleteOperation = Operation
            .createDelete(UriUtils.buildUri(this.host, returnState.documentSelfLink));
    // custom header is not set in delete request, expect failure
    this.host.sendAndWaitExpectFailure(deleteOperation);

    // set custom header
    deleteOperation.addPragmaDirective(Operation.PRAGMA_DIRECTIVE_FROM_MIGRATION_TASK);
    // custom header is set in delete request, expect success
    this.host.sendAndWaitExpectSuccess(deleteOperation);

}
 
开发者ID:vmware,项目名称:photon-model,代码行数:19,代码来源:EndpointServiceTest.java

示例5: deleteConfig

import com.vmware.xenon.common.Operation; //导入方法依赖的package包/类
public void deleteConfig() {
    ServiceHost configHost = this.gatewayHost.getConfigHost();

    Operation op = Operation
            .createDelete(configHost, this.configState.documentSelfLink);
    this.sender.sendAndWait(op);
    this.configState = null;
}
 
开发者ID:vmware,项目名称:xenon-utils,代码行数:9,代码来源:TestGatewayManager.java

示例6: doInstanceDelete

import com.vmware.xenon.common.Operation; //导入方法依赖的package包/类
/**
 * Delete endpoint
 *
 */
private void doInstanceDelete(EndpointRemovalTaskState currentState, SubStage next) {
    EndpointState endpoint = currentState.endpoint;

    Operation crdOp = Operation.createDelete(createInventoryUri(this.getHost(),
            endpoint.authCredentialsLink));
    Operation epOp = Operation.createDelete(createInventoryUri(this.getHost(),
            endpoint.documentSelfLink));
    // custom header identifier for endpoint service to validate before deleting endpoint
    epOp.addRequestHeader(ENDPOINT_REMOVAL_REQUEST_REFERRER_NAME,
            ENDPOINT_REMOVAL_REQUEST_REFERRER_VALUE);

    OperationJoin.create(crdOp, epOp).setCompletion((ops, exc) -> {
        if (exc != null) {
            // failing to delete the endpoint itself is considered a critical error
            Throwable endpointRemovalException = exc.get(epOp.getId());
            if (endpointRemovalException != null) {
                sendFailureSelfPatch(endpointRemovalException);
                return;
            }

            // other removal exceptions are just warnings
            logFine(() -> String.format("Failed delete some of the associated resources,"
                    + " reason %s", Utils.toString(exc)));
        }
        // Endpoint and AuthCredentials are deleted; mark the operation as complete
        sendSelfPatch(TaskStage.STARTED, next);
    }).sendWith(this);
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:33,代码来源:EndpointRemovalTaskService.java

示例7: deleteSubnet

import com.vmware.xenon.common.Operation; //导入方法依赖的package包/类
private DeferredResult<Void> deleteSubnet(Void start) {
    Operation op = Operation.createDelete(
            PhotonModelUriUtils.createInventoryUri(getService().getHost(),getRequest()
                    .resourceReference));
    return getService().sendWithDeferredResult(op).thenAccept(__ -> { });
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:7,代码来源:DeletePortgroupFlow.java

示例8: deleteDisk

import com.vmware.xenon.common.Operation; //导入方法依赖的package包/类
/**
 * Delete disk request to remove the reference from the system as the disk is deleted on the
 * server.
 */
private Operation deleteDisk(String documentSelfLink) {
    return Operation.createDelete(
            PhotonModelUriUtils.createInventoryUri(getHost(), documentSelfLink));
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:9,代码来源:VSphereDiskService.java


注:本文中的com.vmware.xenon.common.Operation.createDelete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。