|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.inf.container.MigrateContainerHelper
Provides utility methods to access cached instances of the exchange and default org container's domains and cabinets, as well as some general utility methods.
WARNING: A call to initialize
must precede any
other uses of the APIs in this class, otherwise a runtime
exception will occur.
Nested Class Summary | |
private static interface |
MigrateContainerHelper.Logger
Assigned in initialize() |
Field Summary | |
private static Connection |
connection
Connection used to create statements. |
private static OrgContainer |
defaultOrg
|
private static Cabinet |
defaultOrgDefaultCabinet
|
private static AdministrativeDomain |
defaultOrgDefaultDomain
|
private static AdministrativeDomain |
defaultOrgPrivateDomain
|
private static Cabinet |
defaultOrgSystemCabinet
|
private static AdministrativeDomain |
defaultOrgSystemDomain
|
private static ExchangeContainer |
exchange
|
private static Cabinet |
exchangeDefaultCabinet
|
private static AdministrativeDomain |
exchangeDefaultDomain
|
private static Cabinet |
exchangeSystemCabinet
|
private static AdministrativeDomain |
exchangeSystemDomain
|
private static MigrateContainerHelper.Logger |
logger
|
private static PersistentObjectManager |
pom
Used for queries. |
Constructor Summary | |
MigrateContainerHelper()
|
Method Summary | |
private static void |
checkState()
Validates that the helper is initialized |
static void |
cleanup()
Nulls the cached resources on the helper |
static ObjectIdentifier |
createTemplate(String name,
String description,
Class container_class,
ObjectIdentifier container_id,
ObjectIdentifier domain_id)
Creates a container template and template master with the given properties. |
static ObjectIdentifier |
getAdministrator()
Get the oid of the WTUser with name
AdministrativeDomainHelper.ADMINISTRATOR_NAME . |
static Cabinet |
getCabinet(String cabinet_name)
Get the cabinet with the given name. |
static WTContainer |
getDefaultOrg()
Get a cached instance of the default org container |
static Cabinet |
getDefaultOrgCabinet()
Get a cached instance of the default org container's default cabinet |
static AdministrativeDomain |
getDefaultOrgDomain()
Get a cached instance of the default org container's default domain |
static AdminDomainRef |
getDefaultOrgDomainRef()
Get a cached reference to the default org container's default domain. |
static WTContainerRef |
getDefaultOrgRef()
Get a reference to a cached instance of the default org container. |
static AdministrativeDomain |
getDomain(String domain_name)
Get the domain with the given name. |
static WTContainer |
getExchange()
Get a cached instance of the exchange container |
static WTContainerRef |
getExchangeRef()
Get a reference to a cached instance of the exchange container. |
static long |
getId(Object obj)
Get the long version of the oid for the given
object. |
static Persistable |
getObject(ObjectReference ref)
Gets the object that the given reference refers to |
static ObjectIdentifier |
getOid(Object obj)
Get the ObjectIdentifier for the given object. |
static AdministrativeDomain |
getPrivateOrgDomain()
Get a cached instance of the default org container's private domain |
static AdminDomainRef |
getPrivateOrgDomainRef()
Get a cached reference to the default org container's private domain. |
static Cabinet |
getSystemOrgCabinet()
Get a cached instance of the default org container's system cabinet |
static AdministrativeDomain |
getSystemOrgDomain()
Get a cached instance of the default org container's system domain |
static ObjectIdentifier |
getTemplate(String name,
Class container_class,
ObjectIdentifier container_id)
Finds the latest iteration of the container template with the given properties. |
static Cabinet |
getXDefaultCabinet()
Get a cached instance of the exchange container's default cabinet |
static AdministrativeDomain |
getXDefaultDomain()
Get a cached instance of the exchange container's default domain |
static AdminDomainRef |
getXDefaultDomainRef()
Get a cached reference to the exchange container's default domain. |
static Cabinet |
getXSysCabinet()
Get a cached instance of the exchange container's system cabinet |
static AdministrativeDomain |
getXSysDomain()
Get a cached instance of the exchange container's system domain |
static AdminDomainRef |
getXSysDomainRef()
Get a cached reference to the exchange container's system domain. |
static void |
initialize(Connection a_Connection,
PersistentObjectManager a_Pom,
PrintWriter a_Log)
Initializes the helper's resources. |
static void |
initialize(DirectiveServices ds)
Initializes the helper's resources. |
static QueryResult |
query(QuerySpec qs)
Performs the query |
private static void |
safeClose(ResultSet rs)
If the Statement is not null, try to close it, catching and smothering any SQLException that results. |
private static void |
safeClose(Statement stmt)
If the Statement is not null, try to close it, catching and smothering any SQLException that results. |
static Persistable |
save(Persistable obj)
Inserts the object if it isn't persisted, updates the object if it is. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static Connection connection
private static PersistentObjectManager pom
private static MigrateContainerHelper.Logger logger
private static ExchangeContainer exchange
private static Cabinet exchangeSystemCabinet
private static Cabinet exchangeDefaultCabinet
private static AdministrativeDomain exchangeSystemDomain
private static AdministrativeDomain exchangeDefaultDomain
private static OrgContainer defaultOrg
private static Cabinet defaultOrgSystemCabinet
private static Cabinet defaultOrgDefaultCabinet
private static AdministrativeDomain defaultOrgSystemDomain
private static AdministrativeDomain defaultOrgDefaultDomain
private static AdministrativeDomain defaultOrgPrivateDomain
Constructor Detail |
public MigrateContainerHelper()
Method Detail |
public static void initialize(Connection a_Connection, PersistentObjectManager a_Pom, PrintWriter a_Log)
a_Connection
- The database connectiona_Pom
- The POMa_Log
- The logpublic static void initialize(DirectiveServices ds) throws Exception
ds
- Migration resources
Exception
public static void cleanup()
private static void checkState()
WTRuntimeException
- If the resources assigned in initialize are null
public static QueryResult query(QuerySpec qs) throws WTException
qs
-
WTException
public static Persistable save(Persistable obj) throws WTException
obj
- The object to update
WTException
public static Persistable getObject(ObjectReference ref) throws WTException
ref
- The reference to find an object for
WTException
public static ObjectIdentifier getOid(Object obj)
ObjectIdentifier
for the given object.
public static long getId(Object obj)
long
version of the oid for the given
object.
obj
- The object to get an oid for
WTException
- If getOid(obj) returns null
public static AdministrativeDomain getDomain(String domain_name) throws WTException
domain_name
- The name of the domain to look for
null
if no matches were found
WTException
- If more than one domain is found with the given namepublic static Cabinet getCabinet(String cabinet_name) throws WTException
cabinet_name
- The name of the domain to look for
null
if no matches were found
WTException
- If more than one cabinet is found with the given namepublic static WTContainer getExchange() throws WTException
WTException
public static WTContainerRef getExchangeRef() throws WTException
WTException
public static Cabinet getXSysCabinet() throws WTException
WTException
public static Cabinet getXDefaultCabinet() throws WTException
WTException
public static AdminDomainRef getXSysDomainRef() throws WTException
WTException
public static AdminDomainRef getXDefaultDomainRef() throws WTException
WTException
public static AdministrativeDomain getXSysDomain() throws WTException
WTException
public static AdministrativeDomain getXDefaultDomain() throws WTException
WTException
public static WTContainer getDefaultOrg() throws WTException
WTException
public static WTContainerRef getDefaultOrgRef() throws WTException
WTException
public static Cabinet getDefaultOrgCabinet() throws WTException
WTException
public static Cabinet getSystemOrgCabinet() throws WTException
WTException
public static AdministrativeDomain getSystemOrgDomain() throws WTException
WTException
public static AdminDomainRef getDefaultOrgDomainRef() throws WTException
WTException
public static AdministrativeDomain getDefaultOrgDomain() throws WTException
WTException
public static AdministrativeDomain getPrivateOrgDomain() throws WTException
WTException
public static AdminDomainRef getPrivateOrgDomainRef() throws WTException
WTException
public static ObjectIdentifier getTemplate(String name, Class container_class, ObjectIdentifier container_id) throws Exception
name
- The name of the template to look forcontainer_class
- The container class the template is forcontainer_id
- The id of the template's container reference
DefaultWTContainerTemplate
's oid,
or null
if there isn't a match
Exception
public static ObjectIdentifier createTemplate(String name, String description, Class container_class, ObjectIdentifier container_id, ObjectIdentifier domain_id) throws Exception
name
- The name of the new templatedescription
- The description for the new templatecontainer_class
- The container class for the new templatecontainer_id
- The id for the template's container referencedomain_id
- The id for the template's administrative domain reference
DefaultWTContainerTemplate
.
Exception
public static ObjectIdentifier getAdministrator() throws Exception
WTUser
with name
AdministrativeDomainHelper.ADMINISTRATOR_NAME
.
WTExeption
- If the administrator can't be found
Exception
private static void safeClose(Statement stmt)
stmt
- The Statement
to closeprivate static void safeClose(ResultSet rs)
rs
- The ResultSet
to close
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |