Skip to content
Permalink
Browse files
Adjustments to spi.
  • Loading branch information
mifosio-04-04-2018 committed May 23, 2017
1 parent 49ade43 commit 44f3fc061d9cfd7a29f2333a603f27fbfa1b80bd
Showing 4 changed files with 118 additions and 3 deletions.
@@ -18,6 +18,8 @@ dependencies {
compile(
[group: 'org.springframework.cloud', name: 'spring-cloud-starter-feign'],
[group: 'io.mifos.core', name: 'api', version: versions.frameworkapi],
[group: 'io.mifos.core', name: 'cassandra', version: versions.frameworkcassandra],
[group: 'io.mifos.core', name: 'command', version: versions.frameworkcommand],
[group: 'org.hibernate', name: 'hibernate-validator', version: versions.validator],
[group: 'org.hibernate', name: 'hibernate-validator-annotation-processor', version: versions.validator]
)
@@ -18,18 +18,19 @@
import io.mifos.rhythm.spi.v1.domain.BeatPublish;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
* @author Myrle Krantz
*/
@SuppressWarnings("unused")
@FeignClient(path="/beatlistener/v1")
@FeignClient
public interface BeatListener {
String PUBLISH_BEAT_PATH = "/beatlistener/v1/publishedbeats";

@RequestMapping(
value = "/publishedbeats",
value = PUBLISH_BEAT_PATH,
method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_VALUE,
consumes = MediaType.APPLICATION_JSON_VALUE
@@ -0,0 +1,85 @@
/*
* Copyright 2017 The Mifos Initiative.
*
* 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 io.mifos.rhythm.spi.v1.events;

import java.util.Objects;

/**
* @author Myrle Krantz
*/
@SuppressWarnings({"WeakerAccess", "unused"})
public class BeatPublishEvent {
String applicationName;
String beatIdentifier;
String forTime;

public BeatPublishEvent() {
}

public BeatPublishEvent(String applicationName, String beatIdentifier, String forTime) {
this.applicationName = applicationName;
this.beatIdentifier = beatIdentifier;
this.forTime = forTime;
}

public String getApplicationName() {
return applicationName;
}

public void setApplicationName(String applicationName) {
this.applicationName = applicationName;
}

public String getBeatIdentifier() {
return beatIdentifier;
}

public void setBeatIdentifier(String beatIdentifier) {
this.beatIdentifier = beatIdentifier;
}

public String getForTime() {
return forTime;
}

public void setForTime(String forTime) {
this.forTime = forTime;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BeatPublishEvent that = (BeatPublishEvent) o;
return Objects.equals(applicationName, that.applicationName) &&
Objects.equals(beatIdentifier, that.beatIdentifier) &&
Objects.equals(forTime, that.forTime);
}

@Override
public int hashCode() {
return Objects.hash(applicationName, beatIdentifier, forTime);
}

@Override
public String toString() {
return "BeatPublishEvent{" +
"applicationName='" + applicationName + '\'' +
", beatIdentifier='" + beatIdentifier + '\'' +
", forTime='" + forTime + '\'' +
'}';
}
}
@@ -0,0 +1,27 @@
/*
* Copyright 2017 The Mifos Initiative.
*
* 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 io.mifos.rhythm.spi.v1.events;

/**
* @author Myrle Krantz
*/
@SuppressWarnings("unused")
public interface EventConstants {
String DESTINATION = "beats-v1";
String SELECTOR_NAME = "action";
String POST_PUBLISHEDBEAT = "post-publishedbeat";
String SELECTOR_POST_PUBLISHEDBEAT = SELECTOR_NAME + " = '" + POST_PUBLISHEDBEAT + "'";
}

0 comments on commit 44f3fc0

Please sign in to comment.