Search in sources :

Example 1 with CDOResourceNode

use of org.eclipse.emf.cdo.eresource.CDOResourceNode in project InformationSystem by ObeoNetwork.

the class EmbeddedCDOServer method getRemoteProjectsURIs.

private Collection<URI> getRemoteProjectsURIs(CDOTransaction transaction) {
    Collection<URI> remoteProjectsURIs = new ArrayList<URI>();
    CDOResource rootResource = transaction.getRootResource();
    for (EObject object : rootResource.getContents()) {
        // CDOResourceNode
        if (object instanceof CDOResourceFolder) {
            // Search in folder
            remoteProjectsURIs.addAll(getRemoteProjectsURIs((CDOResourceFolder) object));
        } else if (object instanceof CDOResourceNode) {
            CDOResourceNode node = (CDOResourceNode) object;
            if (isSessionResource(node)) {
                remoteProjectsURIs.add(node.getURI());
            }
        }
    }
    return remoteProjectsURIs;
}
Also used : EObject(org.eclipse.emf.ecore.EObject) ArrayList(java.util.ArrayList) CDOResourceFolder(org.eclipse.emf.cdo.eresource.CDOResourceFolder) CDOResourceNode(org.eclipse.emf.cdo.eresource.CDOResourceNode) URI(org.eclipse.emf.common.util.URI) CDOResource(org.eclipse.emf.cdo.eresource.CDOResource)

Aggregations

ArrayList (java.util.ArrayList)1 CDOResource (org.eclipse.emf.cdo.eresource.CDOResource)1 CDOResourceFolder (org.eclipse.emf.cdo.eresource.CDOResourceFolder)1 CDOResourceNode (org.eclipse.emf.cdo.eresource.CDOResourceNode)1 URI (org.eclipse.emf.common.util.URI)1 EObject (org.eclipse.emf.ecore.EObject)1