You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Nicolas Toper <nt...@gmail.com> on 2006/06/25 22:34:04 UTC

Main Entry Point for Backup Tool

Hi,

I am updating the RepositoryImpl class. Here is what it looks like (below).

We have agreed on using In/OutputStream. However, now that I have advanced a
little bit in the code, it raises a problem: I cannot use nio and since it
is huge dataset, I would prefer to use it for performance issue. What do you
think?

Nicolas
my blog! http://www.deviant-abstraction.net !!
    /**
     *
     * This method restores data from an InputStream.
     *
     * @param InputStream savedData: InputStream containing the backup (and
its parameters).
     * @param File workingFolder: the folder used to unzip all data.
     *
     * @throws RestoreException. Generic exception during restore operation.
     *
     * @author: Nicolas Toper <nt...@gmail.com>
     *
     */
    public void restore(InputStream savedData, File workingFolder) throws
RestoreException {

        BackupRepository saveRepo = new BackupRepository(this, savedData,
workingFolder);
        saveRepo.restore();
    }


    /**
     *
     * This method saves from this repository to an OutputStream.
     *
     * @param outputStream out: Outputstream where the backup should be.
     * @param BackupConfig conf: BackupConfig object containing all the
parameters.
     *
     * @throws SavingException. Generic exception during saving operation.
     *
     * @author: Nicolas Toper <nt...@gmail.com>
     *
     */
    public void save(OutputStream out, BackupConfig conf) throws
SavingException{

        conf.init(this);
        BackupRepository saveRepo = (BackupRepository) conf.getBackup();
        saveRepo.save(out, conf);
    }

Re: Main Entry Point for Backup Tool

Posted by Tobias Bocanegra <to...@day.com>.
hi,
i would not use 'save' / 'restore', since those methods already have
different semantics on other occasions. i thought it was discussed,
that the use of inpourt/output streams should be avoided, and that
some sort of I/O context is provided?

regards, toby

On 6/25/06, Nicolas Toper <nt...@gmail.com> wrote:
> Hi,
>
> I am updating the RepositoryImpl class. Here is what it looks like (below).
>
> We have agreed on using In/OutputStream. However, now that I have advanced a
> little bit in the code, it raises a problem: I cannot use nio and since it
> is huge dataset, I would prefer to use it for performance issue. What do you
> think?
>
> Nicolas
> my blog! http://www.deviant-abstraction.net !!
>     /**
>      *
>      * This method restores data from an InputStream.
>      *
>      * @param InputStream savedData: InputStream containing the backup (and
> its parameters).
>      * @param File workingFolder: the folder used to unzip all data.
>      *
>      * @throws RestoreException. Generic exception during restore operation.
>      *
>      * @author: Nicolas Toper <nt...@gmail.com>
>      *
>      */
>     public void restore(InputStream savedData, File workingFolder) throws
> RestoreException {
>
>         BackupRepository saveRepo = new BackupRepository(this, savedData,
> workingFolder);
>         saveRepo.restore();
>     }
>
>
>     /**
>      *
>      * This method saves from this repository to an OutputStream.
>      *
>      * @param outputStream out: Outputstream where the backup should be.
>      * @param BackupConfig conf: BackupConfig object containing all the
> parameters.
>      *
>      * @throws SavingException. Generic exception during saving operation.
>      *
>      * @author: Nicolas Toper <nt...@gmail.com>
>      *
>      */
>     public void save(OutputStream out, BackupConfig conf) throws
> SavingException{
>
>         conf.init(this);
>         BackupRepository saveRepo = (BackupRepository) conf.getBackup();
>         saveRepo.save(out, conf);
>     }
>
>


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: Main Entry Point for Backup Tool

Posted by Jukka Zitting <ju...@gmail.com>.
Jo.

