wt.inf.container
Class LoadDefaultOrgContainer

java.lang.Object
  extended bywt.inf.container.LoadDefaultOrgContainer
All Implemented Interfaces:
JavaMigrator

public class LoadDefaultOrgContainer
extends Object
implements JavaMigrator

Creates the default org container.


Field Summary
private static String CREATOR_RESOURCE
           
private  DirectiveServices ds
           
private  WTContainer exchange
           
private  ObjectIdentifier exchangeOid
           
private static String ORG_CREATOR_RESOURCE
           
private static String PRIVATE_DOMAIN_DESCRIPTION
           
private static String RESOURCE
           
private  ObjectIdentifier rootDomainOid
           
 
Constructor Summary
LoadDefaultOrgContainer()
           
 
Method Summary
private  ObjectIdentifier createCabinet(String name, String description, ObjectIdentifier parent_domain, ObjectIdentifier parent_container)
          Creates a cabinet with the given properties
private  ObjectIdentifier createDomain(String name, String description, ObjectIdentifier parent_domain, ObjectIdentifier parent_container)
          Creates an AdministrativeDomain named name with description description that is in domain parent_id and container container_id.
private  void initRootDomainOid()
          Finds the oid of the root domain
private  void migrateDefaultOrgContainer()
          Creates the default org container
 boolean runMigration(DirectiveServices directive_services)
          Implemented from JavaMigrator
private  void safeClose(ResultSet rs)
          If the Statement is not null, try to close it, catching and smothering any SQLException that results.
private  void safeClose(Statement stmt)
          If the Statement is not null, try to close it, catching and smothering any SQLException that results.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE

CREATOR_RESOURCE

private static final String CREATOR_RESOURCE

ORG_CREATOR_RESOURCE

private static final String ORG_CREATOR_RESOURCE

PRIVATE_DOMAIN_DESCRIPTION

private static final String PRIVATE_DOMAIN_DESCRIPTION
See Also:
Constant Field Values

ds

private DirectiveServices ds

exchange

private WTContainer exchange

exchangeOid

private ObjectIdentifier exchangeOid

rootDomainOid

private ObjectIdentifier rootDomainOid
Constructor Detail

LoadDefaultOrgContainer

public LoadDefaultOrgContainer()
Method Detail

runMigration

public boolean runMigration(DirectiveServices directive_services)
                     throws Exception
Implemented from JavaMigrator

Specified by:
runMigration in interface JavaMigrator
Parameters:
directive_services - Contains migration resources
Returns:
true
Throws:
Exception

migrateDefaultOrgContainer

private void migrateDefaultOrgContainer()
                                 throws Exception
Creates the default org container

Throws:
Exception

initRootDomainOid

private void initRootDomainOid()
                        throws Exception
Finds the oid of the root domain

Throws:
WTException - If the root domain can't be found
Exception

createDomain

private ObjectIdentifier createDomain(String name,
                                      String description,
                                      ObjectIdentifier parent_domain,
                                      ObjectIdentifier parent_container)
                               throws Exception
Creates an AdministrativeDomain named name with description description that is in domain parent_id and container container_id.

Parameters:
name - The name of the domain
description - The description of the domain
parent_domain - The oid of the domain's parent domain
parent_container - The oid of the domain's container
Returns:
The ObjectIdentifier of the new domain
Throws:
Exception

createCabinet

private ObjectIdentifier createCabinet(String name,
                                       String description,
                                       ObjectIdentifier parent_domain,
                                       ObjectIdentifier parent_container)
                                throws Exception
Creates a cabinet with the given properties

Parameters:
name - The name of the cabinet
description - The description of the cabinet
parent_domain - The oid of the administrative domain for the cabinet
parent_container - The oid of the container for the cabinet
Returns:
The oid of the new cabinet
Throws:
Exception

safeClose

private void safeClose(Statement stmt)
If the Statement is not null, try to close it, catching and smothering any SQLException that results.

Parameters:
stmt - The Statement to close

safeClose

private void safeClose(ResultSet rs)
If the Statement is not null, try to close it, catching and smothering any SQLException that results.

Parameters:
rs - The ResultSet to close