wt.admin
Class StandardAdministrativeDomainManager

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.admin.StandardAdministrativeDomainManager
All Implemented Interfaces:
AdministrativeDomainManager, AdministrativeDomainManagerSvr, Manager, NetFactor, Serializable

public class StandardAdministrativeDomainManager
extends StandardManager
implements AdministrativeDomainManager, AdministrativeDomainManagerSvr, Serializable

The StandardAdministrativeDomainManager provides the default implementation of the AdministrativeDomainManager.

Use the newStandardAdministrativeDomainManager static factory method(s), not the StandardAdministrativeDomainManager constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
Serialized Form

Nested Class Summary
(package private)  class StandardAdministrativeDomainManager.AdministrativeEventListener
           
private  class StandardAdministrativeDomainManager.DomainPathComponents
           
 
Field Summary
private static String ACCESS_RESOURCE
           
private static AdminDomainCache cache
           
private static String CLASSNAME
           
private static AdministrativeDomain defaultDomain
           
private  KeyedEventListener listener
           
private static String RESOURCE
           
private  ReferenceFactory rf
           
private static AdministrativeDomain rootDomain
           
private static ObjectIdentifier rootDomainId
           
private static AdministrativeDomain systemDomain
           
private static String TOP_CLASS
           
private static AdministrativeDomain userDomain
           
private static boolean VERBOSE
           
private static String WTCONTAINER_RESOURCE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardAdministrativeDomainManager()
           
 
Method Summary
private  AdministrativeDomain _getDomain(String domain_path, WTContainerRef container_ref, boolean applyAccessControls)
           
private  String _getPathOfDomain(AdminDomainRef domain_ref, boolean externalForm)
          Retrieves just the domain part of the path name in either display or external form for an administrative domain given the domain reference.
protected  void addClass(Class cls, com.objectspace.jgl.OrderedSet set)
           
 EnumeratorVector allDomainRefs()
          Returns an enumeration of administrative domain references.
 EnumeratorVector allDomainRefs(WTContainerRef container_ref, boolean include_descendent_containers)
          Retrieves references to domains of the specified container.
 Enumeration allDomains()
          Retrieves all domains defined in the system.
 Enumeration allDomains(WTContainerRef container_ref, boolean include_descendent_containers)
          Retrieves all domains of the specified container.
 com.objectspace.jgl.OrderedSet allEvents(Locale locale)
          Deprecated.  
private  String applyAccessControlsToDomainPath(String domainPath, WTContainerRef containerRef, boolean throwException)
           
protected  void buildHierarchy(String current_class, Vector additional_classes, com.objectspace.jgl.OrderedSet all_descendents, Hashtable classHierarchy)
           
private  void cacheRootDomain()
           
 DomainAdministered changeAdministrativeDomain(DomainAdministered obj, AdminDomainRef domain_ref)
          Changes the domain to which the object belongs and sets domain inheritence to false.
 DomainAdministered changeAdministrativeDomain(DomainAdministered obj, AdminDomainRef domain_ref, boolean inheritedDomain)
          Changes the domain to which the object belongs.
 WTList changeAdministrativeDomain(WTList objs, AdminDomainRef domain_ref, boolean inheritedDomain)
          Multi-object version of the changeAdministrativeDomain() API.
 WTList changeAdministrativeDomain(WTList objs, WTList domain_refs, boolean inheritedDomain)
          Multi-object version of the changeAdministrativeDomain() API.
private  void checkChangeDomain(AdministrativeDomain domain, AdminDomainRef newDomainRef)
           
protected  void checkDeleteDomain(AdministrativeDomain domain)
           
protected  void checkModifyDomain(AdministrativeDomain domain)
           
private  void checkRootDomain(AdministrativeDomain domain)
           
private  void checkRootDomain(AdministrativeDomain domain, AdminDomainRef domain_ref)
           
protected  void checkStoreDomain(AdministrativeDomain domain)
           
 AdminDomainRef createDomain(AdminDomainRef domainRef, String name, String description)
          Deprecated.  
 AdminDomainRef createDomain(AdminDomainRef domainRef, String name, String description, WTContainerRef container_ref)
          Create an administrative domain with the given name and description in the specified domain and in the specified container.
 void delete(AdminDomainRef domain)
          Deletes the referenced administrative domain.
protected  void dispatchVetoableEvent(String event_type, Object target, AdminDomainRef domain_ref, boolean commit)
          Dispatches a single object AdministrativeDomainManagerEvent event.
protected  void dispatchVetoableMultiObjectEvent(String event_type, WTList targets, WTList domain_refs, boolean commit)
          Dispatches a multi-object object AdministrativeDomainManagerEvent event.
private  String genDisplayDomainPath(AdministrativeDomain domain, boolean applyAccessControls)
           
protected  com.objectspace.jgl.OrderedSet getAllDescendents(String from_class)
           
 SortedSet getAllEvents(Locale locale)
          Returns the set of all events defined in the system sorted alphabetically.
 long[] getAncestorDomainIds(ObjectReference domain_ref)
          Returns an array of ObjectIdentifier.ID attributes for the specified domain and all ancestor domains.
 ArrayList getAncestorDomains(AdminDomainRef domain_ref)
          Returns an ArrayList of ancestor domains and siblings of each of those domains, for the domain identified by the specified domain reference.
 ArrayList getAncestorDomains(AdminDomainRef domain_ref, boolean includeSiblings)
          Returns an ArrayList of ancestor domains and siblings of each of those domains, for the domain identified by the specified domain reference.
 ArrayList getChildDomains(AdminDomainRef domain_ref)
          Returns an ArrayList of domain references for the child domains of the domain identified by the specified domain reference.
 ArrayList getChildDomains(AdminDomainRef domain_ref, boolean includeChildContainers)
          Returns an ArrayList of domain references for the child domains of the domain identified by the specified domain reference and residing in the same container.
 Hashtable getClassHierarchy(String from_class)
          Deprecated.  
 String getConceptualClassname()
          Deprecated.  
