class ZTSClient implements Closeable {

    boolean updateServicePrincipal() {
        
        // if we have a service principal then we need to keep updating
        // our PrincipalToken otherwise it might expire.
        
        if (siaProvider == null) {
            return false;
        }
        
        Principal svcPrincipal = siaProvider.getIdentity(domain, service);
        
        // if we get no principal from our sia provider, then we
        // should log and throw an IllegalArgumentException otherwise the
        // client doesn't know that something bad has happened - in this
        // case illegal domain/service was passed to the constructor
        // and the ZTS Server just rejects the request with 401
        
        if (svcPrincipal == null) {
            final String msg = "UpdateServicePrincipal: Unable to get PrincipalToken "
                    + "from SIA Provider for " + domain + "." + service;
            LOG.error(msg);
            throw new IllegalArgumentException(msg);
        }
        
        // if the principal has the same credentials as before
        // then we don't need to update anything
        
        if (sameCredentialsAsBefore(svcPrincipal)) {
            return false;
        }
            
        addPrincipalCredentials(svcPrincipal, false);
        return true;
    }

    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);

}