Connection conn, String objectStoreName) throws RepositoryException {
logger.info("Creating the subject for user: " + userName);
Subject s = UserContext.createSubject(conn, userName, userPassword,
"FileNetP8");
UserContext.get().pushSubject(s);
Domain domain = Factory.Domain.fetchInstance(conn, null, null);
logger.log(Level.INFO, "Fetch domain: {0}", domain);
logger.info("Creating the FileNet object store instance.");
ObjectStore os = Factory.ObjectStore.fetchInstance(domain, objectStoreName,
null);
os.refresh();