protected  void getConcreteDescendents(String from_class, Vector additional_classes, com.objectspace.jgl.OrderedSet all_descendents, Vector concrete_desc)
           
 long[] getDescendentDomainIds(ObjectReference domain_ref)
          Returns an array of ObjectIdentifier.ID attributes for the specified domain and all descendent domains.
 String getDisplayDomainPath(AdminDomainRef domain_ref)
          Retrieves the path name in displayable form for an administrative domain given the domain_ref.
 String getDisplayDomainPath(AdministrativeDomain domain)
          Retrieves the path name in displayable form for an administrative domain.
 String getDisplayPathOfDomain(AdminDomainRef domain_ref)
          Retrieves just the domain part of the path name in display form for an administrative domain given the domain reference.
 AdministrativeDomain getDomain(String domain_path)
          Retrieves an administrative domain given its domain name or domain path name.
 AdministrativeDomain getDomain(String domain_path, WTContainerRef container_ref)
          Retrieves an administrative domain given its path name within a container.
 String getDomainPath(AdminDomainRef domain_ref)
          Retrieves the path name in external form for an administrative domain given the domain reference.
 String getDomainPath(AdministrativeDomain domain)
          Retrieves the path name in external form for the given administrative domain.
 AdministrativeDomain getGlobalDomain(String name)
          Retrieves one of the four special pre-defined domains (Root, Default, System, and User) in the Exchange container, given its name.
 String getLogDomainPath(AdminDomainRef domain_ref)
          This is a server-side only API used to retrieve the path name in displayable form for the given domain reference to be included in log messages.
 String getPathOfDomain(AdminDomainRef domain_ref)
          Retrieves just the domain part of the path name in external form for an administrative domain given the domain reference.
private  ObjectIdentifier getRootDomainId()
           
private  AdministrativeDomain getRootLevelDomain(String domainName)
          Get a domain with the specified name, that resides in the Exchange container, and whose parent domain is the root domain.
 boolean isAncestorDomain(AdminDomainRef ancestorDomainRef, AdminDomainRef domainRef)
          Determines if the input ancestorDomainRef is actually an ancestor of the input domainRef.
private  boolean isSpecialDomain(AdministrativeDomain domain)
          Check if the specified domain is one of the special pre-defined domains.
private  boolean isSpecialDomain(AdministrativeDomain domain, boolean inExchangeContainer)
          Check if the specified domain is one of the special pre-defined domains.
private  boolean isSpecialDomainByOID(AdministrativeDomain domain)
          Check if the specified domain is one of the special pre-defined domains.
private  boolean isSpecialDomainName(AdministrativeDomain domain)
          Check if the input domain has one of the special pre-defined domain names.
static StandardAdministrativeDomainManager newStandardAdministrativeDomainManager()
          Default factory for the class.
private  StandardAdministrativeDomainManager.DomainPathComponents parseDomainPath(String domainPath)
           
protected  void performStartupProcess()
          Manager startup routine.
private  void pp(String msg)
           
 void registerEvents(ManagerService ms)
          Register events with the passed ManagerService.
 DomainAdministered replaceAdministrativeDomain(DomainAdministered from, DomainAdministered to, boolean commit_change)
          Copies the domain reference in the 'from' object to the 'to' object and sets the inheritedDomain attribute to true.
 WTList replaceAdministrativeDomain(DomainAdministered from, WTList to_objs, boolean commit_change)
          Multi-object version of the replaceAdministrativeDomain() API.
 WTList replaceAdministrativeDomain(WTList from_objs, WTList to_objs, boolean commit_change)
          Multi-object version of the replaceAdministrativeDomain() API.
 void setAdministratorRule(AdminDomainRef domainRef)
          Creates an access control rule giving the administrator all the rights in the domain identified by the given domain reference.
 void setAdministratorRule(AdministrativeDomain domain)
          Creates an access control rule giving the administrator all the rights in the given domain.
 void setDomainDescription(AdminDomainRef domainRef, String newDescription)
          Updates the description of the referenced administrative domain.
 void setDomainName(AdminDomainRef domainRef, String newName)
          Updates the name of the referenced administrative domain.
 AdminDomainRef updateDomain(AdminDomainRef domainRef, String name, String description)
          Update an administrative domain with the given name and description.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

WTCONTAINER_RESOURCE

private static final String WTCONTAINER_RESOURCE
See Also:
Constant Field Values

TOP_CLASS

private static String TOP_CLASS

VERBOSE

private static boolean VERBOSE

ACCESS_RESOURCE

private static final String ACCESS_RESOURCE
See Also:
Constant Field Values

rootDomain

private static AdministrativeDomain rootDomain

rootDomainId

private static ObjectIdentifier rootDomainId

systemDomain

private static AdministrativeDomain systemDomain

defaultDomain

private static AdministrativeDomain defaultDomain

userDomain

private static AdministrativeDomain userDomain

cache

private static AdminDomainCache cache

rf

private ReferenceFactory rf

listener

private KeyedEventListener listener
Constructor Detail

StandardAdministrativeDomainManager

public StandardAdministrativeDomainManager()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException
Manager startup routine. One of the tasks is the reading of pre-defined domains.

Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

dispatchVetoableEvent

protected void dispatchVetoableEvent(String event_type,
                                     Object target,
                                     AdminDomainRef domain_ref,
                                     boolean commit)
                              throws WTException
