diff options
Diffstat (limited to 'plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java')
-rw-r--r-- | plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java | 302 |
1 files changed, 14 insertions, 288 deletions
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(); |