Package org.infoglue.cms.util

Examples of org.infoglue.cms.util.NotificationMessage


           
            is.close();

            PortletEntityRegistry.load();

        NotificationMessage notificationMessage = new NotificationMessage("UpdatePortletRegistryAction.store():", "PortletRegistry", this.getInfoGluePrincipal().getName(), NotificationMessage.SYSTEM, "0", "PortletRegistry");
        RemoteCacheUpdater.getSystemNotificationMessages().add(notificationMessage);

            db.commit();
            db.close();
            logger.debug("Stored PortletEntityRegistry successfully");
View Full Code Here


    catch (SystemException e)
    {
      e.printStackTrace();
    }

    NotificationMessage notificationMessage = new NotificationMessage("ViewServerNodePropertiesAction.doSave():", "ServerNodeProperties", infoGluePrincipal.getName(), NotificationMessage.SYSTEM, "0", "ServerNodeProperties");
    RemoteCacheUpdater.getSystemNotificationMessages().add(notificationMessage);
    }
View Full Code Here

          }
         
        logger.info("totalCleanedContentVersions:" + totalCleanedContentVersions);
        context.setResult(totalCleanedContentVersions);
       
        NotificationMessage notificationMessage = new NotificationMessage("CleanOldVersionsJob.execute():", "ServerNodeProperties", "administrator", NotificationMessage.SYSTEM, "0", "ServerNodeProperties");
          ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
            ChangeNotificationController.getInstance().notifyListeners();
      }
      catch(Exception e)
        {
View Full Code Here

      logger.info("*********************************************************************");
   
    try
    {
        logger.info("Notifying caches...");
      NotificationMessage notificationMessage = new NotificationMessage("NightlyRefreshJob.execute():", "ServerNodeProperties", "administrator", NotificationMessage.SYSTEM, "0", "ServerNodeProperties");
        ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
          ChangeNotificationController.getInstance().notifyListeners();
          UserControllerProxy.getController().getAllUsers();
          //RemoteCacheUpdater.clearSystemNotificationMessages();
    }
View Full Code Here

      if(theme != null)
        ps.setString("principal_" + this.getInfoGluePrincipal().getName() + "_theme", theme);
      if(toolbarVariant != null)
        ps.setString("principal_" + this.getInfoGluePrincipal().getName() + "_toolbarVariant", toolbarVariant);
     
    NotificationMessage notificationMessage = new NotificationMessage("UpdateMySettingsAction.doExecute():", "ServerNodeProperties", this.getInfoGluePrincipal().getName(), NotificationMessage.SYSTEM, "0", "MySettings");
    ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
   
        return "success";
    }
View Full Code Here

        }
       
        logger.info("What other:" + notificationMessagesToSend.size());
        for(NotificationMessage message : notificationMessagesToSend)
        {
          NotificationMessage notificationMessage = new NotificationMessage("ViewPublishingToolStartPageAction.doPushSystemNotificationMessages():", "" + message.getClassName(), this.getInfoGluePrincipal().getName(), NotificationMessage.SYSTEM, message.getObjectId(), message.getObjectName());
            ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
        }

        RemoteCacheUpdater.clearSystemNotificationMessages();
       
