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


Java NotesException类代码示例

本文整理汇总了Java中lotus.domino.NotesException的典型用法代码示例。如果您正苦于以下问题:Java NotesException类的具体用法?Java NotesException怎么用?Java NotesException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: deleteAnonymousDoc

import lotus.domino.NotesException; //导入依赖的package包/类
/**
 * Delete anonymous doc.
 *
 * @param session the session
 * @throws NotesException the notes exception
 */
//if the user moved from anonymous to person to anonymous to person
private void deleteAnonymousDoc(Session session) throws NotesException{
	Database db = session.getDatabase(StringCache.EMPTY, Const.WEBSOCKET_PATH);
	View view = db.getView(Const.VIEW_USERS);
	Vector<String> keys = new Vector<String>(3);
	keys.add(this.getSessionId().trim());
	keys.add(this.getSessionId().trim());


	DocumentCollection col = view.getAllDocumentsByKey(keys,true);
	if(col!=null && col.getCount() > 0){
		col.stampAll(Const.FIELD_FORM, Const.FIELD_VALUE_DELETE);
		col.recycle();
	}
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:22,代码来源:ApplyStatus.java

示例2: recycle

import lotus.domino.NotesException; //导入依赖的package包/类
@Override
public void recycle(Vector paramVector) throws NotesException {
	if (paramVector!=null) {
		for (int i=0; i<paramVector.size(); i++) {
			Object obj = paramVector.get(i);
			if (obj instanceof Base) {
				try {
					((Base)obj).recycle();
				}
				catch (NotesException e) {
					//
				}
			}
		}
	}
}
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:17,代码来源:ViewEntryImpl.java

示例3: getUserDoc

import lotus.domino.NotesException; //导入依赖的package包/类
/**
 * Gets the user doc.
 *
 * @param session the session
 * @param create the create
 * @return the user doc
 * @throws NotesException the notes exception
 */
private Document getUserDoc(Session session, boolean create) throws NotesException{
	Database db = session.getDatabase(StringCache.EMPTY, Const.WEBSOCKET_PATH);
	Document doc = null;

	View users = db.getView(Const.VIEW_USERS);
	View sessions = db.getView(Const.VIEW_SESSIONS);
	doc = users.getDocumentByKey(user.getUserId().trim(),true);
	if(doc == null){
		doc = sessions.getDocumentByKey(user.getSessionId(),true);
	}
	//if we get here... create the doc.
	if(doc==null && create){
		doc = db.createDocument();
	}
	//cleanup
	users.recycle();
	sessions.recycle();

	return doc;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:29,代码来源:ApplyStatus.java

示例4: validate

import lotus.domino.NotesException; //导入依赖的package包/类
@Override
public void validate(FacesContext context, UIComponent ui, Object value)throws ValidatorException {
	try {
		Database db = ContextInfo.getUserDatabase();
		if(!db.isFTIndexed()){
			String errorMsg = "Application is not full text index.  Please contact your administrator.";
			FacesMessage message = new FacesMessage();
			message.setSeverity(FacesMessage.SEVERITY_ERROR);
			message.setDetail(errorMsg);
			message.setSummary(errorMsg);
			throw new ValidatorException(message);
		}
	} catch (NotesException e) {
		logger.log(Level.SEVERE,null,e);
	}
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:17,代码来源:FTIndexValidator.java

示例5: toDateTimeVec

import lotus.domino.NotesException; //导入依赖的package包/类
public Vector toDateTimeVec(Session session, List list) throws NotesException{
	Vector vec = new Vector (list.size());
	for(Object o: list){
		Date dt = (Date) o;
		DateTime dateTime = session.createDateTime(dt);
		vec.add(dateTime);
	}
	return vec;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:10,代码来源:BeanBinder.java

示例6: isAuthorized

import lotus.domino.NotesException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private boolean isAuthorized(String[] rolesAllowed) {
	boolean b = false;

	try{
		Session s= XSPUtils.session();
		Database db = XSPUtils.database();

		if(s!=null && db!=null){

			Vector<String> roles = db.queryAccessRoles(s.getEffectiveUserName());

			for(String role : rolesAllowed){
				if(roles.contains(role)){
					b = true;
					break;
				}
			}
		}
	}catch(NotesException n){
		n.printStackTrace();
	}
	return b;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:25,代码来源:RestInterceptor.java

示例7: run

import lotus.domino.NotesException; //导入依赖的package包/类
@Override
public void run() {
	
		Session session = SessionFactory.openTrusted();
		try{

			this.onServer = session.isOnServer();
			this.version = session.getNotesVersion();
			this.serverName = session.getServerName();
			this.platform = session.getPlatform();

		}catch(NotesException n){
			logger.log(Level.SEVERE,null,n);
			
		}finally{
			SessionFactory.closeSession(session);
		}
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:19,代码来源:ServerInfo.java

示例8: removeAll

import lotus.domino.NotesException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void removeAll(Document doc) throws NotesException{
	boolean save = false;
	
	Vector<String> attachments = doc.getParentDatabase().getParent().evaluate("@AttachmentNames", doc);
	
	
	for(String attach : attachments){
		EmbeddedObject eo = doc.getAttachment(attach);
		if(eo!=null && eo.getType() == EmbeddedObject.EMBED_ATTACHMENT){
			eo.remove();
			save = true;
		}//end if
	}//end for
	
	//only save if we need to.
	if(save) {
		doc.save();
	}
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:21,代码来源:AttachUtils.java

示例9: envAsList

import lotus.domino.NotesException; //导入依赖的package包/类
/**
 * Env as list.
 *
 * @param s the s
 * @param key the key
 * @param defaultValue the default value
 * @return the list
 * @throws NotesException the notes exception
 */
private List<String> envAsList(Session s, String key, String defaultValue) throws NotesException{
	String str=this.getValue(s,key);
	
	//if both values are empty... return an empty ArrayList.
	if(StrUtils.areEmpty(str, defaultValue)){
		return new ArrayList<String>();
		
	}else if(StrUtils.isEmpty(str)){
		str = defaultValue;
	}
	
	
	String[] arr = str.split(StringCache.COMMA);
	List<String> list = new ArrayList<String>();
	for(String value : arr){
		list.add(value.trim());
	}
	return list;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:29,代码来源:Config.java

示例10: init

import lotus.domino.NotesException; //导入依赖的package包/类
@Override
@Inject
public void init(IDominoWebSocketServer server){
	if(isOn.compareAndSet(false, true)) {
		this.server = server;
		ApplicationEx appEx = (ApplicationEx) XSPUtils.app();
		
		//add the listeners
		appEx.addApplicationListener(new AppListener());
		appEx.addSessionListener(new SocketSessionListener());
		

		//catch the very first user.
		try {
			this.registerCurrentUser();
		} catch (NotesException e) {
			LOG.log(Level.SEVERE,null,e);
		}
	}
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:21,代码来源:WebSocketBean.java

示例11: createUser

import lotus.domino.NotesException; //导入依赖的package包/类
@Override
public IUser createUser(Document doc) {
	IUser user = guicer.createObject(IUser.class);

	try {
		
		user.setConn(null); // conn should be null, user is on a different server in the cluster.
		user.setDate(doc.getCreated().toJavaDate());
		user.setGoingOffline(false);
		user.setHost(doc.getItemValueString(Const.FIELD_HOST));
		user.setSessionId(doc.getItemValueString(Const.FIELD_SESSIONID));
		user.setStatus(doc.getItemValueString(Const.FIELD_STATUS));
		user.setUserId(doc.getItemValueString(Const.FIELD_USERID));
		
	} catch (NotesException e) {
		LOG.log(Level.SEVERE,null, e);
	}
	
	return user;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:21,代码来源:UserFactory.java

示例12: scanForAttachedJson

import lotus.domino.NotesException; //导入依赖的package包/类
/**
 * Scan for attached json.
 *
 * @param rtitem the rtitem
 * @return the string
 * @throws NotesException the notes exception
 */
private String scanForAttachedJson(RichTextItem rtitem)throws NotesException{
	String json = null;
	@SuppressWarnings("unchecked")
	Vector<EmbeddedObject> objects = rtitem.getEmbeddedObjects();
	for(EmbeddedObject eo: objects){
		if(eo.getName().toLowerCase().endsWith(StringCache.DOT_JSON)){
			InputStream in = eo.getInputStream();
			try {
				json = IOUtils.toString(in,StringCache.UTF8);
				int start = json.indexOf(StringCache.OPEN_CURLY_BRACE);
				int end = json.lastIndexOf(StringCache.CLOSE_CURLY_BRACE);
				json=json.substring(start,end) + StringCache.CLOSE_CURLY_BRACE;
			} catch (IOException e) {
				LOG.log(Level.SEVERE,null,e);
			}finally{
				IOUtils.closeQuietly(in);
				eo.recycle();
				eo = null;
			}
		}
	}
	return json;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:31,代码来源:SocketMessageFactory.java

示例13: openSessionCloner

import lotus.domino.NotesException; //导入依赖的package包/类
public static Session openSessionCloner(){
	Session session = null;

	try{
		
		SessionCloner sessionCloner=SessionCloner.getSessionCloner();
		NSFComponentModule module= NotesContext.getCurrent().getModule();
		NotesContext context = new NotesContext( module );
		NotesContext.initThread( context );
		session = sessionCloner.getSession();
           
	}catch(NotesException n){
		logger.log(Level.SEVERE,null,n);

	}
	return session;

}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:19,代码来源:SessionFactory.java

示例14: buildHostAndWebPath

import lotus.domino.NotesException; //导入依赖的package包/类
public static String buildHostAndWebPath(FacesContext context, Database db) throws NotesException{
	HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
	final StringBuilder url = new StringBuilder(48); 
	String webPath  = db.getFilePath().replace("\\", "/");

	String scheme = request.getScheme(); 

	url.append(scheme); 
	url.append("://"); 
	url.append(request.getServerName()); 

	int port = request.getServerPort(); 
	if (port > 0 && 
			(("http".equalsIgnoreCase(scheme) && port != 80) || 
					("https".equalsIgnoreCase(scheme) && port != 443))) { 
		url.append(':'); 
		url.append(port); 
	} 

	url.append('/');
	url.append(webPath);
	return url.toString();
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:24,代码来源:XSPUtils.java

示例15: recycle

import lotus.domino.NotesException; //导入依赖的package包/类
@Override
public void recycle() {
	try {
		session.recycle();
	}
	catch (NotesException ignore) {}
}
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:8,代码来源:LegacyAPIUtils.java


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