Package wt.inf.container
Class DefaultWTOrganizationValidator
java.lang.Object
wt.inf.container.DefaultWTOrganizationValidator
- All Implemented Interfaces:
WTOrganizationValidator
-
Method Summary
Modifier and TypeMethodDescriptionprotected AdminDomainRefcreateDomain(WTOrganization organization, Object requestor) Creates a newAdministrativeDomainfor the organization, if neccessary.protected voidcreatePolicies(WTOrganization organization, Object requestor) Creates the policy rules for domains created by#createValidDomain(WTOrganization,Object).protected voidfinalizeValidation(WTOrganization organization, Object requestor) Provides subclasses a last opportunity to do any additional work before thevalidatemethod completes.protected WTOrganizationgetOrganization(Object requestor) Gets either an existingWTOrganizationthat corresponds to the requestor, or instantiates a new one.final WTOrganizationTemplate method for organization validation.protected booleanvalidateAttributes(WTOrganization organization, Object requestor) Ensures the organization's attributes are appropriately set up.
-
Method Details
-
validate
Template method for organization validation. The template has the following steps.- Gets either an existing or new instance of an organization by
calling
getOrganization(Object). - Checks to see if a new domain needs to be created for the organization
by calling
createDomain(WTOrganization,Object) - Passes the instance to
validateAttributes(WTOrganization,Object) - If a non-
nulldomain was returned bycreateDomain, then assigns the domain to the organization. - If the instance is new, then calls
OrganizationServicesManager.createPrincipal. If the instance already existed, andvalidateAttributesreturnedtrue, callsOrganizationServicesManager.updatePrincipalinstead. - If a non-
nulldomain was returned bycreateDomain, then callscreatePolicies(WTOrganization,Object) - Calls
finalizeValidation(WTOrganization,Object)
Supported API: true- Specified by:
validatein interfaceWTOrganizationValidator- Parameters:
requestor-- Returns:
- WTOrganization
- Throws:
WTException- See Also:
-
WTOrganizationValidator.validate(Object)DirectoryHelperSvr
- Gets either an existing or new instance of an organization by
calling
-
createDomain
protected AdminDomainRef createDomain(WTOrganization organization, Object requestor) throws WTException Creates a newAdministrativeDomainfor the organization, if neccessary. If the organization is not in either the global USER or UNAFFILIATED domain, then a new domain is not created for it andnullis returned. Otherwise, a new domain is created using the name generated byWTContainerServiceSvr.getUnusedDomainName(String,AdminDomainRef).
Supported API: true- Parameters:
organization-requestor-- Returns:
- A reference to the new domain or
null. - Throws:
WTException
-
createPolicies
Creates the policy rules for domains created by#createValidDomain(WTOrganization,Object). This method will only be called ifcreateValidDomainreturns a non-nullresult.The default implementation gives members of the organization READ access to users and groups in the domain.
Supported API: true- Parameters:
organization-requestor-- Throws:
WTException
-
finalizeValidation
Provides subclasses a last opportunity to do any additional work before thevalidatemethod completes. The default implementation does nothing.
Supported API: true- Parameters:
organization-requestor-- Throws:
WTException
-
getOrganization
Gets either an existingWTOrganizationthat corresponds to the requestor, or instantiates a new one.
Supported API: true- Parameters:
requestor-- Returns:
- WTOrganization
- Throws:
WTException
-
validateAttributes
protected boolean validateAttributes(WTOrganization organization, Object requestor) throws WTException Ensures the organization's attributes are appropriately set up. The default implementation assigns the organization an internet domain (if it wasnull) using {@link DirectoryHelperSvr.generateInternetDomain(WTOrganization)}.Subclasses should typically call
super.validateAttributeswhen overriding this method.
Supported API: true- Parameters:
organization-requestor-- Returns:
- A boolean indicating whether the attributes of the organization
were modified. This is used to determine whether
OrganizationServicesManager.updatePrincipalneeds to be called on an organization that is already persisted. - Throws:
WTException
-