On 6/26/06, Nicolas Toper <nt...@gmail.com> wrote:
> BackupRepository (let's call it like this for now) is a subclass of Backup.
> The naming I have used is BackupResourceNAme, I have for instance
> BackupWorkspace, BackupAllWorkspaces, and so on.
>
> Besides, BackupRepository backup only one repository.
>
> I find this clear.
>
> Do you really think I should call it another name? Jukka?

I agree with Tobias and Felix, it's probably best ot change the name.

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

Re: Main Entry Point for Backup Tool

Posted by Nicolas Toper <nt...@gmail.com>.
Hi,

OK for me. You are right they are better names. I'll correct and post the
patch tonight hopefully (depending on my exams)

Nicolas

On 6/27/06, Felix Meschberger <fm...@gmail.com> wrote:
>
> Hi,
>
> I agree with Toby, that the name is misleading. I suggest that you
> follow the pattern "SpecializationBase"  where "Repository" is the
> specialization of the "Backup". This way you would get
> "RepositoryBackup", "WorkspaceBackup", "AllWorkspaceBackup", which is
> far more understandable.
>
> Regards
> Felix
>
> On 6/26/06, Nicolas Toper <nt...@gmail.com> wrote:
> > BackupRepository (let's call it like this for now) is a subclass of
> Backup.
> > The naming I have used is BackupResourceNAme, I have for instance
> > BackupWorkspace, BackupAllWorkspaces, and so on.
> >
> > Besides, BackupRepository backup only one repository.
> >
> > I find this clear.
> >
> > Do you really think I should call it another name? Jukka?
> >
> > Nicolas
> >
> > On 6/26/06, Tobias Bocanegra <to...@day.com> wrote:
> > >
> > > > 1/ I have added a method called getBackupRepository(BackupConfig
> conf)
> > > in
> > > > RepositoryImpl.
> > >
> > > i find BackupRepository a misleading name. it sounds as if it's a
> > > seperate, backup repository. preferable names are BackupTool, or
> > > BackupManager, or something like this.
> > >
> > > > 2/ OK for backup and restore for naming those methods in
> > > BackupRepository
> > > > and in all others Backup subclasses.
> > >
> > > regards, toby
> > >
> > > >
> > > > Nicolas
> > > >
> > > > On 6/26/06, Tobias Bocanegra <tobias.bocanegra@day.com > wrote:
> > > > >
> > > > > you lost me.... :-)
> > > > >
> > > > > On 6/26/06, Nicolas Toper < ntoper@gmail.com> wrote:
> > > > > > Fine for me. However if we put only a getBackupRepository() in
> > > > > > RepositoryImpl() (  I agree on this, the class is working this
> way
> > > > > already)
> > > > > > , I would use instead backup and restore (BackupRepository
> extend
> > > the
> > > > > Backup
> > > > > > abstract class and I need to have a consistant naming on this
> side
> > > too
> > > > > > please see
> > > > > >
> > >
> http://www.deviant-abstraction.net/wp-content/uploads/2006/06/classdiagram.gif
> > > > >
> > > > > > ).
> > > > > >
> > > > > > Nicolas
> > > > > >
> > > > > > On 6/26/06, Stefan Guggisberg <st...@gmail.com>
> wrote:
> > > > > > >
> > > > > > > On 6/26/06, Nicolas Toper < ntoper@gmail.com> wrote:
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > About the names of the methods, which ones would you
> propose?
> > > > > > >
> > > > > > > off the top of my head, how about:
> > > > > > >
> > > > > > > backupRepository
> > > > > > > restoreRepository
> > > > > > >
> > > > > > > cheers
> > > > > > > stefan
> > > > > > >
> > > > > > > >
> > > > > > > > About the exceptions: some other exceptions can be raised
> and
> > > they
> > > > > will
> > > > > > > all
> > > > > > > > be propagated to this method. I need some specific exception
> to
> > > > > > > encapsulate
> > > > > > > > them all, unless of course, you fill it is better to let
> them as
> > > > > they
> > > > > > > are?
> > > > > > > >
> > > > > > > > The user/password are in the BackupConfig class already. OK
> on
> > > the
> > > > > > > thrown
> > > > > > > > exception.
> > > > > > > >
> > > > > > > >
> > > > > > > > On 6/26/06, Stefan Guggisberg < stefan.guggisberg@gmail.com>
> > > wrote:
> > > > > > > > >
> > > > > > > > > hi nicolas,
> > > > > > > > >
> > > > > > > > > i share tobi's concern regarding the naming of the
> methods.
> > > > > > > > > save and restore are used in other contexts and may cause
> > > > > > > > > confusion.
> > > > > > > > >
> > > > > > > > > some comments regarding the proposed signatures:
> > > > > > > > > - i suggest both methods throw IOException and
> > > > > RepositoryException.
> > > > > > > > >   there's no need for specific SavingException and
> > > > > RestoreException
> > > > > > > > >   as the context is already clear.
> > > > > > > > > - if the methods are goping to be on Repository we'll also
> > > need
> > > > > some
> > > > > > > > >   sort of authentication/authorization. a Credentials
> > > parameter
> > > > > would
> > > > > > > > >   IMO be fine. both methods should also throw
> > > > > AccessDeniedExcpetion.
> > > > > > > > >
> > > > > > > > > cheers
> > > > > > > > > stefan
> > > > > > > > >
> > > > > > > > > On 6/25/06, Nicolas Toper <nt...@gmail.com> wrote:
> > > > > > > > > > Hi,
> > > > > > > > > >
> > > > > > > > > > I am updating the RepositoryImpl class. Here is what it
> > > looks
> > > > > like
> > > > > > > > > (below).
> > > > > > > > > >
> > > > > > > > > > We have agreed on using In/OutputStream. However, now
> that I
> > > > > have
> > > > > > > > > advanced a
> > > > > > > > > > little bit in the code, it raises a problem: I cannot
> use
> > > nio
> > > > > and
> > > > > > > since
> > > > > > > > > it
> > > > > > > > > > is huge dataset, I would prefer to use it for
> performance
> > > issue.
> > > > >
> > > > > > > What do
> > > > > > > > > you
> > > > > > > > > > think?
> > > > > > > > > >
> > > > > > > > > > Nicolas
> > > > > > > > > > my blog! http://www.deviant-abstraction.net !!
> > > > > > > > > >     /**
> > > > > > > > > >      *
> > > > > > > > > >      * This method restores data from an InputStream.
> > > > > > > > > >      *
> > > > > > > > > >      * @param InputStream savedData: InputStream
> containing
> > > the
> > > > > > > backup
> > > > > > > > > (and
> > > > > > > > > > its parameters).
> > > > > > > > > >      * @param File workingFolder: the folder used to
> unzip
> > > all
> > > > > data.
> > > > > > > > > >      *
> > > > > > > > > >      * @throws RestoreException. Generic exception
> during
> > > > > restore
> > > > > > > > > operation.
> > > > > > > > > >      *
> > > > > > > > > >      * @author: Nicolas Toper < ntoper@gmail.com>
> > > > > > > > > >      *
> > > > > > > > > >      */
> > > > > > > > > >     public void restore(InputStream savedData, File
> > > > > workingFolder)
> > > > > > > > > throws
> > > > > > > > > > RestoreException {
> > > > > > > > > >
> > > > > > > > > >         BackupRepository saveRepo = new
> > > BackupRepository(this,
> > > > > > > > > savedData,
> > > > > > > > > > workingFolder);
> > > > > > > > > >         saveRepo.restore();
> > > > > > > > > >     }
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >     /**
> > > > > > > > > >      *
> > > > > > > > > >      * This method saves from this repository to an
> > > > > OutputStream.
> > > > > > > > > >      *
> > > > > > > > > >      * @param outputStream out: Outputstream where the
> > > backup
> > > > > should
> > > > > > > be.
> > > > > > > > > >      * @param BackupConfig conf: BackupConfig object
> > > containing
> > > > > all
> > > > > > > the
> > > > > > > > > > parameters.
> > > > > > > > > >      *
> > > > > > > > > >      * @throws SavingException. Generic exception during
> > > saving
> > > > > > > > > operation.
> > > > > > > > > >      *
> > > > > > > > > >      * @author: Nicolas Toper <nt...@gmail.com>
> > > > > > > > > >      *
> > > > > > > > > >      */
> > > > > > > > > >     public void save(OutputStream out, BackupConfig
> conf)
> > > throws
> > > > > > > > > > SavingException{
> > > > > > > > > >
> > > > > > > > > >         conf.init(this);
> > > > > > > > > >         BackupRepository saveRepo = (BackupRepository)
> > > > > > > conf.getBackup();
> > > > > > > > > >         saveRepo.save(out, conf);
> > > > > > > > > >     }
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > a+
> > > > > > > > Nico
> > > > > > > > my blog! http://www.deviant-abstraction.net !!
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > a+
> > > > > > Nico
> > > > > > my blog! http://www.deviant-abstraction.net !!
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > -----------------------------------------<
> tobias.bocanegra@day.com>---
> > > > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001
> > > Basel
> > > > > T +41 61 226 98 98, F +41 61 226 98 97
> > > > > -----------------------------------------------<
> http://www.day.com>---
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > a+
> > > > Nico
> > > > my blog! http://www.deviant-abstraction.net !!
> > > >
> > > >
> > >
> > >
> > > --
> > > -----------------------------------------< tobias.bocanegra@day.com>---
> > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001
> Basel
> > > T +41 61 226 98 98, F +41 61 226 98 97
> > > -----------------------------------------------< http://www.day.com>---
> > >
> >
> >
> >
> > --
> > a+
> > Nico
> > my blog! http://www.deviant-abstraction.net !!
> >
> >
>



-- 
a+
Nico
my blog! http://www.deviant-abstraction.net !!

Re: Main Entry Point for Backup Tool

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

I agree with Toby, that the name is misleading. I suggest that you
follow the pattern "SpecializationBase"  where "Repository" is the
specialization of the "Backup". This way you would get
"RepositoryBackup", "WorkspaceBackup", "AllWorkspaceBackup", which is
far more understandable.

Regards
Felix

On 6/26/06, Nicolas Toper <nt...@gmail.com> wrote:
> BackupRepository (let's call it like this for now) is a subclass of Backup.
> The naming I have used is BackupResourceNAme, I have for instance
> BackupWorkspace, BackupAllWorkspaces, and so on.
>
> Besides, BackupRepository backup only one repository.
>
> I find this clear.
>
> Do you really think I should call it another name? Jukka?
>
> Nicolas
>
> On 6/26/06, Tobias Bocanegra <to...@day.com> wrote:
> >
> > > 1/ I have added a method called getBackupRepository(BackupConfig conf)
> > in
> > > RepositoryImpl.
> >
> > i find BackupRepository a misleading name. it sounds as if it's a
> > seperate, backup repository. preferable names are BackupTool, or
> > BackupManager, or something like this.
> >
> > > 2/ OK for backup and restore for naming those methods in
> > BackupRepository
> > > and in all others Backup subclasses.
> >
> > regards, toby
> >
> > >
> > > Nicolas
> > >
> > > On 6/26/06, Tobias Bocanegra <tobias.bocanegra@day.com > wrote:
> > > >
> > > > you lost me.... :-)
> > > >
> > > > On 6/26/06, Nicolas Toper < ntoper@gmail.com> wrote:
> > > > > Fine for me. However if we put only a getBackupRepository() in
> > > > > RepositoryImpl() (  I agree on this, the class is working this way
> > > > already)
> > > > > , I would use instead backup and restore (BackupRepository extend
> > the
> > > > Backup
> > > > > abstract class and I need to have a consistant naming on this side
> > too
> > > > > please see
> > > > >
> > http://www.deviant-abstraction.net/wp-content/uploads/2006/06/classdiagram.gif
> > > >
> > > > > ).
> > > > >
> > > > > Nicolas
> > > > >
> > > > > On 6/26/06, Stefan Guggisberg <st...@gmail.com> wrote:
> > > > > >
> > > > > > On 6/26/06, Nicolas Toper < ntoper@gmail.com> wrote:
> > > > > > > Hi,
> > > > > > >
> > > > > > > About the names of the methods, which ones would you propose?
> > > > > >
> > > > > > off the top of my head, how about:
> > > > > >
> > > > > > backupRepository
> > > > > > restoreRepository
> > > > > >
> > > > > > cheers
> > > > > > stefan
> > > > > >
> > > > > > >
> > > > > > > About the exceptions: some other exceptions can be raised and
> > they
> > > > will
> > > > > > all
> > > > > > > be propagated to this method. I need some specific exception to
> > > > > > encapsulate
> > > > > > > them all, unless of course, you fill it is better to let them as
> > > > they
> > > > > > are?
> > > > > > >
> > > > > > > The user/password are in the BackupConfig class already. OK on
> > the
> > > > > > thrown
> > > > > > > exception.
> > > > > > >
> > > > > > >
> > > > > > > On 6/26/06, Stefan Guggisberg < stefan.guggisberg@gmail.com>
> > wrote:
> > > > > > > >
> > > > > > > > hi nicolas,
> > > > > > > >
> > > > > > > > i share tobi's concern regarding the naming of the methods.
> > > > > > > > save and restore are used in other contexts and may cause
> > > > > > > > confusion.
> > > > > > > >
> > > > > > > > some comments regarding the proposed signatures:
> > > > > > > > - i suggest both methods throw IOException and
> > > > RepositoryException.
> > > > > > > >   there's no need for specific SavingException and
> > > > RestoreException
> > > > > > > >   as the context is already clear.
> > > > > > > > - if the methods are goping to be on Repository we'll also
> > need
> > > > some
> > > > > > > >   sort of authentication/authorization. a Credentials
> > parameter
> > > > would
> > > > > > > >   IMO be fine. both methods should also throw
> > > > AccessDeniedExcpetion.
> > > > > > > >
> > > > > > > > cheers
> > > > > > > > stefan
> > > > > > > >
> > > > > > > > On 6/25/06, Nicolas Toper <nt...@gmail.com> wrote:
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > > I am updating the RepositoryImpl class. Here is what it
> > looks
> > > > like
> > > > > > > > (below).
> > > > > > > > >
> > > > > > > > > We have agreed on using In/OutputStream. However, now that I
> > > > have
> > > > > > > > advanced a
> > > > > > > > > little bit in the code, it raises a problem: I cannot use
> > nio
> > > > and
> > > > > > since
> > > > > > > > it
> > > > > > > > > is huge dataset, I would prefer to use it for performance
> > issue.
> > > >
> > > > > > What do
> > > > > > > > you
> > > > > > > > > think?
> > > > > > > > >
> > > > > > > > > Nicolas
> > > > > > > > > my blog! http://www.deviant-abstraction.net !!
> > > > > > > > >     /**
> > > > > > > > >      *
> > > > > > > > >      * This method restores data from an InputStream.
> > > > > > > > >      *
> > > > > > > > >      * @param InputStream savedData: InputStream containing
> > the
> > > > > > backup
> > > > > > > > (and
> > > > > > > > > its parameters).
> > > > > > > > >      * @param File workingFolder: the folder used to unzip
> > all
> > > > data.
> > > > > > > > >      *
> > > > > > > > >      * @throws RestoreException. Generic exception during
> > > > restore
> > > > > > > > operation.
> > > > > > > > >      *
> > > > > > > > >      * @author: Nicolas Toper < ntoper@gmail.com>
> > > > > > > > >      *
> > > > > > > > >      */
> > > > > > > > >     public void restore(InputStream savedData, File
> > > > workingFolder)
> > > > > > > > throws
> > > > > > > > > RestoreException {
> > > > > > > > >
> > > > > > > > >         BackupRepository saveRepo = new
> > BackupRepository(this,
> > > > > > > > savedData,
> > > > > > > > > workingFolder);
> > > > > > > > >         saveRepo.restore();
> > > > > > > > >     }
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >     /**
> > > > > > > > >      *
> > > > > > > > >      * This method saves from this repository to an
> > > > OutputStream.
> > > > > > > > >      *
> > > > > > > > >      * @param outputStream out: Outputstream where the
> > backup
> > > > should
> > > > > > be.
> > > > > > > > >      * @param BackupConfig conf: BackupConfig object
> > containing
> > > > all
> > > > > > the
> > > > > > > > > parameters.
> > > > > > > > >      *
> > > > > > > > >      * @throws SavingException. Generic exception during
> > saving
> > > > > > > > operation.
> > > > > > > > >      *
> > > > > > > > >      * @author: Nicolas Toper <nt...@gmail.com>
> > > > > > > > >      *
> > > > > > > > >      */
> > > > > > > > >     public void save(OutputStream out, BackupConfig conf)
> > throws
> > > > > > > > > SavingException{
> > > > > > > > >
> > > > > > > > >         conf.init(this);
> > > > > > > > >         BackupRepository saveRepo = (BackupRepository)
> > > > > > conf.getBackup();
> > > > > > > > >         saveRepo.save(out, conf);
> > > > > > > > >     }
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > a+
> > > > > > > Nico
> > > > > > > my blog! http://www.deviant-abstraction.net !!
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > a+
> > > > > Nico
> > > > > my blog! http://www.deviant-abstraction.net !!
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > -----------------------------------------< tobias.bocanegra@day.com>---
> > > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001
> > Basel
> > > > T +41 61 226 98 98, F +41 61 226 98 97
> > > > -----------------------------------------------< http://www.day.com>---
> > > >
> > >
> > >
> > >
> > > --
> > > a+
> > > Nico
> > > my blog! http://www.deviant-abstraction.net !!
> > >
> > >
> >
> >
> > --
> > -----------------------------------------< tobias.bocanegra@day.com >---
> > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> > T +41 61 226 98 98, F +41 61 226 98 97
> > -----------------------------------------------< http://www.day.com >---
> >
>
>
>
> --
> a+
> Nico
> my blog! http://www.deviant-abstraction.net !!
>
>

Re: Main Entry Point for Backup Tool

Posted by Nicolas Toper <nt...@gmail.com>.
BackupRepository (let's call it like this for now) is a subclass of Backup.
The naming I have used is BackupResourceNAme, I have for instance
BackupWorkspace, BackupAllWorkspaces, and so on.

Besides, BackupRepository backup only one repository.

I find this clear.

Do you really think I should call it another name? Jukka?

Nicolas

On 6/26/06, Tobias Bocanegra <to...@day.com> wrote:
>
> > 1/ I have added a method called getBackupRepository(BackupConfig conf)
> in
> > RepositoryImpl.
>
> i find BackupRepository a misleading name. it sounds as if it's a
> seperate, backup repository. preferable names are BackupTool, or
> BackupManager, or something like this.
>
> > 2/ OK for backup and restore for naming those methods in
> BackupRepository
> > and in all others Backup subclasses.
>
> regards, toby
>
> >
> > Nicolas
> >
> > On 6/26/06, Tobias Bocanegra <tobias.bocanegra@day.com > wrote:
> > >
> > > you lost me.... :-)
> > >
> > > On 6/26/06, Nicolas Toper < ntoper@gmail.com> wrote:
> > > > Fine for me. However if we put only a getBackupRepository() in
> > > > RepositoryImpl() (  I agree on this, the class is working this way
> > > already)
> > > > , I would use instead backup and restore (BackupRepository extend
> the
> > > Backup
> > > > abstract class and I need to have a consistant naming on this side
> too
> > > > please see
> > > >
> http://www.deviant-abstraction.net/wp-content/uploads/2006/06/classdiagram.gif
> > >
> > > > ).
> > > >
> > > > Nicolas
> > > >
> > > > On 6/26/06, Stefan Guggisberg <st...@gmail.com> wrote:
> > > > >
> > > > > On 6/26/06, Nicolas Toper < ntoper@gmail.com> wrote:
> > > > > > Hi,
> > > > > >
> > > > > > About the names of the methods, which ones would you propose?
> > > > >
> > > > > off the top of my head, how about:
> > > > >
> > > > > backupRepository
> > > > > restoreRepository
> > > > >
> > > > > cheers
> > > > > stefan
> > > > >
> > > > > >
> > > > > > About the exceptions: some other exceptions can be raised and
> they
> > > will
> > > > > all
> > > > > > be propagated to this method. I need some specific exception to
> > > > > encapsulate
> > > > > > them all, unless of course, you fill it is better to let them as
> > > they
> > > > > are?
> > > > > >
> > > > > > The user/password are in the BackupConfig class already. OK on
> the
> > > > > thrown
> > > > > > exception.
> > > > > >
> > > > > >
> > > > > > On 6/26/06, Stefan Guggisberg < stefan.guggisberg@gmail.com>
> wrote:
> > > > > > >
> > > > > > > hi nicolas,
> > > > > > >
> > > > > > > i share tobi's concern regarding the naming of the methods.
> > > > > > > save and restore are used in other contexts and may cause
> > > > > > > confusion.
> > > > > > >
> > > > > > > some comments regarding the proposed signatures:
> > > > > > > - i suggest both methods throw IOException and
> > > RepositoryException.
> > > > > > >   there's no need for specific SavingException and
> > > RestoreException
> > > > > > >   as the context is already clear.
> > > > > > > - if the methods are goping to be on Repository we'll also
> need
> > > some
> > > > > > >   sort of authentication/authorization. a Credentials
> parameter
> > > would
> > > > > > >   IMO be fine. both methods should also throw
> > > AccessDeniedExcpetion.
> > > > > > >
> > > > > > > cheers
> > > > > > > stefan
> > > > > > >
> > > > > > > On 6/25/06, Nicolas Toper <nt...@gmail.com> wrote:
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > I am updating the RepositoryImpl class. Here is what it
> looks
> > > like
> > > > > > > (below).
> > > > > > > >
> > > > > > > > We have agreed on using In/OutputStream. However, now that I
> > > have
> > > > > > > advanced a
> > > > > > > > little bit in the code, it raises a problem: I cannot use
> nio
> > > and
> > > > > since
> > > > > > > it
> > > > > > > > is huge dataset, I would prefer to use it for performance
> issue.
> > >
> > > > > What do
> > > > > > > you
> > > > > > > > think?
> > > > > > > >
> > > > > > > > Nicolas
> > > > > > > > my blog! http://www.deviant-abstraction.net !!
> > > > > > > >     /**
> > > > > > > >      *
> > > > > > > >      * This method restores data from an InputStream.
> > > > > > > >      *
> > > > > > > >      * @param InputStream savedData: InputStream containing
> the
> > > > > backup
> > > > > > > (and
> > > > > > > > its parameters).
> > > > > > > >      * @param File workingFolder: the folder used to unzip
> all
> > > data.
> > > > > > > >      *
> > > > > > > >      * @throws RestoreException. Generic exception during
> > > restore
> > > > > > > operation.
> > > > > > > >      *
> > > > > > > >      * @author: Nicolas Toper < ntoper@gmail.com>
> > > > > > > >      *
> > > > > > > >      */
> > > > > > > >     public void restore(InputStream savedData, File
> > > workingFolder)
> > > > > > > throws
> > > > > > > > RestoreException {
> > > > > > > >
> > > > > > > >         BackupRepository saveRepo = new
> BackupRepository(this,
> > > > > > > savedData,
> > > > > > > > workingFolder);
> > > > > > > >         saveRepo.restore();
> > > > > > > >     }
> > > > > > > >
> > > > > > > >
> > > > > > > >     /**
> > > > > > > >      *
> > > > > > > >      * This method saves from this repository to an
> > > OutputStream.
> > > > > > > >      *
> > > > > > > >      * @param outputStream out: Outputstream where the
> backup
> > > should
> > > > > be.
> > > > > > > >      * @param BackupConfig conf: BackupConfig object
> containing
> > > all
> > > > > the
> > > > > > > > parameters.
> > > > > > > >      *
> > > > > > > >      * @throws SavingException. Generic exception during
> saving
> > > > > > > operation.
> > > > > > > >      *
> > > > > > > >      * @author: Nicolas Toper <nt...@gmail.com>
> > > > > > > >      *
> > > > > > > >      */
> > > > > > > >     public void save(OutputStream out, BackupConfig conf)
> throws
> > > > > > > > SavingException{
> > > > > > > >
> > > > > > > >         conf.init(this);
> > > > > > > >         BackupRepository saveRepo = (BackupRepository)
> > > > > conf.getBackup();
> > > > > > > >         saveRepo.save(out, conf);
> > > > > > > >     }
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > a+
> > > > > > Nico
> > > > > > my blog! http://www.deviant-abstraction.net !!
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > a+
> > > > Nico
> > > > my blog! http://www.deviant-abstraction.net !!
> > > >
> > > >
> > >
> > >
> > > --
> > > -----------------------------------------< tobias.bocanegra@day.com>---
> > > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001
> Basel
> > > T +41 61 226 98 98, F +41 61 226 98 97
> > > -----------------------------------------------< http://www.day.com>---
> > >
> >
> >
> >
> > --
> > a+
> > Nico
> > my blog! http://www.deviant-abstraction.net !!
> >
> >
>
>
> --
> -----------------------------------------< tobias.bocanegra@day.com >---
> Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> T +41 61 226 98 98, F +41 61 226 98 97
> -----------------------------------------------< http://www.day.com >---
>



-- 
a+
Nico
my blog! http://www.deviant-abstraction.net !!

Re: Main Entry Point for Backup Tool

Posted by Tobias Bocanegra <to...@day.com>.
> 1/ I have added a method called getBackupRepository(BackupConfig conf) in
> RepositoryImpl.

i find BackupRepository a misleading name. it sounds as if it's a
seperate, backup repository. preferable names are BackupTool, or
BackupManager, or something like this.

> 2/ OK for backup and restore for naming those methods in BackupRepository
> and in all others Backup subclasses.

regards, toby

>
> Nicolas
>
> On 6/26/06, Tobias Bocanegra <tobias.bocanegra@day.com > wrote:
> >
> > you lost me.... :-)
> >
> > On 6/26/06, Nicolas Toper < ntoper@gmail.com> wrote:
> > > Fine for me. However if we put only a getBackupRepository() in
> > > RepositoryImpl() (  I agree on this, the class is working this way
> > already)
> > > , I would use instead backup and restore (BackupRepository extend the
> > Backup
> > > abstract class and I need to have a consistant naming on this side too
> > > please see
> > > http://www.deviant-abstraction.net/wp-content/uploads/2006/06/classdiagram.gif
> >
> > > ).
> > >
> > > Nicolas
> > >
> > > On 6/26/06, Stefan Guggisberg <st...@gmail.com> wrote:
> > > >
> > > > On 6/26/06, Nicolas Toper < ntoper@gmail.com> wrote:
> > > > > Hi,
> > > > >
> > > > > About the names of the methods, which ones would you propose?
> > > >
> > > > off the top of my head, how about:
> > > >
> > > > backupRepository
> > > > restoreRepository
> > > >
> > > > cheers
> > > > stefan
> > > >
> > > > >
> > > > > About the exceptions: some other exceptions can be raised and they
> > will
> > > > all
> > > > > be propagated to this method. I need some specific exception to
> > > > encapsulate
> > > > > them all, unless of course, you fill it is better to let them as
> > they
> > > > are?
> > > > >
> > > > > The user/password are in the BackupConfig class already. OK on the
> > > > thrown
> > > > > exception.
> > > > >
> > > > >
> > > > > On 6/26/06, Stefan Guggisberg < stefan.guggisberg@gmail.com> wrote:
> > > > > >
> > > > > > hi nicolas,
> > > > > >
> > > > > > i share tobi's concern regarding the naming of the methods.
> > > > > > save and restore are used in other contexts and may cause
> > > > > > confusion.
> > > > > >
> > > > > > some comments regarding the proposed signatures:
> > > > > > - i suggest both methods throw IOException and
> > RepositoryException.
> > > > > >   there's no need for specific SavingException and
> > RestoreException
> > > > > >   as the context is already clear.
> > > > > > - if the methods are goping to be on Repository we'll also need
> > some
> > > > > >   sort of authentication/authorization. a Credentials parameter
> > would
> > > > > >   IMO be fine. both methods should also throw
> > AccessDeniedExcpetion.
> > > > > >
> > > > > > cheers
> > > > > > stefan
> > > > > >
> > > > > > On 6/25/06, Nicolas Toper <nt...@gmail.com> wrote:
> > > > > > > Hi,
> > > > > > >
> > > > > > > I am updating the RepositoryImpl class. Here is what it looks
> > like
> > > > > > (below).
> > > > > > >
> > > > > > > We have agreed on using In/OutputStream. However, now that I
> > have
> > > > > > advanced a
> > > > > > > little bit in the code, it raises a problem: I cannot use nio
> > and
> > > > since
> > > > > > it
> > > > > > > is huge dataset, I would prefer to use it for performance issue.
> >
> > > > What do
> > > > > > you
> > > > > > > think?
> > > > > > >
> > > > > > > Nicolas
> > > > > > > my blog! http://www.deviant-abstraction.net !!
> > > > > > >     /**
> > > > > > >      *
> > > > > > >      * This method restores data from an InputStream.
> > > > > > >      *
> > > > > > >      * @param InputStream savedData: InputStream containing the
> > > > backup
> > > > > > (and
> > > > > > > its parameters).
> > > > > > >      * @param File workingFolder: the folder used to unzip all
> > data.
> > > > > > >      *
> > > > > > >      * @throws RestoreException. Generic exception during
> > restore
> > > > > > operation.
> > > > > > >      *
> > > > > > >      * @author: Nicolas Toper < ntoper@gmail.com>
> > > > > > >      *
> > > > > > >      */
> > > > > > >     public void restore(InputStream savedData, File
> > workingFolder)
> > > > > > throws
> > > > > > > RestoreException {
> > > > > > >
> > > > > > >         BackupRepository saveRepo = new BackupRepository(this,
> > > > > > savedData,
> > > > > > > workingFolder);
> > > > > > >         saveRepo.restore();
> > > > > > >     }
> > > > > > >
> > > > > > >
> > > > > > >     /**
> > > > > > >      *
> > > > > > >      * This method saves from this repository to an
> > OutputStream.
> > > > > > >      *
> > > > > > >      * @param outputStream out: Outputstream where the backup
> > should
> > > > be.
> > > > > > >      * @param BackupConfig conf: BackupConfig object containing
> > all
> > > > the
> > > > > > > parameters.
> > > > > > >      *
> > > > > > >      * @throws SavingException. Generic exception during saving
> > > > > > operation.
> > > > > > >      *
> > > > > > >      * @author: Nicolas Toper <nt...@gmail.com>
> > > > > > >      *
> > > > > > >      */
> > > > > > >     public void save(OutputStream out, BackupConfig conf) throws
> > > > > > > SavingException{
> > > > > > >
> > > > > > >         conf.init(this);
> > > > > > >         BackupRepository saveRepo = (BackupRepository)
> > > > conf.getBackup();
> > > > > > >         saveRepo.save(out, conf);
> > > > > > >     }
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > a+
> > > > > Nico
> > > > > my blog! http://www.deviant-abstraction.net !!
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > a+
> > > Nico
> > > my blog! http://www.deviant-abstraction.net !!
> > >
> > >
> >
> >
> > --
> > -----------------------------------------< tobias.bocanegra@day.com >---
> > Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> > T +41 61 226 98 98, F +41 61 226 98 97
> > -----------------------------------------------< http://www.day.com >---
> >
>
>
>
> --
> a+
> Nico
> my blog! http://www.deviant-abstraction.net !!
>
>


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: Main Entry Point for Backup Tool

