Search in sources :

Example 1 with HistoryStrategy

use of org.jivesoftware.openfire.muc.HistoryStrategy in project Openfire by igniterealtime.

the class LocalMUCRoom method readExternal.

@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    name = ExternalizableUtil.getInstance().readSafeUTF(in);
    startTime = ExternalizableUtil.getInstance().readLong(in);
    lockedTime = ExternalizableUtil.getInstance().readLong(in);
    ExternalizableUtil.getInstance().readSerializableCollection(in, owners, getClass().getClassLoader());
    ExternalizableUtil.getInstance().readSerializableCollection(in, admins, getClass().getClassLoader());
    ExternalizableUtil.getInstance().readSerializableMap(in, members, getClass().getClassLoader());
    ExternalizableUtil.getInstance().readSerializableCollection(in, outcasts, getClass().getClassLoader());
    naturalLanguageName = ExternalizableUtil.getInstance().readSafeUTF(in);
    description = ExternalizableUtil.getInstance().readSafeUTF(in);
    canOccupantsChangeSubject = ExternalizableUtil.getInstance().readBoolean(in);
    maxUsers = ExternalizableUtil.getInstance().readInt(in);
    rolesToBroadcastPresence.addAll(ExternalizableUtil.getInstance().readStringList(in));
    publicRoom = ExternalizableUtil.getInstance().readBoolean(in);
    persistent = ExternalizableUtil.getInstance().readBoolean(in);
    moderated = ExternalizableUtil.getInstance().readBoolean(in);
    membersOnly = ExternalizableUtil.getInstance().readBoolean(in);
    canOccupantsInvite = ExternalizableUtil.getInstance().readBoolean(in);
    password = ExternalizableUtil.getInstance().readSafeUTF(in);
    canAnyoneDiscoverJID = ExternalizableUtil.getInstance().readBoolean(in);
    logEnabled = ExternalizableUtil.getInstance().readBoolean(in);
    loginRestrictedToNickname = ExternalizableUtil.getInstance().readBoolean(in);
    canChangeNickname = ExternalizableUtil.getInstance().readBoolean(in);
    registrationEnabled = ExternalizableUtil.getInstance().readBoolean(in);
    subject = ExternalizableUtil.getInstance().readSafeUTF(in);
    roomID = ExternalizableUtil.getInstance().readLong(in);
    creationDate = new Date(ExternalizableUtil.getInstance().readLong(in));
    modificationDate = new Date(ExternalizableUtil.getInstance().readLong(in));
    if (ExternalizableUtil.getInstance().readBoolean(in)) {
        emptyDate = new Date(ExternalizableUtil.getInstance().readLong(in));
    }
    savedToDB = ExternalizableUtil.getInstance().readBoolean(in);
    String subdomain = ExternalizableUtil.getInstance().readSafeUTF(in);
    mucService = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(subdomain);
    if (mucService == null)
        throw new IllegalArgumentException("MUC service not found for subdomain: " + subdomain);
    roomHistory = new MUCRoomHistory(this, new HistoryStrategy(mucService.getHistoryStrategy()));
    PacketRouter packetRouter = XMPPServer.getInstance().getPacketRouter();
    this.iqOwnerHandler = new IQOwnerHandler(this, packetRouter);
    this.iqAdminHandler = new IQAdminHandler(this, packetRouter);
    router = packetRouter;
}
Also used : PacketRouter(org.jivesoftware.openfire.PacketRouter) MUCRoomHistory(org.jivesoftware.openfire.muc.MUCRoomHistory) Date(java.util.Date) HistoryStrategy(org.jivesoftware.openfire.muc.HistoryStrategy)

Example 2 with HistoryStrategy

use of org.jivesoftware.openfire.muc.HistoryStrategy in project Openfire by igniterealtime.

the class UpdateHistoryStrategy method run.

@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);
}
Also used : MultiUserChatServiceImpl(org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl) HistoryStrategy(org.jivesoftware.openfire.muc.HistoryStrategy)

Aggregations

HistoryStrategy (org.jivesoftware.openfire.muc.HistoryStrategy)2 Date (java.util.Date)1 PacketRouter (org.jivesoftware.openfire.PacketRouter)1 MUCRoomHistory (org.jivesoftware.openfire.muc.MUCRoomHistory)1 MultiUserChatServiceImpl (org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl)1