Package org.vosao.business.mq.message

Examples of org.vosao.business.mq.message.SimpleMessage


*
*/
public class EntityRemove extends AbstractSubscriber {

  public void onMessage(Message message) {
    SimpleMessage msg = (SimpleMessage) message;
    String kind =  msg.getMessage();
    DatastoreService datastore = getBusiness().getSystemService()
              .getDatastore();
        Query query = new Query(kind);
        PreparedQuery results = datastore.prepare(query);
        int i = 0;
View Full Code Here


          logger.info("Finished entity removing.");
        }
  }
 
  private void addEntityRemoveTask(String kind) {
    getMessageQueue().publish(new SimpleMessage(Topic.ENTITY_REMOVE,
        kind, QueueSpeed.LOW));
    logger.info("Added new entity remove task " + kind);
  }
View Full Code Here

*
*/
public class ImportFolder extends AbstractSubscriber {

  public void onMessage(Message message) {
    SimpleMessage msg = (SimpleMessage)message;
    String path = msg.getMessage();
    getBusiness().getFolderBusiness().createFolder(path);
    VfsNode node = VfsNode.find(path);
    if (node == null) {
      logger.error("VFS node not found " + path);
      return;
    }
    for (VfsNode child : node.getChildren()) {
      if (child.isDirectory()) {
        getBusiness().getMessageQueue().publish(new SimpleMessage(
            Topic.IMPORT_FOLDER, child.getPath()));
      }
      else {
        getBusiness().getMessageQueue().publish(new SimpleMessage(
            Topic.IMPORT_FILE, child.getPath()));
      }
    }
  }
View Full Code Here

        if (url.equals(PLUGIN_CRON_URL)) {
          getBusiness().getPluginBusiness().cronSchedule(now);
        processed = true;
        }
        if (url.equals(SESSION_CLEAN_CRON_URL)) {
        getMessageQueue().publish(new SimpleMessage(
            Topic.SESSION_CLEAN, "start"));
        logger.info("Added new session clean task");
        processed = true;
        }
        if (url.equals(PAGE_PUBLISH_CRON_URL)) {
        getMessageQueue().publish(new SimpleMessage(
            Topic.PAGE_PUBLISH_CRON));
        logger.info("Added new page publish task");
        processed = true;
        }
        if (processed) {
View Full Code Here

        else {
          VfsNode.createFile("/" + entry.getName(), data.toByteArray());
        }
      }
    }
    getBusiness().getMessageQueue().publish(new SimpleMessage(
          Topic.IMPORT_FOLDER, "/"));
    logger.info("Unzip finished.");
  }
View Full Code Here

*/
public class FileChangedSubscriber extends AbstractSubscriber {

  @Override
  public void onMessage(Message message) {
    SimpleMessage msg = (SimpleMessage)message;
    getBusiness().getSystemService().getFileCache().remove(msg.getMessage());
    logger.debug("Clear file cache " + msg.getMessage());
  }
View Full Code Here

*
*/
public class SessionCleanTaskSubscriber extends AbstractSubscriber {

  public void onMessage(Message message) {
    SimpleMessage msg = (SimpleMessage) message;
    String mode =  msg.getMessage();
    if (mode != null && mode.equals("start")) {
      addSessionCleanTask();
    }
    else {
          DatastoreService datastore = getBusiness().getSystemService()
View Full Code Here

          }
    }
  }
 
  private void addSessionCleanTask() {
    getMessageQueue().publish(new SimpleMessage(Topic.SESSION_CLEAN.name(),
        null));
    logger.info("Added new session clean task");
  }
View Full Code Here

*/
public class ImportFile extends AbstractSubscriber {

  public void onMessage(Message message) {
    try {
      SimpleMessage msg = (SimpleMessage)message;
      String path = msg.getMessage();
      if (ImportExportBusinessImpl.isGlobalSequenceImportFile(
          path.substring(1))) {
        return;
      }
      VfsNode node = VfsNode.find(path);
View Full Code Here

    }
  }

  @Override
  public void clearSessions() {
    getMessageQueue().publish(new SimpleMessage(
        Topic.SESSION_CLEAN.name(), "start"));
  }
View Full Code Here

TOP

Related Classes of org.vosao.business.mq.message.SimpleMessage

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.