/*
 * $Id: VKCLdapGroup.java,v 1.2 2004/10/08 08:28:24 jonyp Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 *
 * $Log: VKCLdapGroup.java,v $
 * Revision 1.2  2004/10/08 08:28:24  jonyp
 * added method getLdapGroupURL
 *
 * 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 VKCLdapGroup  {

    private Integer ldapGroupId = null;
	private Integer ldapServerId = null;
	private String  ldapGroupRDN = null;
	private String  ldapGroupURL = null;

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

    public Integer getLdapGroupId() {
        return ldapGroupId;
    }

    public void setLdapGroupId(Integer ldapGroupId) {
        this.ldapGroupId = ldapGroupId;
    }

    public String getLdapGroupRDN() {
        return ldapGroupRDN;
    }

    public void setLdapGroupRDN(String ldapGroupRDN) {
        this.ldapGroupRDN = ldapGroupRDN;
    }

    public Integer getLdapServerId() {
        return ldapServerId;
    }

    public void setLdapServerId(Integer ldapServerId) {
        this.ldapServerId = ldapServerId;
    }

    public String getLdapGroupURL() throws DBException {
        if (ldapGroupURL != null) {
            VKCLdapServer ldapServer = VKCLdapServerSerializer.retrieveLdapServer(this.ldapServerId);
            ldapGroupURL = ldapServer.getLdapServerURL() + ldapServer.getBaseDN() + this.ldapGroupRDN;
        }
        
        return ldapGroupURL;
    }
}