• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java LoggingInterceptor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor的典型用法代码示例。如果您正苦于以下问题:Java LoggingInterceptor类的具体用法?Java LoggingInterceptor怎么用?Java LoggingInterceptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LoggingInterceptor类属于ca.uhn.fhir.rest.client.interceptor包,在下文中一共展示了LoggingInterceptor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testFindConsent

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
/**
 * Test method for
 * {@link org.iexhub.services.JaxRsConsentRestProvider\#find(@IdParam final
 * IdDt id)}.
 */
@Test
public void testFindConsent() {

	try {
		Logger logger = LoggerFactory.getLogger(ConsentDstu3Test.class);
		LoggingInterceptor loggingInterceptor = new LoggingInterceptor();
		loggingInterceptor.setLogRequestSummary(true);
		loggingInterceptor.setLogRequestBody(true);
		loggingInterceptor.setLogger(logger);

		IGenericClient client = ctxt.newRestfulGenericClient(serverBaseUrl);
		client.registerInterceptor(loggingInterceptor); // Required only for
														// logging
		Consent retVal = client.read(Consent.class,
				/*iExHubDomainOid + "." + consentId*/ /*"2.25.1469220780502"*/ "2.25.1471531116858");
		
		assertTrue("Error - unexpected return value for testFindConsent", retVal != null);
	} catch (Exception e) {
		fail(e.getMessage());
	}
}
 
开发者ID:bhits,项目名称:iexhub,代码行数:27,代码来源:ConsentDstu3Test.java


示例2: main

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
public static void main(String[] theArgs) {

		// Create a client
      IGenericClient client = FhirContext.forDstu3().newRestfulGenericClient("http://fhirtest.uhn.ca/baseDstu3");

      // Register some interceptors
      client.registerInterceptor(new CookieInterceptor("mycookie=Chips Ahoy"));
      client.registerInterceptor(new LoggingInterceptor());

      // Read a Patient
      Patient patient = client.read().resource(Patient.class).withId("example").execute();

		// Change the gender
		patient.setGender(patient.getGender() == AdministrativeGender.MALE ? AdministrativeGender.FEMALE : AdministrativeGender.MALE);

		// Update the patient
		MethodOutcome outcome = client.update().resource(patient).execute();
		
		System.out.println("Now have ID: " + outcome.getId());
	}
 
开发者ID:furore-fhir,项目名称:fhirstarters,代码行数:21,代码来源:Example09_Interceptors.java


示例3: operationHttpGet

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@SuppressWarnings("unused")
private static void operationHttpGet() {
   // START SNIPPET: operationHttpGet
   // Create a client to talk to the HeathIntersections server
   FhirContext ctx = FhirContext.forDstu2();
   IGenericClient client = ctx.newRestfulGenericClient("http://fhir-dev.healthintersections.com.au/open");
   client.registerInterceptor(new LoggingInterceptor(true));
   
   // Create the input parameters to pass to the server
   Parameters inParams = new Parameters();
   inParams.addParameter().setName("start").setValue(new DateDt("2001-01-01"));
   inParams.addParameter().setName("end").setValue(new DateDt("2015-03-01"));
   
   // Invoke $everything on "Patient/1"
   Parameters outParams = client
      .operation()
      .onInstance(new IdDt("Patient", "1"))
      .named("$everything")
      .withParameters(inParams)
      .useHttpGet() // Use HTTP GET instead of POST
      .execute();
   // END SNIPPET: operationHttpGet
}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:24,代码来源:GenericClientExample.java


示例4: operation

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@SuppressWarnings("unused")
private static void operation() {
   // START SNIPPET: operation
   // Create a client to talk to the HeathIntersections server
   FhirContext ctx = FhirContext.forDstu2();
   IGenericClient client = ctx.newRestfulGenericClient("http://fhir-dev.healthintersections.com.au/open");
   client.registerInterceptor(new LoggingInterceptor(true));
   
   // Create the input parameters to pass to the server
   Parameters inParams = new Parameters();
   inParams.addParameter().setName("start").setValue(new DateDt("2001-01-01"));
   inParams.addParameter().setName("end").setValue(new DateDt("2015-03-01"));
   
   // Invoke $everything on "Patient/1"
   Parameters outParams = client
      .operation()
      .onInstance(new IdDt("Patient", "1"))
      .named("$everything")
      .withParameters(inParams)
      .execute();
   // END SNIPPET: operation
}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:23,代码来源:GenericClientExample.java


示例5: operationNoIn

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@SuppressWarnings("unused")
private static void operationNoIn() {
   // START SNIPPET: operationNoIn
   // Create a client to talk to the HeathIntersections server
   FhirContext ctx = FhirContext.forDstu2();
   IGenericClient client = ctx.newRestfulGenericClient("http://fhir-dev.healthintersections.com.au/open");
   client.registerInterceptor(new LoggingInterceptor(true));
   
   // Invoke $everything on "Patient/1"
   Parameters outParams = client
      .operation()
      .onInstance(new IdDt("Patient", "1"))
      .named("$everything")
      .withNoParameters(Parameters.class) // No input parameters
      .execute();
   // END SNIPPET: operationNoIn
}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:18,代码来源:GenericClientExample.java


示例6: testNonRepeatableParam

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@Test
public void testNonRepeatableParam() throws Exception {
	MyServerBaseProvider patientProvider = new MyServerBaseProvider();
	myServlet.setResourceProviders(patientProvider);

	myServer.start();

	FhirContext ctx = new FhirContext();
	IGenericClient client = ctx.newRestfulGenericClient("http://localhost:" + myPort + "/");
	client.registerInterceptor(new LoggingInterceptor(true));

	try {
		client.search().forResource("Patient").where(new StringClientParam("singleParam").matches().values(Arrays.asList("AA", "BB"))).execute();
		fail();
	} catch (InvalidRequestException e) {
		assertThat(
				e.getMessage(),
				StringContains
						.containsString("HTTP 400 Bad Request: Multiple values detected for non-repeatable parameter 'singleParam'. This server is not configured to allow multiple (AND/OR) values for this param."));
	}
}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:22,代码来源:ServerExtraParametersTest.java


示例7: main

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
public static void main(String[] theArgs) {

		// Create a client
		FhirContext ctx = new FhirContext();
		String serverBaseUrl = "http://fhirtest.uhn.ca/base";
		IGenericClient client = ctx.newRestfulGenericClient(serverBaseUrl);

		// Log requests and responses
		client.registerInterceptor(new LoggingInterceptor(true));
		
		// Build a search and execute it
		Bundle response = client.search()
			.forResource(Patient.class)
			.where(Patient.NAME.matches().value("Test"))
			.and(Patient.BIRTHDATE.before().day("2014-01-01"))
			.limitTo(100)
			.execute();
		
		// How many resources did we find?
		System.out.println("Responses: " + response.size());
		
		// Print the ID of the first one
		IdDt firstResponseId = response.getEntries().get(0).getResource().getId();
		System.out.println(firstResponseId);
		
	}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:27,代码来源:Example06_ClientReadAndUpdate.java


示例8: beforeClass

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@BeforeClass
public static void beforeClass() throws Exception {
	ourPort = PortUtil.findFreePort();
	ourServer = new Server(ourPort);

	PatientProvider patientProvider = new PatientProvider();

	ServletHandler proxyHandler = new ServletHandler();
	RestfulServer servlet = new RestfulServer(ourCtx);
	servlet.setResourceProviders(patientProvider);
	ServletHolder servletHolder = new ServletHolder(servlet);
	proxyHandler.addServletWithMapping(servletHolder, "/*");
	ourServer.setHandler(proxyHandler);
	ourServer.start();

	PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS);
	HttpClientBuilder builder = HttpClientBuilder.create();
	builder.setConnectionManager(connectionManager);
	ourClient = builder.build();

	ourCtx.getRestfulClientFactory().setSocketTimeout(500 * 1000);
	ourHapiClient = ourCtx.newRestfulGenericClient("http://localhost:" + ourPort + "/");
	ourHapiClient.registerInterceptor(new LoggingInterceptor());
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:25,代码来源:DeleteConditionalDstu3Test.java


示例9: testConformance

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@Test
	public void testConformance() throws Exception {
		LoggingInterceptor loggingInterceptor = new LoggingInterceptor();
		loggingInterceptor.setLogResponseBody(true);
		myFhirClient.registerInterceptor(loggingInterceptor);

		CapabilityStatement p = myFhirClient.fetchConformance().ofType(CapabilityStatement.class).prettyPrint().execute();
		ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(p));
		
		List<CapabilityStatementRestOperationComponent> ops = p.getRest().get(0).getOperation();
		assertThat(ops.size(), greaterThan(1));

		List<String> opNames = toOpNames(ops);
		assertThat(opNames, containsInRelativeOrder("OP_TYPE"));
		
