diff options
author | Eike Stepper | 2018-05-10 12:14:15 +0000 |
---|---|---|
committer | Eike Stepper | 2018-05-10 12:14:15 +0000 |
commit | 5a38f1bf4091b5e40710e4cbd94b08eb840bb81b (patch) | |
tree | 0bbddd8aaa8b861ff91aea94e731621d8ef7377a /plugins/org.eclipse.emf.cdo | |
parent | 217a0f1811e5db0791f682d0460d9380218e750e (diff) | |
download | cdo-5a38f1bf4091b5e40710e4cbd94b08eb840bb81b.tar.gz cdo-5a38f1bf4091b5e40710e4cbd94b08eb840bb81b.tar.xz cdo-5a38f1bf4091b5e40710e4cbd94b08eb840bb81b.zip |
[534535] Provide property support for repositories
https://bugs.eclipse.org/bugs/show_bug.cgi?id=534535
Diffstat (limited to 'plugins/org.eclipse.emf.cdo')
3 files changed, 16 insertions, 320 deletions
diff --git a/plugins/org.eclipse.emf.cdo/plugin.xml b/plugins/org.eclipse.emf.cdo/plugin.xml index 90e772d4f0..6379492e14 100644 --- a/plugins/org.eclipse.emf.cdo/plugin.xml +++ b/plugins/org.eclipse.emf.cdo/plugin.xml @@ -49,11 +49,11 @@ </extension> <extension point="org.eclipse.core.expressions.propertyTesters"> - <propertyTester + <propertyTester id="org.eclipse.emf.cdo.session.properties" type="org.eclipse.emf.cdo.session.CDOSession" namespace="org.eclipse.emf.cdo.session" - properties="open,sessionID,userID,passiveUpdateEnabled,lastUpdateTime,passiveUpdateMode,repositoryName,repositoryUUID,repositoryType,repositoryState,repositoryCreationTime,supportingAudits,supportingBranches,serializeCommits,ensureReferentialIntegrity,idGenerationLocation,storeType,objectIDTypes,userAuthenticated" + properties="open,sessionID,userID,passiveUpdateEnabled,lastUpdateTime,passiveUpdateMode,repositoryName,repositoryUUID,repositoryType,repositoryState,repositoryCreationTime,authenticating,supportingAudits,supportingBranches,supportingUnits,serializeCommits,ensureReferentialIntegrity,idGenerationLocation,commitInfoStorage,storeType,objectIDTypes,userAuthenticated" class="org.eclipse.emf.internal.cdo.session.SessionProperties$Tester"/> <propertyTester id="org.eclipse.emf.cdo.view.properties" diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties index 614542e052..4854f109c0 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties @@ -100,37 +100,7 @@ SessionPropertyTester_6=Passive Updates Enabled SessionPropertyTester_7=Whether this session is receiving passive updates from the repository. SessionPropertyTester_8=Passive Updates Mode SessionPropertyTester_9=One of INVALIDATIONS, CHANGES, ADDITIONS. -SessionPropertyTester_10=Name -SessionPropertyTester_11=The name of the repository of this session. -SessionPropertyTester_12=UUID -SessionPropertyTester_13=The UUID of the repository of this session. -SessionPropertyTester_14=Type -SessionPropertyTester_15=The type of the repository of this session. One of MASTER, BACKUP, CLONE. -SessionPropertyTester_16=State -SessionPropertyTester_17=The state of the repository of this session. One of OFFLINE, SYNCING, ONLINE. -SessionPropertyTester_18=Creation Time -SessionPropertyTester_19=The creation time of the repository of this session. -SessionPropertyTester_20=Supporting Audits -SessionPropertyTester_21=Whether the repository of this session is supporting auditing. -SessionPropertyTester_22=Supporting Branches -SessionPropertyTester_23=Whether the repository of this session is supporting branching. -SessionPropertyTester_42=Supporting Units -SessionPropertyTester_43=Whether the repository of this session is supporting units. -SessionPropertyTester_24=Store Type -SessionPropertyTester_25=The type of the store that backs the repository of this session. -SessionPropertyTester_26=Object ID Types -SessionPropertyTester_27=The types of object IDs created by the store that backs the repository of this session. -SessionPropertyTester_30=Ensure Referential Integrity -SessionPropertyTester_31=Whether the repository of this session is ensuring referential integrity. -SessionPropertyTester_32=ID Generation Location -SessionPropertyTester_33=One of STORE, CLIENT. SessionPropertyTester_34=Open SessionPropertyTester_35=Whether this session is open or not. SessionPropertyTester_36=Last Update SessionPropertyTester_37=The time stamp of the last passive update. -SessionPropertyTester_38=Serialize Commits -SessionPropertyTester_39=Whether the repository of this session is serializing commits. -SessionPropertyTester_40=Authenticating -SessionPropertyTester_41=Whether the repository of this session is authenticating users. -SessionPropertyTester_42=Commit Info Storage -SessionPropertyTester_43=One of NO, YES, WITH_MERGE_SOURCE. diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java index 52f98474cf..64438f30bb 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java @@ -12,39 +12,41 @@ package org.eclipse.emf.internal.cdo.session; import org.eclipse.emf.cdo.common.CDOCommonRepository; -import org.eclipse.emf.cdo.common.id.CDOID; -import org.eclipse.emf.cdo.common.id.CDOID.ObjectType; import org.eclipse.emf.cdo.common.util.CDOCommonUtil; +import org.eclipse.emf.cdo.internal.common.AbstractRepositoryProperties; import org.eclipse.emf.cdo.session.CDOSession; import org.eclipse.emf.internal.cdo.messages.Messages; -import org.eclipse.net4j.util.AdapterUtil; import org.eclipse.net4j.util.StringUtil; import org.eclipse.net4j.util.properties.DefaultPropertyTester; import org.eclipse.net4j.util.properties.IProperties; -import org.eclipse.net4j.util.properties.Properties; import org.eclipse.net4j.util.properties.Property; -import org.eclipse.core.runtime.IProgressMonitor; - -import java.util.Set; - /** * @author Eike Stepper */ -public class SessionProperties extends Properties<CDOSession> implements CDOCommonRepository +public class SessionProperties extends AbstractRepositoryProperties<CDOSession> { public static final IProperties<CDOSession> INSTANCE = new SessionProperties(); private static final String CATEGORY_SESSION = "Session"; //$NON-NLS-1$ - private static final String CATEGORY_REPOSITORY = "Repository"; //$NON-NLS-1$ - private SessionProperties() { super(CDOSession.class); + } + + @Override + protected CDOCommonRepository getRepository(CDOSession session) + { + return session.getRepositoryInfo(); + } + + @Override + protected void initProperties() + { add(new Property<CDOSession>("open", Messages.getString("SessionPropertyTester_34"), // Messages.getString("SessionPropertyTester_35"), //$NON-NLS-1$ CATEGORY_SESSION) @@ -111,181 +113,7 @@ public class SessionProperties extends Properties<CDOSession> implements CDOComm } }); - add(new Property<CDOSession>("repositoryName", Messages.getString("SessionPropertyTester_10"), // - Messages.getString("SessionPropertyTester_11"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - return session.getRepositoryInfo().getName(); - } - }); - - add(new Property<CDOSession>("repositoryUUID", Messages.getString("SessionPropertyTester_12"), // - Messages.getString("SessionPropertyTester_13"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - return session.getRepositoryInfo().getUUID(); - } - }); - - add(new Property<CDOSession>("repositoryType", Messages.getString("SessionPropertyTester_14"), // - Messages.getString("SessionPropertyTester_15"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - return session.getRepositoryInfo().getType(); - } - }); - - add(new Property<CDOSession>("repositoryState", Messages.getString("SessionPropertyTester_16"), // - Messages.getString("SessionPropertyTester_17"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - return session.getRepositoryInfo().getState(); - } - }); - - add(new Property<CDOSession>("repositoryCreationTime", Messages.getString("SessionPropertyTester_18"), // - Messages.getString("SessionPropertyTester_19"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - return CDOCommonUtil.formatTimeStamp(session.getRepositoryInfo().getCreationTime()); - } - }); - - add(new Property<CDOSession>("authenticating", Messages.getString("SessionPropertyTester_40"), // - Messages.getString("SessionPropertyTester_41"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - return session.getRepositoryInfo().isAuthenticating(); - } - }); - - add(new Property<CDOSession>("supportingAudits", Messages.getString("SessionPropertyTester_20"), // - Messages.getString("SessionPropertyTester_21"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - return session.getRepositoryInfo().isSupportingAudits(); - } - }); - - add(new Property<CDOSession>("supportingBranches", Messages.getString("SessionPropertyTester_22"), // - Messages.getString("SessionPropertyTester_23"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - return session.getRepositoryInfo().isSupportingBranches(); - } - }); - - add(new Property<CDOSession>("supportingUnits", Messages.getString("SessionPropertyTester_22"), // - Messages.getString("SessionPropertyTester_23"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - return session.getRepositoryInfo().isSupportingBranches(); - } - }); - - add(new Property<CDOSession>("serializeCommits", Messages.getString("SessionPropertyTester_38"), // - Messages.getString("SessionPropertyTester_39"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - return session.getRepositoryInfo().isSerializingCommits(); - } - }); - - add(new Property<CDOSession>("ensureReferentialIntegrity", Messages.getString("SessionPropertyTester_30"), // - Messages.getString("SessionPropertyTester_31"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - return session.getRepositoryInfo().isEnsuringReferentialIntegrity(); - } - }); - - add(new Property<CDOSession>("idGenerationLocation", Messages.getString("SessionPropertyTester_32"), // - Messages.getString("SessionPropertyTester_33"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - return session.getRepositoryInfo().getIDGenerationLocation(); - } - }); - - add(new Property<CDOSession>("commitInfoStorage", Messages.getString("SessionPropertyTester_42"), // - Messages.getString("SessionPropertyTester_43"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - return session.getRepositoryInfo().getCommitInfoStorage(); - } - }); - - add(new Property<CDOSession>("storeType", Messages.getString("SessionPropertyTester_24"), // - Messages.getString("SessionPropertyTester_25"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - return session.getRepositoryInfo().getStoreType(); - } - }); - - add(new Property<CDOSession>("objectIDTypes", Messages.getString("SessionPropertyTester_26"), // - Messages.getString("SessionPropertyTester_27"), //$NON-NLS-1$ - CATEGORY_REPOSITORY) - { - @Override - protected Object eval(CDOSession session) - { - StringBuilder builder = new StringBuilder(); - for (CDOID.ObjectType objectIDType : session.getRepositoryInfo().getObjectIDTypes()) - { - if (builder.length() != 0) - { - builder.append(", "); //$NON-NLS-1$ - } - - builder.append(objectIDType); - } - - return builder; - } - }); + super.initProperties(); add(new Property<CDOSession>("userAuthenticated") { @@ -297,108 +125,6 @@ public class SessionProperties extends Properties<CDOSession> implements CDOComm }); } - @SuppressWarnings({ "unchecked", "rawtypes" }) - public Object getAdapter(Class adapter) - { - return AdapterUtil.adapt(this, adapter, false); - } - - public long getTimeStamp() - { - throw new UnsupportedOperationException(); - } - - public String getName() - { - throw new UnsupportedOperationException(); - } - - public String getUUID() - { - throw new UnsupportedOperationException(); - } - - public Type getType() - { - throw new UnsupportedOperationException(); - } - - public State getState() - { - throw new UnsupportedOperationException(); - } - - public long getCreationTime() - { - throw new UnsupportedOperationException(); - } - - public String getStoreType() - { - throw new UnsupportedOperationException(); - } - - public Set<ObjectType> getObjectIDTypes() - { - throw new UnsupportedOperationException(); - } - - public IDGenerationLocation getIDGenerationLocation() - { - throw new UnsupportedOperationException(); - } - - public CommitInfoStorage getCommitInfoStorage() - { - throw new UnsupportedOperationException(); - } - - public CDOID getRootResourceID() - { - throw new UnsupportedOperationException(); - } - - public boolean isAuthenticating() - { - throw new UnsupportedOperationException(); - } - - public boolean isSupportingAudits() - { - throw new UnsupportedOperationException(); - } - - public boolean isSupportingBranches() - { - throw new UnsupportedOperationException(); - } - - public boolean isSupportingUnits() - { - throw new UnsupportedOperationException(); - } - - @Deprecated - public boolean isSupportingEcore() - { - throw new UnsupportedOperationException(); - } - - public boolean isSerializingCommits() - { - throw new UnsupportedOperationException(); - } - - public boolean isEnsuringReferentialIntegrity() - { - throw new UnsupportedOperationException(); - } - - public boolean waitWhileInitial(IProgressMonitor monitor) - { - throw new UnsupportedOperationException(); - } - public static void main(String[] args) { new Tester().dumpContributionMarkup(); |