Regarding the error message, please see issue 11326.
There is a way to add an error message to the @Pattern annotation,
however, I haven't yet figured out how to put the properties file for
the messages into the right JAR file. It has to be accessible from the
thread's class loader, and OSGi isn't setting up the class loader that way.
Tom
On 8/17/2010 12:41 PM, Joe Di Pol wrote:
>
> Bhakti,
>
> Thanks! I may want to have a chat after MS4 for the proper
> way to do some things.
>
> Joe
>
> Bhakti Mehta wrote:
>> Joe,
>> Please read inline
>>
>> Joe Di Pol wrote:
>>>
>>> What is a legal name for a cluster/instance/config/node/etc? Looks
>>> like it is:
>>>
>>> @Pattern(regexp="[\\p{L}\\p{N}_][\\p{L}\\p{N}\\-_./;#]*")
>>>
>>> which seems a bit liberal to me, but maybe that's what was allowed
>>> in v2.
>> Yes this is the pattern which has been used from v2 .
>>>
>>> My questions:
>>>
>>> Other then the above annotation, is there an existing method that can
>>> be used to verify a name is legal?
>> The validation is done through Bean Validation. I dont think there is
>> any other method to verify this. Using bean validations you can
>> write custom validations and constraints. Let me know if you need any
>> info if you are looking for something there.
>>>
>>> Do we want the ability to exclude some reserved words/names? Some of
>>> the v2 documentation mentions you can use certain reserved words.
>>>
>>> Currently the error you get for an illegal name is not very
>>> friendly. Maybe this should be improved:
>>>
>> I can fix that .
>> Regards,
>> Bhakti
>>> $ ./asadmin create-cluster @@@@
>>> remote failure: Exception while adding the new configuration
>>> org.jvnet.hk2.config.TransactionFailure:
>>> org.jvnet.hk2.config.ValidationException: Constraints for this bean
>>> violated.
>>> Message = configRef must match "[\p{L}\p{N}_][\p{L}\p{N}\-_./;#]*"
>>> : org.jvnet.hk2.config.TransactionFailure:
>>> org.jvnet.hk2.config.ValidationException: Constraints for this bean
>>> violated.
>>> Message = configRef must match "[\p{L}\p{N}_][\p{L}\p{N}\-_./;#]*"
>>> org.jvnet.hk2.config.ValidationException: Constraints for this bean
>>> violated. Message = configRef must match
>>> "[\p{L}\p{N}_][\p{L}\p{N}\-_./;#]*"
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>