Dispatches a single object AdministrativeDomainManagerEvent event.

Supported API: false

Parameters:
event_type -
target -
domain_ref -
commit -
Throws:
WTException

dispatchVetoableMultiObjectEvent

protected void dispatchVetoableMultiObjectEvent(String event_type,
                                                WTList targets,
                                                WTList domain_refs,
                                                boolean commit)
                                         throws WTException
Dispatches a multi-object object AdministrativeDomainManagerEvent event.

Supported API: false

Parameters:
event_type -
targets -
domain_refs -
commit -
Throws:
WTException

newStandardAdministrativeDomainManager

public static StandardAdministrativeDomainManager newStandardAdministrativeDomainManager()
                                                                                  throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardAdministrativeDomainManager
Throws:
WTException

getDomain

public AdministrativeDomain getDomain(String domain_path)
                               throws WTException
Retrieves an administrative domain given its domain name or domain path name. If no such domain is found, null is returned. If an unexpected error condition occurs, an exception is thrown.

If no container information is specified within the input domain path (or if only a domain name is provided), a container is derived depending on the input value.

Valid formats for domain_path include:

  1. domain name (e.g., Design)
  2. domain path (e.g., /Design, /Marketing/Brochures, etc.)
  3. [container-path]/domain-path (the external form of the domain path)

Resulting actions for the different input formats:

  1. domain name
    If domain name is one of the special domain names configurable via wt.admin properties in the wt.properties file, the named domain whose parent is the root domain and resides in the Site container is returned. If the domain name is not one of the special domains, the named domain whose parent is the root domain and resides in the Windchill PDM Library container is returned.
  2. domain path
    If domain path is the path for one of the special domains (e.g., /System) the special domain whose parent is the root domain and resides in the Site container is returned; otherwise the domain corresponding to the domain path that resides in the Windchill PDM Library container is returned. Note that in this case the domain path must be relative to the Windchill PDM Library container. This means that all domains in the path must reside in the Windchill PDM Library container.
  3. external form of the domain path ([container-path]/domain-path )
    This is the external form of the domain path. For a description of the external form see the getDomainPath APIs. In this case, the administrative domain corresponding to the domain-path and residing in the container corresponding to the container-path is returned. Note that the domain-path portion must be relative to the container specified by the container-path portion.


Supported API: true

Specified by:
getDomain in interface AdministrativeDomainManager
Parameters:
domain_path - Required. Specifies the administrative domain path or the domain name.
Returns:
AdministrativeDomain
Throws:
WTException

getDomain

public AdministrativeDomain getDomain(String domain_path,
                                      WTContainerRef container_ref)
                               throws WTException
Retrieves an administrative domain given its path name within a container. If no such domain is found, null is returned. If an unexpected error condition occurs, an exception is thrown.

Supported API: true

Specified by:
getDomain in interface AdministrativeDomainManager
Parameters:
domain_path - Required. The domain path of the administrative domain. This must be a path name (i.e., it must start with "/"). The domain path is relative to the container specified by the container_ref parameter. This means that all of the domains contained in the domain path must reside in the container specified by container_ref.
container_ref - Required. The container the domain path is relative to.
Returns:
AdministrativeDomain
Throws:
WTException

getDomainPath

public String getDomainPath(AdministrativeDomain domain)
                     throws WTException
Retrieves the path name in external form for the given administrative domain. If the administrative domain isn't found, null is returned.

To get the domain path name in displayable form use the getDisplayDomainPath API.

The format for the external form of the domain path is [container-path]/domain-path (the brackets are included) where container-path is the form /containerType=name/containerType=name/.../containerType=name

For example:
[/wt.inf.container.OrgContainer=DefaultOrg/wt.inf.library.WTLibrary=Windchill PDM]/Design

See the ContainerPath.getExternalForm() API for more information about the container-path external form. The domain-path is relative to the container meaning that all of the domains in the domain path reside in the container. The external form of the domain path can be used as input to the getDomain(String domain_path) API.

Supported API: true

Specified by:
getDomainPath in interface AdministrativeDomainManager
Parameters:
domain - Required. The administrative domain.
Returns:
String
Throws:
WTException

getDomainPath

public String getDomainPath(AdminDomainRef domain_ref)
                     throws WTException
Retrieves the path name in external form for an administrative domain given the domain reference. If the administrative domain isn't found, null is returned. See the getDomainPath(AdministrativeDomain domain) API for more information.

Supported API: true

Specified by:
getDomainPath in interface AdministrativeDomainManager
Parameters:
domain_ref - Required. The administrative domain reference.
Returns:
String
Throws:
WTException

getDisplayDomainPath

public String getDisplayDomainPath(AdministrativeDomain domain)
                            throws WTException
Retrieves the path name in displayable form for an administrative domain. If the administrative domain isn't found, null is returned.

To get the domain path name in external form use the getDomainPath API.

The format for the displayable form of the domain path is container-path /domain-path where container-path is the form containerType Name,containerType Name,...,containerType Name

For example:
Site,Organization DefaultOrg,Library Windchill PDM /Marketing/Brochures

See the ContainerPath.getDisplayForm() API for more information about the container-path display form.

The domain-path is relative to the container meaning that all of the domains in the domain path reside in the container.

Note that access control is applied to the domain path before it is returned so if a user isn't allowed to see a portion of the path the String (Secured information) is inserted in the domain path. For example, from the above example if the user doesn't have access to container DefaultOrg and domain Marketing the returned domain path is:
(Secured information),Library Windchill PDM /(Secured information)/Brochures

Supported API: true

