publishToProbe have been added

This commit is contained in:
crusader 2017-09-27 20:21:44 +09:00
parent 905ebd6adf
commit 7c1df07898
3 changed files with 14 additions and 0 deletions

View File

@ -6,4 +6,6 @@ public interface MessagePublisher {
void publishToMember(final String channel, final String memberID, final String method, final Object... params);
void publishToDomain(final String channel, final Domain domain, final String method, final Object... params);
void publishToDomainByProbeKey(final String channel, final String probeKey, final String method, final Object... params);
void publishToProbe(final String channel, final String key, final String method, final Object... params);
}

View File

@ -104,11 +104,17 @@ public class NoAuthProbeService {
this.probeService.regist(probe);
this.noAuthProbeDAO.save(noAuthProbe);
messagePublisher.publishToProbe("/auth", noAuthProbe.getTempProbeKey(), "NoAuthProbeService.acceptNoAuthProbe", probe.getProbeKey());
return this.readAllByDomain(noAuthProbe.getDomain());
}
public List<NoAuthProbe> denyNoauthProbe(NoAuthProbe noAuthProbe) {
this.noAuthProbeDAO.save(noAuthProbe);
messagePublisher.publishToProbe("/auth", noAuthProbe.getTempProbeKey(), "NoAuthProbeService.denyNoauthProbe");
return this.readAllByDomain(noAuthProbe.getDomain());
}

View File

@ -54,6 +54,12 @@ public class RedisMessagePublisher implements MessagePublisher {
this.publish(channel, message, method, params);
}
public void publishToProbe(final String channel, final String key, final String method, final Object... params) {
PublishMessage message = new PublishMessage();
message.addTarget(key);
this.publish(channel, message, method, params);
}
@Cacheable("memberListByDomain")
protected List<String> getMemberListByDomain(final Domain domain) {
return this.getMemberList(memberService.readAllByDomain(domain));