Package plugins.Freetalk.WoT

Examples of plugins.Freetalk.WoT.WoTMessageManager


      final String threadID = request.getPartAsStringFailsafe("ThreadID", 128);
      final String messageID = request.getPartAsStringFailsafe("MessageID", 128);
     
      try {
        WoTIdentityManager identityManager = mFreetalk.getIdentityManager();
        WoTMessageManager messageManager = mFreetalk.getMessageManager();
 
        synchronized(identityManager) {
          final WoTOwnIdentity own = (WoTOwnIdentity)webInterface.getLoggedInOwnIdentity(context);
          boolean removeRating = request.getPartAsStringFailsafe("RemoveRating", 16).equals("true");
         
          try {           
            synchronized (messageManager) {
            synchronized(own) {
              WoTMessage message = (WoTMessage)messageManager.get(messageID);
              if(removeRating)
                messageManager.deleteMessageRatingAndRevertEffect(messageManager.getMessageRating(own, message));
              else
                messageManager.rateMessage(own, message, Byte.parseByte(request.getPartAsStringFailsafe("TrustChange", 5)));
            }
            }
          } catch (NoSuchMessageException e) {
            errorPage = new ErrorPage(webInterface, own, request, "Rating the message failed", e, l10n());
          }
View Full Code Here


   
    DateFormat dateFormat = DateFormat.getInstance();
   
    HTMLNode table = messagesTable.addChild("tbody");
   
    final WoTMessageManager messageManager = mFreetalk.getMessageManager();
   
    synchronized(messageManager) {
      for(final MessageList.MessageReference ref : messageManager.getDownloadableMessagesSortedByDate(mBoard)) {
        MessageFetchFailedMarker failureMarker = null;
        int failedFetches;
       
        try {
          failureMarker = messageManager.getMessageFetchFailedMarker(ref);
          failedFetches = failureMarker.getNumberOfRetries();
        } catch(NoSuchFetchFailedMarkerException e) {
          if(ref.wasMessageDownloaded())
            continue; // We are the unfetched messages page, don't display fetched ones
         
View Full Code Here

  }

  @Override
  public void make() throws RedirectException {
    final WoTIdentityManager identityManager = mFreetalk.getIdentityManager();
    final WoTMessageManager messageManager = mFreetalk.getMessageManager();
   
    synchronized(identityManager)
    {
      HTMLNode statsbox = addContentBox(l10n().getString("StatisticsPage.IdentityStatistics.Title"));
      statsbox.addChild("p", l10n().getString("StatisticsPage.IdentityStatistics.NonOwnIdentities") + " " + identityManager.countKnownIdentities());
      statsbox.addChild("p", l10n().getString("StatisticsPage.IdentityStatistics.OwnIdentities") + " " + identityManager.ownIdentityIterator().size());
    }

    synchronized(messageManager) {
    {
      HTMLNode statsbox = addContentBox(l10n().getString("StatisticsPage.MessageListStatistics.Title"));
      statsbox.addChild("p", l10n().getString("StatisticsPage.MessageListStatistics.MessageListEditionSum") + " " + computeMessageListEditionSum());
      statsbox.addChild("p", l10n().getString("StatisticsPage.MessageListStatistics.FetchedMessageListCount") + " " + messageManager.countNonOwnMessageLists());
      statsbox.addChild("p", l10n().getString("StatisticsPage.MessageListStatistics.KnownMessageCount") + " " + messageManager.countNonOwnMessageListMessageReferences());
      statsbox.addChild("p", l10n().getString("StatisticsPage.MessageListStatistics.MessageFetchQueueSize") + " " + messageManager.notDownloadedMessageIterator().size());
   
    }
   
    {
      HTMLNode statsbox = addContentBox(l10n().getString("StatisticsPage.MessageStatistics.Title"));
      final int ownMessageCount = messageManager.countOwnMessages();
      statsbox.addChild("p", l10n().getString("StatisticsPage.MessageStatistics.NonOwnMessageCount") + " " + (messageManager.countMessages() - ownMessageCount));
      statsbox.addChild("p", l10n().getString("StatisticsPage.MessageStatistics.OwnMessageCount") + " " + ownMessageCount);

    }
   
    {
      HTMLNode statsbox = addContentBox(l10n().getString("StatisticsPage.BoardStatistics.Title"));
      statsbox.addChild("p", l10n().getString("StatisticsPage.BoardStatistics.BoardCount") + " " + messageManager.boardIteratorSortedByName().size());
      statsbox.addChild("p", l10n().getString("StatisticsPage.BoardStatistics.SubscribedBoardCount") + " " + messageManager.subscribedBoardIterator().size());
      statsbox.addChild("p", l10n().getString("StatisticsPage.BoardStatistics.BoardMessageCount") + " " + computeBoardMessageCount());
      statsbox.addChild("p", l10n().getString("StatisticsPage.BoardStatistics.SubscribedBoardMessageCount") + " " + computeSubscribedBoardMessageCount());
    }
    }
   
View Full Code Here

    final HTMLNode table = threadsTable.addChild("tbody");
   
    final DateFormat dateFormat = DateFormat.getInstance();

    final WoTMessageManager messageManager = mFreetalk.getMessageManager();
   
    boolean tableEmpty = true;
   
    synchronized(messageManager) {
      for(final WoTOwnMessage message : messageManager.getNotInsertedOwnMessages()) {
        tableEmpty = false;
       
        row = table.addChild("tr", "class", "message-row");
       
        final Board[] boards = message.getBoards();
View Full Code Here

    if(value == 0) // No change
      return;

    try {
      WoTIdentityManager identityManager = (WoTIdentityManager)mFreetalk.getIdentityManager();
      WoTMessageManager messageManager = (WoTMessageManager)mFreetalk.getMessageManager();

      synchronized(identityManager) {
      synchronized (messageManager) {
        WoTMessage message = (WoTMessage)messageManager.get(mParentMessage.getID()); // It might have be deleted meanwhile, we must re-query
        messageManager.rateMessage((WoTOwnIdentity)mOwnIdentity, message, value);
        HTMLNode successBox = addContentBox(l10n().getString("NewReplyPage.RateMessageSucceededBox.Title"));
        successBox.addChild("div", l10n().getString("NewReplyPage.RateMessageSucceededBox.Text", "value", Byte.toString(value)));
      }
      }
    } catch(Exception e) {
View Full Code Here

    mConfig = Configuration.loadOrCreate(this, db);
    if(mConfig.getDatabaseFormatVersion() != Freetalk.DATABASE_FORMAT_VERSION)
      throw new RuntimeException("The Freetalk plugin's database format is newer than the Freetalk plugin which is being used.");
   
    mIdentityManager = new WoTIdentityManager(this);
    mMessageManager = new WoTMessageManager(this);
    mTaskManager = new PersistentTaskManager(this, db);
  }
View Full Code Here

   
    if(logDEBUG) Logger.debug(this, "Creating identity manager...");
    mIdentityManager = new WoTIdentityManager(this, mPluginRespirator.getNode().executor);
   
    if(logDEBUG) Logger.debug(this, "Creating message manager...");
    mMessageManager = new WoTMessageManager(db, mIdentityManager, this, mPluginRespirator);
   
    if(logDEBUG) Logger.debug(this, "Creating task manager...");
    mTaskManager = new PersistentTaskManager(this, db);
   
    upgradeDatabase();
View Full Code Here

TOP

Related Classes of plugins.Freetalk.WoT.WoTMessageManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.