User user = new UserFactory() .firstName( "John" ) .familyName( "Doe" ) .address( address1 ) .address( address2 ) .build() ;
/** * <p>update</p> * * @throws java.io.IOException if any. * @throws java.io.FileNotFoundException if any. */ @Override public void doUpdate() throws IOException, FileNotFoundException { if (isUpdateNeeded()) { reload(); } }
/** * Sets the users configuration file. * * @param usersConfigurationFile the new users configuration file */ public void setUsersConfigurationFile(String usersConfigurationFile) { m_usersConfigurationFile = usersConfigurationFile; UserFactory.setInstance(null); }
UserFactory.init(); UserManager userManager = UserFactory.getInstance();
private static WebRoleManagerImpl getManager() { if (s_manager == null) { s_manager = new WebRoleManagerImpl(GroupFactory.getInstance(), UserFactory.getInstance()); } return s_manager; }
/** * <p>init</p> * * @throws java.lang.Exception if any. */ public static void init() throws Exception { GroupFactory.init(); UserFactory.init(); }
/** * Initializes the factory * * @throws java.io.IOException if any. * @throws java.io.FileNotFoundException if any. */ public UserFactory() throws FileNotFoundException, IOException { super(GroupFactory.getInstance()); reload(); }
/** * <p>reload</p> * * @throws java.io.IOException if any. * @throws java.io.FileNotFoundException if any. */ public void reload() throws IOException, FileNotFoundException { // Form the complete filename for the config file // m_usersConfFile = ConfigFileConstants.getFile(ConfigFileConstants.USERS_CONF_FILE_NAME); InputStream configIn = new FileInputStream(m_usersConfFile); m_lastModified = m_usersConfFile.lastModified(); m_fileSize = m_usersConfFile.length(); parseXML(configIn); initialized = true; }
@Override public void run() { UserManager userFactory = UserFactory.getInstance(); try { final String emailAddress = userFactory.getEmail(userId); if (emailAddress != null && !emailAddress.isEmpty()) { options.setMailTo(emailAddress); } } catch (final Exception e) { LOG.error("An error occurred while attempting to determine and set the destination email address for user {}", userId, e); } options.setInstanceId(reportId + " " + userId); } });
@Override public void run() { UserManager userFactory = UserFactory.getInstance(); try { final String emailAddress = userFactory.getEmail(userId); if (emailAddress != null && !emailAddress.isEmpty()) { options.setMailTo(emailAddress); } } catch (final Exception e) { LOG.error("An error occurred while attempting to determine and set the destination email address for user {}", userId, e); } options.setInstanceId(reportId + " " + userId); } });
/** * <p>init</p> * * @throws java.io.IOException if any. * @throws java.io.FileNotFoundException if any. */ public static synchronized void init() throws IOException, FileNotFoundException { if (instance == null || !initialized) { GroupFactory.init(); instance = new UserFactory(); initialized = true; } }