//		OperationDefinition def = (OperationDefinition) ops.get(opNames.indexOf("OP_TYPE")).getDefinition().getResource();
		OperationDefinition def = myFhirClient.read().resource(OperationDefinition.class).withId(ops.get(opNames.indexOf("OP_TYPE")).getDefinition().getReferenceElement()).execute();
		assertEquals("OP_TYPE", def.getCode());
	}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:20,代码来源:OperationServerDstu3Test.java


示例10: testConformance

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@Test
	public void testConformance() throws Exception {
		LoggingInterceptor loggingInterceptor = new LoggingInterceptor();
		loggingInterceptor.setLogResponseBody(true);
		myFhirClient.registerInterceptor(loggingInterceptor);

		Conformance p = myFhirClient.fetchConformance().ofType(Conformance.class).prettyPrint().execute();
		ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(p));
		
		List<ConformanceRestOperationComponent> ops = p.getRest().get(0).getOperation();
		assertThat(ops.size(), greaterThan(1));

		List<String> opNames = toOpNames(ops);
		assertThat(opNames, containsInRelativeOrder("OP_TYPE"));
		
//		OperationDefinition def = (OperationDefinition) ops.get(opNames.indexOf("OP_TYPE")).getDefinition().getResource();
		OperationDefinition def = myFhirClient.read().resource(OperationDefinition.class).withId(ops.get(opNames.indexOf("OP_TYPE")).getDefinition().getReferenceElement()).execute();
		assertEquals("OP_TYPE", def.getCode());
	}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:20,代码来源:OperationServerDstu2_1Test.java


