// Path: src/main/java/com/nebhale/buildmonitor/domain/Project.java
// @Entity
// public final class Project {
// 
//     @Id
//     @Size(min = 1, max = 8)
//     private volatile String key;
// 
//     @Size(min = 1, max = 64)
//     private volatile String name;
// 
//     Project() {
//     }
// 
//     /**
//      * Creates a new instance
//      *
//      * @param key  the key of the project
//      * @param name the name of the project
//      */
//     public Project(String key, String name) {
//         this.key = key.toUpperCase();
//         this.name = name;
//     }
// 
//     /**
//      * Returns the key of the project
//      *
//      * @return the key of the project
//      */
//     public String getKey() {
//         return this.key;
//     }
// 
//     /**
//      * Returns the name of the project
//      *
//      * @return the name of the project
//      */
//     public String getName() {
//         return this.name;
//     }
// 
// }
// 
// Path: src/main/java/com/nebhale/buildmonitor/repository/ProjectRepository.java
// public interface ProjectRepository extends JpaRepository<Project, String> {
// 
// }
// 
// Path: src/main/java/com/nebhale/buildmonitor/web/resource/ProjectResourceAssembler.java
// public interface ProjectResourceAssembler extends ResourceAssembler<Project, Resource<Project>> {
// 
// }


import com.nebhale.buildmonitor.domain.Project;
import com.nebhale.buildmonitor.repository.ProjectRepository;
import com.nebhale.buildmonitor.web.resource.ProjectResourceAssembler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.hateoas.Resource;
import org.springframework.messaging.core.MessageSendingOperations;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.stream.Collectors;
/*
 * Copyright 2013-2014 the original author or authors.
 *
 * 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 com.nebhale.buildmonitor.web.notify;



@Component
final class MessagingProjectsChangedNotifier implements ProjectsChangedNotifier {

    private final MessageSendingOperations<String> messageTemplate;

    private final ProjectRepository repository;

    private final ProjectResourceAssembler resourceAssembler;

    @Autowired
// Path: src/main/java/com/nebhale/buildmonitor/domain/Project.java
// @Entity
// public final class Project {
// 
//     @Id
//     @Size(min = 1, max = 8)
//     private volatile String key;
// 
//     @Size(min = 1, max = 64)
//     private volatile String name;
// 
//     Project() {
//     }
// 
//     /**
//      * Creates a new instance
//      *
//      * @param key  the key of the project
//      * @param name the name of the project
//      */
//     public Project(String key, String name) {
//         this.key = key.toUpperCase();
//         this.name = name;
//     }
// 
//     /**
//      * Returns the key of the project
//      *
//      * @return the key of the project
//      */
//     public String getKey() {
//         return this.key;
//     }
// 
//     /**
//      * Returns the name of the project
//      *
//      * @return the name of the project
//      */
//     public String getName() {
//         return this.name;
//     }
// 
// }
// 
// Path: src/main/java/com/nebhale/buildmonitor/repository/ProjectRepository.java
// public interface ProjectRepository extends JpaRepository<Project, String> {
// 
// }
// 
// Path: src/main/java/com/nebhale/buildmonitor/web/resource/ProjectResourceAssembler.java
// public interface ProjectResourceAssembler extends ResourceAssembler<Project, Resource<Project>> {
// 
// }


// Path: src/main/java/com/nebhale/buildmonitor/web/notify/MessagingProjectsChangedNotifier.java
import com.nebhale.buildmonitor.domain.Project;
import com.nebhale.buildmonitor.repository.ProjectRepository;
import com.nebhale.buildmonitor.web.resource.ProjectResourceAssembler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.hateoas.Resource;
import org.springframework.messaging.core.MessageSendingOperations;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.stream.Collectors;

/*
 * Copyright 2013-2014 the original author or authors.
 *
 * 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 com.nebhale.buildmonitor.web.notify;



@Component
final class MessagingProjectsChangedNotifier implements ProjectsChangedNotifier {

    private final MessageSendingOperations<String> messageTemplate;

    private final ProjectRepository repository;

    private final ProjectResourceAssembler resourceAssembler;

    @Autowired
    MessagingProjectsChangedNotifier(MessageSendingOperations<String> messageTemplate, ProjectRepository repository,