class ZTSImpl implements KeyStore, ZTSHandler {

    void validate(Object val, final String type, final String principalDomain, final String caller) {
        if (val == null) {
            throw requestError("Missing or malformed " + type, caller,
                    ZTSConsts.ZTS_UNKNOWN_DOMAIN, principalDomain);
        }

        try {
            Result result = validator.validate(val, type);
            if (!result.valid) {
                throw requestError("Invalid " + type + " error: " + result.error, caller,
                        ZTSConsts.ZTS_UNKNOWN_DOMAIN, principalDomain);
            }
        } catch (Exception ex) {
            LOGGER.error("Object validation exception", ex);
            throw requestError("Invalid " + type + " error: " + ex.getMessage(), caller,
                    ZTSConsts.ZTS_UNKNOWN_DOMAIN, principalDomain);
        }
    }

    public  ZTSImpl();
    public  ZTSImpl(CloudStore implCloudStore, DataStore implDataStore);

}