Share via


CertificateOperations Class

public class CertificateOperations implements IInheritedBehaviors

Performs certificate-related operations on an Azure Batch account.

Field Summary

Modifier and Type Field and Description
final String SHA1_CERTIFICATE_ALGORITHM

The SHA certificate algorithm.

Method Summary

Modifier and Type Method and Description
void cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint)

Cancels a failed deletion of the specified certificate. This operation can be performed only when the certificate is in the DELETE_FAILED state, and restores the certificate to the ACTIVE state.

void cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint, Iterable<BatchClientBehavior> additionalBehaviors)

Cancels a failed deletion of the specified certificate. This operation can be performed only when the certificate is in the DELETE_FAILED state, and restores the certificate to the ACTIVE state.

void createCertificate(CertificateAddParameter certificate)

Adds a certificate to the Batch account.

void createCertificate(CertificateAddParameter certificate, Iterable<BatchClientBehavior> additionalBehaviors)

Adds a certificate to the Batch account.

void createCertificate(InputStream certStream)

Adds a certificate to the Batch account.

void createCertificate(InputStream certStream, Iterable<BatchClientBehavior> additionalBehaviors)

Adds a certificate to the Batch account.

Collection<BatchClientBehavior> customBehaviors()

Gets a collection of behaviors that modify or customize requests to the Batch service.

void deleteCertificate(String thumbprintAlgorithm, String thumbprint)

Deletes the certificate from the Batch account.

The delete operation requests that the certificate be deleted. The request puts the certificate in the DELETING state. The Batch service will perform the actual certificate deletion without any further client action.

You cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a certificate, you must therefore make sure that:

    <li>
    
      <p>The certificate is not associated with any pools. </p>
    
    </li>
    
    <li>
    
      <p>The certificate is not installed on any compute nodes. (Even if you remove a certificate from a pool, it is not removed from existing compute nodes in that pool until they restart.) </p>
    
    </li>
    

If you try to delete a certificate that is in use, the deletion fails. The certificate state changes to DELETE_FAILED. You can use cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint) to set the status back to Active if you decide that you want to continue using the certificate.

void deleteCertificate(String thumbprintAlgorithm, String thumbprint, Iterable<BatchClientBehavior> additionalBehaviors)

Deletes the certificate from the Batch account.

The delete operation requests that the certificate be deleted. The request puts the certificate in the DELETING state. The Batch service will perform the actual certificate deletion without any further client action.

You cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a certificate, you must therefore make sure that:

    <li>
    
      <p>The certificate is not associated with any pools. </p>
    
    </li>
    
    <li>
    
      <p>The certificate is not installed on any compute nodes. (Even if you remove a certificate from a pool, it is not removed from existing compute nodes in that pool until they restart.) </p>
    
    </li>
    

If you try to delete a certificate that is in use, the deletion fails. The certificate state changes to DELETE_FAILED.

You can use cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint) to set the status back to Active if you decide that you want to continue using the certificate.

Certificate getCertificate(String thumbprintAlgorithm, String thumbprint)

Gets the specified Certificate.

Certificate getCertificate(String thumbprintAlgorithm, String thumbprint, DetailLevel detailLevel)

Gets the specified Certificate.

Certificate getCertificate(String thumbprintAlgorithm, String thumbprint, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)

Gets the specified Certificate.

PagedList<Certificate> listCertificates()

Lists the certificates in the Batch account.

PagedList<Certificate> listCertificates(DetailLevel detailLevel)

Lists the certificates in the Batch account.

PagedList<Certificate> listCertificates(DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)

Lists the certificates in the Batch account.

IInheritedBehaviors withCustomBehaviors(Collection<BatchClientBehavior> behaviors)

Sets a collection of behaviors that modify or customize requests to the Batch service.

Field Details

SHA1_CERTIFICATE_ALGORITHM

public static final String SHA1_CERTIFICATE_ALGORITHM= "sha1"

The SHA certificate algorithm.

Method Details

cancelDeleteCertificate

public void cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint)

Cancels a failed deletion of the specified certificate. This operation can be performed only when the certificate is in the DELETE_FAILED state, and restores the certificate to the ACTIVE state.

Parameters:

thumbprintAlgorithm - The algorithm used to derive the thumbprint parameter. This must be sha1.
thumbprint - The thumbprint of the certificate that failed to delete.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.
IOException - Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.

cancelDeleteCertificate

public void cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint, Iterable additionalBehaviors)

Cancels a failed deletion of the specified certificate. This operation can be performed only when the certificate is in the DELETE_FAILED state, and restores the certificate to the ACTIVE state.

Parameters:

thumbprintAlgorithm - The algorithm used to derive the thumbprint parameter. This must be sha1.
thumbprint - The thumbprint of the certificate that failed to delete.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.
IOException - Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.

createCertificate

public void createCertificate(CertificateAddParameter certificate)

Adds a certificate to the Batch account.

Parameters:

certificate - The certificate to be added.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.
IOException - Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.

createCertificate

public void createCertificate(CertificateAddParameter certificate, Iterable additionalBehaviors)

Adds a certificate to the Batch account.

Parameters:

certificate - The certificate to be added.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.
IOException - Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.

createCertificate

public void createCertificate(InputStream certStream)

Adds a certificate to the Batch account.

Parameters:

