use of org.apache.nifi.web.api.dto.action.component.details.ExtensionDetailsDTO in project nifi by apache.
the class DtoFactory method createComponentDetailsDto.
/**
* Creates a ComponentDetailsDTO for the specified ComponentDetails.
*
* @param componentDetails details
* @return dto
*/
private ComponentDetailsDTO createComponentDetailsDto(final ComponentDetails componentDetails) {
if (componentDetails == null) {
return null;
}
if (componentDetails instanceof FlowChangeExtensionDetails) {
final ExtensionDetailsDTO processorDetails = new ExtensionDetailsDTO();
processorDetails.setType(((ExtensionDetails) componentDetails).getType());
return processorDetails;
} else if (componentDetails instanceof FlowChangeRemoteProcessGroupDetails) {
final RemoteProcessGroupDetailsDTO remoteProcessGroupDetails = new RemoteProcessGroupDetailsDTO();
remoteProcessGroupDetails.setUri(((RemoteProcessGroupDetails) componentDetails).getUri());
return remoteProcessGroupDetails;
} else {
throw new WebApplicationException(new IllegalArgumentException(String.format("Unrecognized type of component details encountered %s during serialization. ", componentDetails.toString())));
}
}
Aggregations