wt.ixb.handlers.netmarkets
Class NMDomainIXHandler

java.lang.Object
  extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
      extended bywt.ixb.publicforhandlers.ClassExporterImporterTemplate
          extended bywt.ixb.handlers.netmarkets.NMDomainIXHandler
All Implemented Interfaces:
ClassExporter, ClassExporterImporter, ElementImporter

public class NMDomainIXHandler
extends ClassExporterImporterTemplate


Nested Class Summary
 
Nested classes inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
ClassExporterImporterTemplate.ContentHolderCommitListener
 
Field Summary
private static String _rb
           
private static NMProjectConstants.OrgStructureInfo orgTags
           
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
 
Fields inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
CONFLICT_RESOURCE
 
Constructor Summary
NMDomainIXHandler()
           
 
Method Summary
private  boolean checkTag(IxbElement elem)
           
 Object createObject(IxbElement elem, Importer imp)
          This method expects to recieve an OrgDomain tag.
private  boolean domainExists(String domain, AdminDomainRef parentRef, WTContainerRef contRef)
           
static void exportContainerDomains(Exporter exp)
          This is used to export the domains of a container as a standalone unit.
static void exportContainerDomains(IxbElement elem, Exporter exp)
          This method should be called when exporting into composition objects such as ProjectTemplates or Organization Templates
private static void exportDomainAndChildren(IxbElement elem, AdminDomainRef parent, Exporter exp)
           
 void exportObject(Object obj, Exporter exp)
          Exports the specified object in context given by parameter exporter.
private static void exportSingleDomain(IxbElement elem, AdminDomainRef parent)
           
 Object findAmongExistingObjects(IxbElement elem, Importer imp)
          Checks to see if the domain already exists, if so a message is emitted, and the reference to the object is returned.
private  QueryResult findExistingDomains(Importer imp)
           
static AdministrativeDomain findParentDomain(String parentName, WTContainerRef contRef)
           
private  QueryResult getAllDomains(WTContainerRef contRef)
           
private static AdminDomainRef getChildDomain(String domainName, AdminDomainRef parentRef, WTContainerRef contRef)
           
private static Vector getChildDomains(AdminDomainRef parent)
           
static AdminDomainRef getChildFromParent(String childName, WTContainerRef contRef, AdminDomainRef parentRef)
           
static AdministrativeDomain getDomainInContainer(String parentName, WTContainerRef contRef)
           
private  AdminDomainRef getExistingDomain(String domain, WTContainerRef contRef)
           
 int getImportPriority()
          Return the import priority of the object type represented by this import handler.
 Object importElement(IxbElement elem, Importer imp)
          Imports XML element in context given by importer parameter.
private  AdministrativeDomain lookupParentDomain(WTContainerRef contRef, String parentName)
           
private  void processDomainLevel(IxbElement elem, AdminDomainRef parentRef, WTContainerRef contRef)
           
private  Object processLegacyTag(IxbElement elem, Importer imp)
          Legacy domains assume that the top level domain is always the the Default domain for the container in question.
 Object storeObject(Object domain, IxbElement elem, Importer imp)
          That is the general template how to store object.
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplate
createFileXMLOnExport, exportAttributes, finalizeImportObject, getRootTag, importObjectAttributes, importObjectAttributesAfterStore, isObjectIgnored, isObjectNew, outputLog, rememberNewObInfo, setObjectIgnored, setObjectIsNew, storeAdditionalInfo, storeElement
 
Methods inherited from class wt.ixb.publicforhandlers.ClassExporterImporterTemplateGeneral
checkConflicts, finalizeCheckConflicts, finalizeExport, finalizeImport, getAdditionalImportPriority, getObjectDisplayID, prepareForCheckConflicts, prepareForImport, previewElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rb

private static final String _rb
See Also:
Constant Field Values

orgTags

private static final NMProjectConstants.OrgStructureInfo orgTags
Constructor Detail

NMDomainIXHandler

public NMDomainIXHandler()
Method Detail

exportObject

public void exportObject(Object obj,
                         Exporter exp)
                  throws WTException
Description copied from class: ClassExporterImporterTemplate
Exports the specified object in context given by parameter exporter.
The implementation of this method is partitioned into several protected methods. Individual class handlers can override the following protected methods: Also, export actions from either client or system registry will be performed. Specifically, the two methods wt.ixb.tuner.ExportActionHelper.performPreExportAction () and wt.ixb.tuner.ExportActionHelper.performPostExportAction () will be called before and after th above three protected methods, respectively.

Supported API: true

Specified by:
exportObject in interface ClassExporter
Overrides:
exportObject in class ClassExporterImporterTemplate
Parameters:
obj -
exp - The Exporter instance that represents the context of the export operation.
Throws:
WTException

exportContainerDomains

public static void exportContainerDomains(Exporter exp)
                                   throws WTException
This is used to export the domains of a container as a standalone unit. This call must be used since domains are not exportable as a single units since their relationship must be preserved.

Throws:
WTException

exportContainerDomains

