Skip to content

Commit

Permalink
adding withResponse in sync client:
Browse files Browse the repository at this point in the history
  • Loading branch information
samvaity committed Jul 26, 2019
1 parent 35d7364 commit 1448487
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public Key createKey(String name, KeyType keyType) {
* @return The {@link Key created key}.
*/
public Key createKey(KeyCreateOptions keyCreateOptions) {
return client.createKey(keyCreateOptions, Context.NONE).block().value();
return this.createKeyWithResponse(keyCreateOptions, Context.NONE).value();
}

/**
Expand Down Expand Up @@ -140,7 +140,7 @@ public Response<Key> createKeyWithResponse(KeyCreateOptions keyCreateOptions, Co
* @return The {@link Key created key}.
*/
public Key createRsaKey(RsaKeyCreateOptions rsaKeyCreateOptions) {
return client.createRsaKey(rsaKeyCreateOptions, Context.NONE).block().value();
return this.createKeyWithResponse(rsaKeyCreateOptions, Context.NONE).value();
}

/**
Expand Down Expand Up @@ -192,7 +192,7 @@ public Response<Key> createRsaKeyWithResponse(RsaKeyCreateOptions rsaKeyCreateOp
* @return The {@link Key created key}.
*/
public Key createEcKey(EcKeyCreateOptions ecKeyCreateOptions) {
return client.createEcKey(ecKeyCreateOptions, Context.NONE).block().value();
return this.createEcKeyWithResponse(ecKeyCreateOptions, Context.NONE).value();
}

/**
Expand Down Expand Up @@ -268,7 +268,7 @@ public Key importKey(String name, JsonWebKey keyMaterial) {
* @return The {@link Key imported key}.
*/
public Key importKey(KeyImportOptions keyImportOptions) {
return client.importKey(keyImportOptions, Context.NONE).block().value();
return this.importKeyWithResponse(keyImportOptions, Context.NONE).value();
}

/**
Expand Down Expand Up @@ -315,7 +315,7 @@ public Response<Key> importKeyWithResponse(KeyImportOptions keyImportOptions, Co
* @return The requested {@link Key key}.
*/
public Key getKey(String name, String version) {
return client.getKey(name, version, Context.NONE).block().value();
return this.getKeyWithResponse(name, version, Context.NONE).value();
}

/**
Expand Down Expand Up @@ -350,7 +350,7 @@ public Response<Key> getKeyWithResponse(String name, String version, Context con
* @return The requested {@link Key key}.
*/
public Key getKey(String name) {
return getKey(name, "");
return this.getKeyWithResponse(name, "", Context.NONE).value();
}

/**
Expand All @@ -372,7 +372,7 @@ public Key getKey(KeyBase keyBase) {
if (keyBase.version() == null) {
return getKey(keyBase.name());
}
return getKey(keyBase.name(), keyBase.version());
return getKeyWithResponse(keyBase.name(), keyBase.version(), Context.NONE).value();
}

/**
Expand All @@ -391,7 +391,7 @@ public Key getKey(KeyBase keyBase) {
* @return The {@link KeyBase updated key}.
*/
public Key updateKey(KeyBase key) {
return client.updateKey(key, Context.NONE).block().value();
return this.updateKeyWithResponse(key, Context.NONE).value();
}

/**
Expand All @@ -411,7 +411,7 @@ public Key updateKey(KeyBase key) {
* @return A {@link Response} whose {@link Response#value() value} contains the {@link KeyBase updated key}.
*/
public Key updateKey(KeyBase key, KeyOperation... keyOperations) {
return client.updateKey(key, Context.NONE, keyOperations).block().value();
return this.updateKeyWithResponse(key, Context.NONE, keyOperations).value();
}

/**
Expand Down Expand Up @@ -452,7 +452,7 @@ public Response<Key> updateKeyWithResponse(KeyBase key, Context context, KeyOpe
* @return The {@link DeletedKey deleted key}.
*/
public DeletedKey deleteKey(String name) {
return client.deleteKey(name, Context.NONE).block().value();
return this.deleteKeyWithResponse(name, Context.NONE).value();
}

/**
Expand Down Expand Up @@ -494,7 +494,7 @@ public Response<DeletedKey> deleteKeyWithResponse(String name, Context context)
* @return The {@link DeletedKey deleted key}.
*/
public DeletedKey getDeletedKey(String name) {
return client.getDeletedKey(name, Context.NONE).block().value();
return this.getDeletedKeyWithResponse(name, Context.NONE).value();
}

/**
Expand Down Expand Up @@ -571,7 +571,7 @@ public VoidResponse purgeDeletedKey(String name, Context context) {
* @return The {@link Key recovered key}.
*/
public Key recoverDeletedKey(String name) {
return client.recoverDeletedKey(name, Context.NONE).block().value();
return this.recoverDeletedKeyWithResponse(name, Context.NONE).value();
}

/**
Expand Down Expand Up @@ -614,7 +614,7 @@ public Response<Key> recoverDeletedKeyWithResponse(String name, Context context)
* @return The backed up key blob.
*/
public byte[] backupKey(String name) {
return client.backupKey(name, Context.NONE).block().value();
return this.backupKeyWithResponse(name, Context.NONE).value();
}

/**
Expand Down Expand Up @@ -660,7 +660,7 @@ public Response<byte[]> backupKeyWithResponse(String name, Context context) {
* @return The {@link Key restored key}.
*/
public Key restoreKey(byte[] backup) {
return client.restoreKey(backup, Context.NONE).block().value();
return this.restoreKeyWithResponse(backup, Context.NONE).value();
}

/**
Expand Down

0 comments on commit 1448487

Please sign in to comment.