Search in sources :

Example 1 with CommonDataNodeCreationResponseDTO

use of com.odysseusinc.arachne.commons.api.v1.dto.CommonDataNodeCreationResponseDTO in project ArachneCentralAPI by OHDSI.

the class BaseDataNodeController method createDataNode.

@ApiOperation("Create new data node.")
@RequestMapping(value = "/api/v1/data-nodes", method = RequestMethod.POST)
public JsonResult<CommonDataNodeCreationResponseDTO> createDataNode(Principal principal) throws PermissionDeniedException, AlreadyExistException {
    final IUser user = getUser(principal);
    final DN dataNode = buildEmptyDN();
    CommonDataNodeCreationResponseDTO responseDTO = createDataNode(dataNode, principal);
    final JsonResult<CommonDataNodeCreationResponseDTO> result = new JsonResult<>(JsonResult.ErrorCode.NO_ERROR);
    result.setResult(responseDTO);
    return result;
}
Also used : CommonDataNodeCreationResponseDTO(com.odysseusinc.arachne.commons.api.v1.dto.CommonDataNodeCreationResponseDTO) IUser(com.odysseusinc.arachne.portal.model.IUser) JsonResult(com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with CommonDataNodeCreationResponseDTO

use of com.odysseusinc.arachne.commons.api.v1.dto.CommonDataNodeCreationResponseDTO in project ArachneCentralAPI by OHDSI.

the class DataNodeToCommonDataNodeCreationResponseDTOConverter method convert.

@Override
public CommonDataNodeCreationResponseDTO convert(DataNode source) {
    CommonDataNodeCreationResponseDTO dto = new CommonDataNodeCreationResponseDTO();
    dto.setDataNodeUuid(source.getSid());
    dto.setToken(source.getToken());
    dto.setCentralId(source.getId());
    return dto;
}
Also used : CommonDataNodeCreationResponseDTO(com.odysseusinc.arachne.commons.api.v1.dto.CommonDataNodeCreationResponseDTO)

Aggregations

CommonDataNodeCreationResponseDTO (com.odysseusinc.arachne.commons.api.v1.dto.CommonDataNodeCreationResponseDTO)2 JsonResult (com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult)1 IUser (com.odysseusinc.arachne.portal.model.IUser)1 ApiOperation (io.swagger.annotations.ApiOperation)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1