Skip to content

Commit 9628141

Browse files
add open api prototype
1 parent e796069 commit 9628141

4 files changed

Lines changed: 459 additions & 447 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
The MIT License (MIT)
3+
4+
Copyright (c) 2010-2019 head systems, ltd
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of
7+
this software and associated documentation files (the "Software"), to deal in
8+
the Software without restriction, including without limitation the rights to
9+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10+
the Software, and to permit persons to whom the Software is furnished to do so,
11+
subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
23+
*/
24+
25+
package su.interference.api;
26+
27+
import java.lang.reflect.Field;
28+
29+
/**
30+
* @author Yuriy Glotanov
31+
* @since 1.0
32+
*/
33+
34+
public interface SerializerApi {
35+
/*
36+
serialize object, returns byte[]
37+
1st parameter - fully qualified class name (type)
38+
2nd parameter - instance of described class
39+
*/
40+
byte[] serialize (String t, Object o) throws Exception;
41+
/*
42+
deserialize byte array, returns object
43+
1st parameter - byte[]
44+
2nd parameter - field of class
45+
*/
46+
Object deserialize (byte[] b, Field f) throws Exception;
47+
Object deserialize (String v, String t) throws Exception;
48+
}
Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,41 @@
1-
/**
2-
The MIT License (MIT)
3-
4-
Copyright (c) 2010-2019 head systems, ltd
5-
6-
Permission is hereby granted, free of charge, to any person obtaining a copy of
7-
this software and associated documentation files (the "Software"), to deal in
8-
the Software without restriction, including without limitation the rights to
9-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10-
the Software, and to permit persons to whom the Software is furnished to do so,
11-
subject to the following conditions:
12-
13-
The above copyright notice and this permission notice shall be included in all
14-
copies or substantial portions of the Software.
15-
16-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22-
23-
*/
24-
25-
package su.interference.serialize;
26-
27-
import java.lang.reflect.Field;
28-
29-
/**
30-
* @author Yuriy Glotanov
31-
* @since 1.0
32-
*/
33-
34-
public interface Serializer {
35-
byte[] serialize (String t, Object fo) throws Exception;
36-
Object deserialize (byte[] b, Field f) throws Exception;
37-
Object deserialize (String v, String t) throws Exception;
38-
}
1+
/**
2+
The MIT License (MIT)
3+
4+
Copyright (c) 2010-2019 head systems, ltd
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of
7+
this software and associated documentation files (the "Software"), to deal in
8+
the Software without restriction, including without limitation the rights to
9+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10+
the Software, and to permit persons to whom the Software is furnished to do so,
11+
subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
23+
*/
24+
25+
package su.interference.api;
26+
27+
import su.interference.transport.TransportEvent;
28+
29+
/**
30+
* @author Yuriy Glotanov
31+
* @since 1.0
32+
*/
33+
34+
public interface TransportApi {
35+
36+
/*
37+
send transport event to the specific node
38+
*/
39+
void send(TransportEvent transportEvent);
40+
41+
}

0 commit comments

Comments
 (0)