Commits

Trey Howard committed 1962f75

code cleanup

  • Participants
  • Parent commits da38eaa

Comments (0)

Files changed (3)

File src/main/java/trey/dao/EventDaoImpl.java

 
 	public Event getEventById(long eventId) {
 		return getJdbcTemplate().queryForObject("select * from customer_event where event_id = ?",
-				new Object[] { eventId }, new CustomerEventRowMapper());
+				new Object[] { eventId }, new EventRowMapper());
 	}
 
 	public Event getNextEvent() {
 		try {
-			return getJdbcTemplate().queryForObject("call next_customer_event", new CustomerEventRowMapper());
+			return getJdbcTemplate().queryForObject("call next_customer_event", new EventRowMapper());
 		} catch (IncorrectResultSizeDataAccessException e) {
 			return null;
 		}
 	}
 
-	private static class CustomerEventRowMapper implements RowMapper<Event> {
+	private static class EventRowMapper implements RowMapper<Event> {
 		public Event mapRow(ResultSet res, int rowNum) throws SQLException {
 			Event event = new Event();
 			event.setEventId(res.getLong("event_id"));

File src/main/java/trey/model/Event.java

 
 public class Event {
 
-	// private static final String DELIMITER = ",";
-
 	public static enum EventType {
 		name, address;
 	}
 	@Override
 	public String toString() {
 		StringBuilder builder = new StringBuilder();
-		builder.append("CustomerEvent [eventId=").append(eventId).append(", customerId=").append(customerId)
+		builder.append("Event [eventId=").append(eventId).append(", customerId=").append(customerId)
 				.append(", eventType=").append(eventType).append("]");
 		return builder.toString();
 	}
 
-	// public static String marshal(CustomerEvent event) {
-	// StringBuilder sb = new StringBuilder(256);
-	// sb.append(event.getEventId()).append(",").append(event.getCustomerId()).append(",")
-	// .append(event.getEventType().name());
-	// return sb.toString();
-	// }
-	//
-	// public static CustomerEvent marshal(String text) {
-	// String[] tokens = text.split(DELIMITER);
-	// CustomerEvent event = new CustomerEvent();
-	// event.setEventId(Long.valueOf(tokens[0]));
-	// event.setCustomerId(Long.valueOf(tokens[1]));
-	// event.setEventType(EventType.valueOf(tokens[2]));
-	// return event;
-	// }
-
 }

File src/main/java/trey/service/EventServiceImpl.java

 
 				public Message createMessage(Session session) throws JMSException {
 					TextMessage message = session.createTextMessage(String.valueOf(event.getEventId()));
-					LOG.info("Sending message for CustomerEvent: " + event);
+					LOG.info("Sending message for Event: " + event);
 					return message;
 				}
 			});