Posted by Nicolas Toper <nt...@gmail.com>.
I was saying the same thing as you in the other thread ;)

1/ I have added a method called getBackupRepository(BackupConfig conf) in
RepositoryImpl.

2/ OK for backup and restore for naming those methods in BackupRepository
and in all others Backup subclasses.

Nicolas

On 6/26/06, Tobias Bocanegra <tobias.bocanegra@day.com > wrote:
>
> you lost me.... :-)
>
> On 6/26/06, Nicolas Toper < ntoper@gmail.com> wrote:
> > Fine for me. However if we put only a getBackupRepository() in
> > RepositoryImpl() (  I agree on this, the class is working this way
> already)
> > , I would use instead backup and restore (BackupRepository extend the
> Backup
> > abstract class and I need to have a consistant naming on this side too
> > please see
> > http://www.deviant-abstraction.net/wp-content/uploads/2006/06/classdiagram.gif
>
> > ).
> >
> > Nicolas
> >
> > On 6/26/06, Stefan Guggisberg <st...@gmail.com> wrote:
> > >
> > > On 6/26/06, Nicolas Toper < ntoper@gmail.com> wrote:
> > > > Hi,
> > > >
> > > > About the names of the methods, which ones would you propose?
> > >
> > > off the top of my head, how about:
> > >
> > > backupRepository
> > > restoreRepository
> > >
> > > cheers
> > > stefan
> > >
> > > >
> > > > About the exceptions: some other exceptions can be raised and they
> will
> > > all
> > > > be propagated to this method. I need some specific exception to
> > > encapsulate
> > > > them all, unless of course, you fill it is better to let them as
> they
> > > are?
> > > >
> > > > The user/password are in the BackupConfig class already. OK on the
> > > thrown
> > > > exception.
> > > >
> > > >
> > > > On 6/26/06, Stefan Guggisberg < stefan.guggisberg@gmail.com> wrote:
> > > > >
> > > > > hi nicolas,
> > > > >
> > > > > i share tobi's concern regarding the naming of the methods.
> > > > > save and restore are used in other contexts and may cause
> > > > > confusion.
> > > > >
> > > > > some comments regarding the proposed signatures:
> > > > > - i suggest both methods throw IOException and
> RepositoryException.
> > > > >   there's no need for specific SavingException and
> RestoreException
> > > > >   as the context is already clear.
> > > > > - if the methods are goping to be on Repository we'll also need
> some
> > > > >   sort of authentication/authorization. a Credentials parameter
> would
> > > > >   IMO be fine. both methods should also throw
> AccessDeniedExcpetion.
> > > > >
> > > > > cheers
> > > > > stefan
> > > > >
> > > > > On 6/25/06, Nicolas Toper <nt...@gmail.com> wrote:
> > > > > > Hi,
> > > > > >
> > > > > > I am updating the RepositoryImpl class. Here is what it looks
> like
> > > > > (below).
> > > > > >
> > > > > > We have agreed on using In/OutputStream. However, now that I
> have
> > > > > advanced a
> > > > > > little bit in the code, it raises a problem: I cannot use nio
> and
> > > since
> > > > > it
> > > > > > is huge dataset, I would prefer to use it for performance issue.
>
> > > What do
> > > > > you
> > > > > > think?
> > > > > >
> > > > > > Nicolas
> > > > > > my blog! http://www.deviant-abstraction.net !!
> > > > > >     /**
> > > > > >      *
> > > > > >      * This method restores data from an InputStream.
> > > > > >      *
> > > > > >      * @param InputStream savedData: InputStream containing the
> > > backup
> > > > > (and
> > > > > > its parameters).
> > > > > >      * @param File workingFolder: the folder used to unzip all
> data.
> > > > > >      *
> > > > > >      * @throws RestoreException. Generic exception during
> restore
> > > > > operation.
> > > > > >      *
> > > > > >      * @author: Nicolas Toper < ntoper@gmail.com>
> > > > > >      *
> > > > > >      */
> > > > > >     public void restore(InputStream savedData, File
> workingFolder)
> > > > > throws
> > > > > > RestoreException {
> > > > > >
> > > > > >         BackupRepository saveRepo = new BackupRepository(this,
> > > > > savedData,
> > > > > > workingFolder);
> > > > > >         saveRepo.restore();
> > > > > >     }
> > > > > >
> > > > > >
> > > > > >     /**
> > > > > >      *
> > > > > >      * This method saves from this repository to an
> OutputStream.
> > > > > >      *
> > > > > >      * @param outputStream out: Outputstream where the backup
> should
> > > be.
> > > > > >      * @param BackupConfig conf: BackupConfig object containing
> all
> > > the
> > > > > > parameters.
> > > > > >      *
> > > > > >      * @throws SavingException. Generic exception during saving
> > > > > operation.
> > > > > >      *
> > > > > >      * @author: Nicolas Toper <nt...@gmail.com>
> > > > > >      *
> > > > > >      */
> > > > > >     public void save(OutputStream out, BackupConfig conf) throws
> > > > > > SavingException{
> > > > > >
> > > > > >         conf.init(this);
> > > > > >         BackupRepository saveRepo = (BackupRepository)
> > > conf.getBackup();
> > > > > >         saveRepo.save(out, conf);
> > > > > >     }
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > a+
> > > > Nico
> > > > my blog! http://www.deviant-abstraction.net !!
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > a+
> > Nico
> > my blog! http://www.deviant-abstraction.net !!
> >
> >
>
>
> --
> -----------------------------------------< tobias.bocanegra@day.com >---
> Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
> T +41 61 226 98 98, F +41 61 226 98 97
> -----------------------------------------------< http://www.day.com >---
>



-- 
a+
Nico
my blog! http://www.deviant-abstraction.net !!

Re: Main Entry Point for Backup Tool

Posted by Tobias Bocanegra <to...@day.com>.
you lost me.... :-)

On 6/26/06, Nicolas Toper <nt...@gmail.com> wrote:
> Fine for me. However if we put only a getBackupRepository() in
> RepositoryImpl() (  I agree on this, the class is working this way already)
> , I would use instead backup and restore (BackupRepository extend the Backup
> abstract class and I need to have a consistant naming on this side too
> please see
> http://www.deviant-abstraction.net/wp-content/uploads/2006/06/classdiagram.gif
> ).
>
> Nicolas
>
> On 6/26/06, Stefan Guggisberg <st...@gmail.com> wrote:
> >
> > On 6/26/06, Nicolas Toper <nt...@gmail.com> wrote:
> > > Hi,
> > >
> > > About the names of the methods, which ones would you propose?
> >
> > off the top of my head, how about:
> >
> > backupRepository
> > restoreRepository
> >
> > cheers
> > stefan
> >
> > >
> > > About the exceptions: some other exceptions can be raised and they will
> > all
> > > be propagated to this method. I need some specific exception to
> > encapsulate
> > > them all, unless of course, you fill it is better to let them as they
> > are?
> > >
> > > The user/password are in the BackupConfig class already. OK on the
> > thrown
> > > exception.
> > >
> > >
> > > On 6/26/06, Stefan Guggisberg <st...@gmail.com> wrote:
> > > >
> > > > hi nicolas,
> > > >
> > > > i share tobi's concern regarding the naming of the methods.
> > > > save and restore are used in other contexts and may cause
> > > > confusion.
> > > >
> > > > some comments regarding the proposed signatures:
> > > > - i suggest both methods throw IOException and RepositoryException.
> > > >   there's no need for specific SavingException and RestoreException
> > > >   as the context is already clear.
> > > > - if the methods are goping to be on Repository we'll also need some
> > > >   sort of authentication/authorization. a Credentials parameter would
> > > >   IMO be fine. both methods should also throw AccessDeniedExcpetion.
> > > >
> > > > cheers
> > > > stefan
> > > >
> > > > On 6/25/06, Nicolas Toper <nt...@gmail.com> wrote:
> > > > > Hi,
> > > > >
> > > > > I am updating the RepositoryImpl class. Here is what it looks like
> > > > (below).
> > > > >
> > > > > We have agreed on using In/OutputStream. However, now that I have
> > > > advanced a
> > > > > little bit in the code, it raises a problem: I cannot use nio and
> > since
> > > > it
> > > > > is huge dataset, I would prefer to use it for performance issue.
> > What do
> > > > you
> > > > > think?
> > > > >
> > > > > Nicolas
> > > > > my blog! http://www.deviant-abstraction.net !!
> > > > >     /**
> > > > >      *
> > > > >      * This method restores data from an InputStream.
> > > > >      *
> > > > >      * @param InputStream savedData: InputStream containing the
> > backup
> > > > (and
> > > > > its parameters).
> > > > >      * @param File workingFolder: the folder used to unzip all data.
> > > > >      *
> > > > >      * @throws RestoreException. Generic exception during restore
> > > > operation.
> > > > >      *
> > > > >      * @author: Nicolas Toper <nt...@gmail.com>
> > > > >      *
> > > > >      */
> > > > >     public void restore(InputStream savedData, File workingFolder)
> > > > throws
> > > > > RestoreException {
> > > > >
> > > > >         BackupRepository saveRepo = new BackupRepository(this,
> > > > savedData,
> > > > > workingFolder);
> > > > >         saveRepo.restore();
> > > > >     }
> > > > >
> > > > >
> > > > >     /**
> > > > >      *
> > > > >      * This method saves from this repository to an OutputStream.
> > > > >      *
> > > > >      * @param outputStream out: Outputstream where the backup should
> > be.
> > > > >      * @param BackupConfig conf: BackupConfig object containing all
> > the
> > > > > parameters.
> > > > >      *
> > > > >      * @throws SavingException. Generic exception during saving
> > > > operation.
> > > > >      *
> > > > >      * @author: Nicolas Toper <nt...@gmail.com>
> > > > >      *
> > > > >      */
> > > > >     public void save(OutputStream out, BackupConfig conf) throws
> > > > > SavingException{
> > > > >
> > > > >         conf.init(this);
> > > > >         BackupRepository saveRepo = (BackupRepository)
> > conf.getBackup();
> > > > >         saveRepo.save(out, conf);
> > > > >     }
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > a+
> > > Nico
> > > my blog! http://www.deviant-abstraction.net !!
> > >
> > >
> >
>
>
>
> --
> a+
> Nico
> my blog! http://www.deviant-abstraction.net !!
>
>


