aboutsummaryrefslogtreecommitdiff
path: root/central/src/main/java/moe/yuuta/dn42peering/peer/IPeerService.java
blob: 67240e0e16a5d626f7c911a9f805533412f218e5 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package moe.yuuta.dn42peering.peer;

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 javax.annotation.Nullable;
import java.util.List;

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

    @Nonnull
    static IPeerService createProxy(@Nonnull Vertx vertx) {
        return new IPeerServiceVertxEBProxy(vertx, ADDRESS);
    }

    @Fluent
    @Nonnull
    IPeerService listUnderASN(@Nonnull String asn, @Nonnull Handler<AsyncResult<List<Peer>>> handler);

    @Fluent
    @Nonnull
    IPeerService getSingle(@Nonnull String asn, String id, @Nonnull Handler<AsyncResult<Peer>> handler);

    @Fluent
    @Nonnull
    IPeerService deletePeer(@Nonnull String asn, String id, @Nonnull Handler<AsyncResult<Void>> handler);

    @Fluent
    @Nonnull
    IPeerService updateTo(@Nonnull Peer peer, @Nonnull Handler<AsyncResult<Void>> handler);

    @Fluent
    @Nonnull
    IPeerService addNew(@Nonnull Peer peer, @Nonnull Handler<AsyncResult<Long>> handler);

    @Fluent
    @Nonnull
    IPeerService existsUnderASN(@Nonnull String asn, @Nonnull Handler<AsyncResult<Boolean>> handler);

    @Fluent
    @Nonnull
    IPeerService isIPConflict(@Nonnull Peer.VPNType type, @Nullable String ipv4, @Nullable String ipv6, @Nonnull Handler<AsyncResult<Boolean>> handler);

    @Fluent
    @Nonnull
    IPeerService changeProvisionStatus(int id, @Nonnull ProvisionStatus provisionStatus, @Nonnull Handler<AsyncResult<Void>> handler);

    @Fluent
    @Nonnull
    IPeerService count(@Nonnull Handler<AsyncResult<Integer>> handler);

    @Fluent
    @Nonnull
    IPeerService listUnderNode(long nodeId,
                               @Nonnull Handler<AsyncResult<List<Peer>>> handler);
}