Examples of FeedEvent


Examples of org.rssowl.core.persist.event.FeedEvent

    try {
      feedListener = new FeedAdapter() {
        @Override
        public void entitiesAdded(Set<FeedEvent> events) {
          try {
            FeedEvent event = events.iterator().next();
            Feed dbFeed = (Feed) event.getEntity();
            dbFeed.setDescription("feed description2");
            dbFeed.setTitle("feed title2");
            dbFeed.getImage().setDescription("Some new description");
            dbFeed.getImage().setTitle("yet another title");
            dbFeed.getImage().setHomepage(createURI("http://www.newimageuri.com"));
            updatedFeed[0] = dbFeed;
            DynamicDAO.save(dbFeed);
          } catch (PersistenceException e) {
            TestUtils.fail(e);
          }
        }

        @Override
        public void entitiesUpdated(Set<FeedEvent> events) {
          try {
            FeedEvent event = events.iterator().next();
            // TODO Add method to load entities without using the cache and
            // then use it here. Atm, this test won't actually show the bug
            // we want it to show because it's getting the feed from the cache
            // bypassing the db inconsistency
            Feed dbFeed = (Feed) event.getEntity();
            assertEquals(feedLink.toString(), dbFeed.getLink().toString());
          } catch (RuntimeException re) {
            fail(re.getMessage());
          }
        }
View Full Code Here

Examples of org.sonatype.nexus.timeline.feeds.FeedEvent

          final Map<String, String> data = Maps.newHashMap(rec.getData());
          data.remove("_type");
          data.remove("_subType");
          data.remove("_link");
          data.remove("_author");
          final FeedEvent evt = new FeedEvent(
              rec.getType(),
              rec.getSubType(),
              new Date(rec.getTimestamp()),
              rec.getData().get("_author"), // nullable
              rec.getData().get("_link"), // nullable
View Full Code Here

Examples of org.sonatype.nexus.timeline.feeds.FeedEvent

          // "<br/>" );
          // stackTrace = stackTrace.replace( "\t", "&nbsp;&nbsp;&nbsp;&nbsp;" );
          // contentValue.append( "<br/>" ).append( stackTrace );
          // }

          final FeedEvent entry = new FeedEvent(
              "LOG", // ignored
              "ERROR_WARNING", // ignored
              new Date(), // TODO: timestamp from log file?
              null, // author "system"
              null, // no link (maybe log config? or support?)
              Maps.<String, String>newHashMap()
          );
          if (logLine.contains(" ERROR ")) {
            entry.setTitle("Error");
          }
          else if (logLine.contains(" WARN ")) {
            entry.setTitle("Warning");
          }
          entry.setContent(logLine);

          entries.add(entry);
          if (entries.size() > entriesToExtract) {
            entries.remove(0);
          }
View Full Code Here

Examples of org.sonatype.nexus.timeline.feeds.FeedEvent

  public void on(final NexusStartedEvent e) {
    final Map<String, String> data = Maps.newHashMap();
    putIfNotNull(data, "bootAction", "started");
    putIfNotNull(data, "nxVersion", systemStatusProvider.get().getVersion());
    putIfNotNull(data, "nxEdition", systemStatusProvider.get().getEditionShort());
    final FeedEvent fe = new FeedEvent(
        FeedRecorder.FAMILY_SYSTEM,
        FeedRecorder.SYSTEM_BOOT,
        e.getEventDate(),
        null, // "system" is booting
        "/", // link to UI
View Full Code Here

Examples of org.sonatype.nexus.timeline.feeds.FeedEvent

  public void on(final NexusStoppedEvent e) {
    final Map<String, String> data = Maps.newHashMap();
    putIfNotNull(data, "bootAction", "stopped");
    putIfNotNull(data, "nxVersion", systemStatusProvider.get().getVersion());
    putIfNotNull(data, "nxEdition", systemStatusProvider.get().getEditionShort());
    final FeedEvent fe = new FeedEvent(
        FeedRecorder.FAMILY_SYSTEM,
        FeedRecorder.SYSTEM_BOOT,
        e.getEventDate(),
        null, // "system" is booting
        "/", // link to UI
View Full Code Here

Examples of org.sonatype.nexus.timeline.feeds.FeedEvent

      changes.add(changed.getName());
    }
    final Map<String, String> data = Maps.newHashMap();
    putIfNotNull(data, "changes", changes.toString());
    putIfNotNull(data, "userId", event.getUserId());
    final FeedEvent fe = new FeedEvent(
        FeedRecorder.FAMILY_SYSTEM,
        FeedRecorder.SYSTEM_CONFIG,
        event.getEventDate(),
        event.getUserId(),
        "/", // link to UI
View Full Code Here

Examples of org.sonatype.nexus.timeline.feeds.FeedEvent

      putIfNotNull(data, "userId", userId);
      putIfNotNull(data, "userIp",
          (String) fileItem.getResourceStoreRequest().getRequestContext().get(AccessManager.REQUEST_REMOTE_ADDRESS));
      putIfNotNull(data, "userUa",
          (String) fileItem.getResourceStoreRequest().getRequestContext().get(AccessManager.REQUEST_AGENT));
      final FeedEvent fe = new FeedEvent(
          FeedRecorder.FAMILY_ITEM,
          action,
          ievt.getEventDate(),
          userId,
          "/content/repositories/" + fileItem.getRepositoryId() + fileItem.getPath(), // link to item
View Full Code Here

Examples of org.sonatype.nexus.timeline.feeds.FeedEvent

      putIfNotNull(data, "userId", userId);
      putIfNotNull(data, "userIp",
          (String) fileItem.getResourceStoreRequest().getRequestContext().get(AccessManager.REQUEST_REMOTE_ADDRESS));
      putIfNotNull(data, "userUa",
          (String) fileItem.getResourceStoreRequest().getRequestContext().get(AccessManager.REQUEST_AGENT));
      final FeedEvent fe = new FeedEvent(
          FeedRecorder.FAMILY_ITEM,
          action,
          evt.getEventDate(),
          userId,
          "/content/repositories/" + fileItem.getRepositoryId() + fileItem.getPath(), // link to item
View Full Code Here

Examples of org.sonatype.nexus.timeline.feeds.FeedEvent

    putIfNotNull(data, "repoName", revt.getRepository().getName());
    // TODO: who changed it?
    //putIfNotNull(data, "user.id", userId);
    //putIfNotNull(data, "user.ip", userIp);
    //putIfNotNull(data, "user.ua", userAgent);
    final FeedEvent fe = new FeedEvent(
        FeedRecorder.FAMILY_REPO,
        FeedRecorder.REPO_LSTATUS,
        revt.getEventDate(),
        null, // TODO: who changed it?
        "/", // link to UI
View Full Code Here

Examples of org.sonatype.nexus.timeline.feeds.FeedEvent

    putIfNotNull(data, "repoName", revt.getRepository().getName());
    // TODO: who changed it?
    //putIfNotNull(data, "user.id", userId);
    //putIfNotNull(data, "user.ip", userIp);
    //putIfNotNull(data, "user.ua", userAgent);
    final FeedEvent fe = new FeedEvent(
        FeedRecorder.FAMILY_REPO,
        FeedRecorder.REPO_PSTATUS,
        revt.getEventDate(),
        null, // TODO: who changed it?
        "/", // link to UI
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.