View Full Code Here

        return "successSystem";
    }

    public String doPushSystemNotificationMessages() throws Exception
    {
        NotificationMessage notificationMessage = null;
        List messages = RemoteCacheUpdater.getSystemNotificationMessages();
        synchronized(messages)
        {
            if(messages.size() > 0)
                notificationMessage = (NotificationMessage)messages.get(0);
        }
       
        if(notificationMessage != null)
        {
        notificationMessage = new NotificationMessage("ViewPublishingToolStartPageAction.doPushSystemNotificationMessages():", "" + notificationMessage.getClassName(), this.getInfoGluePrincipal().getName(), NotificationMessage.SYSTEM, notificationMessage.getObjectId(), notificationMessage.getObjectName());
            ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
            RemoteCacheUpdater.clearSystemNotificationMessages();
        }
       
        return doSystem();
View Full Code Here

              {
                String response = postToUrl(publicationQueueBean.getUrlAddress(), publicationQueueBean.getRequestParameters());
                if(logger.isInfoEnabled())
                  logger.info("response:" + response);
                               
                NotificationMessage notificationMessage = new NotificationMessage("Publishing notification solved", "Publication", "SYSTEM", NotificationMessage.LIVE_NOTIFICATION_SOLVED, "" + publicationQueueBean.getRequestParameters().get("0.objectId"), "" + serverBaseUrl);
                TransactionHistoryController.getController().create(notificationMessage);

                beansIterator.remove();
              }
              catch(Exception e)
View Full Code Here

            Boolean wasError = newInstanceStatus.get(serverBase);
            newInstanceStatus.put(serverBase, true);
            newInstanceErrorInformation.remove(serverBase);
            if(wasError != null && wasError)
            {
              NotificationMessage serverErrorMessage = new NotificationMessage("Server available after being unavailable", serverBase, "SYSTEM", NotificationMessage.SERVER_UNAVAILABLE_SOLVED, "n/a", serverBase);
            TransactionHistoryController.getController().create(serverErrorMessage);
            }
          }
        }
      catch(Exception e)
      {   
        if(address.contains("Preview"))
          logger.info("Error in instance monitor: " + serverBase + ", Message: " + e.getMessage());
        else
          logger.warn("Error in instance monitor: " + serverBase + ", Message: " + e.getMessage());
         
        try
        {
          String cause = "" + e.getMessage();
          if(e instanceof FileNotFoundException)
            cause = "Application not found";
          else if(e instanceof SocketTimeoutException)
            cause = "" + e.getMessage();
         
          NotificationMessage serverErrorMessage = new NotificationMessage("Server down!: " + cause, serverBase, "SYSTEM", NotificationMessage.SERVER_UNAVAILABLE, "n/a", serverBase);
          TransactionHistoryController.getController().create(serverErrorMessage);
        }
        catch (Exception e2)
        {
          logger.error("Error adding transaction history log for error: " + e2.getMessage(), e);
        }
       
        newInstanceStatus.put(serverBase, false);
        Integer retries = newInstanceErrorInformation.get(serverBase);
        if(retries == null)
        {
          retries = 0;
        }
        newInstanceErrorInformation.put(serverBase, retries+1);

        boolean isDivisibleBy10 = retries % 10 == 0;
        if(retries == 0 || isDivisibleBy10)
        {
          logger.error("A deliver instance is down or unresponsive. Tested instance: " + address + ". Message: " + e.getMessage());
          sendWarningMail(serverBase);
        }
       
        /*
        if(retries == 20)
        {
            ViewMessageCenterAction.addSystemMessage("administrator", ViewMessageCenterAction.SYSTEM_MESSAGE_TYPE, "alert('One server is down: " + serverBase + "');");
        }
        */
      }
    }
   
    List publicDeliveryUrls = CmsPropertyHandler.getPublicDeliveryUrls();
    Iterator publicDeliveryUrlsIterator = publicDeliveryUrls.iterator();
    while(publicDeliveryUrlsIterator.hasNext())
    {
      String serverBase = "" + publicDeliveryUrlsIterator.next();
      String address = serverBase + "/UpdateCache!test.action";
     
      try
      {
            HttpHelper httpHelper = new HttpHelper();
          String response = httpHelper.getUrlContent(address, new HashMap(), null, 5000);
          if(response.indexOf("test ok") == -1)
              throw new Exception("Got wrong answer");
          else
          {
            Boolean wasError = newInstanceStatus.get(serverBase);
            newInstanceStatus.put(serverBase, true);
            newInstanceErrorInformation.remove(serverBase);
            if(wasError != null && wasError)
            {
              NotificationMessage serverErrorMessage = new NotificationMessage("Server available after being unavailable", serverBase, "SYSTEM", NotificationMessage.SERVER_UNAVAILABLE_SOLVED, "n/a", serverBase);
            TransactionHistoryController.getController().create(serverErrorMessage);
            }
          }
      }
      catch(Exception e)
      {
        logger.info("Error in instance monitor: " + serverBase + ", Message: " + e.getMessage());
        try
        {
          String cause = "" + e.getMessage();
          if(e instanceof FileNotFoundException)
            cause = "Application not found";
          else if(e instanceof SocketTimeoutException)
            cause = "" + e.getMessage();
         
          NotificationMessage serverErrorMessage = new NotificationMessage("Server down!: " + cause, serverBase, "SYSTEM", NotificationMessage.SERVER_UNAVAILABLE, "n/a", serverBase);
          TransactionHistoryController.getController().create(serverErrorMessage);
        }
        catch (Exception e2)
        {
          logger.error("Error adding transaction history log for error: " + e2.getMessage(), e);
View Full Code Here

      mySql.closeMaster();
      mySql.closeSlave();

      // Expire cache on livesites?
      NotificationMessage notificationMessage = new NotificationMessage("ReplicationMySqlController.updateSlaveServer():", NotificationMessage.PUBLISHING_TEXT, "Editor - name unknown", NotificationMessage.PUBLISHING, new Integer(-1), "");
      ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
    }
  }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.util.NotificationMessage

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.