james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernd Fondermann" <bernd.fonderm...@googlemail.com>
Subject Re: svn commit: r446879 - in /james/server/trunk/src/java/org/apache/james: James.java JamesMBean.java core/LocalUsersRepository.java userrepository/DefaultJamesUser.java
Date Sun, 17 Sep 2006 13:52:05 GMT
JamesMBean: can't we simply drop it in trunk? it was a stub and is no
longer needed.

  Bernd

On 9/16/06, bago@apache.org <bago@apache.org> wrote:
> Author: bago
> Date: Sat Sep 16 07:43:53 2006
> New Revision: 446879
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=446879
> Log:
> The previously deprecated JamesMBean is now implemented by LocalUsersRepository service
> Now James.addUser is there only to satisfy the deprecated MailServer.addUser method and
does no more has references to DefaultJamesUser (but simply delegates to LocalUsersRepository.addUser)
> DefaultJamesUsers initializes itself automatically in the constructor (don't know why
is was Initializable)
>
> Modified:
>     james/server/trunk/src/java/org/apache/james/James.java
>     james/server/trunk/src/java/org/apache/james/JamesMBean.java
>     james/server/trunk/src/java/org/apache/james/core/LocalUsersRepository.java
>     james/server/trunk/src/java/org/apache/james/userrepository/DefaultJamesUser.java
>
> Modified: james/server/trunk/src/java/org/apache/james/James.java
> URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/James.java?view=diff&rev=446879&r1=446878&r2=446879
> ==============================================================================
> --- james/server/trunk/src/java/org/apache/james/James.java (original)
> +++ james/server/trunk/src/java/org/apache/james/James.java Sat Sep 16 07:43:53 2006
> @@ -50,7 +50,6 @@
>  import org.apache.james.services.UsersRepository;
>  import org.apache.james.services.UsersStore;
>  import org.apache.james.transport.mailets.LocalDelivery;
> -import org.apache.james.userrepository.DefaultJamesUser;
>  import org.apache.mailet.Mail;
>  import org.apache.mailet.MailAddress;
>  import org.apache.mailet.Mailet;
> @@ -92,7 +91,7 @@
>   */
>  public class James
>      extends AbstractLogEnabled
> -    implements Contextualizable, Serviceable, Configurable, JamesMBean, Initializable,
MailServer, MailetContext {
> +    implements Contextualizable, Serviceable, Configurable, Initializable, MailServer,
MailetContext {
>
>      /**
>       * The software name and version
> @@ -126,11 +125,6 @@
>      private Store store;
>
>      /**
> -     * The store containing the local user repository.
> -     */
> -    private UsersStore usersStore;
> -
> -    /**
>       * The spool used for processing mail handled by this server.
>       */
>      private SpoolRepository spool;
> @@ -286,8 +280,10 @@
>          }
>
>          try {
> +            // lookup the usersStore.
> +            // This is not used by James itself, but we check we received it here
> +            // because mailets will try to lookup this later.
>              UsersStore usersStore = (UsersStore) compMgr.lookup( UsersStore.ROLE );
> -            setUsersStore(usersStore);
>              if (getLogger().isDebugEnabled()) {
>                  getLogger().debug("Using UsersStore: " + usersStore.toString());
>              }
> @@ -418,10 +414,6 @@
>          this.spool = spool;
>      }
>
> -    public void setUsersStore(UsersStore usersStore) {
> -        this.usersStore = usersStore;
> -    }
> -
>      public void setLocalusers(UsersRepository localusers) {
>          this.localusers = localusers;
>      }
> @@ -871,12 +863,7 @@
>       * use the addUser of the usersRepository.
>       */
>      public boolean addUser(String userName, String password) {
> -        boolean success;
> -        DefaultJamesUser user = new DefaultJamesUser(userName, "SHA");
> -        user.setPassword(password);
> -        user.initialize();
> -        success = localusers.addUser(user);
> -        return success;
> +        return localusers.addUser(userName, password);
>      }
>
>      /**
>
> Modified: james/server/trunk/src/java/org/apache/james/JamesMBean.java
> URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/JamesMBean.java?view=diff&rev=446879&r1=446878&r2=446879
> ==============================================================================
> --- james/server/trunk/src/java/org/apache/james/JamesMBean.java (original)
> +++ james/server/trunk/src/java/org/apache/james/JamesMBean.java Sat Sep 16 07:43:53
2006
> @@ -25,6 +25,9 @@
>   * An interface to expose James management functionality through JMX.  At
>   * the time of this writing, this interface is just an example.
>   *
> + * 16/09/2006: This was previously implemented by James object. Now it is temporarily
> + *             implemented by the LocalUsersRepository service.
> + *
>   * @deprecated this MBean will be replaced by UserManagementMBean
>   * @phoenix:mx-topic name="MainJAMESServerManagement"
>   */
>
> Modified: james/server/trunk/src/java/org/apache/james/core/LocalUsersRepository.java
> URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/core/LocalUsersRepository.java?view=diff&rev=446879&r1=446878&r2=446879
> ==============================================================================
> --- james/server/trunk/src/java/org/apache/james/core/LocalUsersRepository.java (original)
> +++ james/server/trunk/src/java/org/apache/james/core/LocalUsersRepository.java Sat Sep
16 07:43:53 2006
> @@ -17,21 +17,24 @@
>   * under the License.                                           *
>   ****************************************************************/
>
> -
> -
>  package org.apache.james.core;
>
>  import org.apache.avalon.framework.activity.Initializable;
>  import org.apache.avalon.framework.service.ServiceException;
>  import org.apache.avalon.framework.service.ServiceManager;
>  import org.apache.avalon.framework.service.Serviceable;
> +import org.apache.james.JamesMBean;
>  import org.apache.james.services.User;
>  import org.apache.james.services.UsersRepository;
>  import org.apache.james.services.UsersStore;
>
>  import java.util.Iterator;
>
> -public class LocalUsersRepository implements UsersRepository, Serviceable, Initializable
{
> +/**
> + * Provide access to the default "LocalUsers" UsersRepository.
> + * Temporarily implements JamesMBean (formerly implemented by James) to keep backward
compatibility.
> + */
> +public class LocalUsersRepository implements UsersRepository, Serviceable, Initializable,
JamesMBean {
>
>      private UsersStore usersStore;
>      private UsersRepository users;
>
> Modified: james/server/trunk/src/java/org/apache/james/userrepository/DefaultJamesUser.java
> URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/userrepository/DefaultJamesUser.java?view=diff&rev=446879&r1=446878&r2=446879
> ==============================================================================
> --- james/server/trunk/src/java/org/apache/james/userrepository/DefaultJamesUser.java
(original)
> +++ james/server/trunk/src/java/org/apache/james/userrepository/DefaultJamesUser.java
Sat Sep 16 07:43:53 2006
> @@ -21,7 +21,6 @@
>
>  package org.apache.james.userrepository;
>
> -import org.apache.avalon.framework.activity.Initializable;
>  import org.apache.james.services.JamesUser;
>  import org.apache.mailet.MailAddress;
>
> @@ -34,7 +33,7 @@
>
>  public class DefaultJamesUser
>          extends DefaultUser
> -        implements JamesUser, Initializable {
> +        implements JamesUser {
>
>      /**
>       * Whether forwarding is enabled for this user.
> @@ -59,15 +58,17 @@
>
>      public DefaultJamesUser(String name, String alg) {
>          super(name, alg);
> +        initialize();
>      }
>
>      public DefaultJamesUser(String name, String passwordHash, String hashAlg) {
>          super(name, passwordHash, hashAlg);
> +        initialize();
>      }
>
>
>      /**
> -     * @see org.apache.avalon.framework.activity.Initializable#initialize()
> +     * Initializes default values for local fields.
>       */
>      public void initialize() {
>          forwarding = false;
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message