Extension SDK 10.1.2

oracle.ide.migration
Class MigrationInfo

java.lang.Object
  extended byoracle.ide.migration.MigrationInfo

public abstract class MigrationInfo
extends java.lang.Object

Version of information about a node requiring migration. Information contained includes the node itself, the current and actual document versions, and the vesion and migration status.

When addins request the node encapsulated by this class, they should request the node copy using the method MigrationInfo@getNodeCopy. Data from the copy can be accessed without notification events being sent. Addins should never request the original node. The original node access is only provided for NodeMigrator writers.

NodeMigrator providers need to extend this class and implement the abstract method copyNode(oracle.ide.model.Node).


Nested Class Summary
static class MigrationInfo.MigrationStatus
          Status class used to define the outer class migration status enums.
static class MigrationInfo.Status
          Base status class.
static class MigrationInfo.VersionStatus
          Status class used to define the outer class version status enums.
 
Field Summary
static MigrationInfo.MigrationStatus MIGRATION_CANCELED
          Migration status indicating the migration of the node was canceled by the user.
static MigrationInfo.MigrationStatus MIGRATION_DONE
          Migration status indicating the node associated with this migration information was carried out successfully.
static MigrationInfo.MigrationStatus MIGRATION_ERROR
          Migration status indicating the migration of the node was not carried out properly.
static MigrationInfo.MigrationStatus MIGRATION_NOT_NEEDED
          Migration status indicating the migration of the node was not needed.
static MigrationInfo.MigrationStatus MIGRATION_NOT_POSSIBLE
          Migration status indicating the migration of the node was not carried out.
static MigrationInfo.MigrationStatus MIGRATION_PENDING
          Migration status indicating the node is ready for migration.
static MigrationInfo.VersionStatus VERSION_CURRENT
          Vesion status indicating the node version is the same as the current node version.
static MigrationInfo.VersionStatus VERSION_NEWER
          Vesion status indicating the node version is newer that the current node version.
static MigrationInfo.VersionStatus VERSION_OLDER
          Vesion status indicating the node version is older that the current node version.
static MigrationInfo.VersionStatus VERSION_UNKNOWN
          Vesion status indicating the node version could not be determined.
 
Constructor Summary
protected MigrationInfo(Node node)
          Constructor.
 
Method Summary
protected abstract  Node copyNode(Node node)
          Created a copy of the specified Node.
protected  void ensureVersionInfo()
          Figure out the version information.
 java.lang.String getCurrentVersion()
          Get the current file format version used if the node were to be saved now.
 MigrationInfo.MigrationStatus getMigrationStatus()
          Get the migration status.
 Node getNodeCopy()
          Get the Node whose version information is recorded here.
 Node getOriginalNode()
          Get the original node.
 java.lang.String getVersion()
          Get the node's file format version stored in the document pointed to by the node's url.
 MigrationInfo.Status getVersionStatus()
          Get the version status.
 void setMigrationStatus(MigrationInfo.MigrationStatus status)
          Set the migration status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIGRATION_DONE

public static final MigrationInfo.MigrationStatus MIGRATION_DONE
Migration status indicating the node associated with this migration information was carried out successfully.


MIGRATION_ERROR

public static final MigrationInfo.MigrationStatus MIGRATION_ERROR
Migration status indicating the migration of the node was not carried out properly. An undermined error was encountered.


MIGRATION_PENDING

public static final MigrationInfo.MigrationStatus MIGRATION_PENDING
Migration status indicating the node is ready for migration.


MIGRATION_CANCELED

public static final MigrationInfo.MigrationStatus MIGRATION_CANCELED
Migration status indicating the migration of the node was canceled by the user.


MIGRATION_NOT_NEEDED

public static final MigrationInfo.MigrationStatus MIGRATION_NOT_NEEDED
Migration status indicating the migration of the node was not needed. This generally implies that the node version is current.


MIGRATION_NOT_POSSIBLE

public static final MigrationInfo.MigrationStatus MIGRATION_NOT_POSSIBLE
Migration status indicating the migration of the node was not carried out. A typical reason why a node cannot be migrated can be that the version of the node is newer than the current version. When this is the case, the version status is VERSION_NEWER.


VERSION_UNKNOWN

public static final MigrationInfo.VersionStatus VERSION_UNKNOWN
Vesion status indicating the node version could not be determined.


VERSION_OLDER

public static final MigrationInfo.VersionStatus VERSION_OLDER
Vesion status indicating the node version is older that the current node version.


VERSION_NEWER

public static final MigrationInfo.VersionStatus VERSION_NEWER
Vesion status indicating the node version is newer that the current node version.


VERSION_CURRENT

public static final MigrationInfo.VersionStatus VERSION_CURRENT
Vesion status indicating the node version is the same as the current node version.

Constructor Detail

MigrationInfo

protected MigrationInfo(Node node)
Constructor.

Parameters:
node - the node whose version information is being specified.
Method Detail

getNodeCopy

public Node getNodeCopy()
Get the Node whose version information is recorded here. The returned node is a copy of the original node. Migration helpers must only use the copy of the node to access node data.

Returns:
the Node.

getOriginalNode

public Node getOriginalNode()
Get the original node. Node migrators should only access the original node. Migration helpers should always use getNodeCopy() and operate on the copy.

Returns:
the original node.

getVersionStatus

public MigrationInfo.Status getVersionStatus()
Get the version status. Can be one of the following values: #OLDER, #NEWER, #CURRENT, or #UNKNOWN.

Returns:
the version status.

getMigrationStatus

public MigrationInfo.MigrationStatus getMigrationStatus()
Get the migration status. Can be one of the MigrationInfo.MigrationStatus declared by this class.

Returns:
the migration status of the node.

setMigrationStatus

public void setMigrationStatus(MigrationInfo.MigrationStatus status)
Set the migration status. Can be one of the MigrationInfo.MigrationStatus declared by this class.

Parameters:
status - the migration status of the node.

getCurrentVersion

public java.lang.String getCurrentVersion()
Get the current file format version used if the node were to be saved now.

Returns:
the current file format version in use.

getVersion

public java.lang.String getVersion()
Get the node's file format version stored in the document pointed to by the node's url.

Returns:
the node's file format version.

copyNode

protected abstract Node copyNode(Node node)
Created a copy of the specified Node. In general, NodeMigrators extend this class and implement this method.

Parameters:
node - the node to copy.
Returns:
a copy of the specified node.

ensureVersionInfo

protected void ensureVersionInfo()
Figure out the version information. This includes the file format version of the document pointed to by the specified url.


Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.