1 13 14 package org.ejbca.core.model.ra.userdatasource; 15 16 import java.util.ArrayList ; 17 import java.util.Collection ; 18 import java.util.Properties ; 19 20 import org.apache.log4j.Logger; 21 import org.ejbca.core.model.SecConst; 22 import org.ejbca.core.model.log.Admin; 23 import org.ejbca.core.model.ra.UserDataVO; 24 25 26 33 public class DummyCustomUserDataSource implements ICustomUserDataSource{ 34 35 private static Logger log = Logger.getLogger(DummyCustomUserDataSource.class); 36 37 40 public DummyCustomUserDataSource() {} 41 42 45 public void init(Properties properties) { 46 48 log.debug("Initializing DummyCustomUserDataSource"); 49 } 50 51 57 public Collection fetch(Admin admin, String searchstring) throws UserDataSourceException { 58 59 ArrayList result = new ArrayList (); 60 if(searchstring.equalsIgnoreCase("per")){ 61 UserDataVO userDataVO = new UserDataVO("PER","CN=PER,C=SE",1,"RFC822NAME=per@test.com", "per@test.com",0,1,1,1,null,null,SecConst.TOKEN_SOFT_BROWSERGEN,0,null); 62 result.add(new UserDataSourceVO(userDataVO)); 63 } 64 65 return result; 66 } 67 68 71 public void testConnection(Admin admin) throws UserDataSourceConnectionException { 72 log.debug("DummyCustomUserDataSource, Testing connection"); 73 } 74 75 76 protected void finalize() throws Throwable { 77 log.debug("DummyCustomUserDataSource, closing connection"); 78 80 super.finalize(); 81 } 82 83 84 85 } 86 | Popular Tags |