@Override protected Object eval(CDOSession session) { return session.getRepositoryInfo().getUUID(); } });
@Override protected Object eval(CDOSession session) { return session.getRepositoryInfo().getUUID(); } });
public static URI createResourceURI(CDOSession session, String path) { return createResourceURI(session == null ? null : session.getRepositoryInfo().getUUID(), path); }
public static URI createResourceURI(CDOSession session, String path) { return createResourceURI(session == null ? null : session.getRepositoryInfo().getUUID(), path); }
public boolean canHandle(URI uri) { if (CDO_URI_SCHEME.equals(uri.scheme())) { String uuid = view.getSession().getRepositoryInfo().getUUID(); return uuid.equals(CDOURIUtil.extractRepositoryUUID(uri)); } CDOViewProvider[] viewProviders = CDOViewProviderRegistry.INSTANCE.getViewProviders(uri); return viewProviders.length != 0; }
public boolean canHandle(URI uri) { if (CDO_URI_SCHEME.equals(uri.scheme())) { String uuid = view.getSession().getRepositoryInfo().getUUID(); return uuid.equals(CDOURIUtil.extractRepositoryUUID(uri)); } CDOViewProvider[] viewProviders = CDOViewProviderRegistry.INSTANCE.getViewProviders(uri); return viewProviders.length != 0; }
public void add(InternalCDOView view) { String repositoryUUID = view.getSession().getRepositoryInfo().getUUID(); synchronized (views) { CDOView lookupView = mapOfViews.get(repositoryUUID); if (lookupView != null) { throw new RuntimeException(Messages.getString("CDOViewSetImpl.2")); //$NON-NLS-1$ } views.add(view); mapOfViews.put(repositoryUUID, view); } if (eNotificationRequired()) { NotificationImpl notification = new NotificationImpl(NotificationImpl.ADD, null, view); eNotify(notification); } }
public void add(InternalCDOView view) { String repositoryUUID = view.getSession().getRepositoryInfo().getUUID(); synchronized (views) { CDOView lookupView = mapOfViews.get(repositoryUUID); if (lookupView != null) { throw new RuntimeException(Messages.getString("CDOViewSetImpl.2")); //$NON-NLS-1$ } views.add(view); mapOfViews.put(repositoryUUID, view); } if (eNotificationRequired()) { NotificationImpl notification = new NotificationImpl(NotificationImpl.ADD, null, view); eNotify(notification); } }
/** * @since 2.0 */ public synchronized <T extends EObject> T getObject(T objectFromDifferentView) { checkActive(); CDOObject object = CDOUtil.getCDOObject(objectFromDifferentView); CDOView view = object.cdoView(); if (view != this) { if (!view.getSession().getRepositoryInfo().getUUID().equals(getSession().getRepositoryInfo().getUUID())) { throw new IllegalArgumentException(MessageFormat.format( Messages.getString("CDOViewImpl.11"), objectFromDifferentView)); //$NON-NLS-1$ } CDOID id = object.cdoID(); InternalCDOObject contextified = getObject(id, true); @SuppressWarnings("unchecked") T cast = (T)CDOUtil.getEObject(contextified); return cast; } return objectFromDifferentView; }
public CDOView getView(URI uri, ResourceSet resourceSet) { IManagedContainer container = getContainer(); if (container == null) { return null; } String repoUUID = CDOURIUtil.extractRepositoryUUID(uri); for (Object element : container.getElements(CDOSessionFactory.PRODUCT_GROUP)) { CDOSession session = (CDOSession)element; String uuid = session.getRepositoryInfo().getUUID(); if (repoUUID.equals(uuid)) { CDOView view = openView(session, resourceSet); if (view != null) { return view; } } } return null; }
public CDOView getView(URI uri, ResourceSet resourceSet) { IManagedContainer container = getContainer(); if (container == null) { return null; } String repoUUID = CDOURIUtil.extractRepositoryUUID(uri); for (Object element : container.getElements(CDOSessionFactory.PRODUCT_GROUP)) { CDOSession session = (CDOSession)element; String uuid = session.getRepositoryInfo().getUUID(); if (repoUUID.equals(uuid)) { CDOView view = openView(session, resourceSet); if (view != null) { return view; } } } return null; }
/** * @since 2.0 */ public synchronized <T extends EObject> T getObject(T objectFromDifferentView) { checkActive(); CDOObject object = CDOUtil.getCDOObject(objectFromDifferentView); CDOView view = object.cdoView(); if (view == null) { return null; } if (view != this) { if (!view.getSession().getRepositoryInfo().getUUID().equals(getSession().getRepositoryInfo().getUUID())) { throw new IllegalArgumentException(MessageFormat.format( Messages.getString("CDOViewImpl.11"), objectFromDifferentView)); //$NON-NLS-1$ } CDOID id = object.cdoID(); InternalCDOObject contextified = getObject(id, true); @SuppressWarnings("unchecked") T cast = (T)CDOUtil.getEObject(contextified); return cast; } return objectFromDifferentView; }
private void applyChangeSet(final CDOTransaction transaction, final CDOBranch taskBranch) throws CustomConflictException { final String repositoryUuid = transaction.getSession().getRepositoryInfo().getUUID(); final CDOBranchMerger branchMerger = new CDOBranchMerger(CDOConflictProcessorBroker.INSTANCE.getProcessor(repositoryUuid), taskBranch.getBase().getBranch(), taskBranch, true); try { // XXX: specifying sourceBase instead of defaulting to the computed common ancestor point here transaction.merge(taskBranch.getHead(), taskBranch.getBase(), branchMerger); LOGGER.info(MessageFormat.format("Post-processing components in ''{0}''...", repositoryUuid)); branchMerger.postProcess(transaction); } catch (final ConflictException e) { final Set<ConflictWrapper> conflictWrappers = newHashSet(); for (final Conflict cdoConflict : branchMerger.getConflicts().values()) { convertRepresentation(cdoConflict, conflictWrappers); } throw new CustomConflictException("Conflicts detected while synchronizing task", conflictWrappers); } }
public void remove(InternalCDOView view) { String repositoryUUID = view.getSession().getRepositoryInfo().getUUID(); List<Resource> resToRemove = new ArrayList<Resource>(); synchronized (views) { // It is important to remove view from the list first. It is the way we can differentiate close and detach. views.remove(view); mapOfViews.remove(repositoryUUID); for (Resource resource : getResourceSet().getResources()) { if (resource instanceof CDOResource) { CDOResource cdoRes = (CDOResource)resource; if (cdoRes.cdoView() == view) { resToRemove.add(resource); } } } } getResourceSet().getResources().removeAll(resToRemove); if (eNotificationRequired()) { NotificationImpl notification = new NotificationImpl(NotificationImpl.REMOVE, view, null); eNotify(notification); } }
public void remove(InternalCDOView view) { String repositoryUUID = view.getSession().getRepositoryInfo().getUUID(); List<Resource> resToRemove = new ArrayList<Resource>(); synchronized (views) { // It is important to remove view from the list first. It is the way we can differentiate close and detach. views.remove(view); mapOfViews.remove(repositoryUUID); for (Resource resource : getResourceSet().getResources()) { if (resource instanceof CDOResource) { CDOResource cdoRes = (CDOResource)resource; if (cdoRes.cdoView() == view) { resToRemove.add(resource); } } } } getResourceSet().getResources().removeAll(resToRemove); if (eNotificationRequired()) { NotificationImpl notification = new NotificationImpl(NotificationImpl.REMOVE, view, null); eNotify(notification); } }
final String uuid = repositoryInfo.getUUID();