aboutsummaryrefslogtreecommitdiff
path: root/central/src/main/java/moe/yuuta/dn42peering/node/INodeService.java
blob: a7a5016935651c782706815cc75e55f488b5d175 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package moe.yuuta.dn42peering.node;

import io.vertx.codegen.annotations.Fluent;
import io.vertx.codegen.annotations.ProxyGen;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;

import javax.annotation.Nonnull;
import java.util.List;

@ProxyGen
public interface INodeService {
    String ADDRESS = INodeService.class.getName();

    @Nonnull
    static INodeService createProxy(@Nonnull Vertx vertx) {
        return new INodeServiceVertxEBProxy(vertx, ADDRESS);
    }

    @Fluent
    @Nonnull
    INodeService listNodes(@Nonnull Handler<AsyncResult<List<Node>>> handler);

    @Fluent
    @Nonnull
    INodeService getNode(int id, @Nonnull Handler<AsyncResult<Node>> handler);

    @Fluent
    @Nonnull
    INodeService addNew(@Nonnull Node node, @Nonnull Handler<AsyncResult<Long>> handler);

    @Fluent
    @Nonnull
    INodeService updateTo(@Nonnull Node node, @Nonnull Handler<AsyncResult<Long>> handler);

    @Fluent
    @Nonnull
    INodeService delete(int id, @Nonnull Handler<AsyncResult<Void>> handler);
}