Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 232982 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/team/internal/ccvs/core/ICVSRepositoryLocation.java (-4 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 19-28 Link Here
19
 * the repository location string for use by connection methods
19
 * the repository location string for use by connection methods
20
 * and the user authenticator.
20
 * and the user authenticator.
21
 * 
21
 * 
22
 * It is not intended to implemented by clients.
23
 * 
24
 * @see IUserAuthenticator
22
 * @see IUserAuthenticator
25
 * @see IConnectionMethod
23
 * @see IConnectionMethod
24
 * 
25
 * @noimplement It is not intended to implemented by clients.
26
 */
26
 */
27
public interface ICVSRepositoryLocation  extends IAdaptable {
27
public interface ICVSRepositoryLocation  extends IAdaptable {
28
28
Lines 103-109 Link Here
103
	public IUserInfo getUserInfo(boolean allowModificationOfUsername);	
103
	public IUserInfo getUserInfo(boolean allowModificationOfUsername);	
104
	
104
	
105
	/**
105
	/**
106
	 * Flush any cahced user information related to the repository location
106
	 * Flush any cached user information related to the repository location
107
	 */
107
	 */
108
	public void flushUserInfo();
108
	public void flushUserInfo();
109
	
109
	
(-)src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java (-13 / +22 lines)
Lines 141-147 Link Here
141
	private boolean previousAuthenticationFailed = false;
141
	private boolean previousAuthenticationFailed = false;
142
	
142
	
143
	/**
143
	/**
144
	 * Return the preferences node whose child nodes are teh know repositories
144
	 * Return the preferences node whose child nodes are the know repositories
145
	 * @return a preferences node
145
	 * @return a preferences node
146
	 */
146
	 */
147
	public static Preferences getParentPreferences() {
147
	public static Preferences getParentPreferences() {
Lines 149-155 Link Here
149
	}
149
	}
150
	
150
	
151
	/**
151
	/**
152
	 * Return a preferences node that contains suitabel defaults for a
152
	 * Return a preferences node that contains suitable defaults for a
153
	 * repository location.
153
	 * repository location.
154
	 * @return  a preferences node
154
	 * @return  a preferences node
155
	 */
155
	 */
Lines 548-558 Link Here
548
	
548
	
549
	/*
549
	/*
550
	 * Dispose of the receiver by clearing any cached authorization information.
550
	 * Dispose of the receiver by clearing any cached authorization information.
551
	 * This method shold only be invoked when the corresponding adapter is shut
551
	 * This method should only be invoked when the corresponding adapter is shut
552
	 * down or a connection is being validated.
552
	 * down or a connection is being validated.
553
	 */
553
	 */
554
	public void dispose() {
554
	public void dispose() {
555
		flushCache();
555
		removeNode();
556
		try {
556
		try {
557
			if (hasPreferences()) {
557
			if (hasPreferences()) {
558
				internalGetPreferences().removeNode();
558
				internalGetPreferences().removeNode();
Lines 564-577 Link Here
564
	}
564
	}
565
	
565
	
566
	/*
566
	/*
567
	 * Flush the keyring entry associated with the receiver
567
	 * Clear and flush the keyring entry associated with the receiver
568
	 */
568
	 */
569
	private void flushCache() {
569
	private void removeNode() {
570
		ISecurePreferences node = getCVSNode();
570
		ISecurePreferences node = getCVSNode();
571
		if (node == null)
571
		if (node == null)
572
			return;
572
			return;
573
		try {
573
		try {
574
			node.flush();
574
			node.clear();
575
			node.flush(); // save immediately
576
		} catch (IllegalStateException e) {
577
			CVSProviderPlugin.log(IStatus.ERROR, e.getMessage(), e);
575
		} catch (IOException e) {
578
		} catch (IOException e) {
576
			CVSProviderPlugin.log(IStatus.ERROR, e.getMessage(), e);
579
			CVSProviderPlugin.log(IStatus.ERROR, e.getMessage(), e);
577
		}
580
		}
Lines 889-896 Link Here
889
    }
892
    }
890
893
891
    /*
894
    /*
892
     * The connection was sucessfully made. Update the cached
895
     * The connection was successfully made. Update the cached
893
     * repository location if it is a differnet instance than
896
     * repository location if it is a different instance than
894
     * this location.
897
     * this location.
895
     */
898
     */
896
    private void updateCachedLocation() {
899
    private void updateCachedLocation() {
Lines 963-968 Link Here
963
		// We set the password here but it will be cleared 
966
		// We set the password here but it will be cleared 
964
		// if the user info is cached using updateCache()
967
		// if the user info is cached using updateCache()
965
		this.password = password;
968
		this.password = password;
969
		// The password has been changed, reset the flag, so we won't 
970
		// prompt before attempting to connect
971
		previousAuthenticationFailed = false;
966
	}
972
	}
967
	
973
	
968
	/*
974
	/*
Lines 980-989 Link Here
980
	
986
	
981
	public void setAllowCaching(boolean value) {
987
	public void setAllowCaching(boolean value) {
982
		allowCaching = value;
988
		allowCaching = value;
983
        if (allowCaching)
989
        if (allowCaching) {
984
            updateCache();
990
            updateCache();
985
        else
991
        } else {
986
            flushCache();
992
        	if (password == null)
993
        		password = retrievePassword();
994
            removeNode();
995
        }
987
	}
996
	}
988
	
997
	
989
	public void updateCache() {
998
	public void updateCache() {
Lines 1082-1088 Link Here
1082
	 * @see ICVSRepositoryLocation#flushUserInfo()
1091
	 * @see ICVSRepositoryLocation#flushUserInfo()
1083
	 */
1092
	 */
1084
	public void flushUserInfo() {
1093
	public void flushUserInfo() {
1085
		flushCache();
1094
		removeNode();
1086
	}
1095
	}
1087
	
1096
	
1088
	/*
1097
	/*

Return to bug 232982