class ZMSClient implements Closeable {

    private void updatePrincipal() {

        /* if the check has already been done then we have nothing to do */

        if (principalCheckDone) {
            return;
        }

        /* make sure we have a principal specified */

        if (principal == null) {
            principalCheckDone = true;
            return;
        }

        /* so at this point we have some credentials specified
         * but it's not the principal authority so we're going
         * to ask ZMS to return a UserToken for us.
         */

        String userName = principal.getName();
        UserToken userToken = getUserToken(userName, null, true);

        clearCredentials();
        client.addCredentials(userToken.getHeader(), userToken.getToken());
        principalCheckDone = true;
    }

    public  ZMSClient();
    public  ZMSClient(String url);
    public  ZMSClient(String url, Principal identity);
    public  ZMSClient(Principal identity);
    public  ZMSClient(String url, SSLContext sslContext);

}