@Override public void run() { MultiUserChatServiceImpl mucServer = (MultiUserChatServiceImpl) XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(serviceName); if (mucServer == null) throw new IllegalArgumentException("MUC service not found for subdomain: "+serviceName); HistoryStrategy strategy = mucServer.getHistoryStrategy(); strategy.setType(HistoryStrategy.Type.values()[type]); strategy.setMaxNumber(maxNumber); }
/** * Obtain the strategy type from string name. See the Type enumeration name * strings for the names strings supported. If nothing matches * and parent is not null, then the default strategy is used. Otherwise the number * strategy is used. * * @param typeName the text name of the strategy type. */ public void setTypeFromString(String typeName) { try { type = Type.valueOf(typeName); } catch (Exception e) { if (parent != null) { type = Type.defaulType; } else { type = Type.number; } } }
public UpdateHistoryStrategy(String serviceName, HistoryStrategy historyStrategy) { this.serviceName = serviceName; type = historyStrategy.getType().ordinal(); maxNumber = historyStrategy.getMaxNumber(); }
@Override public void run() { MultiUserChatServiceImpl mucServer = (MultiUserChatServiceImpl) XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(serviceName); if (mucServer == null) throw new IllegalArgumentException("MUC service not found for subdomain: "+serviceName); HistoryStrategy strategy = mucServer.getHistoryStrategy(); strategy.setType(HistoryStrategy.Type.values()[type]); strategy.setMaxNumber(maxNumber); }
/** * Obtain the strategy type from string name. See the Type enumeration name * strings for the names strings supported. If nothing matches * and parent is not null, then the default strategy is used. Otherwise the number * strategy is used. * * @param typeName the text name of the strategy type. */ public void setTypeFromString(String typeName) { try { type = Type.valueOf(typeName); } catch (Exception e) { if (parent != null) { type = Type.defaulType; } else { type = Type.number; } } }
public UpdateHistoryStrategy(String serviceName, HistoryStrategy historyStrategy) { this.serviceName = serviceName; type = historyStrategy.getType().ordinal(); maxNumber = historyStrategy.getMaxNumber(); }