-- 
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---

Re: Main Entry Point for Backup Tool

Posted by Nicolas Toper <nt...@gmail.com>.
Fine for me. However if we put only a getBackupRepository() in
RepositoryImpl() (  I agree on this, the class is working this way already)
, I would use instead backup and restore (BackupRepository extend the Backup
abstract class and I need to have a consistant naming on this side too
please see
http://www.deviant-abstraction.net/wp-content/uploads/2006/06/classdiagram.gif
).

Nicolas

On 6/26/06, Stefan Guggisberg <st...@gmail.com> wrote:
>
> On 6/26/06, Nicolas Toper <nt...@gmail.com> wrote:
> > Hi,
> >
> > About the names of the methods, which ones would you propose?
>
> off the top of my head, how about:
>
> backupRepository
> restoreRepository
>
> cheers
> stefan
>
> >
> > About the exceptions: some other exceptions can be raised and they will
> all
> > be propagated to this method. I need some specific exception to
> encapsulate
> > them all, unless of course, you fill it is better to let them as they
> are?
> >
> > The user/password are in the BackupConfig class already. OK on the
> thrown
> > exception.
> >
> >
> > On 6/26/06, Stefan Guggisberg <st...@gmail.com> wrote:
> > >
> > > hi nicolas,
> > >
> > > i share tobi's concern regarding the naming of the methods.
> > > save and restore are used in other contexts and may cause
> > > confusion.
> > >
> > > some comments regarding the proposed signatures:
> > > - i suggest both methods throw IOException and RepositoryException.
> > >   there's no need for specific SavingException and RestoreException
> > >   as the context is already clear.
> > > - if the methods are goping to be on Repository we'll also need some
> > >   sort of authentication/authorization. a Credentials parameter would
> > >   IMO be fine. both methods should also throw AccessDeniedExcpetion.
> > >
> > > cheers
> > > stefan
> > >
> > > On 6/25/06, Nicolas Toper <nt...@gmail.com> wrote:
> > > > Hi,
> > > >
> > > > I am updating the RepositoryImpl class. Here is what it looks like
> > > (below).
> > > >
> > > > We have agreed on using In/OutputStream. However, now that I have
> > > advanced a
> > > > little bit in the code, it raises a problem: I cannot use nio and
> since
> > > it
> > > > is huge dataset, I would prefer to use it for performance issue.
> What do
> > > you
> > > > think?
> > > >
> > > > Nicolas
> > > > my blog! http://www.deviant-abstraction.net !!
> > > >     /**
> > > >      *
> > > >      * This method restores data from an InputStream.
> > > >      *
> > > >      * @param InputStream savedData: InputStream containing the
> backup
> > > (and
> > > > its parameters).
> > > >      * @param File workingFolder: the folder used to unzip all data.
> > > >      *
> > > >      * @throws RestoreException. Generic exception during restore
> > > operation.
> > > >      *
> > > >      * @author: Nicolas Toper <nt...@gmail.com>
> > > >      *
> > > >      */
> > > >     public void restore(InputStream savedData, File workingFolder)
> > > throws
> > > > RestoreException {
> > > >
> > > >         BackupRepository saveRepo = new BackupRepository(this,
> > > savedData,
> > > > workingFolder);
> > > >         saveRepo.restore();
> > > >     }
> > > >
> > > >
> > > >     /**
> > > >      *
> > > >      * This method saves from this repository to an OutputStream.
> > > >      *
> > > >      * @param outputStream out: Outputstream where the backup should
> be.
> > > >      * @param BackupConfig conf: BackupConfig object containing all
> the
> > > > parameters.
> > > >      *
> > > >      * @throws SavingException. Generic exception during saving
> > > operation.
> > > >      *
> > > >      * @author: Nicolas Toper <nt...@gmail.com>
> > > >      *
> > > >      */
> > > >     public void save(OutputStream out, BackupConfig conf) throws
> > > > SavingException{
> > > >
> > > >         conf.init(this);
> > > >         BackupRepository saveRepo = (BackupRepository)
> conf.getBackup();
> > > >         saveRepo.save(out, conf);
> > > >     }
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > a+
> > Nico
> > my blog! http://www.deviant-abstraction.net !!
> >
> >
>



