Commit 3cd2d088 authored by Andre Freyssinet's avatar Andre Freyssinet

JMQ-229: Allows to update the administrator password using the

configuration update.
parent eca8b322
......@@ -333,17 +333,15 @@ public final class AdminTopic extends Topic implements AdminTopicMBean {
Identity identity = adminNot.getIdentity();
try {
//identity.validate();
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG,
"AdminTopic store identity = " + identity);
logger.log(BasicLevel.DEBUG, "AdminTopic store administrator identity = " + identity);
usersTable.put(identity.getUserName(), identity);
proxiesTable.put(identity.getUserName(), adminNot.getProxyId());
clients.put(adminNot.getProxyId(), new Integer(READWRITE));
if (adminNot.getProxyId() != null) {
// It's the first boot, registers the administrator proxy
proxiesTable.put(identity.getUserName(), adminNot.getProxyId());
clients.put(adminNot.getProxyId(), new Integer(READWRITE));
}
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG,
identity.getUserName() + " successfully set as admin client.");
......@@ -383,7 +381,7 @@ public final class AdminTopic extends Topic implements AdminTopicMBean {
not.Return(proxyId);
} catch (Exception exc) {
logger.log(BasicLevel.ERROR,
"AdminTopic.handleGetProxyIdNot " + not.getIdentity(), exc);
"AdminTopic.handleGetProxyIdNot " + not.getIdentity());
not.Throw(exc);
}
}
......@@ -946,8 +944,7 @@ public final class AdminTopic extends Topic implements AdminTopicMBean {
*/
private void doProcess(UpdateUser request,
AgentId replyTo,
String msgId)
throws RequestException, UnknownServerException {
String msgId) throws RequestException, UnknownServerException {
String name = request.getUserName();
AgentId proxId = AgentId.fromString(request.getProxId());
......@@ -1917,6 +1914,16 @@ public final class AdminTopic extends Topic implements AdminTopicMBean {
Channel.sendTo(getId(), createNot);
}
// /**
// * {@inheritDoc}
// */
// @Override
// public void updatePassword(String user, String passwd,
// String newpasswd) throws Exception {
//
// }
/**
* {@inheritDoc}
*/
......@@ -2163,5 +2170,4 @@ public final class AdminTopic extends Topic implements AdminTopicMBean {
}
return desc;
}
}
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2006 - 2010 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
package org.objectweb.joram.mom.dest;
import org.objectweb.joram.shared.security.SimpleIdentity;
public interface AdminTopicMBean extends TopicMBean {
/**
* Creates a new topic on the selected server.
*
* @param name
* the topic name
* @param topicClassName
* the topic class to instantiate
* @param serverId
* the server where the topic will be deployed
*/
public void createTopic(String name, String topicClassName, int serverId);
/**
* Creates a new topic on the selected server. The topic will be an instance
* of {@link Topic}.
*
* @param name
* the topic name
* @param serverId
* the server where the topic will be deployed
*/
public void createTopic(String name, int serverId);
/**
* Creates a new topic on the local server.
*
* @param name
* the topic name
*/
public void createTopic(String name);
/**
* Creates a new queue on the selected server.
*
* @param name
* the topic name
* @param queueClassName
* the queue class to instantiate
* @param serverId
* the server where the queue will be deployed
*/
public void createQueue(String name, String queueClassName, int serverId);
/**
* Creates a new queue on the selected server. The queue will be an instance
* of {@link Queue}.
*
* @param name
* the topic name
* @param serverId
* the server where the queue will be deployed
*/
public void createQueue(String name, int serverId);
/**
* Creates a new queue on the local server.
*
* @param name
* the queue name
*/
public void createQueue(String name);
/**
* Creates a new user on the selected server.
*
* @param user
* the user name
* @param passwd
* the user password
* @param serverId
* the server where the user will be created
* @param identityClassName
* the identity class name to instantiate
*/
public void createUser(String user, String passwd, int serverId, String identityClassName) throws Exception;
/**
* Creates a new user on the selected server. {@link SimpleIdentity} class is
* used.
*
* @param user
* the user name
* @param passwd
* the user password
* @param serverId
* the server where the user will be created
*/
public void createUser(String user, String passwd, int serverId) throws Exception;
/**
* Creates a new user on the local server. {@link SimpleIdentity} class is
* used.
*
* @param user
* the user name
* @param passwd
* the user password
*/
public void createUser(String user, String passwd) throws Exception;
}
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2006 - 2010 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
package org.objectweb.joram.mom.dest;
import org.objectweb.joram.shared.security.SimpleIdentity;
public interface AdminTopicMBean extends TopicMBean {
/**
* Creates a new topic on the selected server.
*
* @param name
* the topic name
* @param topicClassName
* the topic class to instantiate
* @param serverId
* the server where the topic will be deployed
*/
public void createTopic(String name, String topicClassName, int serverId);
/**
* Creates a new topic on the selected server. The topic will be an instance
* of {@link Topic}.
*
* @param name
* the topic name
* @param serverId
* the server where the topic will be deployed
*/
public void createTopic(String name, int serverId);
/**
* Creates a new topic on the local server.
*
* @param name
* the topic name
*/
public void createTopic(String name);
/**
* Creates a new queue on the selected server.
*
* @param name
* the topic name
* @param queueClassName
* the queue class to instantiate
* @param serverId
* the server where the queue will be deployed
*/
public void createQueue(String name, String queueClassName, int serverId);
/**
* Creates a new queue on the selected server. The queue will be an instance
* of {@link Queue}.
*
* @param name
* the topic name
* @param serverId
* the server where the queue will be deployed
*/
public void createQueue(String name, int serverId);
/**
* Creates a new queue on the local server.
*
* @param name
* the queue name
*/
public void createQueue(String name);
/**
* Creates a new user on the selected server.
*
* @param user
* the user name
* @param passwd
* the user password
* @param serverId
* the server where the user will be created
* @param identityClassName
* the identity class name to instantiate
*/
public void createUser(String user, String passwd, int serverId, String identityClassName) throws Exception;
/**
* Creates a new user on the selected server. {@link SimpleIdentity} class is
* used.
*
* @param user
* the user name
* @param passwd
* the user password
* @param serverId
* the server where the user will be created
*/
public void createUser(String user, String passwd, int serverId) throws Exception;
/**
* Creates a new user on the local server. {@link SimpleIdentity} class is
* used.
*
* @param user the user name
* @param passwd the user password
*/
public void createUser(String user, String passwd) throws Exception;
// /**
// * Updates the password of the specified user.
// *
// * @param user the user name
// * @param passwd the user password
// * @param newpasswd the new password
// */
// public void updatePassword(String user, String passwd, String newpasswd) throws Exception;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment