Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-03-20 06:36:06 -0400
committerEike Stepper2015-03-20 06:36:06 -0400
commit49f9fe8f8997293590d4f6a2314a5565c57ecbaa (patch)
treec9da0d797c8825778d7aa25d74ba2ab4615675b8 /plugins/org.eclipse.emf.cdo.explorer
parent2310c315b350372c5515dd799b8a6e1acd546013 (diff)
downloadcdo-49f9fe8f8997293590d4f6a2314a5565c57ecbaa.tar.gz
cdo-49f9fe8f8997293590d4f6a2314a5565c57ecbaa.tar.xz
cdo-49f9fe8f8997293590d4f6a2314a5565c57ecbaa.zip
[458349] Consolidate UI
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=458349
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.explorer')
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/repositories/CDORepository.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryImpl.java40
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryManagerImpl.java2
3 files changed, 45 insertions, 7 deletions
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/repositories/CDORepository.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/repositories/CDORepository.java
index 7d8b9bcf93..ab73a7679d 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/repositories/CDORepository.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/repositories/CDORepository.java
@@ -20,6 +20,8 @@ import org.eclipse.emf.cdo.transaction.CDOTransactionOpener;
import org.eclipse.emf.cdo.view.CDOViewOpener;
import org.eclipse.net4j.util.container.IContainer;
+import org.eclipse.net4j.util.security.IPasswordCredentials;
+import org.eclipse.net4j.util.security.IPasswordCredentialsProvider2;
/**
* A CDO server independent representation of a repository.
@@ -27,8 +29,8 @@ import org.eclipse.net4j.util.container.IContainer;
* @author Eike Stepper
* @since 4.4
*/
-public interface CDORepository extends CDOExplorerElement, IContainer<CDOBranch>, CDOSessionProvider, CDOViewOpener,
- CDOTransactionOpener
+public interface CDORepository extends CDOExplorerElement, IContainer<CDOBranch>, IPasswordCredentialsProvider2,
+ CDOSessionProvider, CDOViewOpener, CDOTransactionOpener
{
public static final String TYPE_REMOTE = "remote";
@@ -54,6 +56,10 @@ public interface CDORepository extends CDOExplorerElement, IContainer<CDOBranch>
public IDGeneration getIDGeneration();
+ public IPasswordCredentials getCredentials();
+
+ public void setCredentials(IPasswordCredentials credentials);
+
public State getState();
public boolean isConnected();
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryImpl.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryImpl.java
index 96c5d92400..1bfa484e57 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryImpl.java
@@ -41,6 +41,7 @@ import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.event.IListener;
import org.eclipse.net4j.util.lifecycle.ILifecycle;
import org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter;
+import org.eclipse.net4j.util.security.IPasswordCredentials;
import org.eclipse.emf.ecore.resource.ResourceSet;
@@ -57,6 +58,8 @@ public abstract class CDORepositoryImpl extends AbstractElement implements CDORe
{
public static final String PROP_NAME = "name";
+ public static final String PROP_REALM = "realm";
+
public static final String REPOSITORY_KEY = CDORepository.class.getName();
private final Set<CDOCheckout> checkouts = new HashSet<CDOCheckout>();
@@ -111,6 +114,8 @@ public abstract class CDORepositoryImpl extends AbstractElement implements CDORe
private CDORepository.IDGeneration idGeneration;
+ private String realm;
+
private State state = State.Disconnected;
private boolean explicitelyConnected;
@@ -153,6 +158,25 @@ public abstract class CDORepositoryImpl extends AbstractElement implements CDORe
return idGeneration;
}
+ public IPasswordCredentials getCredentials()
+ {
+ return getCredentials(null);
+ }
+
+ public IPasswordCredentials getCredentials(String realm)
+ {
+ return null;
+ }
+
+ public void setCredentials(IPasswordCredentials credentials)
+ {
+ }
+
+ public boolean isInteractive()
+ {
+ return false;
+ }
+
public final State getState()
{
return state;
@@ -481,9 +505,9 @@ public abstract class CDORepositoryImpl extends AbstractElement implements CDORe
{
super.init(folder, type, properties);
name = properties.getProperty(PROP_NAME);
- versioningMode = CDORepository.VersioningMode.valueOf(properties
- .getProperty(CDORepositoryImpl.PROP_VERSIONING_MODE));
- idGeneration = CDORepository.IDGeneration.valueOf(properties.getProperty(CDORepositoryImpl.PROP_ID_GENERATION));
+ versioningMode = VersioningMode.valueOf(properties.getProperty(PROP_VERSIONING_MODE));
+ idGeneration = IDGeneration.valueOf(properties.getProperty(PROP_ID_GENERATION));
+ realm = properties.getProperty(PROP_REALM);
}
@Override
@@ -491,8 +515,13 @@ public abstract class CDORepositoryImpl extends AbstractElement implements CDORe
{
super.collectProperties(properties);
properties.setProperty(PROP_NAME, name);
- properties.setProperty(CDORepositoryImpl.PROP_VERSIONING_MODE, versioningMode.toString());
- properties.setProperty(CDORepositoryImpl.PROP_ID_GENERATION, idGeneration.toString());
+ properties.setProperty(PROP_VERSIONING_MODE, versioningMode.toString());
+ properties.setProperty(PROP_ID_GENERATION, idGeneration.toString());
+
+ if (realm != null)
+ {
+ properties.setProperty(PROP_REALM, realm);
+ }
}
protected IConnector getConnector()
@@ -516,6 +545,7 @@ public abstract class CDORepositoryImpl extends AbstractElement implements CDORe
CDOSessionConfiguration sessionConfiguration = createSessionConfiguration();
sessionConfiguration.setPassiveUpdateEnabled(true);
sessionConfiguration.setPassiveUpdateMode(PassiveUpdateMode.CHANGES);
+ sessionConfiguration.setCredentialsProvider(this);
CDOSession session = sessionConfiguration.openSession();
session.options().setGeneratedPackageEmulationEnabled(true);
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryManagerImpl.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryManagerImpl.java
index f8fa77ea0d..2bdee9fcae 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryManagerImpl.java
@@ -27,6 +27,8 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public class CDORepositoryManagerImpl extends AbstractManager<CDORepository> implements CDORepositoryManager
{
+ public static final String SECURE_STORE_PATH = "/CDO/repositories";
+
private static final String PROPERTIES_FILE = "repository.properties";
private final Map<CDOSession, CDORepository> sessionMap = new ConcurrentHashMap<CDOSession, CDORepository>();

Back to the top