• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Users类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: MessageListener

import com.owera.xaps.dbi.Users; //导入依赖的package包/类
public MessageListener() {
	try {
		cp = ConnectionProvider.getConnectionProperties("xaps-ws.properties", "db.xaps");
		Users users = new Users(cp);
		User user = users.getUnprotected(Users.USER_ADMIN);
		//		if (user == null)
		//			throw error("The user " + login.getUsername() + " is unknown");

		// At this stage we have a positivt authentication of the user
		id = new Identity(SyslogConstants.FACILITY_WEBSERVICE, XAPSWS.VERSION, user);
		syslog = new Syslog(ConnectionProvider.getConnectionProperties("xaps-ws.properties", "db.syslog"), id);
		dbi = new DBI(Integer.MAX_VALUE, cp, syslog);
		inbox.addFilter(new Message(null, Message.MTYPE_PUB_PS, null, null));
		dbi.registerInbox("publishSPVS", inbox);
		sleep = new Sleep(1000, 10000, false);
		started = true;
	} catch (Throwable t) {
		logger.error("MessageListener was unable to start because of an error, no messages will be transmitted to 3-party integrators", t);
	}
}
 
开发者ID:freeacs,项目名称:ws,代码行数:21,代码来源:MessageListener.java


示例2: init

import com.owera.xaps.dbi.Users; //导入依赖的package包/类
private synchronized void init(Login login, int lifetimeSec) throws RemoteException {
	if (!initialized) {
		try {
			cp = ConnectionProvider.getConnectionProperties("xaps-ws.properties", "db.xaps");
			Users users = new Users(cp);
			User user = users.getUnprotected(login.getUsername());
			if (user == null)
				throw error("The user " + login.getUsername() + " is unknown");

			id = new Identity(SyslogConstants.FACILITY_WEBSERVICE, VERSION, user);
			syslog = new Syslog(ConnectionProvider.getConnectionProperties("xaps-ws.properties", "db.syslog"), id);
			dbi = new DBI(lifetimeSec + 30, cp, syslog);
			xaps = dbi.getXaps();
			if (!login.getPassword().equals(user.getSecret()) && !user.isCorrectSecret(login.getPassword()))
				throw error("The password is incorrect");
			// At this stage we have a positive authentication of the user
			initialized = true;
			OKServlet.setError(null);
		} catch (Throwable t) {
			OKServlet.setError(t);
			String msg = "An exception occured while initializing XAPSWS object: " + t;
			logger.error(msg, t);
			throw new RemoteException(msg, t);
		}
	}
}
 
开发者ID:freeacs,项目名称:ws,代码行数:27,代码来源:XAPSWS.java


示例3: execute

import com.owera.xaps.dbi.Users; //导入依赖的package包/类
@Override
public void execute() {
	Log.error(SessionDataCacheCleanup.class, "SessionData for " + sessionData.getUnitId() + " (key:" + unitKey
			+ ") was removed from cache after timeout - indicate a session which did not terminate correctly");

	ProvisioningMessage pm = sessionData.getProvisioningMessage();
	if (pm != null) { // only available if run in a TR-069 server (not in SPP-server)
		pm.setErrorMessage("TR-069 session was aborted - most probably because the client did not respond");
		pm.setErrorResponsibility(ErrorResponsibility.CLIENT);
		pm.setProvStatus(ProvStatus.ERROR);
		if (pm.getProvOutput() == null)
			pm.setProvOutput(ProvOutput.EMPTY);
		if (sessionData.getStartupTmsForSession() != null)
			pm.setSessionLength((int) (System.currentTimeMillis() - sessionData.getStartupTmsForSession()));
		try {
			SyslogClient.send(pm.syslogMsg(16, null, Users.USER_ADMIN));
		} catch (Throwable t) {
			Log.error(SessionDataCacheCleanup.class, "Could not send/make syslog-message in SessionDataCacheCleanup");
		}
	}

}
 
开发者ID:freeacs,项目名称:prov,代码行数:23,代码来源:SessionDataCacheCleanup.java


示例4: log

import com.owera.xaps.dbi.Users; //导入依赖的package包/类
public static void log(HTTPReqResData reqRes) {
	try {
		SessionData sessionData = reqRes.getSessionData();
		// The old logging to eventlog
		String methodsUsed = abbreviate(sessionData.getReqResList());
		long diff = System.currentTimeMillis() - sessionData.getStartupTmsForSession().longValue();
		String eventMsg = makeEventMsg(reqRes, diff, methodsUsed);
		Log.event(sessionData, eventMsg);

		// The new logging to syslog
		ProvisioningMessage pm = sessionData.getProvisioningMessage();

		if (pm.getProvOutput() == null)
			pm.setProvOutput(ProvOutput.EMPTY);
		if (reqRes.getThrowable() != null) {
			pm.setProvStatus(ProvStatus.ERROR);
			pm.setErrorResponsibility(ErrorResponsibility.SERVER);
			pm.setErrorMessage(reqRes.getThrowable().getMessage());
		} else if (pm.getProvStatus() == null)
			pm.setProvStatus(ProvStatus.OK);
		if (pm.getProvMode() == null) {
			if (sessionData.getUnit() != null)
				pm.setProvMode(sessionData.getUnit().getProvisioningMode());
			else
				pm.setProvMode(ProvisioningMode.REGULAR);
		}
		pm.setSessionLength((int) diff);
		pm.setIpAddress(reqRes.getReq().getRemoteHost());
		// We're not sending the facility-version, since the message is used in a report - where
		// the version of the TR-069 is much more interesting (will be added automatically be the syslog server)
		SyslogClient.send(pm.syslogMsg(16, null, Users.USER_ADMIN));
	} catch (Throwable t) {
		Log.warn(Provisioning.class, "An error ocurred when logging at endOfSession. Does not affect provisioning", t);
	}
}
 
开发者ID:freeacs,项目名称:tr069,代码行数:36,代码来源:SessionLogging.java


示例5: getSyslog

import com.owera.xaps.dbi.Users; //导入依赖的package包/类
public static Syslog getSyslog() throws SQLException {
	Users users = new Users(getXAPSProperties());
	Identity id = new Identity(facility, facilityVersion, users.getUnprotected(Users.USER_ADMIN));
	Syslog syslog = new Syslog(getSyslogProperties(), id);
	return syslog;
}
 
开发者ID:freeacs,项目名称:prov,代码行数:7,代码来源:DBAccess.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ParamUtils类代码示例发布时间:2022-05-22
下一篇:
Java Row类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap