class ZTSImpl implements KeyStore, ZTSHandler {

    AuditLogMsgBuilder getAuditLogMsgBuilder(ResourceContext ctx, String domainName,
            String caller, String method) {
        
        AuditLogMsgBuilder msgBldr = auditLogger.getMsgBuilder();

        // get the where - which means where this server is running
        
        msgBldr.where(serverHostName).whatDomain(domainName)
            .whatApi(caller).whatMethod(method)
            .when(Timestamp.fromCurrentTime().toString());

        // get the 'who' and set it
        
        Principal princ = ((RsrcCtxWrapper) ctx).principal();
        if (princ != null) {
            final String fullName = princ.getFullName();
            final String unsignedCreds = princ.getUnsignedCredentials();
            msgBldr.who(unsignedCreds == null ? fullName : unsignedCreds);
            msgBldr.whoFullName(fullName);
        }

        // get the client IP
        
        msgBldr.clientIp(ServletRequestUtil.getRemoteAddress(ctx.request()));
        return msgBldr;
    }

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

}