Specified by:
getDisplayDomainPath in interface AdministrativeDomainManager
Parameters:
domain - Required. The administrative domain.
Returns:
String
Throws:
WTException

getDisplayDomainPath

public String getDisplayDomainPath(AdminDomainRef domain_ref)
                            throws WTException
Retrieves the path name in displayable form for an administrative domain given the domain_ref. If the administrative domain isn't found, null is returned. See the getDisplayDomainPath(AdministrativeDomain domain) API for more information.

Supported API: true

Specified by:
getDisplayDomainPath in interface AdministrativeDomainManager
Parameters:
domain_ref - Required. The administrative domain reference.
Returns:
String
Throws:
WTException

getGlobalDomain

public AdministrativeDomain getGlobalDomain(String name)
                                     throws WTException
Retrieves one of the four special pre-defined domains (Root, Default, System, and User) in the Exchange container, given its name. An exception is thrown if any other domain is requested.

Supported API: false

Specified by:
getGlobalDomain in interface AdministrativeDomainManager
Parameters:
name -
Returns:
AdministrativeDomain
Throws:
WTException

allDomains

public Enumeration allDomains()
                       throws WTException
Retrieves all domains defined in the system.

Supported API: true

Specified by:
allDomains in interface AdministrativeDomainManager
Returns:
Enumeration
Throws:
WTException

allDomains

public Enumeration allDomains(WTContainerRef container_ref,
                              boolean include_descendent_containers)
                       throws WTException
Retrieves all domains of the specified container. If include_descendent_containers is true, also returns all the domains of the descendent containers.

Supported API: false

Specified by:
allDomains in interface AdministrativeDomainManager
Parameters:
container_ref -
include_descendent_containers -
Returns:
Enumeration
Throws:
WTException

allDomainRefs

public EnumeratorVector allDomainRefs()
                               throws WTException
Returns an enumeration of administrative domain references.

Supported API: true

Specified by:
allDomainRefs in interface AdministrativeDomainManager
Returns:
EnumeratorVector
Throws:
WTException

allDomainRefs

public EnumeratorVector allDomainRefs(WTContainerRef container_ref,
                                      boolean include_descendent_containers)
                               throws WTException
Retrieves references to domains of the specified container. If include_decendent_containers is true, references to domains of the descendent containers are included.

Supported API: false

Specified by:
allDomainRefs in interface AdministrativeDomainManager
Parameters:
container_ref -
include_descendent_containers -
Returns:
EnumeratorVector
Throws:
WTException

allEvents

public com.objectspace.jgl.OrderedSet allEvents(Locale locale)
                                         throws WTException
Deprecated.  

Returns the set of all events defined in the system.

Supported API: true

Specified by:
allEvents in interface AdministrativeDomainManager
Parameters:
locale -
Returns:
OrderedSet
Throws:
WTException

getAllEvents

public SortedSet getAllEvents(Locale locale)
                       throws WTException
Returns the set of all events defined in the system sorted alphabetically.

Supported API: true

Specified by:
getAllEvents in interface AdministrativeDomainManager
Parameters:
locale -
Returns:
SortedSet
Throws:
WTException

createDomain

public AdminDomainRef createDomain(AdminDomainRef domainRef,
                                   String name,
                                   String description)
                            throws WTException,
                                   WTPropertyVetoException
Deprecated.  

Create an administrative domain with the given name and description in the specified domain. Returns a reference to the new domain.

Supported API: true

Specified by:
createDomain in interface AdministrativeDomainManager
Parameters:
domainRef - Domain reference of parent domain
name - Domain name
description - Domain description
Returns:
AdminDomainRef
Throws:
WTException
WTPropertyVetoException
See Also:
createDomain(AdminDomainRef, String, String, WTContainerRef)

createDomain

public AdminDomainRef createDomain(AdminDomainRef domainRef,
                                   String name,
                                   String description,
                                   WTContainerRef container_ref)
                            throws WTException,
                                   WTPropertyVetoException
Create an administrative domain with the given name and description in the specified domain and in the specified container. Returns a reference to the new domain.

Supported API: true

Specified by:
createDomain in interface AdministrativeDomainManager
Parameters:
domainRef -
name -
description -
container_ref -
Returns:
AdminDomainRef
Throws:
WTException
WTPropertyVetoException

changeAdministrativeDomain

public DomainAdministered changeAdministrativeDomain(DomainAdministered obj,
                                                     AdminDomainRef domain_ref)
                                              throws WTException
Changes the domain to which the object belongs and sets domain inheritence to false. Posts PRE_CHANGE_DOMAIN and POST_CHANGE_DOMAIN events. Persists and returns the changed object. Throws an AdministrativeDomainException if the object is not persistent.

Supported API: true

Specified by:
changeAdministrativeDomain in interface AdministrativeDomainManager
Parameters:
obj - A domain administered object. If obj is null, a WTInvalidParameterException is thrown.
domain_ref - The new administrative domain reference for the domain administered object. If domain_ref is null, a WTInvalidParameterException is thrown.
Returns:
DomainAdministered
Throws:
WTException

changeAdministrativeDomain

public DomainAdministered changeAdministrativeDomain(DomainAdministered obj,
                                                     AdminDomainRef domain_ref,
                                                     boolean inheritedDomain)
                                              throws WTException,
                                                     WTPropertyVetoException
Changes the domain to which the object belongs. Posts PRE_CHANGE_DOMAIN and POST_CHANGE_DOMAIN events. Persists and returns the changed object. Throws an AdministrativeDomainException if the object is not persistent.

Supported API: true

