Created
March 11, 2010 19:10
-
-
Save admiyo/329533 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * delete the consumer. | |
| - * @param uuid uuid of the consumer to delete. | |
| + * | |
| + * @param uuid | |
| + * uuid of the consumer to delete. | |
| */ | |
| @DELETE | |
| @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) | |
| @@ -210,70 +225,92 @@ public class ConsumerResource { | |
| public void deleteConsumer(@PathParam("consumer_uuid") String uuid) { | |
| log.debug("deleteing consumer_uuid" + uuid); | |
| try { | |
| - consumerCurator.delete(consumerCurator.lookupByUuid(uuid)); | |
| + Consumer toDelete = consumerCurator.lookupByUuid(uuid); | |
| + if (toDelete == null) | |
| + return; | |
| + | |
| + ConsumerIdentityCertificate certificate = consumerIdentityCertificateCurator | |
| + .find(toDelete.getId()); | |
| + if (certificate != null) { | |
| + consumerIdentityCertificateCurator.delete(certificate); | |
| + } | |
| + consumerCurator.delete(toDelete); | |
| } | |
| catch (RuntimeException e) { | |
| throw new NotFoundException(e.getMessage()); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment