public RegistryResponseType provideAndRegisterDocumentSetB(
      ProvideAndRegisterDocumentSetRequestType msg, AssertionType assertion) {
    LOG.debug("Begin provideAndRegisterDocumentSetb()");
    XDRHelper helper = new XDRHelper();
    RegistryErrorList errorList = helper.validateDocumentMetaData(msg);

    RegistryResponseType result = null;

    if (errorList.getHighestSeverity().equals(NhincConstants.XDS_REGISTRY_ERROR_SEVERITY_ERROR)) {
      result = helper.createErrorResponse(errorList);
    } else {
      LOG.info(" Request contained " + msg.getDocument().size() + " documents.");
      LOG.info(" Request Id: " + msg.getSubmitObjectsRequest().getId());

      List<String> recips = helper.getIntendedRecepients(msg);

      if (recips != null) {
        List<String> xdrBeans = helper.getRoutingBeans(recips);
        RoutingObjectFactory factory = new RoutingObjectFactory();

        for (String bean : xdrBeans) {
          LOG.debug("Bean name = " + bean);
          XDRRouting proxy = factory.getNhinXDRRouting(bean);
          result = proxy.provideAndRegisterDocumentSetB(msg, assertion);
        }
      } else {
        LOG.debug("No beans to forward the message to");
        result = helper.createPositiveAck();
      }
    }
    return result;
  }
예제 #2
0
  @Ignore
  public void testgetIntendedRecepients_NoRecip() {
    System.out.println("testgetIntendedRecepients_NoRecip");
    ProvideAndRegisterDocumentSetRequestType body = new XDRMessageHelper().getSampleMessage();
    XDRHelper instance = createHelper();

    List<String> result = instance.getIntendedRecepients(body);

    assertNotNull(result);
  }
예제 #3
0
  @Test
  public void testgetIntendedRecepients_Null() {
    System.out.println("testgetIntendedRecepients_Null");
    ProvideAndRegisterDocumentSetRequestType body = null;
    XDRHelper instance = createHelper();

    List<String> result = instance.getIntendedRecepients(body);

    assertNull(result);
  }
예제 #4
0
  @Test
  public void testgetIntendedRecepients_NullSubmitObj() {
    System.out.println("testgetIntendedRecepients_NullSubmitObj");
    ProvideAndRegisterDocumentSetRequestType body = new XDRMessageHelper().getSampleMessage();
    XDRHelper instance = createHelper();

    body.setSubmitObjectsRequest(null);

    List<String> result = instance.getIntendedRecepients(body);

    assertNull(result);
  }
예제 #5
0
  @Test
  public void testgetIntendedRecepients_Valid() {
    System.out.println("testgetIntendedRecepients_Valid");
    ProvideAndRegisterDocumentSetRequestType body =
        new XDRMessageHelper()
            .getSampleMessage("ProvideAndRegisterDocumentSet-IntendedRecpient.xml");
    XDRHelper instance = createHelper();

    List<String> result = instance.getIntendedRecepients(body);

    assertNotNull(result);
    assertEquals(4, result.size());
  }