[Buix-commits] r643 - in trunk/lutinvcs: core/src/main/java/org/codelutin/vcs core/src/main/java/org/codelutin/vcs/type core/src/main/java/org/codelutin/vcs/util provider/cvs/src/main/java/org/codelutin/vcs/provider provider/cvs/src/main/java/org/codelutin/vcs/provider/cvs provider/mock/src/main/java/org/codelutin/vcs/provider provider/mock/src/main/java/org/codelutin/vcs/provider/mock provider/svn/src/main/java/org/codelutin/vcs/provider provider/svn/src/main/java/org/codelutin/vcs/provider/svn
Author: tchemit Date: 2008-04-27 14:15:39 +0000 (Sun, 27 Apr 2008) New Revision: 643 Added: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSURIResolver.java trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSConnexionConfigProperty.java trunk/lutinvcs/provider/cvs/src/main/java/org/codelutin/vcs/provider/cvs/CVSURIResolver.java trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/mock/MockURIResolver.java trunk/lutinvcs/provider/svn/src/main/java/org/codelutin/vcs/provider/svn/SVNURIResolver.java Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSCommon.java trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSConnexion.java trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSFactory.java trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSProvider.java trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSConnectionState.java trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSConnexionMode.java trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/AbstractVCSConnexion.java trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/AbstractVCSHandler.java trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/AbstractVCSProvider.java trunk/lutinvcs/provider/cvs/src/main/java/org/codelutin/vcs/provider/CVSProvider.java trunk/lutinvcs/provider/cvs/src/main/java/org/codelutin/vcs/provider/cvs/CVSConnexion.java trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/MockProvider.java trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/mock/MockConnexion.java trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/mock/MockHandler.java trunk/lutinvcs/provider/svn/src/main/java/org/codelutin/vcs/provider/SVNProvider.java trunk/lutinvcs/provider/svn/src/main/java/org/codelutin/vcs/provider/svn/SVNConnexion.java Log: introduc VCSURIResolver contract, to resolv remote URI from a VCSConnnexionConfg. Each provider acts as a VCSURIResolver factory via newURIResolver method. Handler has his own resolver. remove mode field from VCSConnexion, used the VCSConnexionConfig one instead. Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSCommon.java =================================================================== --- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSCommon.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSCommon.java 2008-04-27 14:15:39 UTC (rev 643) @@ -36,6 +36,10 @@ public interface VCSCommon { + VCSURIResolver getURIResolver(); + + void setURIResolver(VCSURIResolver uriResolver); + /** * init working copy, says if it is the first we use it it, we will checkout * the databaseDirectory directory Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSConnexion.java =================================================================== --- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSConnexion.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSConnexion.java 2008-04-27 14:15:39 UTC (rev 643) @@ -26,7 +26,7 @@ * The method {@link #init(VCSConnexionConfig)} must be invoked before using the connexion. * <p/> * Note: you should not instanciate directly this class but use - * {@link org.codelutin.vcs.VCSProvider#newConnection(org.codelutin.vcs.type.VCSConnexionMode , VCSConnexionConfig)} instead. + * {@link VCSProvider#newConnection(VCSConnexionConfig)} instead. * * @author chemit */ Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSFactory.java =================================================================== --- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSFactory.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSFactory.java 2008-04-27 14:15:39 UTC (rev 643) @@ -83,7 +83,7 @@ VCSProvider<?, ?> provider = factory.getProvider(config.getType().toUpperCase()); // delegate instanciation of connexion to provider - VCSConnexion connexion = provider.newConnection(config.getMode(), config); + VCSConnexion connexion = provider.newConnection(config); // init connexion connexion.init(config); Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSProvider.java =================================================================== --- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSProvider.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSProvider.java 2008-04-27 14:15:39 UTC (rev 643) @@ -17,11 +17,12 @@ /** * The contract to be realized to provide vcs communication. * <p/> - * The provider acts as a factory of {@link VCSConnexion}. - * + * The provider acts as a factory of {@link VCSConnexion} and {@link VCSURIResolver}. + * * @author chemit - * @see org.codelutin.vcs.VCSHandler - * @see org.codelutin.vcs.VCSConnexion + * @see VCSHandler + * @see VCSConnexion + * @see VCSURIResolver */ public interface VCSProvider<C extends VCSConnexion<H>, H extends VCSHandler<C>> { @@ -34,15 +35,17 @@ /** @return the imclass of implementation of connexion to use for this provider */ Class<C> getConnexionImpl(); + /** @return a new instance of {@link VCSURIResolver} */ + VCSURIResolver newURIResolver(); + /** * Instanciate an new connexion for a given config, and init it. * <p/> * Note : <b>After this method connexion is init, but not opened.</b> * - * @param mode the mode required * @param config the config to be used * @return the new connexion initialized <b>but not opened</b>. */ - C newConnection(org.codelutin.vcs.type.VCSConnexionMode mode, VCSConnexionConfig config); + C newConnection(VCSConnexionConfig config); } Added: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSURIResolver.java =================================================================== --- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSURIResolver.java (rev 0) +++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/VCSURIResolver.java 2008-04-27 14:15:39 UTC (rev 643) @@ -0,0 +1,26 @@ +/** + * # #% 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; + +/** + * URI resolver from a config to build the remote vcs server uri to vcs root + * + * @author chemit + */ +public interface VCSURIResolver { + + java.net.URI resolv(VCSConnexionConfig config); + +} Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSConnectionState.java =================================================================== --- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSConnectionState.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSConnectionState.java 2008-04-27 14:15:39 UTC (rev 643) @@ -33,7 +33,7 @@ UNDEFINED, /** * connexion was init, but not opened (default state after instanciate a new connexion from - * {@link VCSProvider#newConnection(VCSConnexionMode, VCSConnexionConfig)} + * {@link VCSProvider#newConnection(VCSConnexionConfig)} */ INIT, /** connexion was successfull opened, via {@link VCSConnexion#open()} */ Added: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSConnexionConfigProperty.java =================================================================== --- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSConnexionConfigProperty.java (rev 0) +++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSConnexionConfigProperty.java 2008-04-27 14:15:39 UTC (rev 643) @@ -0,0 +1,56 @@ +/** + * ##% 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.type; + +import org.codelutin.vcs.VCSConnexionConfig; + +/** + * Enumaration of properties useable in a {@link VCSConnexionConfig} + * + * @author chemit + * @see VCSConnexionConfig + */ +public enum VCSConnexionConfigProperty { + + /** property <code>rootConfig</code>, as a {@link org.codelutin.vcs.VCSRootConfig} */ + rootConfig, + + /** property <code>connexionMode</code>, as a {@link org.codelutin.vcs.type.VCSConnexionMode} */ + connexionMode, + + /** property <code>typeRepo</code>, type of repo to use, as a {@link VCSTypeRepo} */ + typeRepo, + + /** property <code>typeRepoValue</code>, the value associated to typeRepo (eg, branch or tag name, null for a head connexion) */ + typeRepoValue, + + /** property <code>login</code>, login for a password connexion */ + login, + + /** property <code>password</code>, password for a password connexion */ + password, + + /** property <code>sshLogin</code>, login for a ssh connexion */ + sshLogin, + + /** property <code>sshPassphrase</code>, passphrase for a ssh connexion */ + sshPassphrase, + + /** property <code>sshPrivateKey</code>, path of the ssh private key file for a ssh connexion */ + sshPrivateKeyFile, + + /** property <code>localDatabasePath</code>, path of the local working copy */ + localDatabasePath +} \ No newline at end of file Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSConnexionMode.java =================================================================== --- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSConnexionMode.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/type/VCSConnexionMode.java 2008-04-27 14:15:39 UTC (rev 643) @@ -14,33 +14,38 @@ */ package org.codelutin.vcs.type; -import static org.codelutin.vcs.VCSConnexionConfig.PROPERTY_LOGIN; -import static org.codelutin.vcs.VCSConnexionConfig.PROPERTY_PASSWORD; -import static org.codelutin.vcs.VCSConnexionConfig.PROPERTY_SSH_LOGIN; -import static org.codelutin.vcs.VCSConnexionConfig.PROPERTY_SSH_PASSPHRASE; -import static org.codelutin.vcs.VCSConnexionConfig.PROPERTY_SSH_PRIVATE_KEY_FILE; +import org.codelutin.vcs.VCSConnexionConfig; +import static org.codelutin.vcs.type.VCSConnexionConfigProperty.login; +import static org.codelutin.vcs.type.VCSConnexionConfigProperty.password; +import static org.codelutin.vcs.type.VCSConnexionConfigProperty.sshLogin; +import static org.codelutin.vcs.type.VCSConnexionConfigProperty.sshPassphrase; +import static org.codelutin.vcs.type.VCSConnexionConfigProperty.sshPrivateKeyFile; +import java.util.EnumSet; +import java.util.Arrays; + /** * Enumaration of connexion mode. * <p/> * Each mode known the list of authentication properties required for a connexion. * * @author chemit - * @see org.codelutin.vcs.VCSConnexionConfig + * @see VCSConnexionConfigProperty + * @see VCSConnexionConfig */ public enum VCSConnexionMode { ANONYMOUS, - PASSWORD(PROPERTY_LOGIN, PROPERTY_PASSWORD), - SSH(PROPERTY_SSH_LOGIN, PROPERTY_SSH_PASSPHRASE, PROPERTY_SSH_PRIVATE_KEY_FILE); + PASSWORD(login, password), + SSH(sshLogin, sshPassphrase, sshPrivateKeyFile); /** array of authentication properties required for this connexion mode. */ - private final String[] authenticationProperties; + private final EnumSet<VCSConnexionConfigProperty> authenticationProperties; - VCSConnexionMode(String... authenticationProperties) { - this.authenticationProperties = authenticationProperties; + VCSConnexionMode(VCSConnexionConfigProperty... authenticationProperties) { + this.authenticationProperties = EnumSet.copyOf(Arrays.asList(authenticationProperties)); } - public String[] getAuthenticationProperties() { + public EnumSet<VCSConnexionConfigProperty> getAuthenticationProperties() { return authenticationProperties; } } Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/AbstractVCSConnexion.java =================================================================== --- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/AbstractVCSConnexion.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/AbstractVCSConnexion.java 2008-04-27 14:15:39 UTC (rev 643) @@ -22,6 +22,7 @@ import org.codelutin.vcs.VCSConnexionConfig; import org.codelutin.vcs.VCSException; import org.codelutin.vcs.VCSHandler; +import org.codelutin.vcs.VCSURIResolver; import org.codelutin.vcs.event.VCSConnexionEvent; import org.codelutin.vcs.event.VCSConnexionEventListener; import org.codelutin.vcs.type.VCSConnectionState; @@ -43,7 +44,6 @@ protected File localRoot; protected URI remoteRoot; - protected VCSConnexionMode mode; protected VCSConnectionState state; protected VCSConnexionConfig config; protected H handler; @@ -51,8 +51,7 @@ protected ListenerSet<VCSConnexionEventListener> listeners = new ListenerSet<VCSConnexionEventListener>(); @SuppressWarnings({"unchecked"}) - protected AbstractVCSConnexion(VCSConnexionMode mode, H handler) { - this.mode = mode; + protected AbstractVCSConnexion(H handler) { this.handler = handler; this.handler.setConnexion(this); // by default, state is undefined before init @@ -78,7 +77,7 @@ public VCSConnexionMode getMode() throws IllegalStateException { checkInit(); - return mode; + return getConfig().getMode(); } public VCSConnexionConfig getConfig() throws IllegalStateException { @@ -252,6 +251,14 @@ return handler.hasProtocoleChanged(); } + public VCSURIResolver getURIResolver() { + return handler.getURIResolver(); + } + + public void setURIResolver(VCSURIResolver uriResolver) { + handler.setURIResolver(uriResolver); + } + protected void fireOpened() { VCSConnexionEvent e = new VCSConnexionEvent(this, VCSConnectionState.OPEN); for (VCSConnexionEventListener l : listeners) { @@ -270,6 +277,7 @@ if (state == VCSConnectionState.UNDEFINED) { throw new IllegalStateException(_("lutinvcs.error.connexion.noinit", this)); } + //TODO Should check config exists } protected void checkOpen() throws IllegalStateException { Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/AbstractVCSHandler.java =================================================================== --- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/AbstractVCSHandler.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/AbstractVCSHandler.java 2008-04-27 14:15:39 UTC (rev 643) @@ -26,6 +26,7 @@ import org.codelutin.vcs.VCSConnexion; import org.codelutin.vcs.VCSHandler; import org.codelutin.vcs.VCSRuntimeException; +import org.codelutin.vcs.VCSURIResolver; import org.codelutin.vcs.type.VCSTypeRepo; import java.io.File; @@ -55,6 +56,7 @@ protected final String confLocalDirName; protected final String confLocalEntriesFilename; protected C connexion; + protected VCSURIResolver uriResolver; protected AbstractVCSHandler(final String vCSConfLocalDirName, String vCSConfLocalEntriesFilename) { this.confLocalDirName = vCSConfLocalDirName; @@ -71,6 +73,14 @@ }; } + public VCSURIResolver getURIResolver() { + return uriResolver; + } + + public void setURIResolver(VCSURIResolver uriResolver) { + this.uriResolver = uriResolver; + } + public void setConnexion(C connexion) { this.connexion = connexion; } Modified: trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/AbstractVCSProvider.java =================================================================== --- trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/AbstractVCSProvider.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/core/src/main/java/org/codelutin/vcs/util/AbstractVCSProvider.java 2008-04-27 14:15:39 UTC (rev 643) @@ -14,14 +14,14 @@ */ package org.codelutin.vcs.util; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import static org.codelutin.i18n.I18n._; import org.codelutin.vcs.VCSConnexion; import org.codelutin.vcs.VCSConnexionConfig; import org.codelutin.vcs.VCSHandler; import org.codelutin.vcs.VCSProvider; -import org.codelutin.vcs.type.VCSConnexionMode; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.codelutin.vcs.VCSURIResolver; /** * base implementation of provider. @@ -41,10 +41,15 @@ /** implementation of connexion to use */ private final Class<C> connexionImpl; - protected AbstractVCSProvider(String name, Class<H> handlerImpl, Class<C> connexionImpl) { + /** implementation of {@link VCSURIResolver} to use */ + private final Class<? extends VCSURIResolver> resolverImpl; + + + protected AbstractVCSProvider(String name, Class<H> handlerImpl, Class<C> connexionImpl, Class<? extends VCSURIResolver> resolverImpl) { this.name = name; this.handlerImpl = handlerImpl; this.connexionImpl = connexionImpl; + this.resolverImpl = resolverImpl; } public final String getName() { @@ -59,18 +64,19 @@ return handlerImpl; } - public C newConnection(VCSConnexionMode mode, VCSConnexionConfig config) { + public C newConnection(VCSConnexionConfig config) { H handler; C connexion; try { handler = handlerImpl.newInstance(); + handler.setURIResolver(newURIResolver()); } catch (Exception e) { throw new RuntimeException(_("lutinvcs.error.provider.init.handler", handlerImpl, this, e.getCause())); } try { - connexion = connexionImpl.getConstructor(VCSConnexionMode.class, handlerImpl).newInstance(mode, handler); + connexion = connexionImpl.getConstructor(handlerImpl).newInstance(handler); // always init connexion from his config connexion.init(config); @@ -81,4 +87,13 @@ } } + public VCSURIResolver newURIResolver() { + try { + return resolverImpl.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + } } Modified: trunk/lutinvcs/provider/cvs/src/main/java/org/codelutin/vcs/provider/CVSProvider.java =================================================================== --- trunk/lutinvcs/provider/cvs/src/main/java/org/codelutin/vcs/provider/CVSProvider.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/provider/cvs/src/main/java/org/codelutin/vcs/provider/CVSProvider.java 2008-04-27 14:15:39 UTC (rev 643) @@ -16,13 +16,14 @@ import org.codelutin.vcs.provider.cvs.CVSConnexion; import org.codelutin.vcs.provider.cvs.CVSHandler; +import org.codelutin.vcs.provider.cvs.CVSURIResolver; import org.codelutin.vcs.util.AbstractVCSProvider; /** @author chemit */ public class CVSProvider extends AbstractVCSProvider<CVSConnexion, CVSHandler> { public CVSProvider() { - super("CVS", CVSHandler.class, CVSConnexion.class); + super("CVS", CVSHandler.class, CVSConnexion.class, CVSURIResolver.class); } } \ No newline at end of file Modified: trunk/lutinvcs/provider/cvs/src/main/java/org/codelutin/vcs/provider/cvs/CVSConnexion.java =================================================================== --- trunk/lutinvcs/provider/cvs/src/main/java/org/codelutin/vcs/provider/cvs/CVSConnexion.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/provider/cvs/src/main/java/org/codelutin/vcs/provider/cvs/CVSConnexion.java 2008-04-27 14:15:39 UTC (rev 643) @@ -9,7 +9,7 @@ * 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. + * - Suite 330, Boston, MA 02111-1307, USA. * ##% */ package org.codelutin.vcs.provider.cvs; @@ -17,7 +17,6 @@ import org.codelutin.vcs.VCSConnexionConfig; import org.codelutin.vcs.VCSException; import org.codelutin.vcs.type.VCSConnectionState; -import org.codelutin.vcs.type.VCSConnexionMode; import org.codelutin.vcs.util.AbstractVCSConnexion; import org.netbeans.lib.cvsclient.CVSRoot; import org.netbeans.lib.cvsclient.Client; @@ -29,8 +28,8 @@ /** @author chemit */ public class CVSConnexion extends AbstractVCSConnexion<CVSHandler> { - public CVSConnexion(VCSConnexionMode mode, CVSHandler handler) { - super(mode, handler); + public CVSConnexion(CVSHandler handler) { + super(handler); } public void init(VCSConnexionConfig config) { Added: trunk/lutinvcs/provider/cvs/src/main/java/org/codelutin/vcs/provider/cvs/CVSURIResolver.java =================================================================== --- trunk/lutinvcs/provider/cvs/src/main/java/org/codelutin/vcs/provider/cvs/CVSURIResolver.java (rev 0) +++ trunk/lutinvcs/provider/cvs/src/main/java/org/codelutin/vcs/provider/cvs/CVSURIResolver.java 2008-04-27 14:15:39 UTC (rev 643) @@ -0,0 +1,27 @@ +/** + * # #% 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.provider.cvs; + +import org.codelutin.vcs.VCSConnexionConfig; + +import java.net.URI; + +/** @author chemit */ +public class CVSURIResolver implements org.codelutin.vcs.VCSURIResolver { + public URI resolv(VCSConnexionConfig config) { + //TODO + return null; + } +} Modified: trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/MockProvider.java =================================================================== --- trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/MockProvider.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/MockProvider.java 2008-04-27 14:15:39 UTC (rev 643) @@ -16,13 +16,14 @@ import org.codelutin.vcs.provider.mock.MockConnexion; import org.codelutin.vcs.provider.mock.MockHandler; +import org.codelutin.vcs.provider.mock.MockURIResolver; import org.codelutin.vcs.util.AbstractVCSProvider; /** @author chemit */ public class MockProvider extends AbstractVCSProvider<MockConnexion, MockHandler> { public MockProvider() { - super("MOCK", MockHandler.class, MockConnexion.class); + super("MOCK", MockHandler.class, MockConnexion.class, MockURIResolver.class); } } \ No newline at end of file Modified: trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/mock/MockConnexion.java =================================================================== --- trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/mock/MockConnexion.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/mock/MockConnexion.java 2008-04-27 14:15:39 UTC (rev 643) @@ -17,14 +17,13 @@ import org.codelutin.vcs.VCSConnexionConfig; import org.codelutin.vcs.VCSException; import org.codelutin.vcs.type.VCSConnectionState; -import org.codelutin.vcs.type.VCSConnexionMode; import org.codelutin.vcs.util.AbstractVCSConnexion; /** @author chemit */ public class MockConnexion extends AbstractVCSConnexion<MockHandler> { - public MockConnexion(VCSConnexionMode mode, MockHandler handler) { - super(mode, handler); + public MockConnexion(MockHandler handler) { + super(handler); } public void init(VCSConnexionConfig config) { Modified: trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/mock/MockHandler.java =================================================================== --- trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/mock/MockHandler.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/mock/MockHandler.java 2008-04-27 14:15:39 UTC (rev 643) @@ -110,15 +110,15 @@ } public String getChangeLog(File file) throws VCSException { - return this+" changelog for : \n"+file+"... mock"; + return this + " changelog for : \n" + file + "... mock"; } public String getDiff(File file) throws VCSException, IOException { - return this+" diff for : \n"+file+"... mock"; + return this + " diff for : \n" + file + "... mock"; } public String getDiff(File file, Object againstRevision) throws VCSException, IOException { - return this+" diff for : \n"+file+"... mock"; + return this + " diff for : \n" + file + "... mock"; } public boolean hasProtocoleChanged() throws VCSException { Added: trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/mock/MockURIResolver.java =================================================================== --- trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/mock/MockURIResolver.java (rev 0) +++ trunk/lutinvcs/provider/mock/src/main/java/org/codelutin/vcs/provider/mock/MockURIResolver.java 2008-04-27 14:15:39 UTC (rev 643) @@ -0,0 +1,25 @@ +/** + * # #% 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.provider.mock; + +import java.net.URI; + +/** @author chemit */ +public class MockURIResolver implements org.codelutin.vcs.VCSURIResolver { + public URI resolv(org.codelutin.vcs.VCSConnexionConfig config) { + //TODO + return null; + } +} Modified: trunk/lutinvcs/provider/svn/src/main/java/org/codelutin/vcs/provider/SVNProvider.java =================================================================== --- trunk/lutinvcs/provider/svn/src/main/java/org/codelutin/vcs/provider/SVNProvider.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/provider/svn/src/main/java/org/codelutin/vcs/provider/SVNProvider.java 2008-04-27 14:15:39 UTC (rev 643) @@ -16,6 +16,7 @@ import org.codelutin.vcs.provider.svn.SVNConnexion; import org.codelutin.vcs.provider.svn.SVNHandler; +import org.codelutin.vcs.provider.svn.SVNURIResolver; import org.codelutin.vcs.type.VCSTypeRepo; import org.codelutin.vcs.util.AbstractVCSHandler; import org.codelutin.vcs.util.AbstractVCSProvider; @@ -45,9 +46,7 @@ private static boolean libraryInit; public SVNProvider() { - - super("SVN", SVNHandler.class, SVNConnexion.class); - + super("SVN", SVNHandler.class, SVNConnexion.class, SVNURIResolver.class); setupLibrary(); } Modified: trunk/lutinvcs/provider/svn/src/main/java/org/codelutin/vcs/provider/svn/SVNConnexion.java =================================================================== --- trunk/lutinvcs/provider/svn/src/main/java/org/codelutin/vcs/provider/svn/SVNConnexion.java 2008-04-27 12:55:51 UTC (rev 642) +++ trunk/lutinvcs/provider/svn/src/main/java/org/codelutin/vcs/provider/svn/SVNConnexion.java 2008-04-27 14:15:39 UTC (rev 643) @@ -20,7 +20,6 @@ import org.codelutin.vcs.VCSRuntimeException; import org.codelutin.vcs.provider.SVNProvider; import org.codelutin.vcs.type.VCSConnectionState; -import org.codelutin.vcs.type.VCSConnexionMode; import org.codelutin.vcs.util.AbstractVCSConnexion; import org.tmatesoft.svn.core.SVNException; import org.tmatesoft.svn.core.SVNURL; @@ -44,8 +43,8 @@ protected SVNWCClient ourWcClient; - public SVNConnexion(VCSConnexionMode mode, SVNHandler handler) { - super(mode, handler); + public SVNConnexion(SVNHandler handler) { + super(handler); } public void init(VCSConnexionConfig config) { Added: trunk/lutinvcs/provider/svn/src/main/java/org/codelutin/vcs/provider/svn/SVNURIResolver.java =================================================================== --- trunk/lutinvcs/provider/svn/src/main/java/org/codelutin/vcs/provider/svn/SVNURIResolver.java (rev 0) +++ trunk/lutinvcs/provider/svn/src/main/java/org/codelutin/vcs/provider/svn/SVNURIResolver.java 2008-04-27 14:15:39 UTC (rev 643) @@ -0,0 +1,28 @@ +/** + * # #% 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.provider.svn; + +import org.codelutin.vcs.VCSConnexionConfig; + +import java.net.URI; + +/** @author chemit */ +public class SVNURIResolver implements org.codelutin.vcs.VCSURIResolver { + + public URI resolv(VCSConnexionConfig config) { + //TODO + return null; + } +}
participants (1)
-
tchemit@users.labs.libre-entreprise.org