class ZMSImpl implements Authorizer, KeyStore, ZMSHandler {

    AthenzDomain virtualHomeDomain(Principal principal, String domainName) {

        if (LOG.isDebugEnabled()) {
            LOG.debug("homeDomain: home domain detected. Create on the fly.");
        }

        AthenzDomain athenzDomain = new AthenzDomain(domainName);

        Domain domain = new Domain().setName(domainName).setEnabled(Boolean.TRUE);
        athenzDomain.setDomain(domain);

        List<String> adminUsers = new ArrayList<>();
        adminUsers.add(principal.getFullName());

        Role role = ZMSUtils.makeAdminRole(domainName, adminUsers);
        athenzDomain.getRoles().add(role);

        Policy policy = ZMSUtils.makeAdminPolicy(domainName, role);
        athenzDomain.getPolicies().add(policy);

        return athenzDomain;
    }

    public  ZMSImpl();

}