public ApiKey regenerateApiKey ( final ApiKey apiKey ) { pm . currentTransaction ( ) . begin ( ) ; apiKey . setKey ( ApiKeyGenerator . generate ( ) ) ; pm . currentTransaction ( ) . commit ( ) ; return pm . getObjectById ( ApiKey . class , apiKey . getId ( ) ) ; }
Regenerates an API key . This method does not create a new ApiKey object rather it uses the existing ApiKey object and simply creates a new key string .