class ZTSClient implements Closeable {

    public RoleAccess getRoleAccess(String domainName, String principal) {
        updateServicePrincipal();

        // Try to fetch from cache.
        ZTSClientCache.DomainAndPrincipal cacheKey = null;
        Cache<ZTSClientCache.DomainAndPrincipal, RoleAccess> cache = ztsClientCache.getRoleAccessCache();
        if (cache != null) {
            cacheKey = new ZTSClientCache.DomainAndPrincipal(domainName, principal);
            RoleAccess cachedValue = cache.get(cacheKey);
            if (cachedValue != null) {
                return cachedValue;
            }
        }

        try {
            RoleAccess roleAccess = ztsClient.getRoleAccess(domainName, principal);
            if (cache != null) {
                cache.put(cacheKey, roleAccess);
            }
            return roleAccess;
        } catch (ResourceException ex) {
            throw new ZTSClientException(ex.getCode(), ex.getMessage());
        } catch (Exception ex) {
            throw new ZTSClientException(ZTSClientException.BAD_REQUEST, ex.getMessage());
        }
    }

    public  ZTSClient();
    public  ZTSClient(String ztsUrl);
    public  ZTSClient(Principal identity);
    public  ZTSClient(String ztsUrl, Principal identity);
    public  ZTSClient(String ztsUrl, SSLContext sslContext);
    public  ZTSClient(String ztsUrl, String proxyUrl, SSLContext sslContext);
    public  ZTSClient(String domainName, String serviceName, ServiceIdentityProvider siaProvider);
    public  ZTSClient(String ztsUrl, String domainName, String serviceName,
                     ServiceIdentityProvider siaProvider);

}