public static void exportContainerDomains(IxbElement elem,
                                          Exporter exp)
                                   throws WTException
This method should be called when exporting into composition objects such as ProjectTemplates or Organization Templates

Throws:
WTException

exportSingleDomain

private static void exportSingleDomain(IxbElement elem,
                                       AdminDomainRef parent)
                                throws WTException
Throws:
WTException

getChildDomains

private static Vector getChildDomains(AdminDomainRef parent)
                               throws WTException
Throws:
WTException

exportDomainAndChildren

private static void exportDomainAndChildren(IxbElement elem,
                                            AdminDomainRef parent,
                                            Exporter exp)
                                     throws WTException
Throws:
WTException

createObject

public Object createObject(IxbElement elem,
                           Importer imp)
                    throws WTException
This method expects to recieve an OrgDomain tag. Any other domain tag is just an identifer. This method will throw a WTException if any other type of element is passed in.

Specified by:
createObject in class ClassExporterImporterTemplate
Parameters:
elem -
imp -
Returns:
a AdministrativeDomain object.
Throws:
WTException

processDomainLevel

private void processDomainLevel(IxbElement elem,
                                AdminDomainRef parentRef,
                                WTContainerRef contRef)
                         throws WTException
Throws:
WTException

getExistingDomain

private AdminDomainRef getExistingDomain(String domain,
                                         WTContainerRef contRef)
                                  throws WTException
Throws:
WTException

getChildDomain

private static AdminDomainRef getChildDomain(String domainName,
                                             AdminDomainRef parentRef,
                                             WTContainerRef contRef)
                                      throws WTException
Throws:
WTException

getChildFromParent

public static AdminDomainRef getChildFromParent(String childName,
                                                WTContainerRef contRef,
                                                AdminDomainRef parentRef)
                                         throws WTException
Throws:
WTException

domainExists

private boolean domainExists(String domain,
                             AdminDomainRef parentRef,
                             WTContainerRef contRef)
                      throws WTException
Throws:
WTException

processLegacyTag

private Object processLegacyTag(IxbElement elem,
                                Importer imp)
                         throws WTException
Legacy domains assume that the top level domain is always the the Default domain for the container in question.

Throws:
WTException

checkTag

private boolean checkTag(IxbElement elem)
                  throws WTException
Throws:
WTException

getImportPriority

public int getImportPriority()
                      throws WTException
Description copied from class: ClassExporterImporterTemplateGeneral
Return the import priority of the object type represented by this import handler.
Import priority defines the order in which objects will be imported. This method does not carry parameters in the signature. The return value can not be negative. Those XML files will have a higher import priority for smaller returned values.

Supported API: true

Specified by:
getImportPriority in interface ElementImporter
Specified by:
getImportPriority in class ClassExporterImporterTemplateGeneral
Returns:
int
Throws:
WTException

findAmongExistingObjects

public Object findAmongExistingObjects(IxbElement elem,
                                       Importer imp)
                                throws WTException
Checks to see if the domain already exists, if so a message is emitted, and the reference to the object is returned.

Overrides:
findAmongExistingObjects in class ClassExporterImporterTemplate
Parameters:
elem -
imp -
Returns:
Object
Throws:
WTException

importElement

public Object importElement(IxbElement elem,
                            Importer imp)
                     throws WTException
Description copied from class: ClassExporterImporterTemplate
Imports XML element in context given by importer parameter. Returns the imported object, which might be newly created or already existed in the datastore.

Supported API: true

Specified by:
importElement in interface ElementImporter
Overrides:
importElement in class ClassExporterImporterTemplate
Parameters:
elem -
imp - The Importer instance that represents the context of the import operation.
Returns:
Object
Throws:
WTException

storeObject

public Object storeObject(Object domain,
                          IxbElement elem,
                          Importer imp)
                   throws WTException
Description copied from class: ClassExporterImporterTemplate
That is the general template how to store object. It looks like it will be good for many classes. If for some class it is not good then it can be override this method

Supported API: true

Overrides:
storeObject in class ClassExporterImporterTemplate
Parameters:
domain - : Object The object to be stored.
elem - : IxbElement reference to the element being imported.
imp - : Importer reference to the application
Returns:
Object the element that was successfully imported.
Throws:
WTException

getDomainInContainer

public static AdministrativeDomain getDomainInContainer(String parentName,
                                                        WTContainerRef contRef)
                                                 throws WTException
Throws:
WTException

findParentDomain

public static AdministrativeDomain findParentDomain(String parentName,
                                                    WTContainerRef contRef)
                                             throws WTException
Throws:
WTException

lookupParentDomain

private AdministrativeDomain lookupParentDomain(WTContainerRef contRef,
                                                String parentName)
                                         throws WTException
Throws:
WTException

findExistingDomains

private QueryResult findExistingDomains(Importer imp)
                                 throws WTException
Throws:
WTException

getAllDomains

private QueryResult getAllDomains(WTContainerRef contRef)
                           throws WTException
Throws:
WTException