Specified by:
changeAdministrativeDomain in interface AdministrativeDomainManager
Parameters:
obj - A domain administered object. If obj is null, a WTInvalidParameterException is thrown.
domain_ref - The new administrative domain reference for the domain administered object. If domain_ref is null, a WTInvalidParameterException is thrown.
inheritedDomain - Set to true if the domain is inherited, otherwise set to false
Returns:
DomainAdministered
Throws:
WTException
WTPropertyVetoException

changeAdministrativeDomain

public WTList changeAdministrativeDomain(WTList objs,
                                         AdminDomainRef domain_ref,
                                         boolean inheritedDomain)
                                  throws WTException,
                                         WTPropertyVetoException
Multi-object version of the changeAdministrativeDomain() API. For each DomainAdministered object in the objs collection, the domain reference for the domain to which the object belongs is changed to the domain reference specified by the domain_ref parameter.

The objs collection must contain one or more DomainAdministered objects. The exception is if you want to change the domain that an AdministrativeDomain object belong to. In this case the objs collection can contain only one DomainAdministered object which is the AdministrativeDomain object being modified.

Multi-object PRE_CHANGE_DOMAIN and POST_CHANGE_DOMAIN events are posted before and after changing the DomainAdministered objects in the objs collection.

The domain changes for each DomainAdministered object in the objs collection are persisted and a collection of the modified DomainAdministered objects is returned.

If any of the DomainAdministered objects in the objs collection are not persistent, an AdministrativeDomainException is thrown.

Supported API: true

Specified by:
changeAdministrativeDomain in interface AdministrativeDomainManager
Parameters:
objs - Collection of DomainAdministered objects to be changed. If obj is null or empty, a WTInvalidParameterException is thrown.
domain_ref - The new AdminDomainRef to be assigned to each of the DomainAdministered objects in the objs collection. If domain_ref is null, a WTInvalidParameterException is thrown.
inheritedDomain - Set to true if the domain is inherited; otherwise, set to false
Returns:
WTList
Throws:
WTException
WTPropertyVetoException

changeAdministrativeDomain

public WTList changeAdministrativeDomain(WTList objs,
                                         WTList domain_refs,
                                         boolean inheritedDomain)
                                  throws WTException,
                                         WTPropertyVetoException
Multi-object version of the changeAdministrativeDomain() API. For each DomainAdministered object in the objs collection, the domain reference for the domain to which the object belongs is changed to the domain reference specified by the corresponding AdminDomainRef object in the domain_refs collection.

The objs collection must contain one or more DomainAdministered objects. The exception is if you want to modify the domain that an AdministrativeDomain object belongs to. In this case the objs collection can contain only one DomainAdministered object which is the AdministrativeDomain object being modified. If objs contains multiple objects and one or more of them is an AdministrativeDomain, a AdministrativeDomainException is thrown. If objs is null or empty, a WTInvalidParameterException is thrown.

The domain_refs collection must contain either 1) a single AdminDomainRef object or 2) the same number of AdminDomainRef objects as there are DomainAdministered objects in the objs collection. If domain_refs contains one AdminDomainRef, this AdminDomainRef is assigned to each DomainAdministered object in the objs collection; otherwise, the first AdminDomainRef is assigned to the first DomainAdministered object, the second AdminDomainRef is assigned to the second DomainAdministered object, and so on. If domain_refs is null, empty, or the wrong size, a WTInvalidParameterException is thrown.

Multi-object PRE_CHANGE_DOMAIN and POST_CHANGE_DOMAIN events are posted before and after changing the DomainAdministered objects in the objs collection.

The domain changes for each DomainAdministered object in the objs collection are persisted and a collection of the modified DomainAdministered objects is returned.

If any of the DomainAdministered objects in the objs collection are not persistent, an AdministrativeDomainException is thrown.

Supported API: true

Specified by:
changeAdministrativeDomain in interface AdministrativeDomainManager
Parameters:
objs - Collection of DomainAdministered objects to be changed.
domain_refs - A collection of the new AdminDomainRef objects to be assigned to the corresponding DomainAdministered objects in the objs collection.
inheritedDomain - Set to true if the domain is inherited; otherwise, set to false
Returns:
WTList
Throws:
WTException
WTPropertyVetoException

delete

public void delete(AdminDomainRef domain)
            throws WTException
Deletes the referenced administrative domain. A domain cannot be deleted if it is referenced by other objects (for example, it has children or associated policy rules).

Supported API: true

Specified by:
delete in interface AdministrativeDomainManager
Parameters:
domain -
Throws:
WTException

getAncestorDomains

public ArrayList getAncestorDomains(AdminDomainRef domain_ref)
                             throws WTException
Returns an ArrayList of ancestor domains and siblings of each of those domains, for the domain identified by the specified domain reference. Each element of the ArrayList is an Array of two domain references; a reference for a domain and for its parent. The first array element is the parent reference, and is null for the root domain.

Supported API: false

Specified by:
getAncestorDomains in interface AdministrativeDomainManager
Parameters:
domain_ref -
Returns:
ArrayList
Throws:
WTException

getAncestorDomains

public ArrayList getAncestorDomains(AdminDomainRef domain_ref,
                                    boolean includeSiblings)
                             throws WTException
Returns an ArrayList of ancestor domains and siblings of each of those domains, for the domain identified by the specified domain reference. Each element of the ArrayList is an Array of two domain references; a reference for a domain and for its parent. The first array element is the parent reference, and is null for the root domain.

Supported API: false

Specified by:
getAncestorDomains in interface AdministrativeDomainManager
Parameters:
domain_ref -
includeSiblings -
Returns:
ArrayList
Throws:
WTException

getChildDomains

public ArrayList getChildDomains(AdminDomainRef domain_ref)
                          throws WTException
Returns an ArrayList of domain references for the child domains of the domain identified by the specified domain reference.

