コード例 #1
0
ファイル: Commit.java プロジェクト: kingqh/controller
  @Override
  protected Element handleWithNoSubsequentOperations(
      final Document document, final XmlElement operationElement) throws DocumentedException {

    boolean commitStatus = transactionProvider.commitTransaction();
    LOG.trace("Transaction commited succesfuly {}", commitStatus);

    return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
  }
コード例 #2
0
ファイル: EditConfig.java プロジェクト: opendaylight/netconf
  @VisibleForTesting
  Element getResponseInternal(final Document document, final ConfigExecution configExecution)
      throws DocumentedException {

    try {
      getConfigSubsystemFacade().executeConfigExecution(configExecution);
    } catch (final ValidationException e) {
      LOG.warn("Test phase for {} failed", EditConfigXmlParser.EDIT_CONFIG, e);
      final Map<String, String> errorInfo = new HashMap<>();
      errorInfo.put(ErrorTag.OPERATION_FAILED.name(), e.getMessage());
      throw new DocumentedException(
          "Test phase: " + e.getMessage(),
          e,
          ErrorType.APPLICATION,
          ErrorTag.OPERATION_FAILED,
          ErrorSeverity.ERROR,
          errorInfo);
    }

    LOG.trace("Operation {} successful", EditConfigXmlParser.EDIT_CONFIG);

    return XmlUtil.createElement(document, XmlNetconfConstants.OK, Optional.<String>absent());
  }