response = databaseClient.getKeyValueById( id );
if ( response.getStatus() == Response.Status.OK.getStatusCode() ) {
return response.readEntity( SequenceDocument.class );
}
else if ( response.getStatus() == Response.Status.NOT_FOUND.getStatusCode() ) {
SequenceDocument identifier = new SequenceDocument( key.getMetadata().getValueColumnName(), initialValue );
identifier.setId( id );
return identifier;
}
else {
GenericResponse responseEntity = response.readEntity( GenericResponse.class );
throw logger.errorRetrievingKeyValue( response.getStatus(), responseEntity.getError(), responseEntity.getReason() );