Supported API: false

Specified by:
getChildDomains in interface AdministrativeDomainManager
Parameters:
domain_ref -
Returns:
ArrayList
Throws:
WTException

getChildDomains

public ArrayList getChildDomains(AdminDomainRef domain_ref,
                                 boolean includeChildContainers)
                          throws WTException
Returns an ArrayList of domain references for the child domains of the domain identified by the specified domain reference and residing in the same container. If includeChildContainers is set to true, child domains residing in the child conntainers of the one specified are included as well.

Supported API: false

Specified by:
getChildDomains in interface AdministrativeDomainManager
Parameters:
domain_ref -
includeChildContainers -
Returns:
ArrayList
Throws:
WTException

getClassHierarchy

public Hashtable getClassHierarchy(String from_class)
                            throws WTException
Deprecated.  

Returns the class hierarchy that extends (or implements) the class (or interface) passed as parameter. The hierarchy is returned in the form of a Hashtable, where the keys are the classes that extend (implement) the argument class and the values are vectors of names of the classes that extend the class in the key. All names of the classes are full qualified.

Normally only concrete classes plus wt.fc.WTObject are returned. A list of abstract classes (that implement from_class) may be included by setting the property

wt.admin.hierarchyListAdditions.=class1,class2,...

Deprecated. Use introspection methods defined by the TypeModel (package com.ptc.core.meta.type.runtime.server) to get a type hierarchy.

Supported API: true

Specified by:
getClassHierarchy in interface AdministrativeDomainManager
Parameters:
from_class -
Returns:
Hashtable
Throws:
WTException

getDisplayPathOfDomain

public String getDisplayPathOfDomain(AdminDomainRef domain_ref)
                              throws WTException
Retrieves just the domain part of the path name in display form for an administrative domain given the domain reference. If the administrative domain isn't found, null is returned. For the display form of the path if a user doesn't have read privaleges to a domain in the path, the string "(Secured information)" is substituted in the path that is returned. Use getPathOfDomain() to get the domain part of the path name in external form. Use the getDomainPath() or getDisplayDomainPath() APIs to retrieve the full domain path including the container part.

Supported API: false

Specified by:
getDisplayPathOfDomain in interface AdministrativeDomainManager
Parameters:
domain_ref - Required. The administrative domain reference.
Returns:
String
Throws:
WTException

getPathOfDomain

public String getPathOfDomain(AdminDomainRef domain_ref)
                       throws WTException
Retrieves just the domain part of the path name in external form for an administrative domain given the domain reference. If the administrative domain isn't found, null is returned. For the external form if a user does not have read privaleges for a domain in the path, a NotAuthorizedException is thrown. Use the getDisplayPathOfDomain to get the domain part of the path name in display form. Use the getDomainPath() or getDisplayDomainPath() APIs to retrieve the full domain path including the container part.

Supported API: false

Specified by:
getPathOfDomain in interface AdministrativeDomainManager
Parameters:
domain_ref - Required. The administrative domain reference.
Returns:
String
Throws:
WTException

setAdministratorRule

public void setAdministratorRule(AdministrativeDomain domain)
                          throws WTException
Creates an access control rule giving the administrator all the rights in the given domain.

Supported API: true

Specified by:
setAdministratorRule in interface AdministrativeDomainManager
Parameters:
domain -
Throws:
WTException

setAdministratorRule

public void setAdministratorRule(AdminDomainRef domainRef)
                          throws WTException
Creates an access control rule giving the administrator all the rights in the domain identified by the given domain reference.

Supported API: true

Specified by:
setAdministratorRule in interface AdministrativeDomainManager
Parameters:
domainRef -
Throws:
WTException

setDomainDescription

public void setDomainDescription(AdminDomainRef domainRef,
                                 String newDescription)
                          throws WTException,
                                 WTPropertyVetoException
Updates the description of the referenced administrative domain.

Supported API: true

Specified by:
setDomainDescription in interface AdministrativeDomainManager
Parameters:
domainRef -
newDescription -
Throws:
WTException
WTPropertyVetoException

setDomainName

public void setDomainName(AdminDomainRef domainRef,
                          String newName)
                   throws WTException,
                          WTPropertyVetoException
Updates the name of the referenced administrative domain.

Supported API: false

Specified by:
setDomainName in interface AdministrativeDomainManager
Parameters:
domainRef -
newName -
Throws:
WTException
WTPropertyVetoException

updateDomain

public AdminDomainRef updateDomain(AdminDomainRef domainRef,
                                   String name,
                                   String description)
                            throws WTException,
                                   WTPropertyVetoException
Update an administrative domain with the given name and description.

Supported API: true

Specified by:
updateDomain in interface AdministrativeDomainManager
Parameters:
domainRef - Domain reference of the domain to update
name - new domain name
description - new domain description
Returns:
AdminDomainRef
Throws:
WTException
WTPropertyVetoException

getAncestorDomainIds

public long[] getAncestorDomainIds(ObjectReference domain_ref)
                            throws WTException
Returns an array of ObjectIdentifier.ID attributes for the specified domain and all ancestor domains.

Supported API: false

Specified by:
getAncestorDomainIds in interface AdministrativeDomainManagerSvr
Parameters:
domain_ref -
Returns:
long []
Throws:
WTException

getDescendentDomainIds

public long[] getDescendentDomainIds(ObjectReference domain_ref)
                              throws WTException
Returns an array of ObjectIdentifier.ID attributes for the specified domain and all descendent domains.

Supported API: false

Specified by:
getDescendentDomainIds in interface AdministrativeDomainManagerSvr
Parameters:
domain_ref -
Returns:
long []
Throws:
WTException

