class ZMSImpl implements Authorizer, KeyStore, ZMSHandler {

    SignedDomain retrieveSignedDomainMeta(final Domain domain, final String metaAttr) {

        SignedDomain signedDomain = createSignedDomain(domain.getName(), domain.getModified().millis());
        if (metaAttr != null) {
            switch (metaAttr) {
                case META_ATTR_ACCOUNT:
                    final String account = domain.getAccount();
                    if (account == null) {
                        return null;
                    }
                    signedDomain.getDomain().setAccount(account);
                    break;
                case META_ATTR_YPM_ID:
                    final Integer ypmId = domain.getYpmId();
                    if (ypmId == null || ypmId == 0) {
                        return null;
                    }
                    signedDomain.getDomain().setYpmId(ypmId);
                    break;
                case META_ATTR_ALL:
                    DomainData domainData = signedDomain.getDomain();
                    domainData.setDescription(domain.getDescription());
                    domainData.setAccount(domain.getAccount());
                    domainData.setYpmId(domain.getYpmId());
                    domainData.setApplicationId(domain.getApplicationId());
                    domainData.setMemberExpiryDays(domain.getMemberExpiryDays());
                    domainData.setServiceExpiryDays(domain.getServiceExpiryDays());
                    domainData.setGroupExpiryDays(domain.getGroupExpiryDays());
                    domainData.setRoleCertExpiryMins(domain.getRoleCertExpiryMins());
                    domainData.setServiceCertExpiryMins(domain.getServiceCertExpiryMins());
                    domainData.setTokenExpiryMins(domain.getTokenExpiryMins());
                    domainData.setOrg(domain.getOrg());
                    domainData.setAuditEnabled(domain.getAuditEnabled());
                    break;
            }
        }
        return signedDomain;
    }

    public  ZMSImpl();

}