Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-03-02 06:37:51 -0500
committerEike Stepper2015-03-02 06:37:51 -0500
commit873ce15ef684e0c8dc70462c00038cec986d132f (patch)
tree7ade71f7302e8374672d2890e5d5eb014ea1d9b1 /plugins/org.eclipse.emf.cdo.server.net4j
parent07d6b27f8f7255780603bc0b27caef8c53dbe1d9 (diff)
downloadcdo-873ce15ef684e0c8dc70462c00038cec986d132f.tar.gz
cdo-873ce15ef684e0c8dc70462c00038cec986d132f.tar.xz
cdo-873ce15ef684e0c8dc70462c00038cec986d132f.zip
[458349] Consolidate UI
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=458349
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.net4j')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadObjectLifetimeIndication.java74
2 files changed, 77 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
index 9d29017149..58ebd6abf1 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
@@ -375,6 +375,9 @@ public class CDOServerProtocol extends SignalProtocol<InternalSession> implement
case SIGNAL_RENAME_BRANCH:
return new RenameBranchIndication(this);
+ case SIGNAL_LOAD_OBJECT_LIFETIME:
+ return new LoadObjectLifetimeIndication(this);
+
default:
return super.createSignalReactor(signalID);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadObjectLifetimeIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadObjectLifetimeIndication.java
new file mode 100644
index 0000000000..fbbc01f919
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadObjectLifetimeIndication.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2009-2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.server.internal.net4j.protocol;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPointRange;
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.protocol.CDODataInput;
+import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
+import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
+import org.eclipse.emf.cdo.server.internal.net4j.bundle.OM;
+import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager;
+
+import org.eclipse.net4j.util.om.trace.ContextTracer;
+
+import java.io.IOException;
+
+/**
+ * @author Eike Stepper
+ */
+public class LoadObjectLifetimeIndication extends CDOServerReadIndication
+{
+ private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_PROTOCOL, LoadObjectLifetimeIndication.class);
+
+ private CDOID id;
+
+ private CDOBranchPoint branchPoint;
+
+ public LoadObjectLifetimeIndication(CDOServerProtocol protocol)
+ {
+ super(protocol, CDOProtocolConstants.SIGNAL_LOAD_OBJECT_LIFETIME);
+ }
+
+ @Override
+ protected void indicating(CDODataInput in) throws IOException
+ {
+ id = in.readCDOID();
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Read id: {0}", id); //$NON-NLS-1$
+ }
+
+ branchPoint = in.readCDOBranchPoint();
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Read branchPoint: {0}", branchPoint); //$NON-NLS-1$
+ }
+ }
+
+ @Override
+ protected void responding(CDODataOutput out) throws IOException
+ {
+ InternalCDORevisionManager revisionManager = getRepository().getRevisionManager();
+ CDOBranchPointRange range = revisionManager.getObjectLifetime(id, branchPoint);
+ if (range != null)
+ {
+ out.writeBoolean(true);
+ out.writeCDOBranchPoint(range.getStartPoint());
+ out.writeCDOBranchPoint(range.getEndPoint());
+ }
+ else
+ {
+ out.writeBoolean(false);
+ }
+ }
+}

Back to the top