Code example for TimeUnit

Methods: toSeconds

 * Servlet, called from an App Engine task, that sends the given message (sync or announcement) 
 * to all devices in a given multicast group (up to 1000). 
public class SendMessageServlet extends BaseServlet { 
    private static final int ANNOUNCEMENT_TTL = (int) TimeUnit.MINUTES.toSeconds(300);
    private Sender sender;
    public void init(ServletConfig config) throws ServletException {
        sender = newSender(config);
     * Creates the {@link Sender} based on the servlet settings. 
    protected Sender newSender(ServletConfig config) {
        String key = (String) config.getServletContext()
Experience pair programming with AI  Get Codota for Java