@Override public void remove(long id) throws MBeanException { bookingService.remove(id); }
@Override public void add(long id, String flight, String customer) throws MBeanException { Booking booking = new Booking(); booking.setId(id); booking.setFlight(flight); booking.setCustomer(customer); bookingService.add(booking); }
@Override public TabularData getBookings() throws MBeanException { try { CompositeType bookingType = new CompositeType("booking", "Booking", new String[]{"id", "flight", "customer"}, new String[]{"ID", "Flight", "Customer"}, new OpenType[]{SimpleType.LONG, SimpleType.STRING, SimpleType.STRING}); TabularType tabularType = new TabularType("bookings", "Bookings", bookingType, new String[]{"id"}); TabularData tabularData = new TabularDataSupport(tabularType); for (Booking booking : bookingService.list()) { CompositeData compositeData = new CompositeDataSupport(bookingType, new String[]{ "id", "flight", "customer" }, new Object[]{ booking.getId(), booking.getFlight(), booking.getCustomer() }); tabularData.put(compositeData); } return tabularData; } catch (Exception e) { throw new MBeanException(e); } }
@Override public void add(long id, String flight, String customer) throws MBeanException { Booking booking = new Booking(); booking.setId(id); booking.setFlight(flight); booking.setCustomer(customer); bookingService.add(booking); }
@Override public TabularData getBookings() throws MBeanException { try { CompositeType bookingType = new CompositeType("booking", "Booking", new String[]{"id", "flight", "customer"}, new String[]{"ID", "Flight", "Customer"}, new OpenType[]{SimpleType.LONG, SimpleType.STRING, SimpleType.STRING}); TabularType tabularType = new TabularType("bookings", "Bookings", bookingType, new String[]{"id"}); TabularData tabularData = new TabularDataSupport(tabularType); for (Booking booking : bookingService.list()) { CompositeData compositeData = new CompositeDataSupport(bookingType, new String[]{ "id", "flight", "customer" }, new Object[]{ booking.getId(), booking.getFlight(), booking.getCustomer() }); tabularData.put(compositeData); } return tabularData; } catch (Exception e) { throw new MBeanException(e); } }
@Override public void add(long id, String flight, String customer) throws MBeanException { Booking booking = new Booking(); booking.setId(id); booking.setFlight(flight); booking.setCustomer(customer); bookingService.add(booking); }
@Override public void remove(long id) throws MBeanException { bookingService.remove(id); }
@Override public TabularData getBookings() throws MBeanException { try { CompositeType bookingType = new CompositeType("booking", "Booking", new String[]{"id", "flight", "customer"}, new String[]{"ID", "Flight", "Customer"}, new OpenType[]{SimpleType.LONG, SimpleType.STRING, SimpleType.STRING}); TabularType tabularType = new TabularType("bookings", "Bookings", bookingType, new String[]{"id"}); TabularData tabularData = new TabularDataSupport(tabularType); for (Booking booking : bookingService.list()) { CompositeData compositeData = new CompositeDataSupport(bookingType, new String[]{ "id", "flight", "customer" }, new Object[]{ booking.getId(), booking.getFlight(), booking.getCustomer() }); tabularData.put(compositeData); } return tabularData; } catch (Exception e) { throw new MBeanException(e); } }
@Override public void remove(long id) throws MBeanException { bookingService.remove(id); }