use of com.microsoft.azure.batch.protocol.models.CertificateGetOptions in project azure-sdk-for-java by Azure.
the class CertificatesImpl method get.
/**
* Gets information about the specified certificate.
*
* @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1.
* @param thumbprint The thumbprint of the certificate to get.
* @throws BatchErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws IllegalArgumentException exception thrown from invalid parameters
* @return the Certificate object wrapped in {@link ServiceResponseWithHeaders} if successful.
*/
public ServiceResponseWithHeaders<Certificate, CertificateGetHeaders> get(String thumbprintAlgorithm, String thumbprint) throws BatchErrorException, IOException, IllegalArgumentException {
if (thumbprintAlgorithm == null) {
throw new IllegalArgumentException("Parameter thumbprintAlgorithm is required and cannot be null.");
}
if (thumbprint == null) {
throw new IllegalArgumentException("Parameter thumbprint is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
final CertificateGetOptions certificateGetOptions = null;
String select = null;
Integer timeout = null;
String clientRequestId = null;
Boolean returnClientRequestId = null;
DateTime ocpDate = null;
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
Call<ResponseBody> call = service.get(thumbprintAlgorithm, thumbprint, this.client.apiVersion(), this.client.acceptLanguage(), select, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
return getDelegate(call.execute());
}
use of com.microsoft.azure.batch.protocol.models.CertificateGetOptions in project azure-sdk-for-java by Azure.
the class CertificateOperations method getCertificate.
/**
* Gets the specified {@link Certificate}.
*
* @param thumbprintAlgorithm the algorithm used to derive the thumbprint parameter. This must be sha1.
* @param thumbprint the thumbprint of the certificate to get.
* @param detailLevel A {@link DetailLevel} used for filtering the list and for controlling which properties are retrieved from the service.
* @param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch service request.
* @return A {@link Certificate} containing information about the specified certificate in the Azure Batch account.
* @throws BatchErrorException Exception thrown from REST call
* @throws IOException Exception thrown from serialization/deserialization
*/
public Certificate getCertificate(String thumbprintAlgorithm, String thumbprint, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
CertificateGetOptions getCertificateOptions = new CertificateGetOptions();
BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors);
bhMgr.appendDetailLevelToPerCallBehaviors(detailLevel);
bhMgr.applyRequestBehaviors(getCertificateOptions);
ServiceResponseWithHeaders<Certificate, CertificateGetHeaders> response = this._parentBatchClient.protocolLayer().certificates().get(thumbprintAlgorithm, thumbprint, getCertificateOptions);
return response.getBody();
}
use of com.microsoft.azure.batch.protocol.models.CertificateGetOptions in project azure-sdk-for-java by Azure.
the class CertificatesImpl method getAsync.
/**
* Gets information about the specified certificate.
*
* @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1.
* @param thumbprint The thumbprint of the certificate to get.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link Call} object
*/
public ServiceCall getAsync(String thumbprintAlgorithm, String thumbprint, final ServiceCallback<Certificate> serviceCallback) throws IllegalArgumentException {
if (serviceCallback == null) {
throw new IllegalArgumentException("ServiceCallback is required for async calls.");
}
if (thumbprintAlgorithm == null) {
serviceCallback.failure(new IllegalArgumentException("Parameter thumbprintAlgorithm is required and cannot be null."));
return null;
}
if (thumbprint == null) {
serviceCallback.failure(new IllegalArgumentException("Parameter thumbprint is required and cannot be null."));
return null;
}
if (this.client.apiVersion() == null) {
serviceCallback.failure(new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."));
return null;
}
final CertificateGetOptions certificateGetOptions = null;
String select = null;
Integer timeout = null;
String clientRequestId = null;
Boolean returnClientRequestId = null;
DateTime ocpDate = null;
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
Call<ResponseBody> call = service.get(thumbprintAlgorithm, thumbprint, this.client.apiVersion(), this.client.acceptLanguage(), select, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
final ServiceCall serviceCall = new ServiceCall(call);
call.enqueue(new ServiceResponseCallback<Certificate>(serviceCallback) {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
try {
serviceCallback.success(getDelegate(response));
} catch (BatchErrorException | IOException exception) {
serviceCallback.failure(exception);
}
}
});
return serviceCall;
}
Aggregations