wt.admin
Class CompareSystemAndUserDomainRulesR6ToR7

java.lang.Object
  extended bywt.admin.CompareSystemAndUserDomainRulesR6ToR7

public final class CompareSystemAndUserDomainRulesR6ToR7
extends Object

This MethodServer migrator reports on the differences between WTPrincipal-related access and notification rules in the global system domain and those in the global user domain. This report is provided because principals themselves are being moved from the system domain to the user domain or one of its descendent domains during R7 migration. The report is intended to aid administrators in restoring their previous access and notification configuration.

Access Policy Report

  1. First, the migrator queries for all the access rules in the system and user domains written against WTPrincipal, WTGroup, WTUser, Item, and WTObject
  2. Then, the policies written against Item and WTObject are merged with the policies written against WTPrincipal. This is because we want to report on policies as they relate to principals, regardless of how the rules are written. This merging of policies is in-memory only, it does not reflect any persistent update to the system or users domain.
  3. The merged policies from the system domain are then compared with the merged policies from the user domain.

Notification Policy Migration

  1. The migrator queries for all notification rules in the system and user domains domain written against WTUser and WTObject.
  2. Notification rules written against WTObject are merged with those written against WTUser.
  3. The merged policies from the system domain are then compared with the merged policies from the user domain.
Notes:


Nested Class Summary
private static class CompareSystemAndUserDomainRulesR6ToR7.PolicyInfo
          A utility class that maintains all the grant and deny permissions for a given WTPrincipalReference and AccessSelector
static class CompareSystemAndUserDomainRulesR6ToR7.Server
           
 
Field Summary
private static String[] ACCESS_TYPES
          The types of access rules to query for in the system domain
private static String[] MERGE_TYPES
          The parent types of WTPrincipal to merge rules down for.
private static String[] NOTIFICATION_TYPES
          The types of notification rules to query for in the system domain
private static String[] PRINCIPAL_TYPES
          The principal types to copy rules for
private static String REPORT_NAME
          The name of the report file
private static AdminDomainRef systemDomainRef
           
private static AdminDomainRef userDomainRef
           
private static int[] ZERO
           
 
Constructor Summary
CompareSystemAndUserDomainRulesR6ToR7()
           
 
Method Summary
private static void compareAccessRules(Writer log)
          Compare access control rules written against WTPrincipals in the system domain to those in the user domain.
private static void compareNotificationRules(Writer log)
          Compare notification rules written for WTPrincpals in the system domain to those in the user domain.
private static Map getRuleInfo(AdminDomainRef domain_ref)
          Collect data about principal-related rules in the given domain.
static void main(String[] args)
           
private static void mergeRules(Map rule_info, Writer log)
          Merge rules in the given Map that are written against superclasses of WTPrincipal into the rules written against WTPrincipal itself.
static boolean runMigration()
          Run the migration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPORT_NAME

private static final String REPORT_NAME
The name of the report file

See Also:
Constant Field Values

PRINCIPAL_TYPES

private static final String[] PRINCIPAL_TYPES
The principal types to copy rules for


MERGE_TYPES

private static final String[] MERGE_TYPES
The parent types of WTPrincipal to merge rules down for.


ACCESS_TYPES

private static final String[] ACCESS_TYPES
The types of access rules to query for in the system domain


NOTIFICATION_TYPES

private static final String[] NOTIFICATION_TYPES
The types of notification rules to query for in the system domain


ZERO

private static final int[] ZERO

systemDomainRef

private static AdminDomainRef systemDomainRef

userDomainRef

private static AdminDomainRef userDomainRef
Constructor Detail

CompareSystemAndUserDomainRulesR6ToR7

public CompareSystemAndUserDomainRulesR6ToR7()
Method Detail

runMigration

public static boolean runMigration()
                            throws Exception
Run the migration.

Returns:
true if the migration succeeds
Throws:
Exception

compareAccessRules

private static void compareAccessRules(Writer log)
                                throws Exception
Compare access control rules written against WTPrincipals in the system domain to those in the user domain.

Throws:
Exception

mergeRules

private static void mergeRules(Map rule_info,
                               Writer log)
                        throws Exception
Merge rules in the given Map that are written against superclasses of WTPrincipal into the rules written against WTPrincipal itself.

Parameters:
rule_info - A rule info map generated by getRuleInfo()
Throws:
Exception

getRuleInfo

private static Map getRuleInfo(AdminDomainRef domain_ref)
                        throws Exception
Collect data about principal-related rules in the given domain. Principal-related rules are those that are in the ALL state and that are written against one of the types listed in the ACCESS_TYPES static variable.

Parameters:
domain_ref - The domain to search for rules in
Returns:
A Map with String type ids for keys, where each value value is a Map of WTPrincipalReferences to PolicyInfos.
Throws:
Exception

compareNotificationRules

private static void compareNotificationRules(Writer log)
                                      throws Exception
Compare notification rules written for WTPrincpals in the system domain to those in the user domain.

Throws:
Exception

main

public static void main(String[] args)