Package org.rhq.core.domain.event

Examples of org.rhq.core.domain.event.Event


                EventDefinition eDef = createEventDefinition(resource);
                em.persist(eDef);

                long now = System.currentTimeMillis();
                EventSource evSrc = new EventSource("ESource", eDef, resource);
                Event ev = new Event("EType", "ESource", now, EventSeverity.INFO, "This is a test", evSrc);
                //Set<Event> eventSet = newEventSet();
                //eventSet.add(ev);
                //Map<EventSource, Set<Event>> events = new HashMap<EventSource, Set<Event>>();
                //events.put(evSrc, eventSet);
                em.persist(evSrc);
View Full Code Here


                em.persist(eDef);
                em.flush();

                long now = System.currentTimeMillis();
                EventSource evSrc = new EventSource("ESource", eDef, resource);
                Event ev = new Event("EType", "ESource", now, EventSeverity.INFO, "This is a 2nd test", evSrc);
                //em.persist(evSrc);
                //em.persist(ev);
                //em.flush();

                /*
 
View Full Code Here

                Resource resource = SessionTestHelper.createNewResource(em, "fake resource");
                EventDefinition eventDefinition = createEventDefinition(resource);
                em.persist(eventDefinition);
                EventSource eventSource = createEventSource(eventDefinition, resource);
                em.persist(eventSource);
                Event event = createEvent(eventSource, EventSeverity.FATAL);
                em.persist(event);
                em.flush();
                EventComposite eventDetail = eventManager.getEventDetailForEventId(subjectManager.getOverlord(),
                    event.getId());
                assertNotNull(eventDetail);
                assertEquals(resource.getName(), eventDetail.getResourceName());
                assertEquals(event.getSourceLocation(), eventDetail.getSourceLocation());
                assertEquals(event.getSeverity(), eventDetail.getSeverity());
            }
        });
    }
View Full Code Here

                em.persist(eventDefinition);
                EventSource eventSource = createEventSource(eventDefinition, resource);
                em.persist(eventSource);
                int eventCount = 7;
                for (int i = 0; i < eventCount; i++) {
                    Event event = createEvent(eventSource, EventSeverity.FATAL);
                    em.persist(event);
                }
                em.flush();
                int deletedCount = eventManager.purgeEventsForContext(subjectManager.getOverlord(),
                    EntityContext.forResource(resource.getId()));
View Full Code Here

                em.persist(eventDefinition);
                EventSource eventSource = createEventSource(eventDefinition, resource);
                em.persist(eventSource);
                int eventCount = 7;
                for (int i = 0; i < eventCount; i++) {
                    Event event = createEvent(eventSource, EventSeverity.FATAL);
                    em.persist(event);
                }
                em.flush();
                int deletedCount = eventManager.purgeEventsForContext(subjectManager.getOverlord(),
                    EntityContext.forGroup(resourceGroup.getId()));
View Full Code Here

                em.persist(eventDefinition);
                EventSource eventSource = createEventSource(eventDefinition, resource);
                em.persist(eventSource);
                int fatalEventCount = 7;
                for (int i = 0; i < fatalEventCount; i++) {
                    Event event = createEvent(eventSource, EventSeverity.FATAL);
                    em.persist(event);
                }
                int warnEventCount = 5;
                for (int i = 0; i < warnEventCount; i++) {
                    Event event = createEvent(eventSource, EventSeverity.WARN);
                    em.persist(event);
                }
                int infoEventCount = 9;
                for (int i = 0; i < infoEventCount; i++) {
                    Event event = createEvent(eventSource, EventSeverity.INFO);
                    em.persist(event);
                }
                em.flush();
                Map<EventSeverity, Integer> eventCountsBySeverity = eventManager.getEventCountsBySeverity(
                    subjectManager.getOverlord(), resource.getId(), 0, System.currentTimeMillis());
View Full Code Here

                em.persist(eventDefinition);
                EventSource eventSource = createEventSource(eventDefinition, resource);
                em.persist(eventSource);
                int fatalEventCount = 7;
                for (int i = 0; i < fatalEventCount; i++) {
                    Event event = createEvent(eventSource, EventSeverity.FATAL);
                    em.persist(event);
                }
                int warnEventCount = 5;
                for (int i = 0; i < warnEventCount; i++) {
                    Event event = createEvent(eventSource, EventSeverity.WARN);
                    em.persist(event);
                }
                int infoEventCount = 9;
                for (int i = 0; i < infoEventCount; i++) {
                    Event event = createEvent(eventSource, EventSeverity.INFO);
                    em.persist(event);
                }
                em.flush();
                Map<EventSeverity, Integer> eventCountsBySeverity = eventManager.getEventCountsBySeverityForGroup(
                    subjectManager.getOverlord(), resourceGroup.getId(), 0, System.currentTimeMillis());
View Full Code Here

                em.persist(eventDefinition);
                EventSource eventSource = createEventSource(eventDefinition, resource);
                em.persist(eventSource);
                Set<Event> events = newEventSet();
                for (int i = 0; i < 4; i++) {
                    Event event = createEvent(eventSource, EventSeverity.FATAL);
                    events.add(event);
                    em.persist(event);
                }
                for (int i = 0; i < 7; i++) {
                    Event event = createEvent(eventSource, EventSeverity.WARN);
                    events.add(event);
                    em.persist(event);
                }
                for (int i = 0; i < 13; i++) {
                    Event event = createEvent(eventSource, EventSeverity.INFO);
                    events.add(event);
                    em.persist(event);
                }
                em.flush();
                EventCriteria criteria = new EventCriteria();
View Full Code Here

    private EventSource createEventSource(EventDefinition eventDefinition, Resource resource) {
        return new EventSource("fake source location", eventDefinition, resource);
    }

    private Event createEvent(EventSource eventSource, EventSeverity eventSeverity) {
        return new Event("fake event type", eventSource.getLocation(), System.currentTimeMillis(), eventSeverity,
            "fake event detail", eventSource);
    }
View Full Code Here

     */
    public void addStatuses(List<Status> statuses) {

        synchronized (events) {
            for (Status status: statuses) {
                Event ev = new Event(getEventType(), // Event Type
                        status.getUser().getName(), // SourceLocation
                        status.getCreatedAt().getTime(), // Timestamp
                        EventSeverity.INFO, // Severity -- just all the same for now
                        status.getText()
                        );
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.event.Event

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.