package org.csstudio.utility.ldap.engine;

import java.util.GregorianCalendar;
import java.util.Hashtable;
import java.util.Vector;

import org.csstudio.platform.logging.CentralLogger;

public class LdapReferences {
	
	public Hashtable<String, Entry> ldapEntries = null;
	
	public LdapReferences() {
		//
		// initialize hash table
		//
		ldapEntries = new Hashtable<String, Entry>();
	}
	
	public class Entry {
		
		private GregorianCalendar timeCreated = null;
		private GregorianCalendar lastTimeUsed = null;
		private Vector namesInNamespace = null;
		
		public Entry ( Vector namesInNamespace) {
			//
			// initialize timer
			//
			setTimeCreated( new GregorianCalendar());
			setNamesInNamespace(namesInNamespace);
			
		}
		
		
		public GregorianCalendar getLastTimeUsed() {
			return lastTimeUsed;
		}
		public void setLastTimeUsed(GregorianCalendar lastTimeUsed) {
			this.lastTimeUsed = lastTimeUsed;
		}
		public Vector getNamesInNamespace() {
			return namesInNamespace;
		}
		public void setNamesInNamespace(Vector namesInNamespace) {
			this.namesInNamespace = namesInNamespace;
		}
		public void replaceNamesInNamespace(Vector namesInNamespace) {
			this.namesInNamespace = namesInNamespace;
		}
		public GregorianCalendar getTimeCreated() {
			return timeCreated;
		}
		public void setTimeCreated(GregorianCalendar timeCreated) {
			this.timeCreated = timeCreated;
		}
		
	}

	public Hashtable getLdapEntries() {
		//
		// return hash table
		//
		return ldapEntries;
	}

	public void setLdapEntries(Hashtable<String, Entry> ldapEntries) {
		this.ldapEntries = ldapEntries;
	}
	
	public void newLdapEntry ( String channelName, Vector namesInNamespace) {
		//
		// insert new entry
		//
		Entry newEntry = new Entry ( namesInNamespace);
		this.ldapEntries.put( channelName, newEntry);
	}
	
	public Entry getEntry ( String channelName) {
		//
		// find and return entry in hastable
		//
		return this.ldapEntries.get( channelName);
	}
	
	public void changeLdapEntry ( String channelName, Vector namesInNamespace) {
		//
		// insert new entry
		//
		if ( hasEntry( channelName)) {
			Entry actualEntry =  (Entry)this.ldapEntries.get( channelName);
			actualEntry.replaceNamesInNamespace(namesInNamespace);
			this.ldapEntries.remove(channelName);
			this.ldapEntries.put( channelName, actualEntry);
		} else {
			CentralLogger.getInstance().warn( this, "no entry for: " + channelName + " in ldapEntries hashTable");
		}
		
	}
	
	public boolean hasEntry ( String channelName) {
		//
		// find ldap entry by searchig for the channel name
		//
		return ldapEntries.containsKey( channelName);
	}

}

@@ -517,24 +517,32 @@
 ivate Vector
+%3CString%3E
  namesInName
@@ -577,24 +577,32 @@
 try ( Vector
+%3CString%3E
  namesInName
@@ -941,16 +941,24 @@
 c Vector
+%3CString%3E
  getName
@@ -1038,32 +1038,40 @@
 Namespace(Vector
+%3CString%3E
  namesInNamespac
@@ -1164,24 +1164,32 @@
 space(Vector
+%3CString%3E
  namesInName
@@ -1676,32 +1676,40 @@
 nnelName, Vector
+%3CString%3E
  namesInNamespac
@@ -2051,16 +2051,24 @@
 , Vector
+%3CString%3E
  namesIn

Change the Vector to Vector<String>