本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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"));
}
示例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));
}
示例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;
}