getLogDomainPath

public String getLogDomainPath(AdminDomainRef domain_ref)
This is a server-side only API used to retrieve the path name in displayable form for the given domain reference to be included in log messages. This method returns the domain path in the same format as the getDisplayDomainPath() methods but DOES NOT apply access control so that the entire path is visible in the log message. The domain-path is relative to the container meaning that all of the domains in the domain-path reside in the container. If the administrative domain isn't found, null is returned. This method always returns a value; either null or a domain path. The caller has to decide what to put in the log message if null is returned.

Supported API: false

Specified by:
getLogDomainPath in interface AdministrativeDomainManagerSvr
Parameters:
domain_ref - Required. The administrative domain reference.
Returns:
String

isAncestorDomain

public boolean isAncestorDomain(AdminDomainRef ancestorDomainRef,
                                AdminDomainRef domainRef)
Determines if the input ancestorDomainRef is actually an ancestor of the input domainRef. If so, true is returned. If either of the input values is null, false is returned.

Supported API: false

Specified by:
isAncestorDomain in interface AdministrativeDomainManagerSvr
Parameters:
ancestorDomainRef -
domainRef -
Returns:
boolean

replaceAdministrativeDomain

public DomainAdministered replaceAdministrativeDomain(DomainAdministered from,
                                                      DomainAdministered to,
                                                      boolean commit_change)
                                               throws WTException
Copies the domain reference in the 'from' object to the 'to' object and sets the inheritedDomain attribute to true. Posts PRE_CHANGE_DOMAIN and POST_CHANGE_DOMAIN events. Persists the changes and returns the changed object if commit_change is true.

Supported API: true

Specified by:
replaceAdministrativeDomain in interface AdministrativeDomainManagerSvr
Parameters:
from - The domain administered object to copy the domain reference from. If from is null, a WTInvalidParameterException is thrown.
to - The domain administered object to copy the domain reference to. If to is null, a WTInvalidParameterException is thrown.
commit_change -
Returns:
DomainAdministered
Throws:
WTException

replaceAdministrativeDomain

public WTList replaceAdministrativeDomain(DomainAdministered from,
                                          WTList to_objs,
                                          boolean commit_change)
                                   throws WTException
Multi-object version of the replaceAdministrativeDomain() API. The domain reference in the from DomainAdministered object is copied to each DomainAdministered object in the to_objs collection and each object's inheritedDomain attribute is set to true.

The to_objs collection must contain one or more DomainAdministered objects.The exception is if you want to replace the domain that an AdministrativeDomain object belongs to. In this case the to_objs collection can contain only one DomainAdministered object which is the AdministrativeDomain object being modified. If to_objs contains multiple objects and one or more of them is an AdministrativeDomain, a AdministrativeDomainException is thrown.

Multi-object PRE_CHANGE_DOMAIN and POST_CHANGE_DOMAIN events are posted before and after modifying the DomainAdministered objects in the to_objs collection.

If commit_change is true, the domain changes for each DomainAdministered object in the to_objs collection are persisted.

A collection of the modified DomainAdministered objects is returned.

Supported API: true

Specified by:
replaceAdministrativeDomain in interface AdministrativeDomainManagerSvr
Parameters:
from - The DomainAdministered object to copy the domain reference from. If from is null, a WTInvalidParameterException is thrown.
to_objs - Collection of DomainAdministered objects to copy the from object's domain reference to. If to_objs is null or empty, a WTInvalidParameterException is thrown.
commit_change - If true, the objects in the to_objs collection are persisted after changing their domains.
Returns:
WTList
Throws:
WTException

replaceAdministrativeDomain

public WTList replaceAdministrativeDomain(WTList from_objs,
                                          WTList to_objs,
                                          boolean commit_change)
                                   throws WTException
Multi-object version of the replaceAdministrativeDomain() API. For each DomainAdministered object in the from_objs collection, the domain reference is copied from the from_obj object to the corresponding DomainAdministered object in the to_objs collection and the inheritedDomain attribute is set to true for each to_objs object.

The to_objs collection must contain one or more DomainAdministered objects.The exception is if you want to replace the domain that an AdministrativeDomain object belongs to. In this case the to_objs collection can contain only one DomainAdministered object which is the AdministrativeDomain object being modified. If to_objs contains multiple objects and one or more of them is an AdministrativeDomain, a AdministrativeDomainException is thrown. If to_objs is null or empty, a WTInvalidParameterException is thrown.

The from_objs collection must contain either 1) a single DomainAdministered object or 2) the same number of DomainAdministered objects as are DomainAdministered objects in the to_objs collection. If from_objs contains one DomainAdministered object, the domain reference from this DomainAdministered object is copied to each DomainAdministered object in the to_objs collection; otherwise, the first from_objs DomainAdministered object's domain reference is copied to the first to_objs DomainAdministered object, the second from_objs DomainAdministered object's domain reference is copied to the second to_objs DomainAdministered object, and so on. If from_objs is null, empty, or the wrong size, a WTInvalidParameterException is thrown.

Multi-object PRE_CHANGE_DOMAIN and POST_CHANGE_DOMAIN events are posted before and after modifying the DomainAdministered objects in the to_objs collection.

If commit_change is true, the domain changes for each DomainAdministered object in the to_objs collection are persisted.

A collection of the modified DomainAdministered objects is returned.

Supported API: true

Specified by:
replaceAdministrativeDomain in interface AdministrativeDomainManagerSvr
Parameters:
from_objs - Collection of DomainAdministered objects to copy the domain references from.
to_objs - Collection of DomainAdministered objects to copy the from_objs domain references to.
commit_change - If true, the objects in the to_objs collection are persisted after changing their domains.
Returns:
WTList
Throws:
WTException