-- 
a+
Nico
my blog! http://www.deviant-abstraction.net !!

Re: Main Entry Point for Backup Tool

Posted by Stefan Guggisberg <st...@gmail.com>.
On 6/26/06, Nicolas Toper <nt...@gmail.com> wrote:
> Hi,
>
> About the names of the methods, which ones would you propose?

off the top of my head, how about:

backupRepository
restoreRepository

cheers
stefan

>
> About the exceptions: some other exceptions can be raised and they will all
> be propagated to this method. I need some specific exception to encapsulate
> them all, unless of course, you fill it is better to let them as they are?
>
> The user/password are in the BackupConfig class already. OK on the thrown
> exception.
>
>
> On 6/26/06, Stefan Guggisberg <st...@gmail.com> wrote:
> >
> > hi nicolas,
> >
> > i share tobi's concern regarding the naming of the methods.
> > save and restore are used in other contexts and may cause
> > confusion.
> >
> > some comments regarding the proposed signatures:
> > - i suggest both methods throw IOException and RepositoryException.
> >   there's no need for specific SavingException and RestoreException
> >   as the context is already clear.
> > - if the methods are goping to be on Repository we'll also need some
> >   sort of authentication/authorization. a Credentials parameter would
> >   IMO be fine. both methods should also throw AccessDeniedExcpetion.
> >
> > cheers
> > stefan
> >
> > On 6/25/06, Nicolas Toper <nt...@gmail.com> wrote:
> > > Hi,
> > >
> > > I am updating the RepositoryImpl class. Here is what it looks like
> > (below).
> > >
> > > We have agreed on using In/OutputStream. However, now that I have
> > advanced a
> > > little bit in the code, it raises a problem: I cannot use nio and since
> > it
> > > is huge dataset, I would prefer to use it for performance issue. What do
> > you
> > > think?
> > >
> > > Nicolas
> > > my blog! http://www.deviant-abstraction.net !!
> > >     /**
> > >      *
> > >      * This method restores data from an InputStream.
> > >      *
> > >      * @param InputStream savedData: InputStream containing the backup
> > (and
> > > its parameters).
> > >      * @param File workingFolder: the folder used to unzip all data.
> > >      *
> > >      * @throws RestoreException. Generic exception during restore
> > operation.
> > >      *
> > >      * @author: Nicolas Toper <nt...@gmail.com>
> > >      *
> > >      */
> > >     public void restore(InputStream savedData, File workingFolder)
> > throws
> > > RestoreException {
> > >
> > >         BackupRepository saveRepo = new BackupRepository(this,
> > savedData,
> > > workingFolder);
> > >         saveRepo.restore();
> > >     }
> > >
> > >
> > >     /**
> > >      *
> > >      * This method saves from this repository to an OutputStream.
> > >      *
> > >      * @param outputStream out: Outputstream where the backup should be.
> > >      * @param BackupConfig conf: BackupConfig object containing all the
> > > parameters.
> > >      *
> > >      * @throws SavingException. Generic exception during saving
> > operation.
> > >      *
> > >      * @author: Nicolas Toper <nt...@gmail.com>
> > >      *
> > >      */
> > >     public void save(OutputStream out, BackupConfig conf) throws
> > > SavingException{
> > >
> > >         conf.init(this);
> > >         BackupRepository saveRepo = (BackupRepository) conf.getBackup();
> > >         saveRepo.save(out, conf);
> > >     }
> > >
> > >
> >
>
>
>
> --
> a+
> Nico
> my blog! http://www.deviant-abstraction.net !!
>
>

