masterConfiguration.setBranchManager(localRepository.getBranchManager()); masterConfiguration.setPassiveUpdateMode(PassiveUpdateMode.ADDITIONS); masterConfiguration.setLockNotificationMode(LockNotificationMode.ALWAYS); remoteSession = (InternalCDOSession)masterConfiguration.openSession();
protected InternalCDOSession openRemoteSession() { CDOSessionConfiguration configuration = remoteSessionConfigurationFactory.createSessionConfiguration(); InternalCDOSession session = (InternalCDOSession)configuration.openSession(); CDORepositoryInfo repositoryInfo = session.getRepositoryInfo(); if (!repositoryInfo.isSupportingAudits()) { session.close(); throw new IllegalStateException("Remote repository does not support auditing"); } IDGenerationLocation remoteLocation = repositoryInfo.getIDGenerationLocation(); if (!remoteLocation.equals(idGenerationLocation)) { session.close(); throw new IllegalStateException("Remote repository uses different ID generation location: " + remoteLocation); } return session; }
public synchronized BranchCheckoutSource[] getElements() { if (subBranches == null) { subBranches = new ArrayList<BranchCheckoutSource>(); CDOSessionConfiguration config = getRepositoryLocation().createSessionConfiguration(); CDOSession session = config.openSession(); if (session.getRepositoryInfo().isSupportingBranches()) { try { CDOBranch branch = session.getBranchManager().getBranch(getBranchPath()); CDOBranch[] branches = branch.getBranches(); for (CDOBranch subBranch : branches) { subBranches.add(new BranchCheckoutSource(this, subBranch.getName())); } } finally { IOUtil.close(session); } } } return subBranches.toArray(new BranchCheckoutSource[subBranches.size()]); }