You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2010/04/20 11:56:16 UTC

[jira] Commented: (CAMEL-2631) Add time millis converter which can convert from String to long

    [ https://issues.apache.org/activemq/browse/CAMEL-2631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58964#action_58964 ] 

Claus Ibsen commented on CAMEL-2631:
------------------------------------

I wonder if it makes sense to force minutes and seconds to be 0..59?

What if you want to say 520 seconds? Having to do that as: 8m40s is not easy to figure out.
Its not a 24h clock you are setting.

But yeah it maybe makes sense to validate it if you have multiple units, eg H and M
2h5m is valid, where as 2h98m is not.

So maybe if we have this rule
- if only 1 unit, then there is no limitations, eg you can say 520s for 520 seconds, or 99m for 99 minutes
- if 2+ units then minutes and seconds should be 0..59

In terms of the code
1) Do not use new String
2) Throw IllegalArgumentException as its the most appropriate exception to thrown when invalid input.



> Add time millis converter which can convert from String to long
> ---------------------------------------------------------------
>
>                 Key: CAMEL-2631
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2631
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>            Priority: Minor
>         Attachments: time-pattern-converter-patch.diff
>
>
> Its currently a bit annoying to set a delay by millis and if you need, like 1 hour 30 min period. What is this in millis?
> We should add a TypeConverter for that which has a String notation such as:
> {code}
> 1h30m
> 3h45m25s
> 10m
> 15m20s
> 30s
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.