Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ipgallery.common.java
/
microservice
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
f00c99e6
authored
May 09, 2017
by
amir
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
first working service - server only
parent
782f84dc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
176 additions
and
93 deletions
doc/todo.txt
src/main/java/microservice/MicroserviceApp.java
src/main/java/microservice/RequestContext.java → src/main/java/microservice/RestContext.java
src/main/java/microservice/defs/Enums.java
src/main/java/microservice/handlers/BaseHandler.java
src/main/java/microservice/handlers/MBIHandler.java
src/main/java/microservice/handlers/MonitorHandler.java
src/main/java/microservice/handlers/Reactor.java
src/main/java/microservice/handlers/RestHandler.java
src/main/java/microservice/io/iface/CommonServices.java
src/main/java/microservice/io/impl/service/IPubSubServiceMqttImpl.java
src/main/java/microservice/io/impl/service/IRestServiceHttpImpl.java
src/main/java/microservice/types/UserProfile.java
src/test/java/microservice/TestMicroserviceApp.java
doc/todo.txt
View file @
f00c99e6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# new services design
# new services design
- counters and metrics in the reactor
- counters and metrics in the reactor
- validateRequest in RestService , the jwt issues
- validateRequest in RestService , the jwt issues
- Add monitoring apis
- All the validation ,pre/post handling that was were done by the handler will be done by the base service
- All the validation ,pre/post handling that was were done by the handler will be done by the base service
- add Runtime Test:
- add Runtime Test:
addTest(const char *testName, nsMicroservice_Iface::TestFunction testFunction);
addTest(const char *testName, nsMicroservice_Iface::TestFunction testFunction);
...
...
src/main/java/microservice/MicroserviceApp.java
View file @
f00c99e6
...
@@ -24,6 +24,7 @@ import java.util.*;
...
@@ -24,6 +24,7 @@ import java.util.*;
import
java.util.Map.Entry
;
import
java.util.Map.Entry
;
import
java.util.function.BiConsumer
;
import
java.util.function.BiConsumer
;
import
java.util.function.Consumer
;
import
java.util.function.Consumer
;
import
java.util.stream.Stream
;
import
static
io
.
undertow
.
Handlers
.
resource
;
import
static
io
.
undertow
.
Handlers
.
resource
;
...
@@ -102,6 +103,12 @@ public class MicroserviceApp
...
@@ -102,6 +103,12 @@ public class MicroserviceApp
return
appName
;
return
appName
;
}
}
public
String
getId
()
{
return
id
;
}
public
boolean
isEnableDefaultServiceAuthorization
()
{
return
enableDefaultServiceAuthorization
;
}
/*************************
/*************************
* WITH SECTION
* WITH SECTION
*************************/
*************************/
...
@@ -517,17 +524,17 @@ public class MicroserviceApp
...
@@ -517,17 +524,17 @@ public class MicroserviceApp
/*************************************************************************/
/*************************************************************************/
//
//
/// the services array
/// the services array
private
final
List
<
Map
<
String
,
CommonServices
.
IService
>>
servicesArray
=
new
ArrayList
<>(
Enums
.
EnumServiceType
.
values
().
length
);
//
private final List<Map<String,CommonServices.IService>> servicesArray = new ArrayList<>(Enums.EnumServiceType.values().length);
private
final
Map
<
String
,
CommonServices
.
IService
>[]
servicesArray
=
new
Map
[
Enums
.
EnumServiceType
.
values
().
length
];
public
MicroserviceApp
addService
(
Enums
.
EnumServiceType
serviceType
,
public
MicroserviceApp
addService
(
Enums
.
EnumServiceType
serviceType
,
CommonServices
.
IService
iService
,
CommonServices
.
IService
iService
,
String
serviceKey
)
String
serviceKey
)
{
{
Map
<
String
,
CommonServices
.
IService
>
serviceMap
=
servicesArray
.
get
(
serviceType
.
ordinal
())
;
Map
<
String
,
CommonServices
.
IService
>
serviceMap
=
servicesArray
[
serviceType
.
ordinal
()]
;
if
(
serviceMap
==
null
){
if
(
serviceMap
==
null
){
serviceMap
=
new
HashMap
<>();
serviceMap
=
new
HashMap
<>();
servicesArray
.
set
(
serviceType
.
ordinal
(),
serviceMap
)
;
servicesArray
[
serviceType
.
ordinal
()]
=
serviceMap
;
}
}
serviceMap
.
put
(
serviceKey
,
iService
);
serviceMap
.
put
(
serviceKey
,
iService
);
iService
.
setReactor
(
reactor
);
iService
.
setReactor
(
reactor
);
...
@@ -535,14 +542,14 @@ public class MicroserviceApp
...
@@ -535,14 +542,14 @@ public class MicroserviceApp
}
}
CommonServices
.
IService
getService
(
Enums
.
EnumServiceType
serviceType
,
String
serviceKey
){
CommonServices
.
IService
getService
(
Enums
.
EnumServiceType
serviceType
,
String
serviceKey
){
Map
<
String
,
CommonServices
.
IService
>
serviceMap
=
servicesArray
.
get
(
serviceType
.
ordinal
())
;
Map
<
String
,
CommonServices
.
IService
>
serviceMap
=
servicesArray
[
serviceType
.
ordinal
()]
;
if
(
serviceMap
!=
null
)
if
(
serviceMap
!=
null
)
return
serviceMap
.
get
(
serviceKey
);
return
serviceMap
.
get
(
serviceKey
);
return
null
;
return
null
;
}
}
CommonServices
.
IService
getService
(
String
serviceKey
){
CommonServices
.
IService
getService
(
String
serviceKey
){
Optional
<
CommonServices
.
IService
>
iServiceOptional
=
servicesArray
.
stream
(
)
Optional
<
CommonServices
.
IService
>
iServiceOptional
=
Arrays
.
stream
(
servicesArray
)
.
filter
(
serviceMap
->
serviceMap
!=
null
&&
serviceMap
.
containsKey
(
serviceKey
))
.
filter
(
serviceMap
->
serviceMap
!=
null
&&
serviceMap
.
containsKey
(
serviceKey
))
.
map
(
serviceMap
->
serviceMap
.
get
(
serviceKey
))
.
map
(
serviceMap
->
serviceMap
.
get
(
serviceKey
))
.
findFirst
();
.
findFirst
();
...
@@ -593,38 +600,45 @@ public class MicroserviceApp
...
@@ -593,38 +600,45 @@ public class MicroserviceApp
/**
/**
* init services
* init services
* iterating only over non empty elements
*/
*/
servicesArray
.
stream
().
forEach
(
servicesMap
->
{
Arrays
.
stream
(
servicesArray
)
servicesMap
.
forEach
(
(
serviceKey
,
service
)
->
{
.
filter
(
p
->
p
!=
null
)
service
.
init
();
.
forEach
(
servicesMap
->
});
servicesMap
.
forEach
((
serviceKey
,
service
)
->
{
});
service
.
init
();
service
.
register
(
serviceDiscovery
,
id
);
})
);
return
this
;
return
this
;
}
}
public
void
_run
()
{
public
void
_run
()
{
if
(!
servicesArray
.
isEmpty
())
/**
* מי מתחכם זה מיקו!!!
*/
if
(
Arrays
.
stream
(
servicesArray
)
.
filter
(
p
->
p
!=
null
)
.
count
()
>
0
)
{
{
if
(
this
.
enableMetrics
)
{
if
(
this
.
enableMetrics
)
{
IMetricsFactoryImpl
.
getInstance
().
startReporting
(
appName
);
IMetricsFactoryImpl
.
getInstance
().
startReporting
(
appName
);
}
}
servicesArray
.
stream
().
forEach
(
servicesMap
->
{
Arrays
.
stream
(
servicesArray
)
servicesMap
.
forEach
(
(
serviceKey
,
service
)
->
{
.
filter
(
p
->
p
!=
null
)
service
.
run
();
.
forEach
(
servicesMap
->
});
servicesMap
.
forEach
(
(
serviceKey
,
service
)
->
service
.
run
()
)
);
});
Runtime
.
getRuntime
().
addShutdownHook
(
new
Thread
(()
->
{
Runtime
.
getRuntime
().
addShutdownHook
(
new
Thread
(()
->
{
try
{
try
{
servicesArray
.
stream
().
forEach
(
servicesMap
->
{
Arrays
.
stream
(
servicesArray
)
servicesMap
.
forEach
(
(
serviceKey
,
service
)
->
{
.
filter
(
p
->
p
!=
null
)
service
.
shutdown
();
.
forEach
(
servicesMap
->
});
servicesMap
.
forEach
(
(
serviceKey
,
service
)
->
service
.
shutdown
()
)
);
});
// notify main
// notify main
notifyAll
();
notifyAll
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -645,7 +659,7 @@ public class MicroserviceApp
...
@@ -645,7 +659,7 @@ public class MicroserviceApp
}
}
else
else
{
{
System
.
out
.
println
(
"no serv
er
/s...exit!"
);
System
.
out
.
println
(
"no serv
ice
/s...exit!"
);
}
}
}
}
...
...
src/main/java/microservice/Re
que
stContext.java
→
src/main/java/microservice/RestContext.java
View file @
f00c99e6
...
@@ -6,17 +6,19 @@ import java.util.Map;
...
@@ -6,17 +6,19 @@ import java.util.Map;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
microservice.defs.Enums
;
import
microservice.defs.Enums
;
import
microservice.io.iface.CommonServices
;
import
microservice.io.iface.IContainer
;
import
microservice.io.iface.IContainer
;
import
microservice.io.iface.IRequest
;
import
microservice.io.iface.IRequest
;
import
microservice.io.iface.IResponse
;
import
microservice.io.iface.IResponse
;
import
microservice.types.UserProfile
;
import
microservice.types.UserProfile
;
public
class
Re
quest
Context
public
class
Re
stContext
implements
CommonServices
.
IMsg
Context
{
{
public
String
[]
params
=
null
;
public
String
[]
params
=
null
;
public
Map
<
String
,
Deque
<
String
>>
queryParameters
=
null
;
public
Map
<
String
,
Deque
<
String
>>
queryParameters
=
null
;
public
Map
<
String
,
String
>
pathParameters
=
null
;
// request-interface
// request-interface
// response interface
// response interface
public
IContainer
container
;
public
IContainer
container
;
...
@@ -25,7 +27,7 @@ public class RequestContext
...
@@ -25,7 +27,7 @@ public class RequestContext
public
ObjectMapper
objMapper
;
public
ObjectMapper
objMapper
;
public
String
rcid
;
// request correlation id
public
String
rcid
;
// request correlation id
public
UserProfile
userProfile
;
public
UserProfile
userProfile
;
public
Enums
.
EnumCrudMethod
enumCrudMethod
;
public
CommonServices
.
EnumRestCommands
enumRestCommands
;
public
String
getParameter
(
String
paramName
)
{
public
String
getParameter
(
String
paramName
)
{
...
@@ -34,4 +36,16 @@ public class RequestContext
...
@@ -34,4 +36,16 @@ public class RequestContext
else
else
return
null
;
return
null
;
}
}
public
String
getPathParameter
(
String
paramName
)
{
if
(
pathParameters
!=
null
)
return
pathParameters
.
get
(
paramName
);
else
return
null
;
}
@Override
public
void
setParameters
(
Map
<
String
,
String
>
parameters
)
{
pathParameters
=
parameters
;
}
}
}
src/main/java/microservice/defs/Enums.java
View file @
f00c99e6
...
@@ -80,5 +80,10 @@ public class Enums
...
@@ -80,5 +80,10 @@ public class Enums
E_PUBSUB
E_PUBSUB
}
}
public
enum
EnumAuthenticationType
{
DEFAULT
,
NONE
,
JWT
,
FORM
}
}
}
src/main/java/microservice/handlers/BaseHandler.java
View file @
f00c99e6
...
@@ -6,7 +6,7 @@ import com.fasterxml.jackson.databind.JsonNode;
...
@@ -6,7 +6,7 @@ import com.fasterxml.jackson.databind.JsonNode;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
microservice.MicroserviceApp
;
import
microservice.MicroserviceApp
;
import
microservice.Re
que
stContext
;
import
microservice.RestContext
;
import
microservice.io.iface.IConfiguration
;
import
microservice.io.iface.IConfiguration
;
import
microservice.io.iface.IContainer
;
import
microservice.io.iface.IContainer
;
import
microservice.io.iface.ILogger
;
import
microservice.io.iface.ILogger
;
...
@@ -29,7 +29,6 @@ public abstract class BaseHandler
...
@@ -29,7 +29,6 @@ public abstract class BaseHandler
protected
EnumAuthenticationType
authType
=
EnumAuthenticationType
.
DEFAULT
;
protected
EnumAuthenticationType
authType
=
EnumAuthenticationType
.
DEFAULT
;
/*
/*
* SOME HELPERS
* SOME HELPERS
*/
*/
...
@@ -74,27 +73,27 @@ public abstract class BaseHandler
...
@@ -74,27 +73,27 @@ public abstract class BaseHandler
}
}
public
void
sendErrorResp
(
Re
que
stContext
reqCtx
,
String
error
)
public
void
sendErrorResp
(
RestContext
reqCtx
,
String
error
)
{
{
reqCtx
.
container
.
sendErrorResp
(
reqCtx
.
response
,
error
);
reqCtx
.
container
.
sendErrorResp
(
reqCtx
.
response
,
error
);
}
}
public
void
writeObjectToResponse
(
Re
que
stContext
reqCtx
,
Object
value
)
public
void
writeObjectToResponse
(
RestContext
reqCtx
,
Object
value
)
{
{
reqCtx
.
container
.
writeObjectToResponse
(
reqCtx
.
response
,
value
);
reqCtx
.
container
.
writeObjectToResponse
(
reqCtx
.
response
,
value
);
}
}
public
Object
readObjectFromRequest
(
Re
questContext
reqCtx
,
Class
<?>
ObjClass
)
public
Object
readObjectFromRequest
(
Re
stContext
reqCtx
,
Class
<?>
ObjClass
)
{
{
return
reqCtx
.
container
.
readObjectFromRequest
(
reqCtx
.
request
,
ObjClass
);
return
reqCtx
.
container
.
readObjectFromRequest
(
reqCtx
.
request
,
ObjClass
);
}
}
public
void
subscribe
(
Re
questContext
reqCtx
,
String
topic
,
INotifyCallback
notifyHandler
)
public
void
subscribe
(
Re
stContext
reqCtx
,
String
topic
,
INotifyCallback
notifyHandler
)
{
{
reqCtx
.
container
.
subscribe
(
topic
,
notifyHandler
);
reqCtx
.
container
.
subscribe
(
topic
,
notifyHandler
);
}
}
public
void
unsubscribe
(
Re
questContext
reqCtx
,
String
topic
)
public
void
unsubscribe
(
Re
stContext
reqCtx
,
String
topic
)
{
{
reqCtx
.
container
.
unsubscribe
(
topic
);
reqCtx
.
container
.
unsubscribe
(
topic
);
}
}
...
@@ -113,7 +112,7 @@ public abstract class BaseHandler
...
@@ -113,7 +112,7 @@ public abstract class BaseHandler
optContainer
.
ifPresent
(
container
->
container
.
unsubscribe
(
topic
));
optContainer
.
ifPresent
(
container
->
container
.
unsubscribe
(
topic
));
}
}
public
void
publish
(
Re
questContext
reqCtx
,
String
topic
,
JsonNode
messageNode
)
public
void
publish
(
Re
stContext
reqCtx
,
String
topic
,
JsonNode
messageNode
)
{
{
reqCtx
.
container
.
publish
(
topic
,
messageNode
);
reqCtx
.
container
.
publish
(
topic
,
messageNode
);
}
}
...
@@ -157,32 +156,32 @@ public abstract class BaseHandler
...
@@ -157,32 +156,32 @@ public abstract class BaseHandler
* the create/post of CRUD
* the create/post of CRUD
* @param reqCtx
* @param reqCtx
*/
*/
public
abstract
void
doCreate
(
Re
que
stContext
reqCtx
);
public
abstract
void
doCreate
(
RestContext
reqCtx
);
/**
/**
* the read/get of CRUD
* the read/get of CRUD
* @param reqCtx
* @param reqCtx
*/
*/
public
abstract
void
doRead
(
Re
que
stContext
reqCtx
);
public
abstract
void
doRead
(
RestContext
reqCtx
);
/**
/**
* the update/put of CRUD
* the update/put of CRUD
* @param reqCtx
* @param reqCtx
*/
*/
public
abstract
void
doUpdate
(
Re
que
stContext
reqCtx
);
public
abstract
void
doUpdate
(
RestContext
reqCtx
);
/**
/**
* the delete of CRUD
* the delete of CRUD
* @param reqCtx
* @param reqCtx
*/
*/
public
abstract
void
doDelete
(
Re
que
stContext
reqCtx
);
public
abstract
void
doDelete
(
RestContext
reqCtx
);
/**
/**
* represents simple send message - not a rest command
* represents simple send message - not a rest command
* @param reqCtx
* @param reqCtx
*/
*/
public
void
doMessage
(
Re
que
stContext
reqCtx
)
{};
public
void
doMessage
(
RestContext
reqCtx
)
{};
/**
/**
* reloading configuration or other data
* reloading configuration or other data
...
...
src/main/java/microservice/handlers/MBIHandler.java
View file @
f00c99e6
...
@@ -5,7 +5,7 @@ import java.util.Deque;
...
@@ -5,7 +5,7 @@ import java.util.Deque;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
microservice.Re
que
stContext
;
import
microservice.RestContext
;
import
microservice.defs.Constants
;
import
microservice.defs.Constants
;
import
microservice.defs.Enums.EnumHttpMethod
;
import
microservice.defs.Enums.EnumHttpMethod
;
import
microservice.io.iface.*
;
import
microservice.io.iface.*
;
...
@@ -40,7 +40,7 @@ public class MBIHandler extends RMQHandler implements IContainer
...
@@ -40,7 +40,7 @@ public class MBIHandler extends RMQHandler implements IContainer
@Override
@Override
public
void
handleRequest
(
RMQMessage
request
)
throws
Exception
public
void
handleRequest
(
RMQMessage
request
)
throws
Exception
{
{
Re
que
stContext
reqContext
=
getRequestContext
(
request
);
RestContext
reqContext
=
getRequestContext
(
request
);
if
(
reqContext
!=
null
)
if
(
reqContext
!=
null
)
{
{
String
sMethod
=
request
.
getParameterByName
(
RMQRestRequest
.
METHOD
);
String
sMethod
=
request
.
getParameterByName
(
RMQRestRequest
.
METHOD
);
...
@@ -88,9 +88,9 @@ public class MBIHandler extends RMQHandler implements IContainer
...
@@ -88,9 +88,9 @@ public class MBIHandler extends RMQHandler implements IContainer
* @param exchange
* @param exchange
* @return
* @return
*/
*/
private
Re
que
stContext
getRequestContext
(
RMQMessage
request
)
private
RestContext
getRequestContext
(
RMQMessage
request
)
{
{
Re
questContext
reqCtx
=
new
Requ
estContext
();
Re
stContext
reqCtx
=
new
R
estContext
();
reqCtx
.
container
=
this
;
reqCtx
.
container
=
this
;
reqCtx
.
request
=
new
IRequestMBIImpl
(
request
);
reqCtx
.
request
=
new
IRequestMBIImpl
(
request
);
reqCtx
.
response
=
new
IResponseMBIImpl
(
request
,
listenerRmqId
,
logger
);
reqCtx
.
response
=
new
IResponseMBIImpl
(
request
,
listenerRmqId
,
logger
);
...
@@ -131,28 +131,28 @@ public class MBIHandler extends RMQHandler implements IContainer
...
@@ -131,28 +131,28 @@ public class MBIHandler extends RMQHandler implements IContainer
return
paramsMap
;
return
paramsMap
;
}
}
public
void
doGet
(
Re
que
stContext
reqCtx
)
public
void
doGet
(
RestContext
reqCtx
)
{
{
msHandler
.
doRead
(
reqCtx
);
msHandler
.
doRead
(
reqCtx
);
}
}
public
void
doPost
(
Re
que
stContext
reqCtx
)
public
void
doPost
(
RestContext
reqCtx
)
{
{
msHandler
.
doCreate
(
reqCtx
);
msHandler
.
doCreate
(
reqCtx
);
}
}
public
void
doPut
(
Re
que
stContext
reqCtx
)
public
void
doPut
(
RestContext
reqCtx
)
{
{
msHandler
.
doUpdate
(
reqCtx
);
msHandler
.
doUpdate
(
reqCtx
);
}
}
public
void
doDelete
(
Re
que
stContext
reqCtx
)
public
void
doDelete
(
RestContext
reqCtx
)
{
{
msHandler
.
doDelete
(
reqCtx
);
msHandler
.
doDelete
(
reqCtx
);
}
}
public
void
doMessage
(
Re
que
stContext
reqCtx
)
public
void
doMessage
(
RestContext
reqCtx
)
{
{
msHandler
.
doMessage
(
reqCtx
);
msHandler
.
doMessage
(
reqCtx
);
}
}
...
...
src/main/java/microservice/handlers/MonitorHandler.java
View file @
f00c99e6
...
@@ -6,9 +6,7 @@ import java.util.List;
...
@@ -6,9 +6,7 @@ import java.util.List;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
microservice.io.impl.IMetricsFactoryImpl
;
import
microservice.io.impl.IMetricsFactoryImpl
;
import
microservice.types.BaseRestResponse
;
import
microservice.types.BaseRestResponse
;
import
microservice.MicroserviceApp
;
import
microservice.RestContext
;
import
microservice.RequestContext
;
import
microservice.io.iface.IContainer
;
/**
/**
* this class is for monitoring the microservice
* this class is for monitoring the microservice
...
@@ -35,7 +33,7 @@ public class MonitorHandler extends BaseHandler
...
@@ -35,7 +33,7 @@ public class MonitorHandler extends BaseHandler
}
}
@Override
@Override
public
void
doCreate
(
Re
que
stContext
reqCtx
)
public
void
doCreate
(
RestContext
reqCtx
)
{
{
switch
(
reqCtx
.
params
[
0
])
switch
(
reqCtx
.
params
[
0
])
{
{
...
@@ -49,7 +47,7 @@ public class MonitorHandler extends BaseHandler
...
@@ -49,7 +47,7 @@ public class MonitorHandler extends BaseHandler
}
}
private
void
printStats
(
Re
que
stContext
reqCtx
)
{
private
void
printStats
(
RestContext
reqCtx
)
{
BaseRestResponse
brr
=
new
BaseRestResponse
(
true
,
null
);
BaseRestResponse
brr
=
new
BaseRestResponse
(
true
,
null
);
IMetricsFactoryImpl
factoryImpl
=
(
IMetricsFactoryImpl
)
IMetricsFactoryImpl
.
getInstance
();
IMetricsFactoryImpl
factoryImpl
=
(
IMetricsFactoryImpl
)
IMetricsFactoryImpl
.
getInstance
();
ObjectNode
objectNode
=
this
.
objMapper
.
createObjectNode
();
ObjectNode
objectNode
=
this
.
objMapper
.
createObjectNode
();
...
@@ -64,7 +62,7 @@ public class MonitorHandler extends BaseHandler
...
@@ -64,7 +62,7 @@ public class MonitorHandler extends BaseHandler
writeObjectToResponse
(
reqCtx
,
brr
);
writeObjectToResponse
(
reqCtx
,
brr
);
}
}
private
void
reloadServiceApp
(
Re
que
stContext
reqCtx
)
{
private
void
reloadServiceApp
(
RestContext
reqCtx
)
{
this
.
optConfiguration
.
ifPresent
(
cfg
->
cfg
.
reload
());
this
.
optConfiguration
.
ifPresent
(
cfg
->
cfg
.
reload
());
containers
.
forEach
(
handler
->
handler
.
doReload
());
containers
.
forEach
(
handler
->
handler
.
doReload
());
...
@@ -72,7 +70,7 @@ public class MonitorHandler extends BaseHandler
...
@@ -72,7 +70,7 @@ public class MonitorHandler extends BaseHandler
}
}
@Override
@Override
public
void
doRead
(
Re
que
stContext
reqCtx
)
public
void
doRead
(
RestContext
reqCtx
)
{
{
switch
(
reqCtx
.
params
[
0
])
switch
(
reqCtx
.
params
[
0
])
{
{
...
@@ -84,14 +82,14 @@ public class MonitorHandler extends BaseHandler
...
@@ -84,14 +82,14 @@ public class MonitorHandler extends BaseHandler
}
}
@Override
@Override
public
void
doUpdate
(
Re
que
stContext
reqCtx
)
public
void
doUpdate
(
RestContext
reqCtx
)
{
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
}
@Override
@Override
public
void
doDelete
(
Re
que
stContext
reqCtx
)
public
void
doDelete
(
RestContext
reqCtx
)
{
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
...
...
src/main/java/microservice/handlers/Reactor.java
View file @
f00c99e6
...
@@ -84,6 +84,14 @@ public class Reactor implements CommonServices.IServiceReactor {
...
@@ -84,6 +84,14 @@ public class Reactor implements CommonServices.IServiceReactor {
methodParams
.
getResourceUri
();
methodParams
.
getResourceUri
();
}
}
public
static
String
buildServiceKey
(
Enums
.
EnumServiceType
enumServiceType
,
CommonServices
.
IServiceCommands
serviceCommands
,
String
resourceUri
)
{
return
new
StringBuilder
(
32
).
append
(
enumServiceType
.
name
()).
append
(
Constants
.
TYPE_PREFIX_SEPERATOR
)
.
append
(
serviceCommands
.
toString
()).
append
(
Constants
.
TYPE_PREFIX_SEPERATOR
)
.
append
(
resourceUri
).
toString
();
}
/**
/**
* delegating the msg/request from the service to the method if any
* delegating the msg/request from the service to the method if any
* @param orgService
* @param orgService
...
@@ -98,12 +106,15 @@ public class Reactor implements CommonServices.IServiceReactor {
...
@@ -98,12 +106,15 @@ public class Reactor implements CommonServices.IServiceReactor {
final
PathTemplateMatcher
.
PathMatchResult
<
MethodMatch
>
match
=
methodsMap
.
match
(
key
);
final
PathTemplateMatcher
.
PathMatchResult
<
MethodMatch
>
match
=
methodsMap
.
match
(
key
);
try
{
try
{
if
(
match
!=
null
&&
match
.
getValue
().
getMethodCallback
()
!=
null
)
{
if
(
match
!=
null
&&
match
.
getValue
().
getMethodCallback
()
!=
null
)
{
msgContext
.
setParameters
(
match
.
getParameters
());
final
BiConsumer
<
CommonServices
.
IMsgContext
,
CommonServices
.
IService
>
methodCallback
=
match
.
getValue
().
getMethodCallback
();
final
BiConsumer
<
CommonServices
.
IMsgContext
,
CommonServices
.
IService
>
methodCallback
=
match
.
getValue
().
getMethodCallback
();
/**
/**
* pre-handling
* pre-handling
*/
*/
if
(
metricsFactory
!=
null
)
{
if
(
metricsFactory
!=
null
)
{
methodMetrics
=
methodMetricsMap
.
get
(
key
);
methodMetrics
=
methodMetricsMap
.
get
(
match
.
getMatchedTemplate
());
if
(
methodMetrics
!=
null
)
methodMetrics
.
preHandle
();
}
}
methodCallback
.
accept
(
msgContext
,
orgService
);
methodCallback
.
accept
(
msgContext
,
orgService
);
}
else
{
}
else
{
...
@@ -140,8 +151,8 @@ public class Reactor implements CommonServices.IServiceReactor {
...
@@ -140,8 +151,8 @@ public class Reactor implements CommonServices.IServiceReactor {
* create counters for every method
* create counters for every method
*/
*/
for
(
String
key
:
methodKeyList
){
for
(
String
key
:
methodKeyList
){
IMetricsFactory
.
IMeter
meter
=
metricsFactory
.
createMeter
(
key
);
IMetricsFactory
.
IMeter
meter
=
metricsFactory
.
createMeter
(
"Meter:"
+
key
);
IMetricsFactory
.
ITimer
timer
=
metricsFactory
.
createTimer
(
key
);
IMetricsFactory
.
ITimer
timer
=
metricsFactory
.
createTimer
(
"Timer:"
+
key
);
methodMetricsMap
.
put
(
key
,
new
MethodMetrics
(
meter
,
timer
));
methodMetricsMap
.
put
(
key
,
new
MethodMetrics
(
meter
,
timer
));
}
}
}
}
...
...
src/main/java/microservice/handlers/RestHandler.java
View file @
f00c99e6
...
@@ -11,7 +11,7 @@ import io.undertow.util.HeaderMap;
...
@@ -11,7 +11,7 @@ import io.undertow.util.HeaderMap;
import
io.undertow.util.Headers
;
import
io.undertow.util.Headers
;
import
io.undertow.util.HttpString
;
import
io.undertow.util.HttpString
;
import
microservice.MicroserviceApp
;
import
microservice.MicroserviceApp
;
import
microservice.Re
que
stContext
;
import
microservice.RestContext
;
import
microservice.common.EncryptionUtils
;
import
microservice.common.EncryptionUtils
;
import
microservice.defs.Constants
;
import
microservice.defs.Constants
;
import
microservice.defs.Enums
;
import
microservice.defs.Enums
;
...
@@ -86,11 +86,11 @@ public class RestHandler implements HttpHandler , IContainer
...
@@ -86,11 +86,11 @@ public class RestHandler implements HttpHandler , IContainer
/*
/*
* async part
* async part
*/
*/
Re
que
stContext
reqContext
=
getRequestContext
(
exchange
);
RestContext
reqContext
=
getRequestContext
(
exchange
);
if
(
reqContext
!=
null
)
{
if
(
reqContext
!=
null
)
{
HttpString
requestMethod
=
exchange
.
getRequestMethod
();
HttpString
requestMethod
=
exchange
.
getRequestMethod
();
EnumHttpMethod
eMethod
=
EnumHttpMethod
.
resolveMethod
(
requestMethod
.
toString
());
EnumHttpMethod
eMethod
=
EnumHttpMethod
.
resolveMethod
(
requestMethod
.
toString
());
reqContext
.
enum
CrudMethod
=
Enums
.
EnumCrudMethod
.
resolveMethodFromHttp
(
eMethod
);
reqContext
.
enum
RestCommands
=
CommonServices
.
EnumRestCommands
.
resolveMethodFromHttp
(
eMethod
);
//exchange. request.setCharacterEncoding(Constants.C_ENCODING_UTF8);
//exchange. request.setCharacterEncoding(Constants.C_ENCODING_UTF8);
exchange
.
getResponseHeaders
().
put
(
Headers
.
CONTENT_TYPE
,
Constants
.
CONTENT_TYPE_JSON
);
exchange
.
getResponseHeaders
().
put
(
Headers
.
CONTENT_TYPE
,
Constants
.
CONTENT_TYPE_JSON
);
...
@@ -143,15 +143,15 @@ public class RestHandler implements HttpHandler , IContainer
...
@@ -143,15 +143,15 @@ public class RestHandler implements HttpHandler , IContainer
/**
/**
* validate the request: service authorization etc.
* validate the request: service authorization etc.
* @param re
que
stContext
* @param restContext
* @return
* @return
*/
*/
private
boolean
validateRequest
(
Re
questContext
requ
estContext
)
private
boolean
validateRequest
(
Re
stContext
r
estContext
)
{
{
boolean
valid
=
true
;
boolean
valid
=
true
;
if
(
msHandler
.
getAuthType
().
equals
(
BaseHandler
.
EnumAuthenticationType
.
JWT
)){
if
(
msHandler
.
getAuthType
().
equals
(
BaseHandler
.
EnumAuthenticationType
.
JWT
)){
// get token
// get token
String
token
=
getJwtToken
(
re
que
stContext
);
String
token
=
getJwtToken
(
restContext
);
if
(
token
!=
null
)
if
(
token
!=
null
)
{
{
try
{
try
{
...
@@ -160,41 +160,41 @@ public class RestHandler implements HttpHandler , IContainer
...
@@ -160,41 +160,41 @@ public class RestHandler implements HttpHandler , IContainer
// resolve service authorization
// resolve service authorization
UserProfile
up
=
new
UserProfile
(
claims
);
UserProfile
up
=
new
UserProfile
(
claims
);
// resolve authorization
// resolve authorization
valid
=
up
.
isServiceAuthorized
(
appName
,
re
questContext
.
enumCrudMethod
);
valid
=
up
.
isServiceAuthorized
(
appName
,
re
stContext
.
enumRestCommands
);
if
(
valid
)
{
if
(
valid
)
{
// set user profile
// set user profile
re
que
stContext
.
userProfile
=
up
;
restContext
.
userProfile
=
up
;
}
else
{
}
else
{
sendErrorResp
(
re
que
stContext
.
response
,
METHOD_NOT_AUTHORIZED
);
sendErrorResp
(
restContext
.
response
,
METHOD_NOT_AUTHORIZED
);
}
}
}
}
else
{
else
{
sendErrorResp
(
re
que
stContext
.
response
,
Constants
.
INVALID_REQUEST_TOKEN
);
sendErrorResp
(
restContext
.
response
,
Constants
.
INVALID_REQUEST_TOKEN
);
}
}
}
catch
(
ExpiredJwtException
exception
){
}
catch
(
ExpiredJwtException
exception
){
sendErrorResp
(
re
que
stContext
.
response
,
TOKEN_EXPIRED
);
sendErrorResp
(
restContext
.
response
,
TOKEN_EXPIRED
);
valid
=
false
;
valid
=
false
;
}
}
}
}
else
else
{
{
MicroserviceApp
.
getsInstance
().
getLogger
().
error
(
NO_TOKEN_FOR_REQUEST
);
MicroserviceApp
.
getsInstance
().
getLogger
().
error
(
NO_TOKEN_FOR_REQUEST
);
sendErrorResp
(
re
que
stContext
.
response
,
NO_TOKEN_FOR_REQUEST
);
sendErrorResp
(
restContext
.
response
,
NO_TOKEN_FOR_REQUEST
);
valid
=
false
;
valid
=
false
;
}
}
}
}
return
valid
;
return
valid
;
}
}
private
String
getJwtToken
(
Re
questContext
requ
estContext
)
{
private
String
getJwtToken
(
Re
stContext
r
estContext
)
{
String
jwt
=
null
;
String
jwt
=
null
;
/*
/*
* jwt token
* jwt token
*/
*/
if
(
jwtTokenInAuthorization
)
if
(
jwtTokenInAuthorization
)
{
{
String
authValue
=
re
que
stContext
.
request
.
getFirstHeader
(
Constants
.
AUTHORIZATION_HEADER
);
String
authValue
=
restContext
.
request
.
getFirstHeader
(
Constants
.
AUTHORIZATION_HEADER
);
if
(
authValue
!=
null
)
if
(
authValue
!=
null
)
{
{
// "Bearer <token>"
// "Bearer <token>"
...
@@ -206,7 +206,7 @@ public class RestHandler implements HttpHandler , IContainer
...
@@ -206,7 +206,7 @@ public class RestHandler implements HttpHandler , IContainer
else
else
{
{
// url - param
// url - param
jwt
=
requ
estContext
.
getParameter
(
JWT_TOKEN
);
jwt
=
r
estContext
.
getParameter
(
JWT_TOKEN
);
}
}
return
jwt
;
return
jwt
;
}
}
...
@@ -260,9 +260,9 @@ public class RestHandler implements HttpHandler , IContainer
...
@@ -260,9 +260,9 @@ public class RestHandler implements HttpHandler , IContainer
* @param exchange
* @param exchange
* @return
* @return
*/
*/
private
Re
que
stContext
getRequestContext
(
HttpServerExchange
exchange
)
private
RestContext
getRequestContext
(
HttpServerExchange
exchange
)
{
{
Re
questContext
reqCtx
=
new
Requ
estContext
();
Re
stContext
reqCtx
=
new
R
estContext
();
reqCtx
.
container
=
this
;
reqCtx
.
container
=
this
;
reqCtx
.
request
=
new
IRequestRestImpl
(
exchange
);
reqCtx
.
request
=
new
IRequestRestImpl
(
exchange
);
reqCtx
.
response
=
new
IResponseRestImpl
(
exchange
);
reqCtx
.
response
=
new
IResponseRestImpl
(
exchange
);
...
@@ -290,26 +290,26 @@ public class RestHandler implements HttpHandler , IContainer
...
@@ -290,26 +290,26 @@ public class RestHandler implements HttpHandler , IContainer
}
}
public
void
doGet
(
Re
que
stContext
reqCtx
)
public
void
doGet
(
RestContext
reqCtx
)
{
{
msHandler
.
doRead
(
reqCtx
);
msHandler
.
doRead
(
reqCtx
);
}
}
public
void
doPost
(
Re
que
stContext
reqCtx
)
public
void
doPost
(
RestContext
reqCtx
)
{
{
msHandler
.
doCreate
(
reqCtx
);
msHandler
.
doCreate
(
reqCtx
);
}
}
public
void
doPut
(
Re
que
stContext
reqCtx
)
public
void
doPut
(
RestContext
reqCtx
)
{
{
msHandler
.
doUpdate
(
reqCtx
);
msHandler
.
doUpdate
(
reqCtx
);
}
}
public
void
doDelete
(
Re
que
stContext
reqCtx
)
public
void
doDelete
(
RestContext
reqCtx
)
{
{
msHandler
.
doDelete
(
reqCtx
);
msHandler
.
doDelete
(
reqCtx
);
...
...
src/main/java/microservice/io/iface/CommonServices.java
View file @
f00c99e6
...
@@ -5,6 +5,7 @@ import microservice.params.CommandParams;
...
@@ -5,6 +5,7 @@ import microservice.params.CommandParams;
import
microservice.types.BaseRestResponse
;
import
microservice.types.BaseRestResponse
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.BiConsumer
;
import
java.util.function.BiConsumer
;
import
java.util.function.Consumer
;
import
java.util.function.Consumer
;
...
@@ -18,6 +19,7 @@ public class CommonServices {
...
@@ -18,6 +19,7 @@ public class CommonServices {
}
}
public
interface
IMsgContext
{
public
interface
IMsgContext
{
void
setParameters
(
Map
<
String
,
String
>
parameters
);
}
}
public
interface
IServiceReactor
{
public
interface
IServiceReactor
{
...
@@ -31,6 +33,8 @@ public class CommonServices {
...
@@ -31,6 +33,8 @@ public class CommonServices {
public
abstract
void
run
();
public
abstract
void
run
();
public
abstract
void
shutdown
();
public
abstract
void
shutdown
();
public
abstract
void
handleNotImplmented
(
IMsgContext
msgContext
);
public
abstract
void
handleNotImplmented
(
IMsgContext
msgContext
);
/// when relevant
public
abstract
void
register
(
IServiceDiscovery
serviceDiscovery
,
String
id
);
public
void
setReactor
(
IServiceReactor
reactor
)
{
public
void
setReactor
(
IServiceReactor
reactor
)
{
this
.
reactor
=
reactor
;
this
.
reactor
=
reactor
;
...
@@ -84,6 +88,26 @@ public class CommonServices {
...
@@ -84,6 +88,26 @@ public class CommonServices {
E_READ
,
E_READ
,
E_UPDATE
,
E_UPDATE
,
E_DELETE
;
E_DELETE
;
public
static
EnumRestCommands
resolveMethodFromHttp
(
Enums
.
EnumHttpMethod
enumHttpMethod
){
EnumRestCommands
enumRestCommands
=
null
;
switch
(
enumHttpMethod
){
case
E_GET:
enumRestCommands
=
EnumRestCommands
.
E_READ
;
break
;
case
E_POST:
enumRestCommands
=
EnumRestCommands
.
E_CREATE
;
break
;
case
E_PUT:
enumRestCommands
=
EnumRestCommands
.
E_UPDATE
;
break
;
case
E_DELETE:
enumRestCommands
=
EnumRestCommands
.
E_DELETE
;
break
;
}
return
enumRestCommands
;
}
}
}
public
static
abstract
class
IRestService
extends
IService
{
public
static
abstract
class
IRestService
extends
IService
{
...
@@ -111,6 +135,11 @@ public class CommonServices {
...
@@ -111,6 +135,11 @@ public class CommonServices {
this
.
topic
=
topic
;
this
.
topic
=
topic
;
this
.
msg
=
msg
;
this
.
msg
=
msg
;
}
}
@Override
public
void
setParameters
(
Map
<
String
,
String
>
parameters
)
{
}
}
}
public
abstract
void
subscribe
(
String
topic
,
Consumer
<
String
>
notifyFunc
);
public
abstract
void
subscribe
(
String
topic
,
Consumer
<
String
>
notifyFunc
);
...
...
src/main/java/microservice/io/impl/service/IPubSubServiceMqttImpl.java
View file @
f00c99e6
...
@@ -3,6 +3,7 @@ package microservice.io.impl.service;
...
@@ -3,6 +3,7 @@ package microservice.io.impl.service;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
common.JsonHandler
;
import
common.JsonHandler
;
import
microservice.io.iface.CommonServices
;
import
microservice.io.iface.CommonServices
;
import
microservice.io.iface.IServiceDiscovery
;
import
org.eclipse.paho.client.mqttv3.*
;
import
org.eclipse.paho.client.mqttv3.*
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -137,4 +138,9 @@ public class IPubSubServiceMqttImpl extends CommonServices.IPubSubService {
...
@@ -137,4 +138,9 @@ public class IPubSubServiceMqttImpl extends CommonServices.IPubSubService {
public
void
handleNotImplmented
(
CommonServices
.
IMsgContext
msgContext
)
{
public
void
handleNotImplmented
(
CommonServices
.
IMsgContext
msgContext
)
{
}
}
@Override
public
void
register
(
IServiceDiscovery
serviceDiscovery
,
String
id
)
{
}
}
}
src/main/java/microservice/io/impl/service/IRestServiceHttpImpl.java
View file @
f00c99e6
This diff is collapsed.
Click to expand it.
src/main/java/microservice/types/UserProfile.java
View file @
f00c99e6
...
@@ -3,6 +3,7 @@ package microservice.types;
...
@@ -3,6 +3,7 @@ package microservice.types;
import
io.jsonwebtoken.Claims
;
import
io.jsonwebtoken.Claims
;
import
io.jsonwebtoken.impl.DefaultClaims
;
import
io.jsonwebtoken.impl.DefaultClaims
;
import
microservice.defs.Enums
;
import
microservice.defs.Enums
;
import
microservice.io.iface.CommonServices
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -62,14 +63,14 @@ public class UserProfile extends DefaultClaims {
...
@@ -62,14 +63,14 @@ public class UserProfile extends DefaultClaims {
return
serviceAuthorizations
;
return
serviceAuthorizations
;
}
}
public
boolean
isServiceAuthorized
(
String
serviceName
,
Enums
.
EnumCrudMethod
enumCrudMethod
){
public
boolean
isServiceAuthorized
(
String
serviceName
,
CommonServices
.
EnumRestCommands
enumRestCommands
){
boolean
authorized
=
false
;
boolean
authorized
=
false
;
String
serviceAuth
=
serviceAuthorizations
.
get
(
serviceName
);
String
serviceAuth
=
serviceAuthorizations
.
get
(
serviceName
);
if
(
serviceAuth
==
null
)
// check for all services authorizations
if
(
serviceAuth
==
null
)
// check for all services authorizations
serviceAuth
=
serviceAuthorizations
.
get
(
ALL_SERVICES
);
serviceAuth
=
serviceAuthorizations
.
get
(
ALL_SERVICES
);
if
(
serviceAuth
!=
null
)
if
(
serviceAuth
!=
null
)
authorized
=
serviceAuth
.
getBytes
()[
enum
CrudMethod
.
ordinal
()]
==
'Y'
;
authorized
=
serviceAuth
.
getBytes
()[
enum
RestCommands
.
ordinal
()]
==
'Y'
;
return
authorized
;
return
authorized
;
}
}
...
...
src/test/java/microservice/TestMicroserviceApp.java
View file @
f00c99e6
package
microservice
;
package
microservice
;
import
com.fasterxml.jackson.databind.node.JsonNodeFactory
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
microservice.defs.Enums
;
import
microservice.defs.Enums
;
import
microservice.io.iface.CommonServices
;
import
microservice.io.iface.CommonServices
;
import
microservice.io.iface.ICommandClient
;
import
microservice.io.iface.ICommandClient
;
...
@@ -78,22 +80,26 @@ public class TestMicroserviceApp {
...
@@ -78,22 +80,26 @@ public class TestMicroserviceApp {
.
withMonitoring
()
.
withMonitoring
()
//.withDefaultServiceAuthorization()
//.withDefaultServiceAuthorization()
.
addService
(
Enums
.
EnumServiceType
.
E_REST
,
new
IRestServiceHttpImpl
(
new
RestServerParams
(
32000
,
"localhost"
,
2
)),
"undertowRestService"
)
.
addService
(
Enums
.
EnumServiceType
.
E_REST
,
new
IRestServiceHttpImpl
(
new
RestServerParams
(
32000
,
"localhost"
,
2
)),
"undertowRestService"
)
.
addMethod
(
Enums
.
EnumServiceType
.
E_REST
,
CommonServices
.
EnumRestCommands
.
E_READ
,
"/resource/r1"
,(
msgCtx
,
orgService
)
->
{
.
addMethod
(
Enums
.
EnumServiceType
.
E_REST
,
CommonServices
.
EnumRestCommands
.
E_READ
,
"/resource/{rid}"
,(
msgCtx
,
orgService
)
->
{
BaseRestResponse
brr
;
BaseRestResponse
brr
=
new
BaseRestResponse
(
true
,
null
);
RestContext
restContext
=
(
RestContext
)
msgCtx
;
msApp
.
getLogger
();
msApp
.
getLogger
();
CommonServices
.
IRestService
restService
=
(
CommonServices
.
IRestService
)
orgService
;
String
rid
=
restContext
.
getParameter
(
"rid"
);
//brr.setObject({ "a":"b" })
ObjectNode
objectNode
=
JsonNodeFactory
.
instance
.
objectNode
();
//restService.writeResponse(brr);
if
(
restContext
.
pathParameters
!=
null
)
restContext
.
pathParameters
.
forEach
((
key
,
value
)
->
objectNode
.
put
(
key
,
value
));
brr
.
objectNode
=
objectNode
;
restContext
.
container
.
writeObjectToResponse
(
restContext
.
response
,
brr
);
})
})
.
addMethod
(
Enums
.
EnumServiceType
.
E_REST
,
CommonServices
.
EnumRestCommands
.
E_READ
,
"/resource/r
1
"
,(
msgCtx
,
orgService
)
->
{
.
addMethod
(
Enums
.
EnumServiceType
.
E_REST
,
CommonServices
.
EnumRestCommands
.
E_READ
,
"/resource/r
2
"
,(
msgCtx
,
orgService
)
->
{
CommonServices
.
IRestService
outRestService
=
(
CommonServices
.
IRestService
)
MicroserviceApp
.
getsInstance
().
getService
(
Enums
.
EnumServiceType
.
E_REST
,
"undertowRestService"
);
CommonServices
.
IRestService
outRestService
=
(
CommonServices
.
IRestService
)
MicroserviceApp
.
getsInstance
().
getService
(
Enums
.
EnumServiceType
.
E_REST
,
"undertowRestService"
);
CommonServices
.
IRestService
restService
=
(
CommonServices
.
IRestService
)
orgService
;
CommonServices
.
IRestService
restService
=
(
CommonServices
.
IRestService
)
orgService
;
CommandParams
cmdParams
=
new
CommandParams
();
CommandParams
cmdParams
=
new
CommandParams
();
BaseRestResponse
brr
=
restService
.
read
(
cmdParams
);
BaseRestResponse
brr
=
restService
.
read
(
cmdParams
);
//restService.writeResponse(brr);
//restService.writeResponse(brr);
})
})
.
build
()
.
_
build
()
.
run
();
.
_
run
();
}
}
}
}
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