use of org.glassfish.jersey.examples.jersey_ejb.entities.Message in project jersey by jersey.
the class MessageBoardResourceBean method addMessage.
@POST
public Response addMessage(String msg) throws URISyntaxException {
Message m = singleton.addMessage(msg);
URI msgURI = ui.getRequestUriBuilder().path(Integer.toString(m.getUniqueId())).build();
return Response.created(msgURI).build();
}
use of org.glassfish.jersey.examples.jersey_ejb.entities.Message in project jersey by jersey.
the class MessageHolderSingletonBean method addMessage.
private Message addMessage(String msg, Date date) {
Message m = new Message(date, msg, getNewId());
list.add(0, m);
return m;
}
use of org.glassfish.jersey.examples.jersey_ejb.entities.Message in project jersey by jersey.
the class MessageHolderSingletonBean method getMessage.
public Message getMessage(int uniqueId) {
int index = 0;
Message m;
while (index < list.size()) {
if ((m = list.get(index)).getUniqueId() == uniqueId) {
return m;
}
index++;
}
return null;
}