本文整理汇总了Java中org.jivesoftware.openfire.session.ClientSession.deliverRawText方法的典型用法代码示例。如果您正苦于以下问题:Java ClientSession.deliverRawText方法的具体用法?Java ClientSession.deliverRawText怎么用?Java ClientSession.deliverRawText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jivesoftware.openfire.session.ClientSession
的用法示例。
在下文中一共展示了ClientSession.deliverRawText方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: terminateSessions
import org.jivesoftware.openfire.session.ClientSession; //导入方法依赖的package包/类
/**
* Terminate open session for the user with specified user name. Username should be complete ie it should
* include the % appid.
* @param username
*/
public static void terminateSessions(String username) throws ServerNotInitializedException {
final StreamError error = new StreamError(StreamError.Condition.not_authorized);
for (ClientSession session : getSessionManager().getSessions(username) ) {
LOGGER.info("Terminating session for user with name:{}", username);
session.deliverRawText(error.toXML());
session.close();
}
}
示例2: deleteUser
import org.jivesoftware.openfire.session.ClientSession; //导入方法依赖的package包/类
private static void deleteUser(User oldUser) {
UserManager.getInstance().deleteUser(oldUser);
final StreamError error = new StreamError(StreamError.Condition.not_authorized);
for (ClientSession sess : SessionManager.getInstance().getSessions(oldUser.getUsername())) {
sess.deliverRawText(error.toXML());
sess.close();
}
}
示例3: disableUser
import org.jivesoftware.openfire.session.ClientSession; //导入方法依赖的package包/类
/**
* Disable user.
*
* @param username
* the username
* @throws ServiceException
* the service exception
*/
public void disableUser(String username) throws ServiceException {
getAndCheckUser(username);
lockOutManager.disableAccount(username, null, null);
if (lockOutManager.isAccountDisabled(username)) {
final StreamError error = new StreamError(StreamError.Condition.not_authorized);
for (ClientSession sess : SessionManager.getInstance().getSessions(username)) {
sess.deliverRawText(error.toXML());
sess.close();
}
}
}
示例4: removeUserSessions
import org.jivesoftware.openfire.session.ClientSession; //导入方法依赖的package包/类
/**
* Removes the user sessions.
*
* @param username the username
* @throws ServiceException the service exception
*/
public void removeUserSessions(String username) throws ServiceException {
final StreamError error = new StreamError(StreamError.Condition.not_authorized);
for (ClientSession session : SessionManager.getInstance().getSessions(username)) {
session.deliverRawText(error.toXML());
session.close();
}
}
示例5: deleteUser
import org.jivesoftware.openfire.session.ClientSession; //导入方法依赖的package包/类
/**
* Delete user.
*
* @param oldUser
* the old user
*/
private static void deleteUser(User oldUser) {
UserManager.getInstance().deleteUser(oldUser);
LockOutManager.getInstance().enableAccount(oldUser.getUsername());
final StreamError error = new StreamError(StreamError.Condition.not_authorized);
for (ClientSession sess : SessionManager.getInstance().getSessions(oldUser.getUsername())) {
sess.deliverRawText(error.toXML());
sess.close();
}
}
示例6: deleteUser
import org.jivesoftware.openfire.session.ClientSession; //导入方法依赖的package包/类
private static void deleteUser(User oldUser) {
UserManager.getInstance().deleteUser(oldUser);
final StreamError error = new StreamError(StreamError.Condition.not_authorized);
for (ClientSession sess : SessionManager.getInstance().getSessions(oldUser.getUsername())) {
sess.deliverRawText(error.toXML());
sess.close();
}
}