summaryrefslogtreecommitdiff
path: root/same/src/main/java/com/orbekk/same/services.proto
blob: 714905959795f0997b7d4ad28c76489237c74043 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package com.orbekk.same;

option java_generic_services = true;

message Empty {
}

message UpdateComponentResponse {
    required bool success = 1;
}

// Next tag: 9
message SystemStatus {
	repeated string extra_info = 7;
	
	optional MasterState master_status = 1;
	repeated Component master_state_component = 2;
	repeated string extra_master_info = 3;
	
	optional ClientState client_status = 4;
	optional MasterState client_master_status = 8;
	repeated Component client_state_component = 5;
	repeated string extra_client_info = 6;
}

message Component {
    required string id = 1;
    required string data = 2;
    required int64 revision = 3;
}

// Next tag: 6
message MasterState {
    optional string master_url = 1;
    optional int32 master_id = 2;
    optional string network_name = 3;
    optional string master_location = 4;
    optional int64 revision = 5;
}

message ClientState {
    optional string url = 1;
    optional string location = 2;
    optional int64 revision = 3;
}

message NetworkDirectory {
    repeated MasterState network = 1;
}

message PaxosRequest {
	optional ClientState client = 1;
	optional int32 proposalNumber = 2;
}

message PaxosResponse {
	optional int32 result = 1;
}

service Client {
    rpc SetState (Component) returns (Empty);
    rpc MasterTakeover (MasterState) returns (Empty);
    rpc MasterDown (MasterState) returns (Empty);
}

service Master {
    rpc JoinNetworkRequest (ClientState) returns (Empty);
    rpc UpdateStateRequest (Component) returns (UpdateComponentResponse);
}

service Directory {
    rpc RegisterNetwork (MasterState) returns (Empty);
    rpc GetNetworks (Empty) returns (NetworkDirectory);
}

service Paxos {
	rpc Propose (PaxosRequest) returns (PaxosResponse);
	rpc AcceptRequest (PaxosRequest) returns (PaxosResponse);
}

service SystemService {
	rpc GetSystemStatus (Empty) returns (SystemStatus);
}