Skip to content
Permalink
Browse files
Fixing last few namings (applicationName -> applicationIdentifier)
  • Loading branch information
mifosio-04-04-2018 committed May 29, 2017
1 parent cbf9066 commit 6df459ff7e9f0474514ba39cbdc8bdf382e2d981
Showing 4 changed files with 15 additions and 15 deletions.
@@ -63,7 +63,7 @@ public interface RhythmManager {
consumes = MediaType.APPLICATION_JSON_VALUE
)
Beat getBeat(
@PathVariable("applicationidentifier") final String applicationName,
@PathVariable("applicationidentifier") final String applicationIdentifier,
@PathVariable("beatidentifier") final String beatIdentifier);

@RequestMapping(
@@ -42,11 +42,11 @@ static List<Beat> map(final List<BeatEntity> entities) {
return ret;
}

static BeatEntity map(final String tenantIdentifier, final String applicationName, final Beat instance) {
static BeatEntity map(final String tenantIdentifier, final String applicationIdentifier, final Beat instance) {
final BeatEntity ret = new BeatEntity();
ret.setBeatIdentifier(instance.getIdentifier());
ret.setTenantIdentifier(tenantIdentifier);
ret.setApplicationIdentifier(applicationName);
ret.setApplicationIdentifier(applicationIdentifier);
ret.setAlignmentHour(instance.getAlignmentHour());
//First beat is today. If it's in the past, it will be created nearly immediately.
ret.setNextBeat(LocalDateTime.now(ZoneId.of("UTC")).truncatedTo(ChronoUnit.DAYS).plusHours(instance.getAlignmentHour()));
@@ -98,11 +98,11 @@ public Optional<LocalDateTime> checkBeatForPublish(
final LocalDateTime now,
final String beatIdentifier,
final String tenantIdentifier,
final String applicationName,
final String applicationIdentifier,
final Integer alignmentHour,
final LocalDateTime nextBeat) {
return checkBeatForPublishHelper(now, alignmentHour, nextBeat,
x -> beatPublisherService.publishBeat(beatIdentifier, tenantIdentifier, applicationName, x));
x -> beatPublisherService.publishBeat(beatIdentifier, tenantIdentifier, applicationIdentifier, x));
}

//Helper is separated from original function so that it can be unit-tested separately from publishBeat.
@@ -22,25 +22,25 @@
*/
@SuppressWarnings({"WeakerAccess", "unused"})
public class BeatPublishEvent {
String applicationName;
String applicationIdentifier;
String beatIdentifier;
String forTime;

public BeatPublishEvent() {
}

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

public String getApplicationName() {
return applicationName;
public String getApplicationIdentifier() {
return applicationIdentifier;
}

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

public String getBeatIdentifier() {
@@ -64,20 +64,20 @@ 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) &&
return Objects.equals(applicationIdentifier, that.applicationIdentifier) &&
Objects.equals(beatIdentifier, that.beatIdentifier) &&
Objects.equals(forTime, that.forTime);
}

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

@Override
public String toString() {
return "BeatPublishEvent{" +
"applicationName='" + applicationName + '\'' +
"applicationIdentifier='" + applicationIdentifier + '\'' +
", beatIdentifier='" + beatIdentifier + '\'' +
", forTime='" + forTime + '\'' +
'}';

0 comments on commit 6df459f

Please sign in to comment.