Skip to main content
summaryrefslogtreecommitdiffstats
blob: dcb4af0d174661102683cb7a73e9142f437fafa5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package org.eclipse.emf.cdo.server.internal.commitables;

import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranch;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager;
import org.eclipse.emf.cdo.spi.common.commit.InternalCDOCommitInfoManager;

public class JSONCommitInfo
{
  private int branchID;

  private long timeStamp;

  private long previousTimeStamp;

  private String userID;

  private String comment;

  public JSONCommitInfo(int branchID, long timeStamp, long previousTimeStamp, String userID, String comment)
  {
    this.branchID = branchID;
    this.timeStamp = timeStamp;
    this.previousTimeStamp = previousTimeStamp;
    this.userID = userID;
    this.comment = comment;
  }

  public int getBranchID()
  {
    return branchID;
  }

  public long getTimeStamp()
  {
    return timeStamp;
  }

  public void handle(InternalCDOBranchManager branchManager, InternalCDOCommitInfoManager manager,
      CDOCommitInfoHandler handler)
  {
    InternalCDOBranch branch = branchManager.getBranch(branchID);
    CDOCommitInfo commitInfo = manager.createCommitInfo(branch, timeStamp, previousTimeStamp, userID, comment, null);
    handler.handleCommitInfo(commitInfo);
  }
}

Back to the top