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


Java UriUtils.extendUri方法代码示例

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


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

示例1: doSubStageBootHost

import com.vmware.xenon.common.UriUtils; //导入方法依赖的package包/类
private void doSubStageBootHost(ProvisionComputeTaskState updatedState,
        BootDevice[] bootDevices,
        ProvisionComputeTaskState.SubStage nextStage) {
    CompletionHandler c = (o, e) -> {
        if (e != null) {
            failTask(e);
            return;
        }

        ComputeBootRequest br = new ComputeBootRequest();
        br.resourceReference = UriUtils.extendUri(ClusterUtil.getClusterUri(getHost(),
                ServiceTypeCluster.INVENTORY_SERVICE),
                updatedState.computeLink);
        for (BootDevice bootDevice : bootDevices) {
            br.bootDeviceOrder.add(bootDevice);
        }
        ServiceDocument subTask = o.getBody(ServiceDocument.class);
        br.taskReference = UriUtils.buildUri(this.getHost(), subTask.documentSelfLink);
        br.isMockRequest = updatedState.isMockRequest;
        sendHostServiceRequest(br, updatedState.bootAdapterReference);
    };

    // After setting boot order and rebooting, we want the sub-task
    // to patch the main task to the "next" state.
    createSubTask(c, nextStage, updatedState);
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:27,代码来源:ProvisionComputeTaskService.java

示例2: buildSecurityGroupInstanceRequest

import com.vmware.xenon.common.UriUtils; //导入方法依赖的package包/类
private SecurityGroupInstanceRequest buildSecurityGroupInstanceRequest(SecurityGroupState
        securityGroupState, InstanceRequestType type,
        AWSLoadBalancerContext context) {
    SecurityGroupInstanceRequest req = new SecurityGroupInstanceRequest();
    req.requestType = type;
    req.resourceReference = UriUtils.extendUri(ClusterUtil.getClusterUri(getHost(),
            ServiceTypeCluster.INVENTORY_SERVICE),
            securityGroupState.documentSelfLink);
    req.authCredentialsLink = securityGroupState.authCredentialsLink;
    req.resourcePoolLink = securityGroupState.resourcePoolLink;
    req.isMockRequest = context.request.isMockRequest;
    req.customProperties = new HashMap<>();
    req.customProperties.put(NETWORK_STATE_ID_PROP_NAME, context.vpcId);

    return req;
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:17,代码来源:AWSLoadBalancerService.java

示例3: createMissingComputeStates

import com.vmware.xenon.common.UriUtils; //导入方法依赖的package包/类
/**
 * The user adds the EA account as the end-point. By parsing the bill, we understand there are
 * one or more subscriptions, resources whose compute states need to be created in order
 * to store cost information for those entities.
 */
private void createMissingComputeStates(Context context,
        Stages next, List<AzureSubscription> newSubscriptions) {
    logInfo(() -> String
            .format("Creating compute states for the following subscriptions: %s for " +
                            "endpoint %s ", newSubscriptions.toString(),
                    context.computeHostDesc.endpointLink));
    AzureSubscriptionsEnumerationRequest request = new AzureSubscriptionsEnumerationRequest();
    request.resourceReference = UriUtils
            .extendUri(getInventoryServiceUri(), context.computeHostDesc.documentSelfLink);
    request.azureSubscriptions = newSubscriptions;
    Operation.createPatch(getHost(), AzureSubscriptionsEnumerationService.SELF_LINK)
            .setBody(request)
            .setCompletion((operation, exception) -> {
                logInfo(() -> String.format("Finished creating compute states for " +
                                "subscriptions under endpoint %s.",
                        context.computeHostDesc.documentSelfLink));
                context.stage = next;
                handleRequest(context);
            }).sendWith(this);
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:26,代码来源:AzureCostStatsService.java

示例4: validateCredentials

import com.vmware.xenon.common.UriUtils; //导入方法依赖的package包/类
private void validateCredentials(EndpointAllocationTaskState currentState, SubStage next) {
    EndpointConfigRequest req = new EndpointConfigRequest();
    req.requestType = RequestType.VALIDATE;
    req.endpointProperties = currentState.endpointState.endpointProperties;
    req.tenantLinks = currentState.tenantLinks;
    req.checkForEndpointUniqueness = currentState.checkForEndpointUniqueness;

    if (currentState.endpointState.documentSelfLink != null) {
        req.resourceReference = UriUtils.extendUri(ClusterUtil.getClusterUri(getHost(),
                ServiceTypeCluster.INVENTORY_SERVICE),
                currentState.endpointState.documentSelfLink);
    }
    req.isMockRequest = currentState.options.contains(TaskOption.IS_MOCK);

    Operation
            .createPatch(currentState.adapterReference)
            .setBody(req)
            .setCompletion((o, e) -> {
                if (e != null) {
                    logWarning(() -> e.getMessage());
                    sendFailurePatch(this, currentState, e);
                    return;
                }
                EndpointAllocationTaskState st = createUpdateSubStageTask(next);
                if (o.hasBody() && currentState.taskSubStage == SubStage.VALIDATE_CREDENTIALS) {
                    CertificateInfoServiceErrorResponse errorResponse =
                            o.getBody(CertificateInfoServiceErrorResponse.class);

                    if (CertificateInfoServiceErrorResponse.KIND.equals(
                            errorResponse.documentKind)) {
                        st.taskInfo.failure = errorResponse;
                        st.taskInfo.stage = TaskStage.FAILED;
                        if (errorResponse.certificateInfo != null) {
                            st.certificateInfo = errorResponse.certificateInfo;
                        }
                    }
                }
                sendSelfPatch(st);
            }).sendWith(this);
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:41,代码来源:EndpointAllocationTaskService.java

示例5: getParentAuth

import com.vmware.xenon.common.UriUtils; //导入方法依赖的package包/类
protected void getParentAuth(AWSReservedInstanceContext context) {
    Consumer<Operation> onSuccess = (op) -> {
        context.parentAuth = op.getBody(AuthCredentialsService.AuthCredentialsServiceState.class);
        getReservedInstancesPlans(context);
    };
    String authLink = context.computeDesc.description.authCredentialsLink;
    URI authUri = UriUtils.extendUri(getInventoryServiceUri(), authLink);
    AdapterUtils.getServiceState(this, authUri, onSuccess, getFailureConsumer(context,
            "Error while retrieving auth credentials"));
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:11,代码来源:AWSReservedInstancePlanService.java

示例6: getAuth

import com.vmware.xenon.common.UriUtils; //导入方法依赖的package包/类
/**
 * Gets the credentials (enrollment number & API key) required to call the Azure API for
 * requesting data.
 */
private void getAuth(Context context, Stages next) {
    logInfo(() -> String.format("Starting azure ea cost stats collection for endpoint %s ",
            context.computeHostDesc.endpointLink));

    URI authUri = UriUtils.extendUri(getInventoryServiceUri(),
            context.endpointState.authCredentialsLink);
    Consumer<Operation> onSuccess = (op) -> {
        context.auth = op.getBody(AuthCredentialsServiceState.class);
        context.stage = next;
        handleRequest(context);
    };
    AdapterUtils.getServiceState(this, authUri, onSuccess, getFailureConsumer(context));
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:18,代码来源:AzureCostStatsService.java

示例7: createSubscriptionEndpointCreationRequest

import com.vmware.xenon.common.UriUtils; //导入方法依赖的package包/类
private AzureSubscriptionEndpointCreationRequest createSubscriptionEndpointCreationRequest(
        AzureSubscriptionEndpointsEnumerationContext context, AzureSubscription subscription) {
    AzureSubscriptionEndpointCreationRequest request =
            new AzureSubscriptionEndpointCreationRequest();
    request.accountId = subscription.parentEntityId;
    request.subscriptionId = subscription.entityId;
    request.resourceReference = UriUtils.extendUri(ClusterUtil.getClusterUri(getHost(),
            ServiceTypeCluster.INVENTORY_SERVICE), context.parent.endpointLink);
    return request;
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:11,代码来源:AzureSubscriptionEndpointsEnumerationService.java


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