Re: Main Entry Point for Backup Tool

Posted by Nicolas Toper <nt...@gmail.com>.
Hi,

About the names of the methods, which ones would you propose?

About the exceptions: some other exceptions can be raised and they will all
be propagated to this method. I need some specific exception to encapsulate
them all, unless of course, you fill it is better to let them as they are?

The user/password are in the BackupConfig class already. OK on the thrown
exception.


On 6/26/06, Stefan Guggisberg <st...@gmail.com> wrote:
>
> hi nicolas,
>
> i share tobi's concern regarding the naming of the methods.
> save and restore are used in other contexts and may cause
> confusion.
>
> some comments regarding the proposed signatures:
> - i suggest both methods throw IOException and RepositoryException.
>   there's no need for specific SavingException and RestoreException
>   as the context is already clear.
> - if the methods are goping to be on Repository we'll also need some
>   sort of authentication/authorization. a Credentials parameter would
>   IMO be fine. both methods should also throw AccessDeniedExcpetion.
>
> cheers
> stefan
>
> On 6/25/06, Nicolas Toper <nt...@gmail.com> wrote:
> > Hi,
> >
> > I am updating the RepositoryImpl class. Here is what it looks like
> (below).
> >
> > We have agreed on using In/OutputStream. However, now that I have
> advanced a
> > little bit in the code, it raises a problem: I cannot use nio and since
> it
> > is huge dataset, I would prefer to use it for performance issue. What do
> you
> > think?
> >
> > Nicolas
> > my blog! http://www.deviant-abstraction.net !!
> >     /**
> >      *
> >      * This method restores data from an InputStream.
> >      *
> >      * @param InputStream savedData: InputStream containing the backup
> (and
> > its parameters).
> >      * @param File workingFolder: the folder used to unzip all data.
> >      *
> >      * @throws RestoreException. Generic exception during restore
> operation.
> >      *
> >      * @author: Nicolas Toper <nt...@gmail.com>
> >      *
> >      */
> >     public void restore(InputStream savedData, File workingFolder)
> throws
> > RestoreException {
> >
> >         BackupRepository saveRepo = new BackupRepository(this,
> savedData,
> > workingFolder);
> >         saveRepo.restore();
> >     }
> >
> >
> >     /**
> >      *
> >      * This method saves from this repository to an OutputStream.
> >      *
> >      * @param outputStream out: Outputstream where the backup should be.
> >      * @param BackupConfig conf: BackupConfig object containing all the
> > parameters.
> >      *
> >      * @throws SavingException. Generic exception during saving
> operation.
> >      *
> >      * @author: Nicolas Toper <nt...@gmail.com>
> >      *
> >      */
> >     public void save(OutputStream out, BackupConfig conf) throws
> > SavingException{
> >
> >         conf.init(this);
> >         BackupRepository saveRepo = (BackupRepository) conf.getBackup();
> >         saveRepo.save(out, conf);
> >     }
> >
> >
>



