package org.opennms.netmgt.ticketd;

import java.util.Arrays;

import org.opennms.netmgt.EventConstants;
import org.opennms.netmgt.daemon.SpringServiceDaemon;
import org.opennms.netmgt.eventd.EventIpcManager;
import org.opennms.netmgt.eventd.EventListener;
import org.opennms.netmgt.xml.event.Event;

public class TroubleTicketer implements SpringServiceDaemon, EventListener {
	
	private EventIpcManager m_eventIpcManager;
	
	public void setEventIpcManager(EventIpcManager eventIpcManager) {
		m_eventIpcManager = eventIpcManager;
	}
	
	public void setTicketerServiceLayer(TicketerServiceLayer svcLayer) {
		m_ticketerServiceLayer = svcLayer;
	}
	
    public void afterPropertiesSet() throws Exception {
    	String[] ueis = {
    			EventConstants.TROUBLETICKET_CANCEL_UEI,
    			EventConstants.TROUBLETICKET_CLOSE_UEI,
    			EventConstants.TROUBLETICKET_CREATE_UEI,
    			EventConstants.TROUBLETICKET_UPDATE_UEI
    	};
    	m_eventIpcManager.addEventListener(this, Arrays.asList(ueis));
    }

    public void start() throws Exception {
        // TODO Auto-generated method stub

    }

	public String getName() {
		return "TroubleTicketer";
	}

	public void onEvent(Event e) {
		if (EventConstants.TROUBLETICKET_CANCEL_UEI.equals(e.getUei())) {
			handleCancelTicket(e);
		} else if (EventConstants.TROUBLETICKET_CLOSE_UEI.equals(e.getUei())) {
			handleCloseTicket(e);
		} else if (EventConstants.TROUBLETICKET_CREATE_UEI.equals(e.getUei())) {
			handleCreateTicket(e);
		} else if (EventConstants.TROUBLETICKET_UPDATE_UEI.equals(e.getUei())) {
			handleUpdateTicket(e);
		}
	}

	private void handleCloseTicket(Event e) {
	}

	private void handleUpdateTicket(Event e) {
	}

	private void handleCreateTicket(Event e) {
	}

	private void handleCancelTicket(Event e) {
	}

}

@@ -292,16 +292,56 @@
 t.Event;
+%0Aimport org.springframework.util.Assert;
 %0A%0Apublic
@@ -457,16 +457,73 @@
 anager;%0A
+    private TicketerServiceLayer m_ticketerServiceLayer;%0A
 %09%0A%09publi
@@ -799,17 +799,249 @@
 n %7B%0A    
-%09
+    Assert.state(m_eventIpcManager != null, %22property eventIpcManager must be set to a non-null value%22);%0A        Assert.state(m_ticketerServiceLayer != null, %22property ticketerServiceLayer must be set to a non-null value%22);%0A%0A        
 String%5B%5D

Make this class compile and add asserts that properties are set.