当前位置: 首页>>代码示例>>Java>>正文


Java NotesFactory.createSession方法代码示例

本文整理汇总了Java中lotus.domino.NotesFactory.createSession方法的典型用法代码示例。如果您正苦于以下问题:Java NotesFactory.createSession方法的具体用法?Java NotesFactory.createSession怎么用?Java NotesFactory.createSession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lotus.domino.NotesFactory的用法示例。


在下文中一共展示了NotesFactory.createSession方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDataPath

import lotus.domino.NotesFactory; //导入方法依赖的package包/类
private String getDataPath() {
	Logger logCurrent = LoggerFactory.getLogger(this.getClass().getCanonicalName());
	if (m_Datapath == null) {
		try {
			logCurrent.fine("Initialize the notes context");
			NotesThread.sinitThread();
			Session sesCurrent = NotesFactory.createSession();
			m_Datapath = sesCurrent.getEnvironmentString("Directory", true);
			logCurrent.fine("DIRECTORY == " + m_Datapath);
			sesCurrent.recycle();
			NotesThread.stermThread();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	return m_Datapath;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:18,代码来源:XPageAgentManager.java

示例2: openSession

import lotus.domino.NotesFactory; //导入方法依赖的package包/类
public static Session openSession(String username, String password){
	Session s = null;
	try {
		NotesThread.sinitThread();
		s = NotesFactory.createSession((String) null, username, password);
		logger.log(Level.FINE,"opened session for " + s.getUserName());
	} catch (NotesException e) {
		logger.log(Level.SEVERE,null,e);
	}
	return s;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:12,代码来源:SessionFactory.java

示例3: getSession

import lotus.domino.NotesFactory; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public Session<lotus.domino.Session> getSession(Object... parameters) {
	lotus.domino.Session __obj = null;

	if (parameters.length == 1 && parameters[0] instanceof lotus.domino.Session) {
		log.finer("Creating a session with one lotus.domino.Session parameter");

		__obj = (lotus.domino.Session) parameters[0];

		_session = getWrapper(DefaultSession.class, lotus.domino.Session.class, __obj); 
		return (Session<lotus.domino.Session>) _session; 
	}

	if (parameters.length == 3 && parameters[2] instanceof String) {
		log.finer("Creating a session with three parameters: server, username, password");

		try {
			isRemoteSession = (parameters[0] != null);					

			__obj = NotesFactory.createSession((String) parameters[0], (String) parameters[1], (String) parameters[2]); 
		} catch (NotesException e) {
			throw new RiverException(e);
		}

		_session = getWrapper(DefaultSession.class, lotus.domino.Session.class, __obj);
		return (Session<lotus.domino.Session>) _session; 
	}

	throw new RiverException(
			"Valid parameters: (A) one lotus.domino.Session or (B) three Strings in this order: server, username and password.");
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:32,代码来源:DefaultFactory.java

示例4: getSession

import lotus.domino.NotesFactory; //导入方法依赖的package包/类
@Override
public Session getSession() {
	lotus.domino.Session __session = null;

	try {
		__session = NotesFactory.createSession((String) null, (String) null, Credentials.getPassword());
	} catch (NotesException e) {
		throw new RiverException(e);
	}

	Session session = River.getSession(River.LOTUS_DOMINO, __session);
	return session;
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:14,代码来源:Context.java

示例5: getSession

import lotus.domino.NotesFactory; //导入方法依赖的package包/类
@Override
public Session getSession() {
	lotus.domino.Session _session = null;

	try {
		_session = NotesFactory.createSession((String) null, (String) null, Credentials.getPassword());
	} catch (NotesException e) {
		throw new RiverException(e);
	}

	Session session = River.getSession(River.LOTUS_DOMINO, _session);
	return session;
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:14,代码来源:Context.java

示例6: getUserNameFromRequest

import lotus.domino.NotesFactory; //导入方法依赖的package包/类
private String getUserNameFromRequest(Request request){
	  String user = null;
	  try{
			String LtpaToken = null;

			// Extract cookie named "LtpaToken"
			Series<Cookie> cookies = request.getCookies();
			if (cookies == null) {
				return null;
			}

			for (int i = 0; i < cookies.size(); i++) {
				LOGGER.finest("i=" + i + " & name="
						+ cookies.get(i).getName());

				if (cookies.get(i).getName().equals("LtpaToken")) {
					LtpaToken = cookies.get(i).getValue();
					LOGGER.finest("got LTPA value:" + LtpaToken);
					break;
				}
			}
			if(LtpaToken!=null){
				  NotesThread.sinitThread();
		    	  Session session = NotesFactory.createSession(null, LtpaToken);
		    	  user = session.getUserName();
//		    	  user = session.getUserNameObject().getAbbreviated();
		    	  session.recycle();
		    	  NotesThread.stermThread();
			}
			LOGGER.finest("Activity rest service: get user name:"+user);
	  }catch(Exception e){
		  e.printStackTrace();
	  }
	  return user;
  }
 
开发者ID:OpenNTF,项目名称:WorkflowForXPages,代码行数:36,代码来源:ActivitiRestApplication.java

示例7: run

import lotus.domino.NotesFactory; //导入方法依赖的package包/类
@Override
public void run() {
	try {
		Session sess = NotesFactory.createSession();
		DbDirectory dir = sess.getDbDirectory("");

		Database db = sess.getDatabase("", FAKENAMES_NSF);
		if (db != null)
			db.remove();

		db = dir.createDatabase(FAKENAMES_NSF, true);
		View view = db.createView("Names", "SELECT Form = \"DocName\"");
		view.createColumn(2, "Title", "Title").recycle();

		view.createColumn(3, "Prefix", "NamePrefix").recycle();
		view.createColumn(4, "First Name", "FirstName").recycle();
		view.createColumn(5, "Last Name", "LastName").recycle();

		view.createColumn(6, "Zip Code", "ZipCode").recycle();
		view.createColumn(7, "Country", "Country").recycle();
		view.createColumn(8, "Address", "Address").recycle();

		view.createColumn(9, "Birthday", "Birthday").recycle();
		view.createColumn(10, "PhoneNumber", "PhoneNumber").recycle();
		view.recycle();
		db.recycle();
		dir.recycle();
		//	sess.recycle();
	} catch (NotesException e) {
		e.printStackTrace();
	}
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:33,代码来源:CreateTestDatabaseLotus.java

示例8: run

import lotus.domino.NotesFactory; //导入方法依赖的package包/类
@Override
public void run() {
	try {
		System.out.println("Starting NotesRunner");
		Session session = NotesFactory.createSession();
		run4(session);
		session.recycle();
	} catch (Throwable t) {
		t.printStackTrace();
	}
	System.out.println("FINI!");
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:13,代码来源:NotesRunner.java

示例9: openSession

import lotus.domino.NotesFactory; //导入方法依赖的package包/类
public static Session openSession(){
	Session s = null;
	try {

		NotesThread.sinitThread();
		String password = "";
		s = NotesFactory.createSession((String)null, (String)null, password);
		logger.log(Level.FINE,"opened session for " + s.getUserName());
	} catch (NotesException e) {
		logger.log(Level.SEVERE,null,e);
	}
	return s;
}
 
开发者ID:mwambler,项目名称:webshell-xpages-ext-lib,代码行数:14,代码来源:SessionFactory.java

示例10: init

import lotus.domino.NotesFactory; //导入方法依赖的package包/类
@BeforeClass
public static void init() throws Exception {
	// MUST use sysout because the log handler crashes when the Notes thread has not been initialized
	System.out.println("Init " + AllTests.class.getName()); //$NON-NLS-1$

	NotesThread.sinitThread();
	Factory.startup();
	Factory.initThread(Factory.PERMISSIVE_THREAD_CONFIG);

	lotusSession = NotesFactory.createSession();
	session = Factory.getWrapperFactory().fromLotus(lotusSession, Session.SCHEMA, null);
	FrameworkUtils.setFallbackSession(session);

	MODELS_DB_PATH = instantiateDb("models");
}
 
开发者ID:jesse-gallagher,项目名称:XPages-Scaffolding,代码行数:16,代码来源:AllTests.java

示例11: checkIfExists

import lotus.domino.NotesFactory; //导入方法依赖的package包/类
private IStatus checkIfExists() {
	
	IStatus status = Status.OK_STATUS;

	final Status[] arrayOfStatus = new Status[1];

	Runnable runnable = new Runnable() {
		
		@SuppressWarnings("unused")
		public void run() {
			
			Session session = null;
			Database database = null;
			
			try {
				
				session = NotesFactory.createSession();

				database = session.getDatabase(CreateNSFJob.this.serverName, CreateNSFJob.this.nsfName, false);
				if (database != null) {
					CreateNSFJob.this.alreadyExists = true;
				}
				
			} catch (NotesException e) {

				String msg = StringUtil.format("NSF creation failed for {0} [server:{1}]",
						new Object[] { CreateNSFJob.this.nsfName, CreateNSFJob.this.serverName });
				
				arrayOfStatus[0] = new Status(4, "com.ibm.designer.domino", CommandLineJobManager.STATUSCODE_ERROR,
						msg, e);
				if (database != null) {
					try {
						database.recycle();
					} catch (Exception localException1) {
					}
				}
				if (session != null) {
					try {
						session.recycle();
					} catch (Exception localException2) {
					}
				}
			} finally {
				if (database != null) {
					try {
						database.recycle();
					} catch (Exception localException3) {
					}
				}
				if (session != null) {
					try {
						session.recycle();
					} catch (Exception localException4) {
					}
				}
			}
		}
	};
	
	try {
		NotesPlatform.getInstance().syncExec(runnable);
	} catch (Throwable localThrowable) {
		String str = StringUtil.format("NSF existance check failed for {0} [server:{1}]",
				new Object[] { this.nsfName, this.serverName });
		arrayOfStatus[0] = new Status(4, "com.ibm.designer.domino", CommandLineJobManager.STATUSCODE_ERROR, str,
				localThrowable);
	}
	if ((status.isOK()) && (arrayOfStatus[0] != null)) {
		status = arrayOfStatus[0];
	}
	return status;
}
 
开发者ID:camac,项目名称:BuildXPages,代码行数:73,代码来源:CreateNSFJob.java


注:本文中的lotus.domino.NotesFactory.createSession方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。