test_class.declarator: PATIENT_UUID = "patientUuid"
test_class.modifier: private static final
test_class.original_string: private static final String PATIENT_UUID = "patientUuid";
test_class.type: String
test_class.var_name: PATIENT_UUID
test_class.declarator: VISIT_UUID = "visitUuid"
test_class.modifier: private static final
test_class.original_string: private static final String VISIT_UUID = "visitUuid";
test_class.type: String
test_class.var_name: VISIT_UUID
test_class.declarator: ENCOUNTER_UUID = "encounterUuid"
test_class.modifier: private static final
test_class.original_string: private static final String ENCOUNTER_UUID = "encounterUuid";
test_class.type: String
test_class.var_name: ENCOUNTER_UUID
test_class.declarator: OBS_UUID = "obsUuid"
test_class.modifier: private static final
test_class.original_string: private static final String OBS_UUID = "obsUuid";
test_class.type: String
test_class.var_name: OBS_UUID
test_class.declarator: FHIR_CLIENT_KEY = "fhir"
test_class.modifier: private static final
test_class.original_string: private static final String FHIR_CLIENT_KEY = "fhir";
test_class.type: String
test_class.var_name: FHIR_CLIENT_KEY
test_class.declarator: REST_CLIENT_KEY = "rest"
test_class.modifier: private static final
test_class.original_string: private static final String REST_CLIENT_KEY = "rest";
test_class.type: String
test_class.var_name: REST_CLIENT_KEY
test_class.declarator: FHIR_RESOURCE_LINK = "openmrs/ws/fhir/Patient/"
test_class.modifier: private static final
test_class.original_string: private static final String FHIR_RESOURCE_LINK = "openmrs/ws/fhir/Patient/";
test_class.type: String
test_class.var_name: FHIR_RESOURCE_LINK
test_class.declarator: REST_RESOURCE_LINK = "openmrs/ws/rest/v1/patient/"
test_class.modifier: private static final
test_class.original_string: private static final String REST_RESOURCE_LINK = "openmrs/ws/rest/v1/patient/";
test_class.type: String
test_class.var_name: REST_RESOURCE_LINK
test_class.declarator: PATIENT_CATEGORY = new SyncCategory("patient", Patient.class)
test_class.modifier: private static final
test_class.original_string: private static final SyncCategory PATIENT_CATEGORY = new SyncCategory("patient", Patient.class);
test_class.type: SyncCategory
test_class.var_name: PATIENT_CATEGORY
test_class.declarator: VISIT_CATEGORY = new SyncCategory("visit", Visit.class)
test_class.modifier: private static final
test_class.original_string: private static final SyncCategory VISIT_CATEGORY = new SyncCategory("visit", Visit.class);
test_class.type: SyncCategory
test_class.var_name: VISIT_CATEGORY
test_class.declarator: PARENT_ADDRESS = "http://localhost:8080/"
test_class.modifier: private static final
test_class.original_string: private static final String PARENT_ADDRESS = "http://localhost:8080/";
test_class.type: String
test_class.var_name: PARENT_ADDRESS
test_class.declarator: PARENT_FEED_LOCATION = "http://localhost:8080/openmrs"
test_class.modifier: private static final
test_class.original_string: private static final String PARENT_FEED_LOCATION = "http://localhost:8080/openmrs";
test_class.type: String
test_class.var_name: PARENT_FEED_LOCATION
test_class.declarator: USERNAME = "username"
test_class.modifier: private static final
test_class.original_string: private static final String USERNAME = "username";
test_class.type: String
test_class.var_name: USERNAME
test_class.declarator: PASSWORD = "password"
test_class.modifier: private static final
test_class.original_string: private static final String PASSWORD = "password";
test_class.type: String
test_class.var_name: PASSWORD
test_class.declarator: SYNC_ENDPOINT = "openmrs/ws/rest/sync2"
test_class.modifier: private static final
test_class.original_string: private static final String SYNC_ENDPOINT = "openmrs/ws/rest/sync2";
test_class.type: String
test_class.var_name: SYNC_ENDPOINT
test_class.declarator: REST_FULL_RESOURCE_URL = PARENT_ADDRESS + REST_RESOURCE_LINK + PATIENT_UUID
test_class.modifier: private static final
test_class.original_string: private static final String REST_FULL_RESOURCE_URL = PARENT_ADDRESS + REST_RESOURCE_LINK + PATIENT_UUID;
test_class.type: String
test_class.var_name: REST_FULL_RESOURCE_URL
test_class.declarator: FHIR_FULL_RESOURCE_URL = PARENT_ADDRESS + FHIR_RESOURCE_LINK + PATIENT_UUID
test_class.modifier: private static final
test_class.original_string: private static final String FHIR_FULL_RESOURCE_URL = PARENT_ADDRESS + FHIR_RESOURCE_LINK + PATIENT_UUID;
test_class.type: String
test_class.var_name: FHIR_FULL_RESOURCE_URL
test_class.declarator: PARENT_DESTINATION_URL = PARENT_ADDRESS + SYNC_ENDPOINT
test_class.modifier: private static final
test_class.original_string: private static final String PARENT_DESTINATION_URL = PARENT_ADDRESS + SYNC_ENDPOINT;
test_class.type: String
test_class.var_name: PARENT_DESTINATION_URL
test_class.declarator: LOCAL_INSTANCE_ID = "LocalId"
test_class.modifier: public static final
test_class.original_string: public static final String LOCAL_INSTANCE_ID = "LocalId";
test_class.type: String
test_class.var_name: LOCAL_INSTANCE_ID
test_class.declarator: administrationServiceMock
test_class.modifier: private
test_class.original_string: private AdministrationService administrationServiceMock;
test_class.type: AdministrationService
test_class.var_name: administrationServiceMock
test_class.declarator: syncConfigurationService
test_class.modifier: private
test_class.original_string: private SyncConfigurationService syncConfigurationService;
test_class.type: SyncConfigurationService
test_class.var_name: syncConfigurationService
test_class.declarator: expectedPatient
test_class.modifier: private
test_class.original_string: private Patient expectedPatient;
test_class.type: Patient
test_class.var_name: expectedPatient
test_class.declarator: expectedVisit
test_class.modifier: private
test_class.original_string: private Visit expectedVisit;
test_class.type: Visit
test_class.var_name: expectedVisit
test_class.declarator: expectedEncounter
test_class.modifier: private
test_class.original_string: private Encounter expectedEncounter;
test_class.type: Encounter
test_class.var_name: expectedEncounter
test_class.declarator: expectedOb
test_class.modifier: private
test_class.original_string: private Obs expectedOb;
test_class.type: Obs
test_class.var_name: expectedOb
test_class.declarator: links
test_class.modifier: private
test_class.original_string: private Map<String, String> links;
test_class.type: Map<String, String>
test_class.var_name: links
test_class.declarator: restHelper
test_class.modifier: private
test_class.original_string: private RESTClientHelper restHelper;
test_class.type: RESTClientHelper
test_class.var_name: restHelper
test_class.declarator: context
test_class.modifier: private
test_class.original_string: private Context context;
test_class.type: Context
test_class.var_name: context
test_class.file: api/src/test/java/org/openmrs/module/sync2/api/sync/SyncClientTest.java
test_class.identifier: SyncClientTest
test_case.body: @Test
      public void pullDataFromParent_shouldCallRestClient() {
          SyncClient resourceManager = new SyncClient();
  
          Object pulledObject = resourceManager.pullData(PATIENT_CATEGORY, REST_CLIENT_KEY,
                  REST_FULL_RESOURCE_URL, PARENT);
  
          assertThat((Patient) pulledObject, is(expectedPatient));
      }