-- 
a+
Nico
my blog! http://www.deviant-abstraction.net !!

Re: Main Entry Point for Backup Tool

Posted by Stefan Guggisberg <st...@gmail.com>.
hi nicolas,

i share tobi's concern regarding the naming of the methods.
save and restore are used in other contexts and may cause
confusion.

some comments regarding the proposed signatures:
- i suggest both methods throw IOException and RepositoryException.
  there's no need for specific SavingException and RestoreException
  as the context is already clear.
- if the methods are goping to be on Repository we'll also need some
  sort of authentication/authorization. a Credentials parameter would
  IMO be fine. both methods should also throw AccessDeniedExcpetion.

cheers
stefan

On 6/25/06, Nicolas Toper <nt...@gmail.com> wrote:
> Hi,
>
> I am updating the RepositoryImpl class. Here is what it looks like (below).
>
> We have agreed on using In/OutputStream. However, now that I have advanced a
> little bit in the code, it raises a problem: I cannot use nio and since it
> is huge dataset, I would prefer to use it for performance issue. What do you
> think?
>
> Nicolas
> my blog! http://www.deviant-abstraction.net !!
>     /**
>      *
>      * This method restores data from an InputStream.
>      *
>      * @param InputStream savedData: InputStream containing the backup (and
> its parameters).
>      * @param File workingFolder: the folder used to unzip all data.
>      *
>      * @throws RestoreException. Generic exception during restore operation.
>      *
>      * @author: Nicolas Toper <nt...@gmail.com>
>      *
>      */
>     public void restore(InputStream savedData, File workingFolder) throws
> RestoreException {
>
>         BackupRepository saveRepo = new BackupRepository(this, savedData,
> workingFolder);
>         saveRepo.restore();
>     }
>
>
>     /**
>      *
>      * This method saves from this repository to an OutputStream.
>      *
>      * @param outputStream out: Outputstream where the backup should be.
>      * @param BackupConfig conf: BackupConfig object containing all the
> parameters.
>      *
>      * @throws SavingException. Generic exception during saving operation.
>      *
>      * @author: Nicolas Toper <nt...@gmail.com>
>      *
>      */
>     public void save(OutputStream out, BackupConfig conf) throws
> SavingException{
>
>         conf.init(this);
>         BackupRepository saveRepo = (BackupRepository) conf.getBackup();
>         saveRepo.save(out, conf);
>     }
>
>