public class CDOMigrator extends Object
Constructor and Description |
---|
CDOMigrator(History history,
IClassLoader classLoader)
Constructor.
|
CDOMigrator(org.eclipse.emf.common.util.URI historyURI,
IClassLoader classLoader)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static org.eclipse.emf.common.util.URI |
cdoCanonicalURI(org.eclipse.emf.common.util.URI sourceURI,
String repo)
Converts a 'regular' resource URI to a CDO Resource URI.
|
static org.eclipse.emf.common.util.URI |
cdoConnectionAwareURI(String host,
String port,
String repo,
String resourceName)
Get a
connection aware URI for specified arguments. |
static org.eclipse.emf.common.util.URI |
cdoConnectionAwareURI(org.eclipse.emf.common.util.URI canonicalURI,
org.eclipse.emf.cdo.util.CDOURIData data)
Get a
connection aware URI for original canonical URI
and specified source CDOURIData. |
static org.eclipse.emf.common.util.URI |
cdoConnectionAwareURI(org.eclipse.emf.common.util.URI canonicalURI,
String authority)
Get a
connection aware URI for original canonical URI
and specified arguments. |
static org.eclipse.emf.common.util.URI |
cdoConnectionAwareURI(org.eclipse.emf.common.util.URI sourceURI,
String host,
String port,
String repo)
Converts a 'regular' resource URI to a CDO Resource URI.
|
static org.eclipse.emf.cdo.eresource.CDOResource |
cdoCreateResource(org.eclipse.emf.ecore.resource.ResourceSet set,
org.eclipse.emf.common.util.URI cdoResourceURI,
Metamodel mmmeta)
Create a
CDOResource from a URI the MMMeta will be used to register the corresponding EPackage by
the CDOViewProvider . |
static void |
clear(List<org.eclipse.emf.common.util.URI> cdoSourceURIs,
ResourceSetFactoryImpl resourceSetFactoryImpl)
Clear a
CDOResource from the CDO Repository. |
void |
clearCDORepositories(String host,
String port,
String repo)
clear the specified CDO Repository.
|
static List<org.eclipse.emf.common.util.URI> |
collectConnectionAwareURIs(org.eclipse.emf.cdo.util.CDOURIData data,
List<org.eclipse.emf.cdo.eresource.CDOResource> cdoResCollection,
org.eclipse.emf.cdo.eresource.CDOResourceNode node)
Converts regular CDOResource URI's to connection aware URI's.
|
static void |
collectResources(List<org.eclipse.emf.cdo.eresource.CDOResource> cdoResCollection,
org.eclipse.emf.cdo.eresource.CDOResourceNode node)
Collect all
CDOResource for a root resource. |
static boolean |
commitTransaction(org.eclipse.emf.cdo.transaction.CDOTransaction t)
Commit a CDO Transaction.
|
static void |
copy(Metamodel metamodel,
org.eclipse.emf.ecore.resource.ResourceSet sourceModels,
List<org.eclipse.emf.common.util.URI> cdoURIs,
IResourceSetFactory resourceSetFactory)
Construct CDO
URI from a given source models ,
create target models and copy the source content to
the target content. |
EdaptCDOViewProvider |
getEdaptCDOViewProvider()
Get the
CDOViewProvider . |
Metamodel |
getMetamodel(Release release)
Returns the metamodel for a release.
|
Set<String> |
getNsURIs()
Get set of namespace URIs.
|
Set<Release> |
getRelease(org.eclipse.emf.cdo.eresource.CDOResource resource) |
Release |
getRelease(int number)
Get the release with a certain number.
|
Set<Release> |
getRelease(org.eclipse.emf.common.util.URI modelURI)
Get the release of a model based on
URI . |
List<Release> |
getReleases()
Get all releases.
|
IResourceSetFactory |
getResourceSetFactory()
Get the factory to create
ResourceSet s for custom serialization. |
static org.eclipse.emf.ecore.EPackage |
loadEPackageFromEcore(org.eclipse.emf.common.util.URI expectedTargetMetamodelURI) |
static void |
main(String[] args)
Main method to perform migrations.
|
void |
migrateAndCopy(org.eclipse.emf.cdo.util.CDOURIData sourceURIData,
org.eclipse.emf.cdo.util.CDOURIData targetURIData,
org.eclipse.core.runtime.IProgressMonitor monitor) |
void |
migrateAndCopy(List<org.eclipse.emf.common.util.URI> modelURIs,
Release sourceRelease,
Release targetRelease,
org.eclipse.core.runtime.IProgressMonitor monitor,
List<org.eclipse.emf.common.util.URI> list) |
org.eclipse.emf.ecore.resource.ResourceSet |
migrateAndLoad(List<org.eclipse.emf.common.util.URI> modelURIs,
Release sourceRelease,
Release targetRelease,
org.eclipse.core.runtime.IProgressMonitor monitor)
Migrate a model based on a set of
URI s and load it afterwards. |
void |
setLevel(ValidationLevel level)
Set the validation level.
|
void |
setResourceSetFactory(IResourceSetFactory resourceSetFactory)
Set the factory to create
ResourceSet s for custom serialization. |
public CDOMigrator(org.eclipse.emf.common.util.URI historyURI, IClassLoader classLoader) throws MigrationException
MigrationException
public CDOMigrator(History history, IClassLoader classLoader)
public EdaptCDOViewProvider getEdaptCDOViewProvider()
CDOViewProvider
.public void migrateAndCopy(org.eclipse.emf.cdo.util.CDOURIData sourceURIData, org.eclipse.emf.cdo.util.CDOURIData targetURIData, org.eclipse.core.runtime.IProgressMonitor monitor) throws MigrationException
sourceURIData
- the source uri datatargetURIData
- the target uri datamonitor
- the progress monitorMigrationException
public void migrateAndCopy(List<org.eclipse.emf.common.util.URI> modelURIs, Release sourceRelease, Release targetRelease, org.eclipse.core.runtime.IProgressMonitor monitor, List<org.eclipse.emf.common.util.URI> list) throws MigrationException
MigrationException
public org.eclipse.emf.ecore.resource.ResourceSet migrateAndLoad(List<org.eclipse.emf.common.util.URI> modelURIs, Release sourceRelease, Release targetRelease, org.eclipse.core.runtime.IProgressMonitor monitor) throws MigrationException
URI
s and load it afterwards.modelURIs
- The set of URI
sourceRelease
- Release to which the model conformstargetRelease
- Release to which the model should be migrated (use null for
the newest release)monitor
- Progress monitorResourceSet
MigrationException
public Set<Release> getRelease(org.eclipse.emf.common.util.URI modelURI)
URI
.public Release getRelease(int number)
public void setLevel(ValidationLevel level)
public static void main(String[] args)
public void setResourceSetFactory(IResourceSetFactory resourceSetFactory)
ResourceSet
s for custom serialization.public IResourceSetFactory getResourceSetFactory()
ResourceSet
s for custom serialization.public void clearCDORepositories(String host, String port, String repo)
host
- port
- repo
- public static void copy(Metamodel metamodel, org.eclipse.emf.ecore.resource.ResourceSet sourceModels, List<org.eclipse.emf.common.util.URI> cdoURIs, IResourceSetFactory resourceSetFactory)
URI
from a given source models
,
create target models
and copy the source content to
the target content. Note: this will only work with a configured CDOViewProvider
.metamodel
- sourceModels
- resourceSetFactory
- public static org.eclipse.emf.cdo.eresource.CDOResource cdoCreateResource(org.eclipse.emf.ecore.resource.ResourceSet set, org.eclipse.emf.common.util.URI cdoResourceURI, Metamodel mmmeta)
CDOResource
from a URI
the MMMeta
will be used to register the corresponding EPackage
by
the CDOViewProvider
.set
- cdoResourceURI
- mmmeta
- public static org.eclipse.emf.common.util.URI cdoConnectionAwareURI(String host, String port, String repo, String resourceName)
connection aware URI
for specified arguments.
The schema is set to TCP.host
- port
- repo
- resourceName
- public static org.eclipse.emf.common.util.URI cdoConnectionAwareURI(org.eclipse.emf.common.util.URI canonicalURI, String authority)
connection aware URI
for original canonical URI
and specified arguments. The schema is set to TCP.canonicalURI
- uri for creating a CDOURIData
authority
- authority for creating a CDOURIData
public static org.eclipse.emf.common.util.URI cdoConnectionAwareURI(org.eclipse.emf.common.util.URI canonicalURI, org.eclipse.emf.cdo.util.CDOURIData data)
connection aware URI
for original canonical URI
and specified source CDOURIData. (Setting the authority, user name and
password from this source).
The schema is set to TCP.canonicalURI
- data
- public static void clear(List<org.eclipse.emf.common.util.URI> cdoSourceURIs, ResourceSetFactoryImpl resourceSetFactoryImpl)
CDOResource
from the CDO Repository. The CDOResource
should be active (Have an active CDOTransaction
).cdoSourceURIs
- resourceSetFactoryImpl
- public static org.eclipse.emf.common.util.URI cdoConnectionAwareURI(org.eclipse.emf.common.util.URI sourceURI, String host, String port, String repo)
sourceURI
- public static List<org.eclipse.emf.common.util.URI> collectConnectionAwareURIs(org.eclipse.emf.cdo.util.CDOURIData data, List<org.eclipse.emf.cdo.eresource.CDOResource> cdoResCollection, org.eclipse.emf.cdo.eresource.CDOResourceNode node)
data
- cdoResCollection
- node
- public static void collectResources(List<org.eclipse.emf.cdo.eresource.CDOResource> cdoResCollection, org.eclipse.emf.cdo.eresource.CDOResourceNode node)
CDOResource
for a root resource. (Works best if the
initial CDOResourceNode
is of type CDOResource
and this
is the root resource for the repository.cdoResCollection
- node
- public static boolean commitTransaction(org.eclipse.emf.cdo.transaction.CDOTransaction t)
t
- true
if commit failed, false
otherwisepublic static org.eclipse.emf.ecore.EPackage loadEPackageFromEcore(org.eclipse.emf.common.util.URI expectedTargetMetamodelURI)
public static org.eclipse.emf.common.util.URI cdoCanonicalURI(org.eclipse.emf.common.util.URI sourceURI, String repo)
sourceURI
- Copyright © 2020. All rights reserved.