class NssmfManagerServiceImpl implements NssmfManagerService {

    @Override
    public ResponseEntity allocateNssi(NssmfAdapterNBIRequest request) {
        try {

            if (StringUtils.isNotBlank(request.getServiceInfo().getNssiId())) {
                return buildResponse(buildNssmfManager(request, ActionType.MODIFY).modifyNssi(request));
            }

            return buildResponse(buildNssmfManager(request, ActionType.ALLOCATE).allocateNssi(request));

        } catch (ApplicationException e) {
            return e.buildErrorResponse();
        }
    }

}