r349 - in trunk/lutinvcs: lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs lutinvcs-provider-mock/src/main/java/org/codelutin/vcs lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/impl/mock lutinvcs-provider-svn/src/main/java/org/codelutin/vcs lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn
Author: tchemit Date: 2008-04-04 21:26:10 +0000 (Fri, 04 Apr 2008) New Revision: 349 Added: trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSConnexion.java trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/impl/mock/MockConnexion.java trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNConnexion.java Removed: trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/SVNConnexion.java Modified: trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/CVSProvider.java trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/MockProvider.java Log: refactor provider to act as handler and connexion factory Modified: trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/CVSProvider.java =================================================================== --- trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/CVSProvider.java 2008-04-04 21:24:11 UTC (rev 348) +++ trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/CVSProvider.java 2008-04-04 21:26:10 UTC (rev 349) @@ -16,6 +16,7 @@ import org.codelutin.vcs.impl.cvs.CVSHandler; import org.codelutin.vcs.impl.cvs.CVSHelper; +import org.codelutin.vcs.impl.cvs.CVSConnexion; /** @author chemit */ public class CVSProvider implements VCSProvider<CVSHandler, CVSConnexion> { Copied: trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSConnexion.java (from rev 345, trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/CVSConnexion.java) =================================================================== --- trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSConnexion.java (rev 0) +++ trunk/lutinvcs/lutinvcs-provider-cvs/src/main/java/org/codelutin/vcs/impl/cvs/CVSConnexion.java 2008-04-04 21:26:10 UTC (rev 349) @@ -0,0 +1,36 @@ +/** + * # #% Copyright (C) 2008 Code Lutin, Tony Chemit + * This program is free software; you + * can redistribute it and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. This program 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 General Public License for more details. You + * should have received a copy of the GNU General Public License along with this + * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place + * - Suite 330, Boston, MA 02111-1307, USA. + * # #% + */ +package org.codelutin.vcs.impl.cvs; + +import org.codelutin.vcs.util.AbstractVCSConnexion; +import org.codelutin.vcs.VCSConfig; +import org.codelutin.vcs.VCSHandler; + +/** @author chemit */ +public class CVSConnexion extends AbstractVCSConnexion { + + public void init(VCSConfig config, VCSHandler handler) { + } + + @Override + public void close() throws IllegalStateException { + checkInit(); + } + + @Override + public void open() throws IllegalStateException { + checkInit(); + } +} \ No newline at end of file Modified: trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/MockProvider.java =================================================================== --- trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/MockProvider.java 2008-04-04 21:24:11 UTC (rev 348) +++ trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/MockProvider.java 2008-04-04 21:26:10 UTC (rev 349) @@ -15,6 +15,7 @@ package org.codelutin.vcs; import org.codelutin.vcs.impl.mock.MockVCSHandler; +import org.codelutin.vcs.impl.mock.MockConnexion; /** @author chemit */ public class MockProvider implements VCSProvider<MockVCSHandler, MockConnexion> { Copied: trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/impl/mock/MockConnexion.java (from rev 345, trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/MockConnexion.java) =================================================================== --- trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/impl/mock/MockConnexion.java (rev 0) +++ trunk/lutinvcs/lutinvcs-provider-mock/src/main/java/org/codelutin/vcs/impl/mock/MockConnexion.java 2008-04-04 21:26:10 UTC (rev 349) @@ -0,0 +1,40 @@ +/** + * # #% Copyright (C) 2008 Code Lutin, Tony Chemit + * This program is free software; you + * can redistribute it and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. This program 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 General Public License for more details. You + * should have received a copy of the GNU General Public License along with this + * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place + * - Suite 330, Boston, MA 02111-1307, USA. + * # #% + */ +package org.codelutin.vcs.impl.mock; + +import org.codelutin.vcs.util.AbstractVCSConnexion; +import org.codelutin.vcs.VCSConfig; +import org.codelutin.vcs.VCSHandler; +import org.codelutin.vcs.ConnectionState; + +/** @author chemit */ +public class MockConnexion extends AbstractVCSConnexion { + + public void init(VCSConfig config, VCSHandler handler) { + state = ConnectionState.INIT; + } + + @Override + public void close() throws IllegalStateException { + checkInit(); + } + + @Override + public void open() throws IllegalStateException { + checkInit(); + state = ConnectionState.INIT; + } + +} \ No newline at end of file Deleted: trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/SVNConnexion.java =================================================================== --- trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/SVNConnexion.java 2008-04-04 21:24:11 UTC (rev 348) +++ trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/SVNConnexion.java 2008-04-04 21:26:10 UTC (rev 349) @@ -1,38 +0,0 @@ -/** - * # #% Copyright (C) 2008 Code Lutin, Tony Chemit - * This program is free software; you - * can redistribute it and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. This program 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 General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - * - Suite 330, Boston, MA 02111-1307, USA. - * # #% - */ -package org.codelutin.vcs; - -import org.codelutin.vcs.util.AbstractVCSConnexion; - -/** @author chemit */ -public class SVNConnexion extends AbstractVCSConnexion { - - public void init(VCSConfig config, VCSHandler handler) { - state = null; - } - - @Override - public void close() throws IllegalStateException { - checkInit(); - if (!isOpen()) { - return; - } - } - - @Override - public void open() throws IllegalStateException { - checkInit(); - } -} Copied: trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNConnexion.java (from rev 345, trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/SVNConnexion.java) =================================================================== --- trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNConnexion.java (rev 0) +++ trunk/lutinvcs/lutinvcs-provider-svn/src/main/java/org/codelutin/vcs/impl/svn/SVNConnexion.java 2008-04-04 21:26:10 UTC (rev 349) @@ -0,0 +1,40 @@ +/** + * # #% Copyright (C) 2008 Code Lutin, Tony Chemit + * This program is free software; you + * can redistribute it and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. This program 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 General Public License for more details. You + * should have received a copy of the GNU General Public License along with this + * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place + * - Suite 330, Boston, MA 02111-1307, USA. + * # #% + */ +package org.codelutin.vcs.impl.svn; + +import org.codelutin.vcs.util.AbstractVCSConnexion; +import org.codelutin.vcs.VCSConfig; +import org.codelutin.vcs.VCSHandler; + +/** @author chemit */ +public class SVNConnexion extends AbstractVCSConnexion { + + public void init(VCSConfig config, VCSHandler handler) { + state = null; + } + + @Override + public void close() throws IllegalStateException { + checkInit(); + if (!isOpen()) { + return; + } + } + + @Override + public void open() throws IllegalStateException { + checkInit(); + } +}
participants (1)
-
tchemit@users.labs.libre-entreprise.org