You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Mário Homem (JIRA)" <ji...@apache.org> on 2010/10/15 18:02:40 UTC
[jira] Created: (CAMEL-3237) XmppEndPoint - setting login to false
when creating an account results in no action
XmppEndPoint - setting login to false when creating an account results in no action
-----------------------------------------------------------------------------------
Key: CAMEL-3237
URL: https://issues.apache.org/activemq/browse/CAMEL-3237
Project: Apache Camel
Issue Type: Bug
Components: camel-xmpp
Affects Versions: 2.4.0
Reporter: Mário Homem
XmppEndPoint myXmppEndPoint = new XmppEndPoint();
(...)
myXmppEndPoint.setCreateAccount(true);
myXmppEndPoint .setLogin(false);
(...)
This will result in "no action" in xmpp server, if setLogin true the account is created and the user stays online.
I believe it's because of the logic used in createConnection() method of XmppEndPoint that could be changed to:
if (!connection.isAuthenticated()) {
if (user != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Logging in to XMPP as user: " + user + " on connection: " + getConnectionMessage(connection));
}
if (password == null) {
LOG.warn("No password configured for user: " + user + " on connection: " + getConnectionMessage(connection));
}
if (createAccount) {
AccountManager accountManager = new AccountManager(connection);
accountManager.createAccount(user, password);
}
if(login){
if (resource != null) {
connection.login(user, password, resource);
} else {
connection.login(user, password);
}
}
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("Logging in anonymously to XMPP on connection: " + getConnectionMessage(connection));
}
connection.loginAnonymously();
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-3237) XmppEndPoint - setting login to
false when creating an account results in no action
Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-3237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62634#action_62634 ]
Jean-Baptiste Onofré commented on CAMEL-3237:
---------------------------------------------
I reproduce the issue.
createAccount shouldn't be affected by the login attribute.
I submit a patch in that way.
> XmppEndPoint - setting login to false when creating an account results in no action
> -----------------------------------------------------------------------------------
>
> Key: CAMEL-3237
> URL: https://issues.apache.org/activemq/browse/CAMEL-3237
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-xmpp
> Affects Versions: 2.4.0
> Reporter: Mário Homem
> Attachments: CAMEL-3237.patch
>
> Original Estimate: 15 minutes
> Remaining Estimate: 15 minutes
>
> {code}
> XmppEndPoint myXmppEndPoint = new XmppEndPoint();
> (...)
> myXmppEndPoint.setCreateAccount(true);
> myXmppEndPoint .setLogin(false);
> (...)
> {code}
> This will result in "no action" in xmpp server, if setLogin true the account is created and the user stays online.
> I believe it's because of the logic used in createConnection() method of XmppEndPoint that could be changed to:
> {code}
> if (!connection.isAuthenticated()) {
> if (user != null) {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in to XMPP as user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (password == null) {
> LOG.warn("No password configured for user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (createAccount) {
> AccountManager accountManager = new AccountManager(connection);
> accountManager.createAccount(user, password);
> }
> if(login){
> if (resource != null) {
> connection.login(user, password, resource);
> } else {
> connection.login(user, password);
> }
> }
> } else {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in anonymously to XMPP on connection: " + getConnectionMessage(connection));
> }
> connection.loginAnonymously();
> }
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-3237) XmppEndPoint - setting login to
false when creating an account results in no action
Posted by "Mário Homem (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-3237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62641#action_62641 ]
Mário Homem commented on CAMEL-3237:
------------------------------------
Hi,
Ok Jean the patch resolves the issue.
Claus thanks for the tip about "code snippet".
> XmppEndPoint - setting login to false when creating an account results in no action
> -----------------------------------------------------------------------------------
>
> Key: CAMEL-3237
> URL: https://issues.apache.org/activemq/browse/CAMEL-3237
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-xmpp
> Affects Versions: 2.4.0
> Reporter: Mário Homem
> Attachments: CAMEL-3237.patch
>
> Original Estimate: 15 minutes
> Remaining Estimate: 15 minutes
>
> {code}
> XmppEndPoint myXmppEndPoint = new XmppEndPoint();
> (...)
> myXmppEndPoint.setCreateAccount(true);
> myXmppEndPoint .setLogin(false);
> (...)
> {code}
> This will result in "no action" in xmpp server, if setLogin true the account is created and the user stays online.
> I believe it's because of the logic used in createConnection() method of XmppEndPoint that could be changed to:
> {code}
> if (!connection.isAuthenticated()) {
> if (user != null) {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in to XMPP as user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (password == null) {
> LOG.warn("No password configured for user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (createAccount) {
> AccountManager accountManager = new AccountManager(connection);
> accountManager.createAccount(user, password);
> }
> if(login){
> if (resource != null) {
> connection.login(user, password, resource);
> } else {
> connection.login(user, password);
> }
> }
> } else {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in anonymously to XMPP on connection: " + getConnectionMessage(connection));
> }
> connection.loginAnonymously();
> }
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAMEL-3237) XmppEndPoint - setting login to false
when creating an account results in no action
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-3237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-3237:
-------------------------------
Description:
{code}
XmppEndPoint myXmppEndPoint = new XmppEndPoint();
(...)
myXmppEndPoint.setCreateAccount(true);
myXmppEndPoint .setLogin(false);
(...)
{code}
This will result in "no action" in xmpp server, if setLogin true the account is created and the user stays online.
I believe it's because of the logic used in createConnection() method of XmppEndPoint that could be changed to:
{code}
if (!connection.isAuthenticated()) {
if (user != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Logging in to XMPP as user: " + user + " on connection: " + getConnectionMessage(connection));
}
if (password == null) {
LOG.warn("No password configured for user: " + user + " on connection: " + getConnectionMessage(connection));
}
if (createAccount) {
AccountManager accountManager = new AccountManager(connection);
accountManager.createAccount(user, password);
}
if(login){
if (resource != null) {
connection.login(user, password, resource);
} else {
connection.login(user, password);
}
}
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("Logging in anonymously to XMPP on connection: " + getConnectionMessage(connection));
}
connection.loginAnonymously();
}
{code}
was:
XmppEndPoint myXmppEndPoint = new XmppEndPoint();
(...)
myXmppEndPoint.setCreateAccount(true);
myXmppEndPoint .setLogin(false);
(...)
This will result in "no action" in xmpp server, if setLogin true the account is created and the user stays online.
I believe it's because of the logic used in createConnection() method of XmppEndPoint that could be changed to:
if (!connection.isAuthenticated()) {
if (user != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Logging in to XMPP as user: " + user + " on connection: " + getConnectionMessage(connection));
}
if (password == null) {
LOG.warn("No password configured for user: " + user + " on connection: " + getConnectionMessage(connection));
}
if (createAccount) {
AccountManager accountManager = new AccountManager(connection);
accountManager.createAccount(user, password);
}
if(login){
if (resource != null) {
connection.login(user, password, resource);
} else {
connection.login(user, password);
}
}
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("Logging in anonymously to XMPP on connection: " + getConnectionMessage(connection));
}
connection.loginAnonymously();
}
Added code snippet to easier read the code
> XmppEndPoint - setting login to false when creating an account results in no action
> -----------------------------------------------------------------------------------
>
> Key: CAMEL-3237
> URL: https://issues.apache.org/activemq/browse/CAMEL-3237
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-xmpp
> Affects Versions: 2.4.0
> Reporter: Mário Homem
> Original Estimate: 15 minutes
> Remaining Estimate: 15 minutes
>
> {code}
> XmppEndPoint myXmppEndPoint = new XmppEndPoint();
> (...)
> myXmppEndPoint.setCreateAccount(true);
> myXmppEndPoint .setLogin(false);
> (...)
> {code}
> This will result in "no action" in xmpp server, if setLogin true the account is created and the user stays online.
> I believe it's because of the logic used in createConnection() method of XmppEndPoint that could be changed to:
> {code}
> if (!connection.isAuthenticated()) {
> if (user != null) {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in to XMPP as user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (password == null) {
> LOG.warn("No password configured for user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (createAccount) {
> AccountManager accountManager = new AccountManager(connection);
> accountManager.createAccount(user, password);
> }
> if(login){
> if (resource != null) {
> connection.login(user, password, resource);
> } else {
> connection.login(user, password);
> }
> }
> } else {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in anonymously to XMPP on connection: " + getConnectionMessage(connection));
> }
> connection.loginAnonymously();
> }
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (CAMEL-3237) XmppEndPoint - setting login to false
when creating an account results in no action
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-3237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen reassigned CAMEL-3237:
----------------------------------
Assignee: Claus Ibsen
> XmppEndPoint - setting login to false when creating an account results in no action
> -----------------------------------------------------------------------------------
>
> Key: CAMEL-3237
> URL: https://issues.apache.org/activemq/browse/CAMEL-3237
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-xmpp
> Affects Versions: 2.4.0
> Reporter: Mário Homem
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 2.6.0
>
> Attachments: CAMEL-3237.patch
>
> Original Estimate: 15 minutes
> Remaining Estimate: 15 minutes
>
> {code}
> XmppEndPoint myXmppEndPoint = new XmppEndPoint();
> (...)
> myXmppEndPoint.setCreateAccount(true);
> myXmppEndPoint .setLogin(false);
> (...)
> {code}
> This will result in "no action" in xmpp server, if setLogin true the account is created and the user stays online.
> I believe it's because of the logic used in createConnection() method of XmppEndPoint that could be changed to:
> {code}
> if (!connection.isAuthenticated()) {
> if (user != null) {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in to XMPP as user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (password == null) {
> LOG.warn("No password configured for user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (createAccount) {
> AccountManager accountManager = new AccountManager(connection);
> accountManager.createAccount(user, password);
> }
> if(login){
> if (resource != null) {
> connection.login(user, password, resource);
> } else {
> connection.login(user, password);
> }
> }
> } else {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in anonymously to XMPP on connection: " + getConnectionMessage(connection));
> }
> connection.loginAnonymously();
> }
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (CAMEL-3237) XmppEndPoint - setting login to false
when creating an account results in no action
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-3237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-3237.
--------------------------------
Resolution: Fixed
trunk: 1033904.
Thanks for the patch.
> XmppEndPoint - setting login to false when creating an account results in no action
> -----------------------------------------------------------------------------------
>
> Key: CAMEL-3237
> URL: https://issues.apache.org/activemq/browse/CAMEL-3237
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-xmpp
> Affects Versions: 2.4.0
> Reporter: Mário Homem
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 2.6.0
>
> Attachments: CAMEL-3237.patch
>
> Original Estimate: 15 minutes
> Remaining Estimate: 15 minutes
>
> {code}
> XmppEndPoint myXmppEndPoint = new XmppEndPoint();
> (...)
> myXmppEndPoint.setCreateAccount(true);
> myXmppEndPoint .setLogin(false);
> (...)
> {code}
> This will result in "no action" in xmpp server, if setLogin true the account is created and the user stays online.
> I believe it's because of the logic used in createConnection() method of XmppEndPoint that could be changed to:
> {code}
> if (!connection.isAuthenticated()) {
> if (user != null) {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in to XMPP as user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (password == null) {
> LOG.warn("No password configured for user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (createAccount) {
> AccountManager accountManager = new AccountManager(connection);
> accountManager.createAccount(user, password);
> }
> if(login){
> if (resource != null) {
> connection.login(user, password, resource);
> } else {
> connection.login(user, password);
> }
> }
> } else {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in anonymously to XMPP on connection: " + getConnectionMessage(connection));
> }
> connection.loginAnonymously();
> }
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-3237) XmppEndPoint - setting login to
false when creating an account results in no action
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-3237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62626#action_62626 ]
Claus Ibsen commented on CAMEL-3237:
------------------------------------
What is it you suggest to be changed in the code?
> XmppEndPoint - setting login to false when creating an account results in no action
> -----------------------------------------------------------------------------------
>
> Key: CAMEL-3237
> URL: https://issues.apache.org/activemq/browse/CAMEL-3237
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-xmpp
> Affects Versions: 2.4.0
> Reporter: Mário Homem
> Original Estimate: 15 minutes
> Remaining Estimate: 15 minutes
>
> XmppEndPoint myXmppEndPoint = new XmppEndPoint();
> (...)
> myXmppEndPoint.setCreateAccount(true);
> myXmppEndPoint .setLogin(false);
> (...)
> This will result in "no action" in xmpp server, if setLogin true the account is created and the user stays online.
> I believe it's because of the logic used in createConnection() method of XmppEndPoint that could be changed to:
> if (!connection.isAuthenticated()) {
> if (user != null) {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in to XMPP as user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (password == null) {
> LOG.warn("No password configured for user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (createAccount) {
> AccountManager accountManager = new AccountManager(connection);
> accountManager.createAccount(user, password);
> }
> if(login){
> if (resource != null) {
> connection.login(user, password, resource);
> } else {
> connection.login(user, password);
> }
> }
> } else {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in anonymously to XMPP on connection: " + getConnectionMessage(connection));
> }
> connection.loginAnonymously();
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAMEL-3237) XmppEndPoint - setting login to false
when creating an account results in no action
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-3237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-3237:
-------------------------------
Priority: Minor (was: Major)
Fix Version/s: 2.6.0
> XmppEndPoint - setting login to false when creating an account results in no action
> -----------------------------------------------------------------------------------
>
> Key: CAMEL-3237
> URL: https://issues.apache.org/activemq/browse/CAMEL-3237
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-xmpp
> Affects Versions: 2.4.0
> Reporter: Mário Homem
> Priority: Minor
> Fix For: 2.6.0
>
> Attachments: CAMEL-3237.patch
>
> Original Estimate: 15 minutes
> Remaining Estimate: 15 minutes
>
> {code}
> XmppEndPoint myXmppEndPoint = new XmppEndPoint();
> (...)
> myXmppEndPoint.setCreateAccount(true);
> myXmppEndPoint .setLogin(false);
> (...)
> {code}
> This will result in "no action" in xmpp server, if setLogin true the account is created and the user stays online.
> I believe it's because of the logic used in createConnection() method of XmppEndPoint that could be changed to:
> {code}
> if (!connection.isAuthenticated()) {
> if (user != null) {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in to XMPP as user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (password == null) {
> LOG.warn("No password configured for user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (createAccount) {
> AccountManager accountManager = new AccountManager(connection);
> accountManager.createAccount(user, password);
> }
> if(login){
> if (resource != null) {
> connection.login(user, password, resource);
> } else {
> connection.login(user, password);
> }
> }
> } else {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in anonymously to XMPP on connection: " + getConnectionMessage(connection));
> }
> connection.loginAnonymously();
> }
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAMEL-3237) XmppEndPoint - setting login to false
when creating an account results in no action
Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-3237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jean-Baptiste Onofré updated CAMEL-3237:
----------------------------------------
Attachment: CAMEL-3237.patch
> XmppEndPoint - setting login to false when creating an account results in no action
> -----------------------------------------------------------------------------------
>
> Key: CAMEL-3237
> URL: https://issues.apache.org/activemq/browse/CAMEL-3237
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-xmpp
> Affects Versions: 2.4.0
> Reporter: Mário Homem
> Attachments: CAMEL-3237.patch
>
> Original Estimate: 15 minutes
> Remaining Estimate: 15 minutes
>
> {code}
> XmppEndPoint myXmppEndPoint = new XmppEndPoint();
> (...)
> myXmppEndPoint.setCreateAccount(true);
> myXmppEndPoint .setLogin(false);
> (...)
> {code}
> This will result in "no action" in xmpp server, if setLogin true the account is created and the user stays online.
> I believe it's because of the logic used in createConnection() method of XmppEndPoint that could be changed to:
> {code}
> if (!connection.isAuthenticated()) {
> if (user != null) {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in to XMPP as user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (password == null) {
> LOG.warn("No password configured for user: " + user + " on connection: " + getConnectionMessage(connection));
> }
> if (createAccount) {
> AccountManager accountManager = new AccountManager(connection);
> accountManager.createAccount(user, password);
> }
> if(login){
> if (resource != null) {
> connection.login(user, password, resource);
> } else {
> connection.login(user, password);
> }
> }
> } else {
> if (LOG.isDebugEnabled()) {
> LOG.debug("Logging in anonymously to XMPP on connection: " + getConnectionMessage(connection));
> }
> connection.loginAnonymously();
> }
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.