Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added @ServiceMethod annotations to Key Vault clients for long runnin…
…g operations to follow checkstyle rules.
  • Loading branch information
vcolin7 committed Feb 12, 2021
commit 00dbcb9bf4bbd036faf077134adeae68210e503c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Duration getDefaultPollingInterval() {
* @throws ResourceModifiedException when invalid certificate policy configuration is provided.
* @return A {@link PollerFlux} polling on the create certificate operation status.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux<CertificateOperation, KeyVaultCertificateWithPolicy> beginCreateCertificate(String certificateName, CertificatePolicy policy, Boolean isEnabled, Map<String, String> tags) {
return new PollerFlux<>(getDefaultPollingInterval(),
activationOperation(certificateName, policy, isEnabled, tags),
Expand Down Expand Up @@ -245,6 +246,7 @@ Mono<Response<CertificateOperation>> createCertificateWithResponse(String certif
* @throws ResourceNotFoundException when a certificate operation for a certificate with {@code certificateName} doesn't exist.
* @return A {@link PollerFlux} polling on the certificate operation status.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux<CertificateOperation, KeyVaultCertificateWithPolicy> getCertificateOperation(String certificateName) {
return new PollerFlux<>(getDefaultPollingInterval(),
(pollingContext) -> Mono.empty(),
Expand Down Expand Up @@ -450,7 +452,7 @@ Mono<Response<KeyVaultCertificate>> updateCertificatePropertiesWithResponse(Cert
* @throws HttpResponseException when a certificate with {@code certificateName} is empty string.
* @return A {@link PollerFlux} to poll on the {@link DeletedCertificate deleted certificate}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux<DeletedCertificate, Void> beginDeleteCertificate(String certificateName) {
return new PollerFlux<>(getDefaultPollingInterval(),
activationOperation(certificateName),
Expand Down Expand Up @@ -631,7 +633,7 @@ Mono<Response<Void>> purgeDeletedCertificateWithResponse(String certificateName,
* @throws HttpResponseException when a certificate with {@code certificateName} is empty string.
* @return A {@link PollerFlux} to poll on the {@link KeyVaultCertificate recovered certificate}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux<KeyVaultCertificateWithPolicy, Void> beginRecoverDeletedCertificate(String certificateName) {
return new PollerFlux<>(getDefaultPollingInterval(),
recoverActivationOperation(certificateName),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public String getVaultUrl() {
* @throws ResourceModifiedException when invalid certificate policy configuration is provided.
* @return A {@link SyncPoller} to poll on the create certificate operation status.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller<CertificateOperation, KeyVaultCertificateWithPolicy> beginCreateCertificate(String certificateName, CertificatePolicy policy, Boolean isEnabled, Map<String, String> tags) {
return client.beginCreateCertificate(certificateName, policy, isEnabled, tags).getSyncPoller();
}
Expand All @@ -108,7 +108,7 @@ public SyncPoller<CertificateOperation, KeyVaultCertificateWithPolicy> beginCrea
* @throws ResourceModifiedException when invalid certificate policy configuration is provided.
* @return A {@link SyncPoller} to poll on the create certificate operation status.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller<CertificateOperation, KeyVaultCertificateWithPolicy> beginCreateCertificate(String certificateName, CertificatePolicy policy) {
return client.beginCreateCertificate(certificateName, policy).getSyncPoller();
}
Expand All @@ -126,7 +126,7 @@ public SyncPoller<CertificateOperation, KeyVaultCertificateWithPolicy> beginCrea
* @throws ResourceNotFoundException when a certificate operation for a certificate with {@code certificateName} doesn't exist.
* @return A {@link SyncPoller} to poll on the certificate operation status.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller<CertificateOperation, KeyVaultCertificateWithPolicy> getCertificateOperation(String certificateName) {
return client.getCertificateOperation(certificateName).getSyncPoller();
}
Expand Down Expand Up @@ -268,7 +268,7 @@ public Response<KeyVaultCertificate> updateCertificatePropertiesWithResponse(Cer
* @throws HttpRequestException when a certificate with {@code certificateName} is empty string.
* @return A {@link SyncPoller} to poll on and retrieve {@link DeletedCertificate deleted certificate}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller<DeletedCertificate, Void> beginDeleteCertificate(String certificateName) {
return client.beginDeleteCertificate(certificateName).getSyncPoller();
}
Expand Down Expand Up @@ -372,7 +372,7 @@ public Response<Void> purgeDeletedCertificateWithResponse(String certificateName
* @throws HttpRequestException when a certificate with {@code certificateName} is empty string.
* @return A {@link SyncPoller} to poll on and retrieve {@link KeyVaultCertificateWithPolicy recovered certificate}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller<KeyVaultCertificateWithPolicy, Void> beginRecoverDeletedCertificate(String certificateName) {
return client.beginRecoverDeletedCertificate(certificateName).getSyncPoller();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ Mono<Response<KeyVaultKey>> updateKeyPropertiesWithResponse(KeyProperties keyPro
* @throws ResourceNotFoundException when a key with {@code name} doesn't exist in the key vault.
* @throws HttpResponseException when a key with {@code name} is empty string.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux<DeletedKey, Void> beginDeleteKey(String name) {
return new PollerFlux<>(getDefaultPollingInterval(),
activationOperation(name),
Expand Down Expand Up @@ -866,7 +866,7 @@ Mono<Response<Void>> purgeDeletedKeyWithResponse(String name, Context context) {
* @throws ResourceNotFoundException when a key with {@code name} doesn't exist in the key vault.
* @throws HttpResponseException when a key with {@code name} is empty string.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux<KeyVaultKey, Void> beginRecoverDeletedKey(String name) {
return new PollerFlux<>(getDefaultPollingInterval(),
recoverActivationOperation(name),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

package com.azure.security.keyvault.keys;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
Expand Down Expand Up @@ -444,6 +446,7 @@ public Response<KeyVaultKey> updateKeyPropertiesWithResponse(KeyProperties keyPr
* @throws ResourceNotFoundException when a key with {@code name} doesn't exist in the key vault.
* @throws HttpResponseException when a key with {@code name} is empty string.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller<DeletedKey, Void> beginDeleteKey(String name) {
return client.beginDeleteKey(name).getSyncPoller();
}
Expand Down Expand Up @@ -540,6 +543,7 @@ public Response<Void> purgeDeletedKeyWithResponse(String name, Context context)
* @throws ResourceNotFoundException when a key with {@code name} doesn't exist in the key vault.
* @throws HttpResponseException when a key with {@code name} is empty string.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller<KeyVaultKey, Void> beginRecoverDeletedKey(String name) {
return client.beginRecoverDeletedKey(name).getSyncPoller();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ Mono<Response<SecretProperties>> updateSecretPropertiesWithResponse(SecretProper
* @throws ResourceNotFoundException when a secret with {@code name} doesn't exist in the key vault.
* @throws HttpResponseException when a secret with {@code name} is empty string.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux<DeletedSecret, Void> beginDeleteSecret(String name) {
return new PollerFlux<>(getDefaultPollingInterval(),
activationOperation(name),
Expand Down Expand Up @@ -567,7 +567,7 @@ Mono<Response<Void>> purgeDeletedSecretWithResponse(String name, Context context
* @throws ResourceNotFoundException when a secret with {@code name} doesn't exist in the key vault.
* @throws HttpResponseException when a secret with {@code name} is empty string.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux<KeyVaultSecret, Void> beginRecoverDeletedSecret(String name) {
return new PollerFlux<>(getDefaultPollingInterval(),
recoverActivationOperation(name),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

package com.azure.security.keyvault.secrets;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
Expand Down Expand Up @@ -238,6 +240,7 @@ public SecretProperties updateSecretProperties(SecretProperties secretProperties
* @throws ResourceNotFoundException when a secret with {@code name} doesn't exist in the key vault.
* @throws HttpResponseException when a secret with {@code name} is empty string.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller<DeletedSecret, Void> beginDeleteSecret(String name) {
return client.beginDeleteSecret(name).getSyncPoller();
}
Expand Down Expand Up @@ -331,6 +334,7 @@ public Response<Void> purgeDeletedSecretWithResponse(String name, Context contex
* @throws ResourceNotFoundException when a secret with {@code name} doesn't exist in the key vault.
* @throws HttpResponseException when a secret with {@code name} is empty string.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller<KeyVaultSecret, Void> beginRecoverDeletedSecret(String name) {
return client.beginRecoverDeletedSecret(name).getSyncPoller();
}
Expand Down