public static UserInfo getUserInfo() { UserInfo userInfo = new DefaultUserInfo(true); if ("ldap".equalsIgnoreCase(USER_INFO_IMPL)) { userInfo = new LDAPUserInfoImpl(true); } else if ("db".equalsIgnoreCase(USER_INFO_IMPL)) { userInfo = new DBUserInfoImpl(true); } else if ("props".equalsIgnoreCase(USER_INFO_IMPL)) { userInfo = new PropertyUserInfoImpl(true); } else if ("custom".equalsIgnoreCase(USER_INFO_IMPL)) { try { userInfo = (UserInfo) Class.forName(CUSTOM_USER_INFO_IMPL).newInstance(); } catch (Exception e) { throw new RuntimeException("Unable to create instance of custom user info impl", e); } } return userInfo; } }
public DefaultUserInfo(boolean activate) { try { Properties registryProps = readProperties(DEFAULT_USER_PROPS_LOCATION, DEFAULT_USER_PROPS_LOCATION); buildRegistry(registryProps); } catch (Exception e) { throw new IllegalStateException("Problem loading userinfo properties", e); } }
/** * Constructs default UserInfo implementation to provide required information to the escalation handler. * following is the string for every organizational entity * entityId=email:locale:displayname:[member,member] * members are optional and should be given for group entities * @param registryProps */ public DefaultUserInfo(Properties registryProps) { buildRegistry(registryProps); }
userInfo = new DefaultUserInfo(true);
@Bean @ConditionalOnMissingBean(name = "userInfo") public UserInfo userInfo() throws IOException { Resource resource = new ClassPathResource("/userinfo.properties"); Properties userInfo = PropertiesLoaderUtils.loadProperties(resource); return new DefaultUserInfo(userInfo); }
public static UserInfo getUserInfo() { UserInfo userInfo = new DefaultUserInfo(true); if ("ldap".equalsIgnoreCase(USER_INFO_IMPL)) { userInfo = new LDAPUserInfoImpl(true); } else if ("db".equalsIgnoreCase(USER_INFO_IMPL)) { userInfo = new DBUserInfoImpl(true); } else if ("props".equalsIgnoreCase(USER_INFO_IMPL)) { userInfo = new PropertyUserInfoImpl(true); } else if ("custom".equalsIgnoreCase(USER_INFO_IMPL)) { try { userInfo = (UserInfo) Class.forName(CUSTOM_USER_INFO_IMPL).newInstance(); } catch (Exception e) { throw new RuntimeException("Unable to create instance of custom user info impl", e); } } return userInfo; } }
@Before public void setUp() throws Exception { System.setProperty("org.jbpm.email.templates.dir", new File("src/test/resources/templates").getAbsolutePath()); TemplateManager.reset(); ChainedProperties props = ChainedProperties.getChainedProperties( "email.conf", ClassLoaderUtil.getClassLoader( null, getClass(), false )); emailHost = props.getProperty( "mail.smtp.host", "localhost" ); emailPort = props.getProperty( "mail.smtp.port", "2345" ); wiser = new Wiser(); wiser.setHostname( emailHost ); wiser.setPort( Integer.parseInt( emailPort ) ); wiser.start(); Thread.sleep(200); connection = new Connection(emailHost, emailPort); userInfo = new DefaultUserInfo(true); }