test_case.class_method_signature: SyncClientTest.pullDataFromParent_shouldCallRestClient()
test_case.full_signature: @Test public void pullDataFromParent_shouldCallRestClient()
test_case.identifier: pullDataFromParent_shouldCallRestClient
test_case.invocations: pullData assertThat is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void pullDataFromParent_shouldCallRestClient()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(SyncClient.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(SyncClient.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: username
focal_class.modifier: private
focal_class.original_string: private String username;
focal_class.type: String
focal_class.var_name: username
focal_class.declarator: password
focal_class.modifier: private
focal_class.original_string: private String password;
focal_class.type: String
focal_class.var_name: password
focal_class.declarator: restTemplate = new RestTemplate()
focal_class.modifier: private
focal_class.original_string: private RestTemplate restTemplate = new RestTemplate();
focal_class.type: RestTemplate
focal_class.var_name: restTemplate
focal_class.file: api/src/main/java/org/openmrs/module/sync2/api/sync/SyncClient.java
focal_class.identifier: SyncClient
focal_class.class_method_signature: SyncClient.pullData(SyncCategory category, String clientName, String resourceUrl, OpenMRSSyncInstance instance)
focal_class.full_signature: public Object pullData(SyncCategory category, String clientName, String resourceUrl, OpenMRSSyncInstance instance)
focal_class.identifier: pullData
focal_class.modifiers: public
focal_class.parameters: (SyncCategory category, String clientName, String resourceUrl, OpenMRSSyncInstance instance)
focal_class.return: Object
focal_class.signature: Object pullData(SyncCategory category, String clientName, String resourceUrl, OpenMRSSyncInstance instance)
focal_class.class_method_signature: SyncClient.pushData(SyncCategory category, Object object, String clientName,
  			String resourceUrl, String action, OpenMRSSyncInstance instance)
focal_class.full_signature: public ResponseEntity<String> pushData(SyncCategory category, Object object, String clientName,
  			String resourceUrl, String action, OpenMRSSyncInstance instance)
focal_class.identifier: pushData
focal_class.modifiers: public
focal_class.parameters: (SyncCategory category, Object object, String clientName,
  			String resourceUrl, String action, OpenMRSSyncInstance instance)
focal_class.return: ResponseEntity<String>
focal_class.signature: ResponseEntity<String> pushData(SyncCategory category, Object object, String clientName,
  			String resourceUrl, String action, OpenMRSSyncInstance instance)
focal_class.class_method_signature: SyncClient.setUpCredentials(String clientName, OpenMRSSyncInstance instance)
focal_class.full_signature: private void setUpCredentials(String clientName, OpenMRSSyncInstance instance)
focal_class.identifier: setUpCredentials
focal_class.modifiers: private
focal_class.parameters: (String clientName, OpenMRSSyncInstance instance)
focal_class.return: void
focal_class.signature: void setUpCredentials(String clientName, OpenMRSSyncInstance instance)
focal_class.class_method_signature: SyncClient.prepareRestTemplate(ClientHelper clientHelper)
focal_class.full_signature: private void prepareRestTemplate(ClientHelper clientHelper)
focal_class.identifier: prepareRestTemplate
focal_class.modifiers: private
focal_class.parameters: (ClientHelper clientHelper)
focal_class.return: void
focal_class.signature: void prepareRestTemplate(ClientHelper clientHelper)
focal_class.class_method_signature: SyncClient.retrieveObject(SyncCategory category, String resourceUrl, String destinationUrl, String clientName,
  			OpenMRSSyncInstance instance)
focal_class.full_signature: private Object retrieveObject(SyncCategory category, String resourceUrl, String destinationUrl, String clientName,
  			OpenMRSSyncInstance instance)
focal_class.identifier: retrieveObject
focal_class.modifiers: private
focal_class.parameters: (SyncCategory category, String resourceUrl, String destinationUrl, String clientName,
  			OpenMRSSyncInstance instance)
focal_class.return: Object
focal_class.signature: Object retrieveObject(SyncCategory category, String resourceUrl, String destinationUrl, String clientName,
  			OpenMRSSyncInstance instance)
focal_class.class_method_signature: SyncClient.createObject(SyncCategory category, String resourceUrl, String destinationUrl,
  			Object object,
  			String clientName, OpenMRSSyncInstance instance)
focal_class.full_signature: private ResponseEntity<String> createObject(SyncCategory category, String resourceUrl, String destinationUrl,
  			Object object,
  			String clientName, OpenMRSSyncInstance instance)
focal_class.identifier: createObject
focal_class.modifiers: private
focal_class.parameters: (SyncCategory category, String resourceUrl, String destinationUrl,
  			Object object,
  			String clientName, OpenMRSSyncInstance instance)
focal_class.return: ResponseEntity<String>
focal_class.signature: ResponseEntity<String> createObject(SyncCategory category, String resourceUrl, String destinationUrl,
  			Object object,
  			String clientName, OpenMRSSyncInstance instance)
focal_class.class_method_signature: SyncClient.deleteObject(SyncCategory category, String resourceUrl, String destinationUrl,
  			String uuid,
  			String clientName, OpenMRSSyncInstance instance)
focal_class.full_signature: private ResponseEntity<String> deleteObject(SyncCategory category, String resourceUrl, String destinationUrl,
  			String uuid,
  			String clientName, OpenMRSSyncInstance instance)
focal_class.identifier: deleteObject
focal_class.modifiers: private
focal_class.parameters: (SyncCategory category, String resourceUrl, String destinationUrl,
  			String uuid,
  			String clientName, OpenMRSSyncInstance instance)
focal_class.return: ResponseEntity<String>
focal_class.signature: ResponseEntity<String> deleteObject(SyncCategory category, String resourceUrl, String destinationUrl,
  			String uuid,
  			String clientName, OpenMRSSyncInstance instance)
focal_class.class_method_signature: SyncClient.updateObject(SyncCategory category, String resourceUrl, String destinationUrl,
  			Object object,
  			String clientName, OpenMRSSyncInstance instance)
focal_class.full_signature: private ResponseEntity<String> updateObject(SyncCategory category, String resourceUrl, String destinationUrl,
  			Object object,
  			String clientName, OpenMRSSyncInstance instance)
focal_class.identifier: updateObject
focal_class.modifiers: private
focal_class.parameters: (SyncCategory category, String resourceUrl, String destinationUrl,
  			Object object,
  			String clientName, OpenMRSSyncInstance instance)
focal_class.return: ResponseEntity<String>
focal_class.signature: ResponseEntity<String> updateObject(SyncCategory category, String resourceUrl, String destinationUrl,
  			Object object,
  			String clientName, OpenMRSSyncInstance instance)
focal_class.class_method_signature: SyncClient.setRequestHeaders(ClientHelper clientHelper, HttpHeaders headers)
focal_class.full_signature: private HttpHeaders setRequestHeaders(ClientHelper clientHelper, HttpHeaders headers)
focal_class.identifier: setRequestHeaders
focal_class.modifiers: private
focal_class.parameters: (ClientHelper clientHelper, HttpHeaders headers)
focal_class.return: HttpHeaders
focal_class.signature: HttpHeaders setRequestHeaders(ClientHelper clientHelper, HttpHeaders headers)
focal_class.class_method_signature: SyncClient.exchange(ClientHelper helper, ClientHttpEntity request, Class clazz)
focal_class.full_signature: private ResponseEntity exchange(ClientHelper helper, ClientHttpEntity request, Class clazz)
focal_class.identifier: exchange
focal_class.modifiers: private
focal_class.parameters: (ClientHelper helper, ClientHttpEntity request, Class clazz)
focal_class.return: ResponseEntity
focal_class.signature: ResponseEntity exchange(ClientHelper helper, ClientHttpEntity request, Class clazz)
focal_class.class_method_signature: SyncClient.sendRequest(SyncCategory category, String destinationUrl, String clientName,
  			InnerRequest request)
focal_class.full_signature: private ClientHttpEntity<RequestWrapper> sendRequest(SyncCategory category, String destinationUrl, String clientName,
  			InnerRequest request)
focal_class.identifier: sendRequest
focal_class.modifiers: private
focal_class.parameters: (SyncCategory category, String destinationUrl, String clientName,
  			InnerRequest request)
focal_class.return: ClientHttpEntity<RequestWrapper>
focal_class.signature: ClientHttpEntity<RequestWrapper> sendRequest(SyncCategory category, String destinationUrl, String clientName,
  			InnerRequest request)
focal_class.class_method_signature: SyncClient.shouldWrappMessage(String clientName, OpenMRSSyncInstance instance)
focal_class.full_signature: private boolean shouldWrappMessage(String clientName, OpenMRSSyncInstance instance)
focal_class.identifier: shouldWrappMessage
focal_class.modifiers: private
focal_class.parameters: (String clientName, OpenMRSSyncInstance instance)
focal_class.return: boolean
focal_class.signature: boolean shouldWrappMessage(String clientName, OpenMRSSyncInstance instance)
focal_class.class_method_signature: SyncClient.getDestinationUri(OpenMRSSyncInstance instance, String clientName)
focal_class.full_signature: private String getDestinationUri(OpenMRSSyncInstance instance, String clientName)
focal_class.identifier: getDestinationUri
focal_class.modifiers: private
focal_class.parameters: (OpenMRSSyncInstance instance, String clientName)
focal_class.return: String
focal_class.signature: String getDestinationUri(OpenMRSSyncInstance instance, String clientName)
focal_method.body: public Object pullData(SyncCategory category, String clientName, String resourceUrl, OpenMRSSyncInstance instance) {
  		Object result = null;
  		setUpCredentials(clientName, instance);
  
  		ClientHelper clientHelper = ClientHelperFactory.createClient(clientName);
  		prepareRestTemplate(clientHelper);
  		String destinationUrl = getDestinationUri(instance, clientName);
  
  		try {
  			result = retrieveObject(category, resourceUrl, destinationUrl, clientName, instance);
  		}
  		catch (HttpClientErrorException e) {
  			if (e.getStatusCode().equals(HttpStatus.UNAUTHORIZED)) {
  				throw new SyncException("Unauthorized error during reading parent object: ", e);
  			}
  			if (!e.getStatusCode().equals(HttpStatus.NOT_FOUND)) {
  				throw new SyncException("Error during reading local object: ", e);
  			}
  		}
  		catch (URISyntaxException e) {
  			LOGGER.error(e.getMessage());
  		}
  		return result;
  	}
focal_method.class_method_signature: SyncClient.pullData(SyncCategory category, String clientName, String resourceUrl, OpenMRSSyncInstance instance)
focal_method.full_signature: public Object pullData(SyncCategory category, String clientName, String resourceUrl, OpenMRSSyncInstance instance)
focal_method.identifier: pullData
focal_method.invocations: setUpCredentials createClient prepareRestTemplate getDestinationUri retrieveObject equals getStatusCode equals getStatusCode error getMessage
focal_method.modifiers: public
focal_method.parameters: (SyncCategory category, String clientName, String resourceUrl, OpenMRSSyncInstance instance)
focal_method.return: Object
focal_method.signature: Object pullData(SyncCategory category, String clientName, String resourceUrl, OpenMRSSyncInstance instance)