[jira] [Commented] (CAMEL-11655) Camel-Nagios: Use Encryption enum instead of EncryptionMethod

2017-08-21 Thread Andrea Cosentino (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-11655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16135613#comment-16135613
 ] 

Andrea Cosentino commented on CAMEL-11655:
--

I'll do it.

> Camel-Nagios: Use Encryption enum instead of EncryptionMethod
> -
>
> Key: CAMEL-11655
> URL: https://issues.apache.org/jira/browse/CAMEL-11655
> Project: Camel
>  Issue Type: Task
>  Components: camel-nagios
>Reporter: Andrea Cosentino
>Assignee: Andrea Cosentino
> Fix For: 2.20.0
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (CAMEL-11655) Camel-Nagios: Use Encryption enum instead of EncryptionMethod

2017-08-21 Thread Babak Vahdat (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-11655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16135599#comment-16135599
 ] 

Babak Vahdat commented on CAMEL-11655:
--

{quote}
If this is something critical for you, you can revert commit and do what you 
think is best for this component. It was just an attempt to avoid the death of 
camel-nagios.
{quote}

[~ancosen] LOL it's not critical for me but for the community :-)

I am not convineced by your answers and kindly ask [~davsclaus] & [~lb] to 
share their thoughts about this ticket as well as it's corresponding code 
changes. To summurize:

- The made changes are breaking for the upcoming 2.20.0 _minor_ release if a 
Camel based application already makes use of the {{encryptionMethod}} query 
parameter today in production.
- IMHO Camel should be transparent and not restrict an underlying library API 
just because it seems to be buggy or non-working. Bugs _should_ be resolved by 
the underlying library itself and not _artificially_ through Camel by 
hiding/restricting a given API. See my comments above regarding this point.
- In general, shouldn't we mark a not-recommended-to-be-used Camel API as 
deprecated and encourage users to make use of the right/new API. E.g. as it's 
done when some {{StringHelper}} new utiliy methods were extracted out of 
{{ObjectHelper}} and the corresponding {{ObjectHelper}} methods were marked as 
deprecated, see CAMEL-10389. This would make it much much easier both for Camel 
code base itself as well as user's code to avoid using the legacy API. I guess 
that's exactly what the {{@Deprecated}} annotation good for. I don't seem to 
understand what it would be wrong with such an approach, that's, marking 
{{encryptionMethod}} query parameter as deprecaterd and encourage useres to 
make use of the new {{encryption}} query parameter and then support both of 
them. Supporting both would not break a pre-existing application on the 
production and then we could find and remove the deprecated API by Camel 3 much 
easier.

WDYT?

> Camel-Nagios: Use Encryption enum instead of EncryptionMethod
> -
>
> Key: CAMEL-11655
> URL: https://issues.apache.org/jira/browse/CAMEL-11655
> Project: Camel
>  Issue Type: Task
>  Components: camel-nagios
>Reporter: Andrea Cosentino
>Assignee: Andrea Cosentino
> Fix For: 2.20.0
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (CAMEL-11655) Camel-Nagios: Use Encryption enum instead of EncryptionMethod

2017-08-21 Thread Andrea Cosentino (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-11655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16134846#comment-16134846
 ] 

Andrea Cosentino commented on CAMEL-11655:
--

It's stated here in this thread:

https://groups.google.com/forum/#!msg/jsend-nsca/QI4OUTqzv6w/jNhOC-8z4AwJ

for Blowfish, yes, in case it will be supported we can add another else if 
there. It doesn't make sense to allow all the encryption if most of them don't 
work in nsca.

