private static void validateDeployment ( Catalog catalog , DeploymentType deployment ) { if ( deployment . getSecurity ( ) != null && deployment . getSecurity ( ) . isEnabled ( ) ) { if ( deployment . getUsers ( ) == null ) { String msg = "Cannot enable security without defining at least one user in the built-in ADMINISTRATOR role in the deployment file." ; throw new RuntimeException ( msg ) ; } boolean foundAdminUser = false ; for ( UsersType . User user : deployment . getUsers ( ) . getUser ( ) ) { if ( user . getRoles ( ) == null ) { continue ; } for ( String role : extractUserRoles ( user ) ) { if ( role . equalsIgnoreCase ( ADMIN ) ) { foundAdminUser = true ; break ; } } } if ( ! foundAdminUser ) { String msg = "Cannot enable security without defining at least one user in the built-in ADMINISTRATOR role in the deployment file." ; throw new RuntimeException ( msg ) ; } } }
Validate the contents of the deployment . xml file . This is for validating VoltDB requirements not XML schema correctness