当前位置: 首页>>代码示例>>Java>>正文


Java LoggingInterceptor.setLogRequestSummary方法代码示例

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


在下文中一共展示了LoggingInterceptor.setLogRequestSummary方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: testSearchConsent

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

	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);

		Identifier searchParam = new Identifier();
		searchParam.setSystem(iExHubDomainOid).setValue(defaultPatientId);
		Bundle response = client
				.search()
				.forResource(Consent.class)
				.where(Patient.IDENTIFIER.exactly().identifier(searchParam.getId()))
				.returnBundle(Bundle.class).execute();

		assertTrue("Error - unexpected return value for testSearchConsent", response != null);
	} catch (Exception e) {
		fail(e.getMessage());
	}
}
 
开发者ID:bhits,项目名称:iexhub,代码行数:32,代码来源:ConsentDstu3Test.java

示例3: testCreateBasicConsent

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入方法依赖的package包/类
/**
 * Test method for Basic Consent Content
 * {@link org.iexhub.services.JaxRsConsentRestProvider\#create(Patient patient, String theConditional)}
 * 
 * @author Ioana Singureanu
 */
@Test
public void testCreateBasicConsent() {

	// Create a Privacy Consent as a Consent to be submitted as document
	// using ITI-41
	String currentTest = "BasicConsent";
	try {
		Logger logger = LoggerFactory.getLogger(ConsentDstu3Test.class);
		LoggingInterceptor loggingInterceptor = new LoggingInterceptor();
		loggingInterceptor.setLogRequestSummary(true);
		loggingInterceptor.setLogRequestBody(true);
		loggingInterceptor.setLogger(logger);

		Consent consent = createBasicTestConsent();

		// Use the narrative generator
		// @TODO: add generator Thymeleaf templates
		// ctxt.setNarrativeGenerator(new  DefaultThymeleafNarrativeGenerator());

		String xmlEncodedGranularConsent = ctxt.newXmlParser().setPrettyPrint(true)
				.encodeResourceToString(consent);
		FileUtils.writeStringToFile(new File(testResourcesPath+"/XML/"+currentTest+".xml"), xmlEncodedGranularConsent);
		String jsonEncodedGranularConsent = ctxt.newJsonParser().setPrettyPrint(true)
				.encodeResourceToString(consent);
		FileUtils.writeStringToFile(new File(testResourcesPath+"/JSON/"+currentTest+".json"), jsonEncodedGranularConsent);

		// create FHIR client
		IGenericClient client = ctxt.newRestfulGenericClient(serverBaseUrl);
		client.registerInterceptor(loggingInterceptor);
		 
		//  invoke Consent service
		client.create().resource(consent).execute();
	} catch (Exception e) {
		fail( e.getMessage());
	}
}
 
开发者ID:bhits,项目名称:iexhub,代码行数:43,代码来源:ConsentDstu3Test.java

示例4: testUpdateBasicConsent

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入方法依赖的package包/类
/**
 * Test method for Basic Consent Content update
 * {@link org.iexhub.services.JaxRsConsentRestProvider\#create(Patient patient, String theConditional)}
 * 
 * @author A. Sute
 */
