Package org.rhq.core.domain.event

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


            ResourceType rt = em.find(ResourceType.class, resourceTypeId);
            Set<EventDefinition> evDs = rt.getEventDefinitions();
            if (evDs != null) {
                Iterator<EventDefinition> evdIter = evDs.iterator();
                while (evdIter.hasNext()) {
                    EventDefinition evd = evdIter.next();
                    em.remove(evd);
                    evdIter.remove();
                }
            }
            Set<MeasurementDefinition> mDefs = rt.getMetricDefinitions();
View Full Code Here


        assertEquals("did not persist all endpoint calltime data, only persisted: " + persistedData.get(0).getCount(),
            count, persistedData.get(0).getCount());
    }

    private void createNewEvents(Resource res, long timestamp, int count) {
        EventDefinition ed = res.getResourceType().getEventDefinitions().iterator().next();
        EventSource source = new EventSource("datapurgejobtest", ed, res);
        Map<EventSource, Set<Event>> eventMap = new HashMap<EventSource, Set<Event>>();
        Set<Event> events = new HashSet<Event>();
        for (int i = 0; i < count; i++) {
            events.add(new Event(ed.getName(), source.getLocation(), timestamp + i, EventSeverity.DEBUG, "details"));
        }
        eventMap.put(source, events);

        EventManagerLocal mgr = LookupUtil.getEventManager();
        mgr.addEventData(eventMap);
View Full Code Here

            AlertCondition ac = new AlertCondition(ad, AlertConditionCategory.AVAILABILITY);
            ac.setComparator("==");
            em.persist(ac);
            ad.addCondition(ac);

            EventDefinition ed = new EventDefinition(resourceType, "DataPurgeJobTestEventDefinition");
            em.persist(ed);
            resourceType.addEventDefinition(ed);

            // add calltime schedule
            MeasurementDefinition def = new MeasurementDefinition(resourceType, "DataPurgeJobTestCalltimeMeasDef");
View Full Code Here

            @Override
            public void execute() throws Exception {

                Resource resource = SessionTestHelper.createNewResource(em, "fake resource");

                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);
View Full Code Here

            @Override
            public void execute() throws Exception {

                Resource resource = SessionTestHelper.createNewResource(em, "fake resource");

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

                long now = System.currentTimeMillis();
                EventSource evSrc = new EventSource("ESource", eDef, resource);
View Full Code Here

    public void testGetEventDetailForEventId() {
        executeInTransaction(new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                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);
View Full Code Here

    public void testPurgeEventsForResourceContext() {
        executeInTransaction(new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                Resource resource = SessionTestHelper.createNewResource(em, "fake resource");
                EventDefinition eventDefinition = createEventDefinition(resource);
                em.persist(eventDefinition);
                EventSource eventSource = createEventSource(eventDefinition, resource);
                em.persist(eventSource);
                int eventCount = 7;
                for (int i = 0; i < eventCount; i++) {
View Full Code Here

            public void execute() throws Exception {
                Subject subject = SessionTestHelper.createNewSubject(em, "fake subject");
                Role role = SessionTestHelper.createNewRoleForSubject(em, subject, "fake role");
                ResourceGroup resourceGroup = SessionTestHelper.createNewCompatibleGroupForRole(em, role, "fake group");
                Resource resource = SessionTestHelper.createNewResourceForGroup(em, resourceGroup, "fake resource");
                EventDefinition eventDefinition = createEventDefinition(resource);
                em.persist(eventDefinition);
                EventSource eventSource = createEventSource(eventDefinition, resource);
                em.persist(eventSource);
                int eventCount = 7;
                for (int i = 0; i < eventCount; i++) {
View Full Code Here

    public void testGetEventCountsBySeverity() {
        executeInTransaction(new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                Resource resource = SessionTestHelper.createNewResource(em, "fake resource");
                EventDefinition eventDefinition = createEventDefinition(resource);
                em.persist(eventDefinition);
                EventSource eventSource = createEventSource(eventDefinition, resource);
                em.persist(eventSource);
                int fatalEventCount = 7;
                for (int i = 0; i < fatalEventCount; i++) {
View Full Code Here

            public void execute() throws Exception {
                Subject subject = SessionTestHelper.createNewSubject(em, "fake subject");
                Role role = SessionTestHelper.createNewRoleForSubject(em, subject, "fake role");
                ResourceGroup resourceGroup = SessionTestHelper.createNewCompatibleGroupForRole(em, role, "fake group");
                Resource resource = SessionTestHelper.createNewResourceForGroup(em, resourceGroup, "fake resource");
                EventDefinition eventDefinition = createEventDefinition(resource);
                em.persist(eventDefinition);
                EventSource eventSource = createEventSource(eventDefinition, resource);
                em.persist(eventSource);
                int fatalEventCount = 7;
                for (int i = 0; i < fatalEventCount; i++) {
View Full Code Here

TOP

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

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.