certStream - The certificate data in .cer format.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.
IOException - Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
CertificateException - Exception thrown when an error is encountered processing the provided certificate.
NoSuchAlgorithmException - Exception thrown if the X.509 provider is not registered in the Java security provider list.

createCertificate

public void createCertificate(InputStream certStream, Iterable additionalBehaviors)

Adds a certificate to the Batch account.

Parameters:

certStream - The certificate data in .cer format.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.
IOException - Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
CertificateException - Exception thrown when an error is encountered processing the provided certificate.
NoSuchAlgorithmException - Exception thrown if the X.509 provider is not registered in the Java security provider list.

customBehaviors

public Collection customBehaviors()

Gets a collection of behaviors that modify or customize requests to the Batch service.

Overrides:

CertificateOperations.customBehaviors()

Returns:

A collection of BatchClientBehavior instances.

deleteCertificate

public void deleteCertificate(String thumbprintAlgorithm, String thumbprint)

Deletes the certificate from the Batch account.

The delete operation requests that the certificate be deleted. The request puts the certificate in the DELETING state. The Batch service will perform the actual certificate deletion without any further client action.

You cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a certificate, you must therefore make sure that:

    <li>
    
      <p>The certificate is not associated with any pools. </p>
    
    </li>
    
    <li>
    
      <p>The certificate is not installed on any compute nodes. (Even if you remove a certificate from a pool, it is not removed from existing compute nodes in that pool until they restart.) </p>
    
    </li>
    

If you try to delete a certificate that is in use, the deletion fails. The certificate state changes to DELETE_FAILED. You can use cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint) to set the status back to Active if you decide that you want to continue using the certificate.

Parameters:

thumbprintAlgorithm - The algorithm used to derive the thumbprint parameter. This must be sha1.
thumbprint - The thumbprint of the certificate to delete.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.
IOException - Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.

deleteCertificate

public void deleteCertificate(String thumbprintAlgorithm, String thumbprint, Iterable additionalBehaviors)

Deletes the certificate from the Batch account.

The delete operation requests that the certificate be deleted. The request puts the certificate in the DELETING state. The Batch service will perform the actual certificate deletion without any further client action.

You cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a certificate, you must therefore make sure that:

    <li>
    
      <p>The certificate is not associated with any pools. </p>
    
    </li>
    
    <li>
    
      <p>The certificate is not installed on any compute nodes. (Even if you remove a certificate from a pool, it is not removed from existing compute nodes in that pool until they restart.) </p>
    
    </li>
    

If you try to delete a certificate that is in use, the deletion fails. The certificate state changes to DELETE_FAILED.

You can use cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint) to set the status back to Active if you decide that you want to continue using the certificate.

Parameters:

thumbprintAlgorithm - The algorithm used to derive the thumbprint parameter. This must be sha1.
thumbprint - The thumbprint of the certificate to delete.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.
IOException - Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.

getCertificate

public Certificate getCertificate(String thumbprintAlgorithm, String thumbprint)

Gets the specified Certificate.

Parameters:

thumbprintAlgorithm - The algorithm used to derive the thumbprint parameter. This must be sha1.
thumbprint - The thumbprint of the certificate to get.

Returns:

A Certificate containing information about the specified certificate in the Azure Batch account.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.
IOException - Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.

getCertificate

public Certificate getCertificate(String thumbprintAlgorithm, String thumbprint, DetailLevel detailLevel)

Gets the specified Certificate.

Parameters:

thumbprintAlgorithm - The algorithm used to derive the thumbprint parameter. This must be sha1.
thumbprint - The thumbprint of the certificate to get.
detailLevel - A DetailLevel used for controlling which properties are retrieved from the service.

Returns:

A Certificate containing information about the specified certificate in the Azure Batch account.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.
IOException - Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.

getCertificate

public Certificate getCertificate(String thumbprintAlgorithm, String thumbprint, DetailLevel detailLevel, Iterable additionalBehaviors)

Gets the specified Certificate.

Parameters:

thumbprintAlgorithm - the algorithm used to derive the thumbprint parameter. This must be sha1.
thumbprint - the thumbprint of the certificate to get.
detailLevel - A DetailLevel used for controlling which properties are retrieved from the service.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Returns:

A Certificate containing information about the specified certificate in the Azure Batch account.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.
IOException - Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.

listCertificates

public PagedList listCertificates()

Lists the certificates in the Batch account.

Returns:

A list of Certificate objects.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.
IOException - Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.

listCertificates

public PagedList listCertificates(DetailLevel detailLevel)

Lists the certificates in the Batch account.

Parameters:

detailLevel - A DetailLevel used for filtering the list and for controlling which properties are retrieved from the service.

Returns:

A list of Certificate objects.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.
IOException - Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.

listCertificates

public PagedList listCertificates(DetailLevel detailLevel, Iterable additionalBehaviors)

Lists the certificates in the Batch account.

Parameters:

detailLevel - A DetailLevel used for filtering the list and for controlling which properties are retrieved from the service.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Returns:

A list of Certificate objects.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.
IOException - Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.

withCustomBehaviors

public IInheritedBehaviors withCustomBehaviors(Collection behaviors)

Sets a collection of behaviors that modify or customize requests to the Batch service.

Overrides:

CertificateOperations.withCustomBehaviors(Collection<BatchClientBehavior> behaviors)

Parameters:

behaviors - The collection of BatchClientBehavior instances.

Returns:

The current instance.

Applies to