_getDomain

private AdministrativeDomain _getDomain(String domain_path,
                                        WTContainerRef container_ref,
                                        boolean applyAccessControls)
                                 throws WTException
Throws:
WTException

buildHierarchy

protected void buildHierarchy(String current_class,
                              Vector additional_classes,
                              com.objectspace.jgl.OrderedSet all_descendents,
                              Hashtable classHierarchy)
                       throws WTException
Throws:
WTException

getConcreteDescendents

protected void getConcreteDescendents(String from_class,
                                      Vector additional_classes,
                                      com.objectspace.jgl.OrderedSet all_descendents,
                                      Vector concrete_desc)
                               throws WTException
Throws:
WTException

getAllDescendents

protected com.objectspace.jgl.OrderedSet getAllDescendents(String from_class)
                                                    throws WTException
Throws:
WTException

addClass

protected void addClass(Class cls,
                        com.objectspace.jgl.OrderedSet set)
                 throws WTException
Throws:
WTException

cacheRootDomain

private void cacheRootDomain()
                      throws WTException
Throws:
WTException

checkDeleteDomain

protected void checkDeleteDomain(AdministrativeDomain domain)
                          throws WTException
Throws:
WTException

checkRootDomain

private void checkRootDomain(AdministrativeDomain domain)
                      throws WTException
Throws:
WTException

checkRootDomain

private void checkRootDomain(AdministrativeDomain domain,
                             AdminDomainRef domain_ref)
                      throws WTException
Throws:
WTException

checkChangeDomain

private void checkChangeDomain(AdministrativeDomain domain,
                               AdminDomainRef newDomainRef)
                        throws WTException
Throws:
WTException

checkModifyDomain

protected void checkModifyDomain(AdministrativeDomain domain)
                          throws AdministrativeDomainException,
                                 WTException
Throws:
AdministrativeDomainException
WTException

checkStoreDomain

protected void checkStoreDomain(AdministrativeDomain domain)
                         throws AdministrativeDomainException,
                                WTException
Throws:
AdministrativeDomainException
WTException

getRootDomainId

private ObjectIdentifier getRootDomainId()
                                  throws WTException
Throws:
WTException

getRootLevelDomain

private AdministrativeDomain getRootLevelDomain(String domainName)
                                         throws WTException
Get a domain with the specified name, that resides in the Exchange container, and whose parent domain is the root domain. This method bypasses access controls.

Throws:
WTException

isSpecialDomain

private boolean isSpecialDomain(AdministrativeDomain domain)
                         throws WTException
Check if the specified domain is one of the special pre-defined domains. The check is done by comparing the input Domain's name with the Special Domain names. True is returned if the Domain's parent is Root, the Domain resides in the Exchange container, and the Domain's name matches one of the Special Domain names.

Throws:
WTException

isSpecialDomain

private boolean isSpecialDomain(AdministrativeDomain domain,
                                boolean inExchangeContainer)
                         throws WTException
Check if the specified domain is one of the special pre-defined domains. The check is done by comparing the input Domain's name with the Special Domain names. Params: domain Domain to check. inExchangeContainer Boolean indicating if we want the check to include checking that the Domain is in the Exchange container. If inExchange Container is True, True is returned if the Domain's parent is Root, the Domain resides in the Exchange container, and the Domain's name matches one of the Special Domain names. If inExchange Container is False, True is returned if the Domain's parent is Root and the Domain's name matches one of the Special Domain names.

Throws:
WTException

isSpecialDomainByOID

private boolean isSpecialDomainByOID(AdministrativeDomain domain)
                              throws WTException
Check if the specified domain is one of the special pre-defined domains. The check is done by comparing the input Domain's OID with the Special Domain OIDs. Note that it is more efficient to use the isSpecialDomain() method to check domains by name. Only use this method if the check MUST be done by OID. True is returned if the Domain's OID matches on of the Special Domain OIDs.

Throws:
WTException

isSpecialDomainName

private boolean isSpecialDomainName(AdministrativeDomain domain)
                             throws WTException
Check if the input domain has one of the special pre-defined domain names. The check is done by comparing the input Domain's name with the Special Domain names. Params: domain Domain to check. True is returned if the input domain name matches one of the special domain names.

Throws:
WTException

registerEvents

public void registerEvents(ManagerService ms)
Register events with the passed ManagerService.

Specified by:
registerEvents in interface Manager
Overrides:
registerEvents in class StandardManager
Parameters:
ms - the ManagerService with which to register events.

_getPathOfDomain

private String _getPathOfDomain(AdminDomainRef domain_ref,
                                boolean externalForm)
                         throws WTException
Retrieves just the domain part of the path name in either display or external form for an administrative domain given the domain reference. If the administrative domain isn't found, null is returned. For the display form of the path if a user doesn't have read privaleges to a domain in the path, the string "(Secured information)" is substituted in the path that is returned. For the external form if a user does not have read privaleges for a domain in the path, a NotAuthorizedException is thrown.

Supported API: false

Parameters:
domain_ref - Required. The administrative domain reference.
Returns:
String
Throws:
WTException

applyAccessControlsToDomainPath

private String applyAccessControlsToDomainPath(String domainPath,
                                               WTContainerRef containerRef,
                                               boolean throwException)
                                        throws WTException
Throws:
WTException

genDisplayDomainPath

private String genDisplayDomainPath(AdministrativeDomain domain,
                                    boolean applyAccessControls)
                             throws WTException
Throws:
WTException

parseDomainPath

private StandardAdministrativeDomainManager.DomainPathComponents parseDomainPath(String domainPath)

pp

private final void pp(String msg)