Class CertificateOperations
- java.lang.Object
-
- com.microsoft.azure.batch.CertificateOperations
-
- All Implemented Interfaces:
IInheritedBehaviors
public class CertificateOperations extends Object implements IInheritedBehaviors
Performs certificate-related operations on an Azure Batch account.
-
-
Field Summary
Fields Modifier and Type Field Description static String
SHA1_CERTIFICATE_ALGORITHM
The SHA certificate algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint)
Cancels a failed deletion of the specified certificate.void
cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint, Iterable<BatchClientBehavior> additionalBehaviors)
Cancels a failed deletion of the specified certificate.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.void
deleteCertificate(String thumbprintAlgorithm, String thumbprint, Iterable<BatchClientBehavior> additionalBehaviors)
Deletes the certificate from the Batch account.Certificate
getCertificate(String thumbprintAlgorithm, String thumbprint)
Gets the specifiedCertificate
.Certificate
getCertificate(String thumbprintAlgorithm, String thumbprint, DetailLevel detailLevel)
Gets the specifiedCertificate
.Certificate
getCertificate(String thumbprintAlgorithm, String thumbprint, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)
Gets the specifiedCertificate
.com.microsoft.azure.PagedList<Certificate>
listCertificates()
Lists thecertificates
in the Batch account.com.microsoft.azure.PagedList<Certificate>
listCertificates(DetailLevel detailLevel)
Lists thecertificates
in the Batch account.com.microsoft.azure.PagedList<Certificate>
listCertificates(DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)
Lists thecertificates
in the Batch account.IInheritedBehaviors
withCustomBehaviors(Collection<BatchClientBehavior> behaviors)
Sets a collection of behaviors that modify or customize requests to the Batch service.
-
-
-
Field Detail
-
SHA1_CERTIFICATE_ALGORITHM
public static final String SHA1_CERTIFICATE_ALGORITHM
The SHA certificate algorithm.- See Also:
- Constant Field Values
-
-
Method Detail
-
customBehaviors
public Collection<BatchClientBehavior> customBehaviors()
Gets a collection of behaviors that modify or customize requests to the Batch service.- Specified by:
customBehaviors
in interfaceIInheritedBehaviors
- Returns:
- A collection of
BatchClientBehavior
instances.
-
withCustomBehaviors
public IInheritedBehaviors withCustomBehaviors(Collection<BatchClientBehavior> behaviors)
Sets a collection of behaviors that modify or customize requests to the Batch service.- Specified by:
withCustomBehaviors
in interfaceIInheritedBehaviors
- Parameters:
behaviors
- The collection ofBatchClientBehavior
instances.- Returns:
- The current instance.
-
createCertificate
public void createCertificate(InputStream certStream) throws BatchErrorException, IOException, CertificateException, NoSuchAlgorithmException
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<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException, CertificateException, NoSuchAlgorithmException
Adds a certificate to the Batch account.- Parameters:
certStream
- The certificate data in .cer format.additionalBehaviors
- A collection ofBatchClientBehavior
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.
-
createCertificate
public void createCertificate(CertificateAddParameter certificate) throws BatchErrorException, IOException
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<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Adds a certificate to the Batch account.- Parameters:
certificate
- The certificate to be added.additionalBehaviors
- A collection ofBatchClientBehavior
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.
-
cancelDeleteCertificate
public void cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint) throws BatchErrorException, IOException
Cancels a failed deletion of the specified certificate. This operation can be performed only when the certificate is in theDelete Failed
state, and restores the certificate to theActive
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<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Cancels a failed deletion of the specified certificate. This operation can be performed only when the certificate is in theDelete Failed
state, and restores the certificate to theActive
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 ofBatchClientBehavior
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.
-
deleteCertificate
public void deleteCertificate(String thumbprintAlgorithm, String thumbprint) throws BatchErrorException, IOException
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:
- The certificate is not associated with any pools.
- 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.)
If you try to delete a certificate that is in use, the deletion fails. The certificate state changes to
Delete Failed
. You can usecancelDeleteCertificate(String, String)
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<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
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:
- The certificate is not associated with any pools.
- 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.)
If you try to delete a certificate that is in use, the deletion fails. The certificate state changes to
Delete Failed
. You can usecancelDeleteCertificate(String, String)
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 ofBatchClientBehavior
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) throws BatchErrorException, IOException
Gets the specifiedCertificate
.- 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) throws BatchErrorException, IOException
Gets the specifiedCertificate
.- Parameters:
thumbprintAlgorithm
- The algorithm used to derive the thumbprint parameter. This must be sha1.thumbprint
- The thumbprint of the certificate to get.detailLevel
- ADetailLevel
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<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Gets the specifiedCertificate
.- Parameters:
thumbprintAlgorithm
- the algorithm used to derive the thumbprint parameter. This must be sha1.thumbprint
- the thumbprint of the certificate to get.detailLevel
- ADetailLevel
used for controlling which properties are retrieved from the service.additionalBehaviors
- A collection ofBatchClientBehavior
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 com.microsoft.azure.PagedList<Certificate> listCertificates() throws BatchErrorException, IOException
Lists thecertificates
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 com.microsoft.azure.PagedList<Certificate> listCertificates(DetailLevel detailLevel) throws BatchErrorException, IOException
Lists thecertificates
in the Batch account.- Parameters:
detailLevel
- ADetailLevel
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 com.microsoft.azure.PagedList<Certificate> listCertificates(DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Lists thecertificates
in the Batch account.- Parameters:
detailLevel
- ADetailLevel
used for filtering the list and for controlling which properties are retrieved from the service.additionalBehaviors
- A collection ofBatchClientBehavior
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.
-
-