Class DefaultWTOrganizationValidator

java.lang.Object
wt.inf.container.DefaultWTOrganizationValidator
All Implemented Interfaces:
WTOrganizationValidator

public class DefaultWTOrganizationValidator extends Object implements WTOrganizationValidator
Provides a final template implementation of validate.

Supported API: true

Extendable: true
  • Method Details

    • validate

      public final WTOrganization validate(Object requestor) throws WTException
      Template method for organization validation. The template has the following steps.
      1. Gets either an existing or new instance of an organization by calling getOrganization(Object).
      2. Checks to see if a new domain needs to be created for the organization by calling createDomain(WTOrganization,Object)
      3. Passes the instance to validateAttributes(WTOrganization,Object)
      4. If a non-null domain was returned by createDomain, then assigns the domain to the organization.
      5. If the instance is new, then calls OrganizationServicesManager.createPrincipal. If the instance already existed, and validateAttributes returned true, calls OrganizationServicesManager.updatePrincipal instead.
      6. If a non-null domain was returned by createDomain, then calls createPolicies(WTOrganization,Object)
      7. Calls finalizeValidation(WTOrganization,Object)


      Supported API: true
      Specified by:
      validate in interface WTOrganizationValidator
      Parameters:
      requestor -
      Returns:
      WTOrganization
      Throws:
      WTException
      See Also:
    • createDomain

      protected AdminDomainRef createDomain(WTOrganization organization, Object requestor) throws WTException
      Creates a new AdministrativeDomain for 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 and nullis returned. Otherwise, a new domain is created using the name generated by WTContainerServiceSvr.getUnusedDomainName(String,AdminDomainRef).

      Supported API: true
      Parameters:
      organization -
      requestor -
      Returns:
      A reference to the new domain or null.
      Throws:
      WTException
    • createPolicies

      protected void createPolicies(WTOrganization organization, Object requestor) throws WTException
      Creates the policy rules for domains created by #createValidDomain(WTOrganization,Object). This method will only be called if createValidDomain returns a non-null result.

      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

      protected void finalizeValidation(WTOrganization organization, Object requestor) throws WTException
      Provides subclasses a last opportunity to do any additional work before the validate method completes. The default implementation does nothing.

      Supported API: true
      Parameters:
      organization -
      requestor -
      Throws:
      WTException
    • getOrganization

      protected WTOrganization getOrganization(Object requestor) throws WTException
      Gets either an existing WTOrganization that 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 was null) using {@link DirectoryHelperSvr.generateInternetDomain(WTOrganization)}.

      Subclasses should typically call super.validateAttributes when 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.updatePrincipal needs to be called on an organization that is already persisted.
      Throws:
      WTException