You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by David BERNARD <dw...@freesurf.fr> on 2002/10/22 23:31:22 UTC

[VFS] PropertiesValueSetter

> > > +1.  Any thoughts on how the provider might get hold of the user's
> > > authentication info (usernames, passwords, certs, etc)?
> > Encoding this stuff
> > > in the url is ok as a convenience, but isn't a very good
> > general solution.
> > > I guess we need some kind of authentication provider that can
> > be handed to
> > > the ssh provider; Something that the ftp, smb, dav, whatever
> > providers can
> > > also make use of.
> >
> > I think about a call back Interface, call by provider to required
any
> > information (String). The user application provide implementation
for
> > this Interface (automatic answer, swing dialog box,...).
> > like :
> >
> > public interface Replier {
> >
> >   public void needProperties(Property[] properties) throws
Exception;
> > }
> >
> > public class Property {
> >   public String name;
> >   public String value;
> >   public String defaultValue;
> > }
> >
> > name and defaultValue are set by FSProvider before call
needProperties.
> > value are set by Replier implementation.
> >
> > Your opinion ?
> 
> That looks fine.  We'll need to come up with a naming scheme for
> common properties like the username for a particular
> protocol+hostname(+port), and
> a password for a particular username+protocol+hostname.

user.login, user.password,

> I guess another option could be to subclass Property with
> classes that provide this info to
> the Replier.

I think, my write was bad (like my english).

Replier is a bad name, I propose PropertiesValueSetter :

--
package org.apache.commons.vfs;

/**
 * Interface call by FileSystem(Provider) when it needs informations.
 * This interface is a gateway, used by VFS to request information to
 * user application.
 * So the user application provide implementation for this Interface
 * (automatic answer, swing dialog box,...).
 */
public interface PropertiesValueSetter {

    /**
     * Method call by FileSystem(Provider) to request properties.
     * Property's value is set by this method.
     * Property's name and defaultValue were set by caller.
     *
     * @param fs FileSystem fo which properties are needs.
     * @param message optionnal message used by
     *        fs to describe needs (for end-user).
     * @param prop Array of requested properties (inout)
     * @exception Exception if problem.
     */
    public void setProperties(FileSystem fs,
                              String message,
                              Property[] prop) throws Exception ;
}

--
package org.apache.commons.vfs;

/**
 * Data structure used to store request part
 * (name, defaultValue) and the answser part (value)
 * of property.
 *
 * predefine names are :
 * <ul>
 *   <li>user.login : when login connexion is needed.</li>
 *   <li>user.password : when password connexion is needed.</li>
 * </ul>
 */
public class Property {
    public String name;
    public String value;
    public String defaultValue;
}
--

-- 
*---------------------------------------------------------*
| Contrary to popular belief, UNIX is user-friendly. It   |
| just happens to be selective on who it makes friendship |
| with.                                                   |
|                       - Richard Cook                    |
*---------------------------------------------------------*


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [VFS] PropertiesValueSetter

Posted by Adam Murdoch <ad...@apache.org>.
That looks good.  Passing the FileSystem to setProperties() is better idea
than trying to guess it from a propery name or whatever.


Adam

> -----Original Message-----
> From: David BERNARD [mailto:dwayne@freesurf.fr]
> Sent: Wednesday, 23 October 2002 7:31 AM
> To: Jakarta Commons Developers List
> Subject: [VFS] PropertiesValueSetter
>
>
> > > > +1.  Any thoughts on how the provider might get hold of the user's
> > > > authentication info (usernames, passwords, certs, etc)?
> > > Encoding this stuff
> > > > in the url is ok as a convenience, but isn't a very good
> > > general solution.
> > > > I guess we need some kind of authentication provider that can
> > > be handed to
> > > > the ssh provider; Something that the ftp, smb, dav, whatever
> > > providers can
> > > > also make use of.
> > >
> > > I think about a call back Interface, call by provider to required
> any
> > > information (String). The user application provide implementation
> for
> > > this Interface (automatic answer, swing dialog box,...).
> > > like :
> > >
> > > public interface Replier {
> > >
> > >   public void needProperties(Property[] properties) throws
> Exception;
> > > }
> > >
> > > public class Property {
> > >   public String name;
> > >   public String value;
> > >   public String defaultValue;
> > > }
> > >
> > > name and defaultValue are set by FSProvider before call
> needProperties.
> > > value are set by Replier implementation.
> > >
> > > Your opinion ?
> >
> > That looks fine.  We'll need to come up with a naming scheme for
> > common properties like the username for a particular
> > protocol+hostname(+port), and
> > a password for a particular username+protocol+hostname.
>
> user.login, user.password,
>
> > I guess another option could be to subclass Property with
> > classes that provide this info to
> > the Replier.
>
> I think, my write was bad (like my english).
>
> Replier is a bad name, I propose PropertiesValueSetter :
>
> --
> package org.apache.commons.vfs;
>
> /**
>  * Interface call by FileSystem(Provider) when it needs informations.
>  * This interface is a gateway, used by VFS to request information to
>  * user application.
>  * So the user application provide implementation for this Interface
>  * (automatic answer, swing dialog box,...).
>  */
> public interface PropertiesValueSetter {
>
>     /**
>      * Method call by FileSystem(Provider) to request properties.
>      * Property's value is set by this method.
>      * Property's name and defaultValue were set by caller.
>      *
>      * @param fs FileSystem fo which properties are needs.
>      * @param message optionnal message used by
>      *        fs to describe needs (for end-user).
>      * @param prop Array of requested properties (inout)
>      * @exception Exception if problem.
>      */
>     public void setProperties(FileSystem fs,
>                               String message,
>                               Property[] prop) throws Exception ;
> }
>
> --
> package org.apache.commons.vfs;
>
> /**
>  * Data structure used to store request part
>  * (name, defaultValue) and the answser part (value)
>  * of property.
>  *
>  * predefine names are :
>  * <ul>
>  *   <li>user.login : when login connexion is needed.</li>
>  *   <li>user.password : when password connexion is needed.</li>
>  * </ul>
>  */
> public class Property {
>     public String name;
>     public String value;
>     public String defaultValue;
> }
> --
>
> --
> *---------------------------------------------------------*
> | Contrary to popular belief, UNIX is user-friendly. It   |
> | just happens to be selective on who it makes friendship |
> | with.                                                   |
> |                       - Richard Cook                    |
> *---------------------------------------------------------*
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>