Marking the NagiosEncryptionMethod as deprecated in my opinion it's not so 
important, it's just an option. If we start to deprecate all the options when 
we upgrade something we will end with a lot of dead code until Camel 3.0 (that 
actually doesn't have an ETA by the way).

If this is something critical for you, you can revert commit and do what you 
think is best for this component. It was just an attempt to avoid the death of 
camel-nagios. 

> Camel-Nagios: Use Encryption enum instead of EncryptionMethod
> -
>
> Key: CAMEL-11655
> URL: https://issues.apache.org/jira/browse/CAMEL-11655
> Project: Camel
>  Issue Type: Task
>  Components: camel-nagios
>Reporter: Andrea Cosentino
>Assignee: Andrea Cosentino
> Fix For: 2.20.0
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (CAMEL-11655) Camel-Nagios: Use Encryption enum instead of EncryptionMethod

2017-08-21 Thread Babak Vahdat (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-11655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16134817#comment-16134817
 ] 

Babak Vahdat commented on CAMEL-11655:
--

[~ancosen] Thanks for your feedback.

Could you please point to the bug report or ticket you're talking about so the 
real rationale behind this jira ticket becomes clear to others. I guess it's 
about this enum:

https://github.com/jsendnsca/jsendnsca/blob/master/src/main/java/com/googlecode/jsendnsca/encryption/Encryption.java

IMHO we should not restrict the API only to those three enum members NONE, XOR 
and Triple_Des just because the others don't work. If that's really the case it 
should be resolved on the jsendnsca side and we _should not_ restrict the API 
to only those 3 members just because the others don't work. IMHO Camel should 
be transparent about this. What if the Blowfish encryption gets fixed by the 
next jsendnsca release and we update to that version in Camel? Are we going to 
suddenly allow that Blowfish encryption as well and add another {{else if}} for 
that?

And what do you think about marking {{NagiosEncryptionMethod}} enum as 
deprecated? Does it make sense?

> Camel-Nagios: Use Encryption enum instead of EncryptionMethod
> -
>
> Key: CAMEL-11655
> URL: https://issues.apache.org/jira/browse/CAMEL-11655
> Project: Camel
>  Issue Type: Task
>  Components: camel-nagios
>Reporter: Andrea Cosentino
>Assignee: Andrea Cosentino
> Fix For: 2.20.0
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (CAMEL-11655) Camel-Nagios: Use Encryption enum instead of EncryptionMethod

2017-08-20 Thread Andrea Cosentino (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-11655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16134734#comment-16134734
 ] 

Andrea Cosentino commented on CAMEL-11655:
--

That code portion is needed because currently jsendnsca works only with 
Encryption NONE, XOR and Triple des, the others aren't working.

I guess that we can accept a change like this one is just a minor change to 
align with the new library. So IMO it's not a problem for the end users.

> Camel-Nagios: Use Encryption enum instead of EncryptionMethod
> -
>
> Key: CAMEL-11655
> URL: https://issues.apache.org/jira/browse/CAMEL-11655
> Project: Camel
>  Issue Type: Task
>  Components: camel-nagios
>Reporter: Andrea Cosentino
>Assignee: Andrea Cosentino
> Fix For: 2.20.0
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (CAMEL-11655) Camel-Nagios: Use Encryption enum instead of EncryptionMethod

2017-08-18 Thread Babak Vahdat (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-11655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16133400#comment-16133400
 ] 

Babak Vahdat commented on CAMEL-11655:
--

[~ancosen] IMHO this's a breaking change for the upcoming {{2.20.0}} version as 
the {{encryptionMethod}} query parameter has been simply removed and replaced 
with a new {{encryption}} query parameter, which _would_ break user's code 
making use of this option. AFAIK a minor release should not include any 
breaking changes, right? Shouldn't we better somehow mark {{encryptionMethod}} 
as deprecated and encourage users to make use of the new {{encryption}} 
parameter instead? Other than that some feedback on your made code changes:

What would be wrong to do:
{code}
nagiosSettings.setEncryption(encryption);
{code}

Instead of the following if / else if:
{code}
if (encryption != null) {
  if (Encryption.NONE == encryption) {
nagiosSettings.setEncryption(Encryption.NONE);
  } else if (Encryption.XOR == encryption) {
nagiosSettings.setEncryption(Encryption.XOR);
  } else if (Encryption.TRIPLE_DES == encryption) {
nagiosSettings.setEncryption(Encryption.TRIPLE_DES);
  } else {
throw new IllegalArgumentException("Unknown encryption method: " + 
encryption);
  }
}
{code}

As because:
{code}
private Encryption encryption = Encryption.NONE;
{code}

Also maybe mark the {{NagiosEncryptionMethod}} enum itself as deprecated so we 
don't forget to remove it in Camel 3.

> Camel-Nagios: Use Encryption enum instead of EncryptionMethod
> -
>
> Key: CAMEL-11655
> URL: https://issues.apache.org/jira/browse/CAMEL-11655
> Project: Camel
>  Issue Type: Task
>  Components: camel-nagios
>Reporter: Andrea Cosentino
>Assignee: Andrea Cosentino
> Fix For: 2.20.0
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)