Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ipgallery
/
mde
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Registry
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
057dd961
authored
Jun 16, 2016
by
Eli Ben Baruch
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Some changes
parent
070b16da
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
30 additions
and
15 deletions
cfg/adapter.chicago.transportation.json
cfg/config.properties
cfg/services.chicago.transportation.json
doc/mde-service-flow.txt
src/main/java/handlers/MdeHandler.java
src/main/java/logic/MdeManager.java
src/main/java/logic/adapter/BaseAdapter.java
src/main/java/logic/adapter/HttpAdapter/HttpAdapter.java
src/main/java/logic/adapter/HttpAdapter/DataHttpAdapter.java → src/main/java/logic/adapter/HttpAdapter/model/DataHttpAdapter.java
src/main/java/logic/adapter/HttpAdapter/DataHttpAdapterApi.java → src/main/java/logic/adapter/HttpAdapter/model/DataHttpAdapterApi.java
cfg/adapter.chicago.transportation.json
View file @
057dd961
...
...
@@ -4,9 +4,11 @@
"apiList"
:
[{
"id"
:
"getroutes"
,
"method"
:
"GET"
,
"headers"
:
null
,
"content"
:
null
,
"path"
:
"getroutes"
,
"QueryParams"
:
[{
"key"
:
"$
config$chicago.transportation
.key"
"key"
:
"$
query
.key"
}]
}]
}
\ No newline at end of file
cfg/config.properties
View file @
057dd961
...
...
@@ -8,4 +8,3 @@ server.port=50040
server.host
=
0.0.0.0
server.worker.threads
=
6
chicago.transportation.key
=
gT2nciTKwRv6Jy5njqm8fe7LW
\ No newline at end of file
cfg/services.chicago.transportation.json
View file @
057dd961
{
"services"
:
[{
"apiId"
:
"
get
routes"
,
"apiId"
:
"routes"
,
"actions"
:
[{
"id"
:
"forwardRequest"
,
"adapterId"
:
"adapter.chicago.transportation"
,
...
...
doc/mde-service-flow.txt
View file @
057dd961
...
...
@@ -61,7 +61,7 @@ Flow
GET http://www.ctabustracker.com/bustime/api/v1/getroutes?key=gT2nciTKwRv6Jy5njqm8fe7LW
GET ../mde/{tenantId}/{serviceId}/{apiId}
GET ../mde/{tenantId}/{serviceId}/{apiId}
?key=gT2nciTKwRv6Jy5njqm8fe7LW
mde.HandleRequest(reqCtx)
{
...
...
src/main/java/handlers/MdeHandler.java
View file @
057dd961
...
...
@@ -43,12 +43,10 @@ public class MdeHandler extends BaseHandler {
public
void
doRead
(
RequestContext
requestContext
)
{
// GET ../mde/{tenantId}/{serviceId}/{apiId}
String
tenantId
=
requestContext
.
params
[
0
];
String
serviceId
=
requestContext
.
params
[
1
];
String
apiId
=
requestContext
.
params
[
2
];
HttpAdapter
httpAdapter
=
new
HttpAdapter
();
httpAdapter
.
handleRequest
(
requestContext
);
mdeManager
.
doRead
(
requestContext
);
}
@Override
...
...
src/main/java/logic/MdeManager.java
View file @
057dd961
...
...
@@ -2,6 +2,7 @@ package logic;
import
logic.adapter.BaseAdapter
;
import
logic.adapter.HttpAdapter.HttpAdapter
;
import
microservice.RequestContext
;
import
microservice.io.iface.ILogger
;
import
java.util.Map
;
...
...
@@ -36,4 +37,15 @@ public class MdeManager {
AdapterList
.
put
(
"aaa"
,
httpAdapter
);
}
public
void
doRead
(
RequestContext
requestContext
)
{
String
tenantId
=
requestContext
.
params
[
0
];
String
serviceId
=
requestContext
.
params
[
1
];
String
apiId
=
requestContext
.
params
[
2
];
HttpAdapter
httpAdapter
=
new
HttpAdapter
();
httpAdapter
.
doRead
(
requestContext
);
}
}
src/main/java/logic/adapter/BaseAdapter.java
View file @
057dd961
...
...
@@ -7,6 +7,9 @@ import microservice.RequestContext;
*/
public
abstract
class
BaseAdapter
{
public
void
handleRequest
(
RequestContext
requestContext
)
{
}
public
void
doRead
(
RequestContext
requestContext
)
{};
public
void
doCreate
(
RequestContext
requestContext
)
{};
public
void
doUpdate
(
RequestContext
requestContext
)
{};
public
void
doDelete
(
RequestContext
requestContext
)
{};
}
src/main/java/logic/adapter/HttpAdapter/HttpAdapter.java
View file @
057dd961
...
...
@@ -19,7 +19,7 @@ public class HttpAdapter extends BaseAdapter {
return
LoadFromFile
(
id
);
}
public
void
handleRequest
(
RequestContext
requestContext
)
{
public
void
doRead
(
RequestContext
requestContext
)
{
String
tenantId
=
requestContext
.
params
[
0
];
String
serviceId
=
requestContext
.
params
[
1
];
...
...
src/main/java/logic/adapter/HttpAdapter/DataHttpAdapter.java
→
src/main/java/logic/adapter/HttpAdapter/
model/
DataHttpAdapter.java
View file @
057dd961
package
logic
.
adapter
.
HttpAdapter
;
package
logic
.
adapter
.
HttpAdapter
.
model
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
src/main/java/logic/adapter/HttpAdapter/DataHttpAdapterApi.java
→
src/main/java/logic/adapter/HttpAdapter/
model/
DataHttpAdapterApi.java
View file @
057dd961
package
logic
.
adapter
.
HttpAdapter
;
package
logic
.
adapter
.
HttpAdapter
.
model
;
import
java.util.List
;
...
...
@@ -11,6 +11,7 @@ public class DataHttpAdapterApi {
public
String
method
=
null
;
public
String
uri
=
null
;
public
String
content
=
null
;
public
List
<
String
>
headerList
=
null
;
public
List
<
String
>
pathList
=
null
;
public
List
<
String
>
queryParamsList
=
null
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment