/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.identity.User
 *  com.l7tech.identity.ldap.LdapIdentity
 *  com.l7tech.util.Functions$Unary
 */
package com.l7tech.server.policy.variable;

import com.l7tech.identity.User;
import com.l7tech.identity.ldap.LdapIdentity;
import com.l7tech.server.identity.AuthenticationResult;
import com.l7tech.util.Functions;

class at
implements Functions.Unary<String, AuthenticationResult> {
    at() {
    }

    public String call(AuthenticationResult authenticationResult) {
        if (authenticationResult == null) {
            return null;
        }
        User user = authenticationResult.getUser();
        if (user instanceof LdapIdentity) {
            LdapIdentity ldapIdentity = (LdapIdentity)user;
            return ldapIdentity.getDn();
        }
        return user == null ? null : user.getSubjectDn();
    }
}

