Search in sources :

Example 1 with CertificateGetHeaders

use of com.microsoft.azure.batch.protocol.models.CertificateGetHeaders 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();
}
Also used : CertificateGetOptions(com.microsoft.azure.batch.protocol.models.CertificateGetOptions) CertificateGetHeaders(com.microsoft.azure.batch.protocol.models.CertificateGetHeaders) Certificate(com.microsoft.azure.batch.protocol.models.Certificate) X509Certificate(java.security.cert.X509Certificate)

Aggregations

Certificate (com.microsoft.azure.batch.protocol.models.Certificate)1 CertificateGetHeaders (com.microsoft.azure.batch.protocol.models.CertificateGetHeaders)1 CertificateGetOptions (com.microsoft.azure.batch.protocol.models.CertificateGetOptions)1 X509Certificate (java.security.cert.X509Certificate)1