@Test
public void testUpdateBasicConsent() {

	// Create a Privacy Consent as a Consent to be submitted as document
	// using ITI-41
	String currentTest = "BasicConsentUpdate";
	try {
		Logger logger = LoggerFactory.getLogger(ConsentDstu3Test.class);
		LoggingInterceptor loggingInterceptor = new LoggingInterceptor();
		loggingInterceptor.setLogRequestSummary(true);
		loggingInterceptor.setLogRequestBody(true);
		loggingInterceptor.setLogger(logger);

		Consent consent = createBasicTestConsent(UUID.fromString("819efe60-d1bb-47b7-b5d6-ab5fa073eef0"));

		// Use the narrative generator
		// @TODO: add generator Thymeleaf templates
		// ctxt.setNarrativeGenerator(new  DefaultThymeleafNarrativeGenerator());

		String xmlEncodedGranularConsent = ctxt.newXmlParser().setPrettyPrint(true)
				.encodeResourceToString(consent);
		FileUtils.writeStringToFile(new File(testResourcesPath+"/XML/"+currentTest+".xml"), xmlEncodedGranularConsent);
		String jsonEncodedGranularConsent = ctxt.newJsonParser().setPrettyPrint(true)
				.encodeResourceToString(consent);
		FileUtils.writeStringToFile(new File(testResourcesPath+"/JSON/"+currentTest+".json"), jsonEncodedGranularConsent);

		// create FHIR client
		IGenericClient client = ctxt.newRestfulGenericClient(serverBaseUrl);
		client.registerInterceptor(loggingInterceptor);
		
		//  invoke Consent service
		client.update().resource(consent).execute();
	} catch (Exception e) {
		fail( e.getMessage());
	}
}
 
开发者ID:bhits,项目名称:iexhub,代码行数:43,代码来源:ConsentDstu3Test.java

示例5: testSearchWithPostAndInvalidParameters

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入方法依赖的package包/类
@Test
public void testSearchWithPostAndInvalidParameters() throws Exception {
	IGenericClient client = ourCtx.newRestfulGenericClient("http://localhost:" + ourPort);
	LoggingInterceptor interceptor = new LoggingInterceptor();
	interceptor.setLogRequestSummary(true);
	interceptor.setLogRequestBody(true);
	interceptor.setLogRequestHeaders(false);
	interceptor.setLogResponseBody(false);
	interceptor.setLogResponseHeaders(false);
	interceptor.setLogResponseSummary(false);
	client.registerInterceptor(interceptor);
	try {
		client
				.search()
				.forResource(Patient.class)
				.where(new StringClientParam("foo").matches().value("bar"))
				.prettyPrint()
				.usingStyle(SearchStyleEnum.POST)
				.returnBundle(org.hl7.fhir.dstu3.model.Bundle.class)
				.encodedJson()
				.execute();
		fail();
	} catch (InvalidRequestException e) {
		assertThat(e.getMessage(), containsString("Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[Patient/_search] with parameters [[_pretty, foo]]"));
	}

}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:28,代码来源:SearchDstu3Test.java

示例6: testSearchWithPostAndInvalidParameters

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入方法依赖的package包/类
@Test
public void testSearchWithPostAndInvalidParameters() throws Exception {
	IGenericClient client = ourCtx.newRestfulGenericClient("http://localhost:" + ourPort);
	LoggingInterceptor interceptor = new LoggingInterceptor();
	interceptor.setLogRequestSummary(true);
	interceptor.setLogRequestBody(true);
	interceptor.setLogRequestHeaders(false);
	interceptor.setLogResponseBody(false);
	interceptor.setLogResponseHeaders(false);
	interceptor.setLogResponseSummary(false);
	client.registerInterceptor(interceptor);
	try {
		client
			.search()
			.forResource(Patient.class)
			.where(new StringClientParam("foo").matches().value("bar"))
			.prettyPrint()
			.usingStyle(SearchStyleEnum.POST)
			.returnBundle(org.hl7.fhir.r4.model.Bundle.class)
			.encodedJson()
			.execute();
		fail();
	} catch (InvalidRequestException e) {
		assertThat(e.getMessage(), containsString("Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[Patient/_search] with parameters [[_pretty, foo]]"));
	}

}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:28,代码来源:SearchR4Test.java

示例7: getGenericClient

import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; //导入方法依赖的package包/类
public static IGenericClient getGenericClient(String theServerBase) {
	// Create a logging interceptor
	LoggingInterceptor loggingInterceptor = new LoggingInterceptor();
	loggingInterceptor.setLogRequestSummary(true);
	loggingInterceptor.setLogRequestBody(true);

	IGenericClient client = context.newRestfulGenericClient(theServerBase);
	client.registerInterceptor(loggingInterceptor);
	return client;
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:11,代码来源:ModelUtil.java


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