You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Tim Reilly <ti...@consultant.com> on 2004/03/10 04:55:06 UTC

[id] hooking up UUID generation

Any thoughts on "hooking-up" the UUID generation like the other id
generators?

I was thinking something along these lines:
either:
IdentifierUtils.nextUUID([UUID.VERSION_ONE | UUID.VERSION_FOUR]);
-or-
IdentifierUtils.nextVersionOneUUID();
IdentifierUtils.nextVersionFourUUID([void | boolean:secure]);

And same thought on the factory:
either:
IdentifierGeneratorFactory factory =
IdentifierGeneratorFactory.newInstance();
UUIDGenerator generator = factory.uuidGenerator(UUID.VERSION_ONE |
UUID.VERSION_FOUR);
-or-
VersionOneGenerator generator = factory.uuidVersionOneGenerator();
VersionFourGenerator generator = factory.uuidVersionFourGenerator();


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [id] use of commons-logging

Posted by Phil Steitz <ph...@steitz.com>.
Stephen Colebourne wrote:
> I'll admit to being surprised that [id] has any dependencies. When it was
> created I was assuing that none would be needed.
> Stephen
> 

Currently, we depend on [discovery], essentially to make implementation 
decisions pluggable / configurable.  This brings [logging].  We also 
depend on [codec] (for part of the uuid impl).  If you have ideas about 
how these dependencies could be removed without (significant) loss, and 
you see them as a problem / limitation, please feel free to jump with 
suggestions or changes at any time ;-)

Phil


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [id] use of commons-logging

Posted by Stephen Colebourne <sc...@btopenworld.com>.
I'll admit to being surprised that [id] has any dependencies. When it was
created I was assuing that none would be needed.
Stephen

----- Original Message -----
From: "Tim Reilly" <ti...@consultant.com>
> Since there is a dependency on commons-logging; any issues with using it?
>
> For example in IdentifierGeneratorFactory.java line 53
>
> -        } catch (Exception ex) {
> -            // ignore as default implementation will be used.
> +        }
> +        catch (Exception ex) {
> +            if (log.isInfoEnabled()) {
> +                log.info(ex);
> +            }
>
> There are two other similar places in the uuid packages I was think it
might
> be useful to log what's happening in the recoverable exceptions.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [id] use of commons-logging

Posted by Phil Steitz <ph...@steitz.com>.
Tim Reilly wrote:
> Since there is a dependency on commons-logging; any issues with using it?
> 
> For example in IdentifierGeneratorFactory.java line 53
> 
> -        } catch (Exception ex) {
> -            // ignore as default implementation will be used.
> +        }
> +        catch (Exception ex) {
> +            if (log.isInfoEnabled()) {
> +                log.info(ex);
> +            }
> 
> There are two other similar places in the uuid packages I was think it might
> be useful to log what's happening in the recoverable exceptions.
> 
I would be -1 to the change above, since the "no configuration present, so 
use default" situation is not really exceptional.  I would be careful 
adding logging elsewhere if there is any chance that it will end up 
generating a large volume of log messages under normal circumstances.

Phil
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: [id] use of commons-logging

Posted by Tim Reilly <ti...@consultant.com>.
Since there is a dependency on commons-logging; any issues with using it?

For example in IdentifierGeneratorFactory.java line 53

-        } catch (Exception ex) {
-            // ignore as default implementation will be used.
+        }
+        catch (Exception ex) {
+            if (log.isInfoEnabled()) {
+                log.info(ex);
+            }

There are two other similar places in the uuid packages I was think it might
be useful to log what's happening in the recoverable exceptions.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [id] hooking up UUID generation

Posted by Phil Steitz <ph...@steitz.com>.
Tim,

Sorry for the latency.  My inclination would be to go with the different 
names / classes for different versions.  These look like different 
identifiers to me.

Phil

Tim Reilly wrote:
> Any thoughts on "hooking-up" the UUID generation like the other id
> generators?
> 
> I was thinking something along these lines:
> either:
> IdentifierUtils.nextUUID([UUID.VERSION_ONE | UUID.VERSION_FOUR]);
> -or-
> IdentifierUtils.nextVersionOneUUID();
> IdentifierUtils.nextVersionFourUUID([void | boolean:secure]);
> 
> And same thought on the factory:
> either:
> IdentifierGeneratorFactory factory =
> IdentifierGeneratorFactory.newInstance();
> UUIDGenerator generator = factory.uuidGenerator(UUID.VERSION_ONE |
> UUID.VERSION_FOUR);
> -or-
> VersionOneGenerator generator = factory.uuidVersionOneGenerator();
> VersionFourGenerator generator = factory.uuidVersionFourGenerator();
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org