use of org.apache.servicecomb.core.definition.OperationMeta in project incubator-servicecomb-java-chassis by apache.
the class InvocationFactory method forConsumer.
/*
* 为tcc场景提供的快捷方式,consumer端使用
*/
public static Invocation forConsumer(ReferenceConfig referenceConfig, String operationQualifiedName, Object[] swaggerArguments) {
MicroserviceMeta microserviceMeta = referenceConfig.getMicroserviceMeta();
OperationMeta operationMeta = microserviceMeta.ensureFindOperation(operationQualifiedName);
return forConsumer(referenceConfig, operationMeta, swaggerArguments);
}
use of org.apache.servicecomb.core.definition.OperationMeta in project incubator-servicecomb-java-chassis by apache.
the class ServicePathManager method addSchema.
public void addSchema(SchemaMeta schemaMeta) {
if (isSchemaExists(schemaMeta.getSchemaId())) {
return;
}
schemaIdSet.add(schemaMeta.getSchemaId());
for (OperationMeta operationMeta : schemaMeta.getOperations()) {
RestOperationMeta restOperationMeta = new RestOperationMeta();
restOperationMeta.init(operationMeta);
operationMeta.putExtData(RestConst.SWAGGER_REST_OPERATION, restOperationMeta);
addResource(restOperationMeta);
}
LOGGER.info("add schema to service paths. {}:{}:{}.", schemaMeta.getMicroserviceMeta().getAppId(), schemaMeta.getMicroserviceName(), schemaMeta.getSchemaId());
}
use of org.apache.servicecomb.core.definition.OperationMeta in project incubator-servicecomb-java-chassis by apache.
the class UnitTestRestUtils method createRestOperationMeta.
public static RestOperationMeta createRestOperationMeta(String httpMethod, String path) {
OperationMeta om = new OperationMeta();
om.setHttpMethod(httpMethod);
RestOperationMeta rom = new RestOperationMeta();
rom.setOperationMeta(om);
rom.setAbsolutePath(path);
Deencapsulation.setField(rom, "produces", Arrays.asList(MediaType.APPLICATION_JSON));
return rom;
}
use of org.apache.servicecomb.core.definition.OperationMeta in project incubator-servicecomb-java-chassis by apache.
the class ServerRestArgsFilter method afterReceiveRequest.
@Override
public Response afterReceiveRequest(Invocation invocation, HttpServletRequestEx requestEx) {
OperationMeta operationMeta = invocation.getOperationMeta();
RestOperationMeta restOperationMeta = operationMeta.getExtData(RestConst.SWAGGER_REST_OPERATION);
Object[] args = RestCodec.restToArgs(requestEx, restOperationMeta);
invocation.setSwaggerArguments(args);
return null;
}
use of org.apache.servicecomb.core.definition.OperationMeta in project incubator-servicecomb-java-chassis by apache.
the class MockUtil method mockRequestMeta.
public void mockRequestMeta() {
new MockUp<RequestMeta>() {
@Mock
public OperationMeta getOperationMeta() throws Exception {
OperationMeta om = new OperationMeta();
om.init(new SchemaMeta(null, new MicroserviceMeta("test"), null), this.getClass().getMethods()[0], "path", "get", null);
return om;
}
};
}
Aggregations