// Path: src/main/java/org/swarmcom/jsynapse/controller/JsynapseApi.java
// public class JsynapseApi {
// 
//     public static final String CLIENT_V1_API = "/_matrix/client/api/v1";
//     public static final String CONTENT_V1_API = "/_matrix/media/v1";
// 
//     @ExceptionHandler
//     @ResponseStatus(NOT_FOUND)
//     public String handleEntityNotFound(EntityNotFoundException ex) {
//         return ex.getMessage();
//     }
// 
//     @ExceptionHandler
//     @ResponseStatus(CONFLICT)
//     public String handleEntityAlreadyExists(EntityAlreadyExistsException ex) {
//         return ex.getMessage();
//     }
// 
//     @ExceptionHandler
//     @ResponseStatus(BAD_REQUEST)
//     public String handleInvalidRequest(InvalidRequestException ex) {
//         return ex.getMessage();
//     }
// 
//     @ExceptionHandler
//     @ResponseStatus(FORBIDDEN)
//     public String handleTokenNotFound(TokenNotFoundException ex) {
//         return ex.getMessage();
//     }
// 
//     @ExceptionHandler
//     @ResponseStatus(BAD_REQUEST)
//     public String handleValidationException(ValidationException ex) {
//         return ex.getMessage();
//     }
// }
// 
// Path: src/main/java/org/swarmcom/jsynapse/domain/Presence.java
// public class Presence {
//     @Id
//     String id;
// 
//     @NotNull
//     @EnumValue(enumClass = PresenceEnum.class)
//     @JsonView(PresenceSummary.class)
//     String presence;
// 
//     @NotNull
//     @JsonProperty("status_msg")
//     @JsonView(PresenceSummary.class)
//     String statusMessage;
// 
//     @Indexed
//     String userId;
// 
//     @LastModifiedDate
//     private Date lastModifiedDate;
// 
//     public Presence() {
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public void setId(String id) {
//         this.id = id;
//     }
// 
//     public String getPresence() {
//         return presence;
//     }
// 
//     public void setPresence(String presence) {
//         this.presence = presence;
//     }
// 
//     public String getStatusMessage() {
//         return statusMessage;
//     }
// 
//     public void setStatusMessage(String statusMessage) {
//         this.statusMessage = statusMessage;
//     }
// 
//     public String getUserId() {
//         return userId;
//     }
// 
//     public void setUserId(String userId) {
//         this.userId = userId;
//     }
// 
//     public enum PresenceEnum {
//         offline,
//         unavailable,
//         online,
//         free_for_chat;
//     }
// 
//     public interface PresenceSummary {}
// }
// 
// Path: src/main/java/org/swarmcom/jsynapse/domain/Presence.java
// public interface PresenceSummary {}
// 
// Path: src/main/java/org/swarmcom/jsynapse/service/presence/PresenceService.java
// public interface PresenceService {
//     void savePresence(String userId, Presence presence);
// 
//     Presence getUserPresence(String userId);
// }
// 
// Path: src/main/java/org/swarmcom/jsynapse/controller/JsynapseApi.java
// public static final String CLIENT_V1_API = "/_matrix/client/api/v1";


import static java.lang.String.format;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.PUT;
import static org.swarmcom.jsynapse.controller.JsynapseApi.CLIENT_V1_API;
import com.fasterxml.jackson.annotation.JsonView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.swarmcom.jsynapse.controller.JsynapseApi;
import org.swarmcom.jsynapse.domain.Presence;
import org.swarmcom.jsynapse.domain.Presence.PresenceSummary;
import org.swarmcom.jsynapse.service.presence.PresenceService;
import javax.inject.Inject;
import javax.validation.Valid;
/*
 * (C) Copyright 2015 eZuce Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
*/
package org.swarmcom.jsynapse.controller.client.api.v1;




@RestController
@RequestMapping(value = CLIENT_V1_API)
public class PresenceRestApi extends JsynapseApi {
    private static final Logger LOGGER = LoggerFactory.getLogger(PresenceRestApi.class);
    private final PresenceService presenceService;

    @Inject
// Path: src/main/java/org/swarmcom/jsynapse/controller/JsynapseApi.java
// public class JsynapseApi {
// 
//     public static final String CLIENT_V1_API = "/_matrix/client/api/v1";
//     public static final String CONTENT_V1_API = "/_matrix/media/v1";
// 
//     @ExceptionHandler
//     @ResponseStatus(NOT_FOUND)
//     public String handleEntityNotFound(EntityNotFoundException ex) {
//         return ex.getMessage();
//     }
// 
//     @ExceptionHandler
//     @ResponseStatus(CONFLICT)
//     public String handleEntityAlreadyExists(EntityAlreadyExistsException ex) {
//         return ex.getMessage();
//     }
// 
//     @ExceptionHandler
//     @ResponseStatus(BAD_REQUEST)
//     public String handleInvalidRequest(InvalidRequestException ex) {
//         return ex.getMessage();
//     }
// 
//     @ExceptionHandler
//     @ResponseStatus(FORBIDDEN)
//     public String handleTokenNotFound(TokenNotFoundException ex) {
//         return ex.getMessage();
//     }
// 
//     @ExceptionHandler
//     @ResponseStatus(BAD_REQUEST)
//     public String handleValidationException(ValidationException ex) {
//         return ex.getMessage();
//     }
// }
// 
// Path: src/main/java/org/swarmcom/jsynapse/domain/Presence.java
// public class Presence {
//     @Id
//     String id;
// 
//     @NotNull
//     @EnumValue(enumClass = PresenceEnum.class)
//     @JsonView(PresenceSummary.class)
//     String presence;
// 
//     @NotNull
//     @JsonProperty("status_msg")
//     @JsonView(PresenceSummary.class)
//     String statusMessage;
// 
//     @Indexed
//     String userId;
// 
//     @LastModifiedDate
//     private Date lastModifiedDate;
// 
//     public Presence() {
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public void setId(String id) {
//         this.id = id;
//     }
// 
//     public String getPresence() {
//         return presence;
//     }
// 
//     public void setPresence(String presence) {
//         this.presence = presence;
//     }
// 
//     public String getStatusMessage() {
//         return statusMessage;
//     }
// 
//     public void setStatusMessage(String statusMessage) {
//         this.statusMessage = statusMessage;
//     }
// 
//     public String getUserId() {
//         return userId;
//     }
// 
//     public void setUserId(String userId) {
//         this.userId = userId;
//     }
// 
//     public enum PresenceEnum {
//         offline,
//         unavailable,
//         online,
//         free_for_chat;
//     }
// 
//     public interface PresenceSummary {}
// }
// 
// Path: src/main/java/org/swarmcom/jsynapse/domain/Presence.java
// public interface PresenceSummary {}
// 
// Path: src/main/java/org/swarmcom/jsynapse/service/presence/PresenceService.java
// public interface PresenceService {
//     void savePresence(String userId, Presence presence);
// 
//     Presence getUserPresence(String userId);
// }
// 
// Path: src/main/java/org/swarmcom/jsynapse/controller/JsynapseApi.java
// public static final String CLIENT_V1_API = "/_matrix/client/api/v1";


// Path: src/main/java/org/swarmcom/jsynapse/controller/client/api/v1/PresenceRestApi.java
import static java.lang.String.format;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.PUT;
import static org.swarmcom.jsynapse.controller.JsynapseApi.CLIENT_V1_API;
import com.fasterxml.jackson.annotation.JsonView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.swarmcom.jsynapse.controller.JsynapseApi;
import org.swarmcom.jsynapse.domain.Presence;
import org.swarmcom.jsynapse.domain.Presence.PresenceSummary;
import org.swarmcom.jsynapse.service.presence.PresenceService;
import javax.inject.Inject;
import javax.validation.Valid;

/*
 * (C) Copyright 2015 eZuce Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
*/
package org.swarmcom.jsynapse.controller.client.api.v1;




@RestController
@RequestMapping(value = CLIENT_V1_API)
public class PresenceRestApi extends JsynapseApi {
    private static final Logger LOGGER = LoggerFactory.getLogger(PresenceRestApi.class);
    private final PresenceService presenceService;

    @Inject
    public PresenceRestApi(final PresenceService presenceService) {