public void waitGetPasswordData(AwsProcessClient awsProcessClient, Long instanceNo) { AwsInstance awsInstance = awsInstanceDao.read(instanceNo); String instanceId = awsInstance.getInstanceId(); GetPasswordDataRequest request = new GetPasswordDataRequest(); request.withInstanceId(instanceId); while (true) { GetPasswordDataResult result = awsProcessClient.getEc2Client().getPasswordData(request); if (StringUtils.isNotEmpty(result.getPasswordData())) { break; } try { Thread.sleep(1000L * awsProcessClient.getDescribeInterval()); } catch (InterruptedException ignore) { } } }
protected String getPasswordData(Long instanceNo) { Instance instance = instanceDao.read(instanceNo); Farm farm = farmDao.read(instance.getFarmNo()); AwsProcessClient awsProcessClient = awsProcessClientFactory.createAwsProcessClient(farm.getUserNo(), instance.getPlatformNo()); AwsInstance awsInstance = awsInstanceDao.read(instanceNo); // パスワードデータの取得 GetPasswordDataRequest request = new GetPasswordDataRequest(); request.withInstanceId(awsInstance.getInstanceId()); GetPasswordDataResult result = awsProcessClient.getEc2Client().getPasswordData(request); return result.getPasswordData(); }
@Override public GetPasswordDataResult passwordData(GetPasswordDataRequest request, ResultCapture<GetPasswordDataResult> extractor) { ActionResult result = resource.performAction("PasswordData", request, extractor); if (result == null) return null; return (GetPasswordDataResult) result.getData(); }
@Override public GetPasswordDataResult passwordData( ResultCapture<GetPasswordDataResult> extractor) { GetPasswordDataRequest request = new GetPasswordDataRequest(); return passwordData(request, extractor); }
@Override public GetPasswordDataResult getPasswordData(GetPasswordDataRequest getPasswordDataRequest) throws AmazonServiceException, AmazonClientException { throw new UnsupportedOperationException("Not supported in mock"); }
@Override public GetPasswordDataResult passwordData(GetPasswordDataRequest request) { return passwordData(request, null); }
@Override public GetPasswordDataResult passwordData() { return passwordData((ResultCapture<GetPasswordDataResult>)null); }
/** * Performs the <code>PasswordData</code> action. * * <p> * The following request parameters will be populated from the data of this * <code>Instance</code> resource, and any conflicting parameter value set * in the request will be overridden: * <ul> * <li> * <b><code>InstanceId</code></b> * - mapped from the <code>Id</code> identifier. * </li> * </ul> * * <p> * * @return The response of the low-level client operation associated with * this resource action. * @see GetPasswordDataRequest */ GetPasswordDataResult passwordData(GetPasswordDataRequest request);
/** * Performs the <code>PasswordData</code> action and use a ResultCapture to * retrieve the low-level client response. * * <p> * The following request parameters will be populated from the data of this * <code>Instance</code> resource, and any conflicting parameter value set * in the request will be overridden: * <ul> * <li> * <b><code>InstanceId</code></b> * - mapped from the <code>Id</code> identifier. * </li> * </ul> * * <p> * * @return The response of the low-level client operation associated with * this resource action. * @see GetPasswordDataRequest */ GetPasswordDataResult passwordData(GetPasswordDataRequest request, ResultCapture<GetPasswordDataResult> extractor);
/** * The convenient method form for the <code>PasswordData</code> action. * * @see #passwordData(GetPasswordDataRequest) */ GetPasswordDataResult passwordData();
/** * The convenient method form for the <code>PasswordData</code> action. * * @see #passwordData(GetPasswordDataRequest, ResultCapture) */ GetPasswordDataResult passwordData(ResultCapture<GetPasswordDataResult> extractor);