@Override
	public void run() {
		while (true) {
			/*
			 * Get the user id
			 */
			String id = reader.read();
			System.out.println(String.format("[ID]: %s", id));
			if(db.isIdAllowed(id)) {
				/*
				 * Open the door
				 */
				this.door.open_door();
				if(db.isIdInRoomDB(id)) {
					/*
					 * Add user to nearbyUsers list
					 */
					while(true) {
						try {
							this.nearbyUsersSemaphore.acquire();
							String deviceId = db.getDeviceIdFromID(id);
							if(!this.nearbyUsers.contains(deviceId))
								this.nearbyUsers.add(deviceId);
							/*
							 * Log the user and publish on twitter
							 */
							String twitterName = db.getTwitterNameFromID(id);
							db.logInUserWithID(id);
							messagesToPublish.add(String.format("@%s opened the door.", twitterName));
							this.nearbyUsersSemaphore.release();
							break;
						}
						catch (InterruptedException e) {
							
						}
					}
				} else {
					messagesToPublish.add("Unauthorized access to room.");
				}
			}

		}
	}