示例11: testNonRepeatableParam

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@Test
public void testNonRepeatableParam() throws Exception {
	MyServerBaseProvider patientProvider = new MyServerBaseProvider();
	myServlet.setResourceProviders(patientProvider);

	myServer.start();

	FhirContext ctx = ourCtx;
	IGenericClient client = ctx.newRestfulGenericClient("http://localhost:" + myPort + "/");
	client.registerInterceptor(new LoggingInterceptor(true));

	try {
		client.search().forResource("Patient").where(new StringClientParam("singleParam").matches().values(Arrays.asList("AA", "BB"))).execute();
		fail();
	} catch (InvalidRequestException e) {
		assertThat(
				e.getMessage(),
				StringContains
						.containsString("HTTP 400 Bad Request: Multiple values detected for non-repeatable parameter 'singleParam'. This server is not configured to allow multiple (AND/OR) values for this param."));
	}
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:22,代码来源:ServerExtraParametersTest.java


示例12: testLoggerNonVerbose

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@Test
public void testLoggerNonVerbose() throws Exception {
	System.out.println("Starting testLogger");
	IGenericClient client = ourCtx.newRestfulGenericClient("http://localhost:" + ourPort);
	ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);

	LoggingInterceptor interceptor = new LoggingInterceptor(false);
	client.registerInterceptor(interceptor);
	Patient patient = client.read(Patient.class, "1");
	assertFalse(patient.getIdentifierFirstRep().isEmpty());

	verify(myMockAppender, times(2)).doAppend(argThat(new ArgumentMatcher<ILoggingEvent>() {
		@Override
		public boolean matches(final Object argument) {
			String formattedMessage = ((LoggingEvent) argument).getFormattedMessage();
			System.out.flush();
			System.out.println("** Got Message: " + formattedMessage);
			System.out.flush();
			return
				formattedMessage.contains("Client request: GET http://localhost:" + ourPort + "/Patient/1 HTTP/1.1") ||
				formattedMessage.contains("Client response: HTTP 200 OK (Patient/1/_history/1)");
		}
	}));
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:25,代码来源:LoggingInterceptorTest.java


示例13: beforeClass

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@BeforeClass
public static void beforeClass() throws Exception {

	URL conf = LoggingInterceptor.class.getResource("/logback-test-dstuforce.xml");
	assertNotNull(conf);
	LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
	JoranConfigurator configurator = new JoranConfigurator();
	configurator.setContext(context);
	context.reset();
	configurator.doConfigure(conf);

	ourPort = PortUtil.findFreePort();
	ourServer = new Server(ourPort);

	DummyProvider patientProvider = new DummyProvider();

	ServletHandler proxyHandler = new ServletHandler();
	RestfulServer servlet = new RestfulServer(ourCtx);
	servlet.setResourceProviders(patientProvider);
	ServletHolder servletHolder = new ServletHolder(servlet);
	proxyHandler.addServletWithMapping(servletHolder, "/*");
	ourServer.setHandler(proxyHandler);
	ourServer.start();

	ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:27,代码来源:LoggingInterceptorTest.java


示例14: testConformance

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@Test
	public void testConformance() throws Exception {
		LoggingInterceptor loggingInterceptor = new LoggingInterceptor();
		loggingInterceptor.setLogResponseBody(true);
		myFhirClient.registerInterceptor(loggingInterceptor);

		CapabilityStatement p = myFhirClient.fetchConformance().ofType(CapabilityStatement.class).prettyPrint().execute();
		ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(p));

		List<CapabilityStatement.CapabilityStatementRestResourceOperationComponent> ops = p.getRest().get(0).getOperation();
		assertThat(ops.size(), greaterThan(1));

		List<String> opNames = toOpNames(ops);
		assertThat(opNames, containsInRelativeOrder("OP_TYPE"));
		
//		OperationDefinition def = (OperationDefinition) ops.get(opNames.indexOf("OP_TYPE")).getDefinition().getResource();
		OperationDefinition def = myFhirClient.read().resource(OperationDefinition.class).withId(ops.get(opNames.indexOf("OP_TYPE")).getDefinition().getReferenceElement()).execute();
		assertEquals("OP_TYPE", def.getCode());
	}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:20,代码来源:OperationServerR4Test.java


示例15: testExtendedOperations

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
/** Extended Operations */
// Create a client to talk to the HeathIntersections server
@Test
public void testExtendedOperations() {
	client.registerInterceptor(new LoggingInterceptor(true));

	// Create the input parameters to pass to the server
	Parameters inParams = new Parameters();
	inParams.addParameter().setName("start").setValue(new DateDt("2001-01-01"));
	inParams.addParameter().setName("end").setValue(new DateDt("2015-03-01"));
	inParams.addParameter().setName("dummy").setValue(new StringDt("myAwesomeDummyValue"));

	// Invoke $everything on "Patient/1"
	Parameters outParams = client
			.operation()
			.onInstance(new IdDt("Patient", "1"))
			.named("$firstVersion")
			.withParameters(inParams)
			// .useHttpGet() // Use HTTP GET instead of POST
			.execute();
	String resultValue = outParams.getParameter().get(0).getValue().toString();
	System.out.println(resultValue);
	assertEquals("expected but found : " + resultValue, resultValue.contains("myAwesomeDummyValue"), true);
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:25,代码来源:JaxRsPatientProviderTest.java


示例16: testExtendedOperations

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
/** Extended Operations */
// Create a client to talk to the HeathIntersections server
   @Test
   public void testExtendedOperations() {
       client.registerInterceptor(new LoggingInterceptor(true));
        
       // Create the input parameters to pass to the server
       Parameters inParams = new Parameters();
       inParams.addParameter().setName("start").setValue(new DateType("2001-01-01"));
       inParams.addParameter().setName("end").setValue(new DateType("2015-03-01"));
       inParams.addParameter().setName("dummy").setValue(new StringType("myAwesomeDummyValue"));
        
       // Invoke $everything on "Patient/1"
       Parameters outParams = client
          .operation()
          .onInstance(new IdType("Patient", "1"))
          .named("$firstVersion")
          .withParameters(inParams)
          //.useHttpGet() // Use HTTP GET instead of POST
          .execute();
       String resultValue = outParams.getParameter().get(0).getValue().toString();
       System.out.println(resultValue);
       assertEquals("expected but found : "+ resultValue, resultValue.contains("myAwesomeDummyValue"), true);
   }
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:25,代码来源:JaxRsPatientProviderDstu3Test.java


示例17: testConformance

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@Test
public void testConformance() throws Exception {
	LoggingInterceptor loggingInterceptor = new LoggingInterceptor();
	loggingInterceptor.setLogResponseBody(true);
	myFhirClient.registerInterceptor(loggingInterceptor);

	Conformance p = myFhirClient.fetchConformance().ofType(Conformance.class).prettyPrint().execute();
	List<RestOperation> ops = p.getRest().get(0).getOperation();
	assertThat(ops.size(), greaterThan(1));
	assertNull(ops.get(0).getDefinition().getReference().getBaseUrl());
	assertThat(ops.get(0).getDefinition().getReference().getValue(), startsWith("OperationDefinition/"));

	OperationDefinition def = myFhirClient.read().resource(OperationDefinition.class).withId(ops.get(0).getDefinition().getReference()).execute();
	assertThat(def.getCode(), not(blankOrNullString()));

	List<String> opNames = toOpNames(ops);
	assertThat(opNames, containsInRelativeOrder("OP_TYPE"));
	
	assertEquals("OperationDefinition/Patient--OP_TYPE", ops.get(opNames.indexOf("OP_TYPE")).getDefinition().getReference().getValue());
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:21,代码来源:OperationServerDstu2Test.java


示例18: testConformance

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@Test
public void testConformance() {
	ourCtx.getRestfulClientFactory().setSocketTimeout(500000);
	IGenericClient client = ourCtx.newRestfulGenericClient("http://localhost:" + ourPort + "/");
	client.registerInterceptor(new LoggingInterceptor(true));
	Conformance rest = client.fetchConformance().ofType(Conformance.class).prettyPrint().execute();
	boolean supportsTransaction = false;
	for (SystemInteractionComponent next : rest.getRest().get(0).getInteraction()) {
		ourLog.info("Supports interaction: {}");
		if (next.getCodeElement().getValue() == SystemRestfulInteraction.TRANSACTION) {
			supportsTransaction = true;
		}
	}
	
	assertTrue(supportsTransaction);
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:17,代码来源:TransactionWithBundleResourceParamHl7OrgDstu2Test.java


示例19: beforeClass

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@BeforeClass
public static void beforeClass() throws Exception {
	/*
	 * This runs under maven, and I'm not sure how else to figure out the target directory from code..
	 */
	String path = ExampleServerIT.class.getClassLoader().getResource(".keep_hapi-fhir-jpaserver-example").getPath();
	path = new File(path).getParent();
	path = new File(path).getParent();
	path = new File(path).getParent();

	ourLog.info("Project base path is: {}", path);

	ourPort = RandomServerPortProvider.findFreePort();
	ourServer = new Server(ourPort);

	WebAppContext webAppContext = new WebAppContext();
	webAppContext.setContextPath("/");
	webAppContext.setDescriptor(path + "/src/main/webapp/WEB-INF/web.xml");
	webAppContext.setResourceBase(path + "/target/hapi-fhir-jpaserver-example");
	webAppContext.setParentLoaderPriority(true);

	ourServer.setHandler(webAppContext);
	ourServer.start();

	ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
	ourCtx.getRestfulClientFactory().setSocketTimeout(1200 * 1000);
	ourServerBase = "http://localhost:" + ourPort + "/baseDstu2";
	ourClient = ourCtx.newRestfulGenericClient(ourServerBase);
	ourClient.registerInterceptor(new LoggingInterceptor(true));

}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:32,代码来源:ExampleServerIT.java


示例20: beforeClass

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入依赖的package包/类
@BeforeClass
public static void beforeClass() throws Exception {
	/*
	 * This runs under maven, and I'm not sure how else to figure out the target directory from code..
	 */
	String path = ExampleServerIT.class.getClassLoader().getResource(".keep_hapi-fhir-jpaserver-example").getPath();
	path = new File(path).getParent();
	path = new File(path).getParent();
	path = new File(path).getParent();

	ourLog.info("Project base path is: {}", path);

	ourPort = RandomServerPortProvider.findFreePort();
	ourServer = new Server(ourPort);

	WebAppContext webAppContext = new WebAppContext();
	webAppContext.setContextPath("/");
	webAppContext.setDescriptor(path + "/src/main/webapp/WEB-INF/web.xml");
	webAppContext.setResourceBase(path + "/target/");
	webAppContext.setParentLoaderPriority(true);

	ourServer.setHandler(webAppContext);
	ourServer.start();

	ourCtx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
	ourCtx.getRestfulClientFactory().setSocketTimeout(1200 * 1000);
	ourServerBase = "http://localhost:" + ourPort + "/fhir";
	ourClient = ourCtx.newRestfulGenericClient(ourServerBase);
	ourClient.registerInterceptor(new LoggingInterceptor(true));

}
 
开发者ID:daimor,项目名称:isc-hapi-fhir-jpaserver,代码行数:32,代码来源:ExampleServerIT.java



注:本文中的ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java VersionRequestProto类代码示例发布时间:2022-05-22
下一篇:
Java RegisterNodeManagerResponseProtoOrBuilder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap