/*
 * $Id: VKCLdapUser.java,v 1.2 2004/10/08 08:28:38 jonyp Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 *
 * $Log: VKCLdapUser.java,v $
 * Revision 1.2  2004/10/08 08:28:38  jonyp
 * added method getLdapUserURL
 *
 * Revision 1.1  2004/10/07 14:40:46  jonyp
 * first strike
 *
 */
package vkc.ldap.db.entities;

import vkc.ldap.db.serializer.VKCLdapServerSerializer;
import vkc.exception.DBException;

/**
 * Diese Klasse einen Eintrag in der LDAP-Group-Tabelle
 *
 */
public final class VKCLdapUser  {

    private Integer ldapUserId = null;
	private Integer ldapServerId = null;
	private String  ldapUserRDN = null;
	private String  ldapUserURL = null;

    /**
     * Creates a new VKCLdapUser object.
     */
    public VKCLdapUser() {
    }

    public Integer getLdapUserId() {
        return ldapUserId;
    }

    public void setLdapUserId(Integer ldapUserId) {
        this.ldapUserId = ldapUserId;
    }

    public String getLdapUserRDN() {
        return ldapUserRDN;
    }

    public void setLdapUserRDN(String ldapUserRDN) {
        this.ldapUserRDN = ldapUserRDN;
    }

    public Integer getLdapServerId() {
        return ldapServerId;
    }

    public void setLdapServerId(Integer ldapServerId) {
        this.ldapServerId = ldapServerId;
    }
    
    public String getLdapGroupURL() throws DBException {
        if (ldapUserURL != null) {
            VKCLdapServer ldapServer = VKCLdapServerSerializer.retrieveLdapServer(this.ldapServerId);
            ldapUserURL = ldapServer.getLdapServerURL() + ldapServer.getBaseDN() + this.ldapUserRDN;
        }
        
        return ldapUserURL;
    }
   
}