Remove trailing whitespace
[openflowjava.git] / simple-client / src / main / java / org / opendaylight / openflowjava / protocol / impl / clients / SleepEvent.java
1 /*
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowjava.protocol.impl.clients;
10
11 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory;
13
14 /**
15  * Class representing sleep (wait) event
16  *
17  * @author michal.polkorab
18  */
19 public class SleepEvent implements ClientEvent {
20
21     private static final Logger LOGGER = LoggerFactory.getLogger(SleepEvent.class);
22     private long sleepTime;
23
24     /**
25      *
26      * @param sleepTime time of {@link Thread#sleep(long)} in milliseconds
27      */
28     public SleepEvent(long sleepTime) {
29         this.sleepTime = sleepTime;
30     }
31
32     @Override
33     public boolean eventExecuted() {
34         try {
35             Thread.sleep(sleepTime);
36             LOGGER.debug("Sleeping");
37             return true;
38         } catch (InterruptedException e) {
39             LOGGER.error(e.getMessage(), e);
40         }
41         return false;
42     }
43 }