Ejemplo n.º 1
0
  public EndpointResponse removeMediaChannel(RemoveMediaChannelRequest request) {
    try {
      mediaChannelDao.remove(request.getMediaChannelId());
      return EndpointHelper.createResponse(EndpointResponse.class, request);

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(EndpointResponse.class, request, e);
    }
  }
Ejemplo n.º 2
0
  public EndpointResponse updateTransformationRule(UpdateTransformationRuleRequest request) {
    try {
      transformationRuleDao.update(request.getTransformationRule());
      return EndpointHelper.createResponse(EndpointResponse.class, request);

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(EndpointResponse.class, request, e);
    }
  }
Ejemplo n.º 3
0
  public EndpointResponse updateWorkflow(UpdateWorkflowRequest request) {
    try {
      workflowDao.update(request.getWorkflow());
      return EndpointHelper.createResponse(EndpointResponse.class, request);

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(EndpointResponse.class, request, e);
    }
  }
Ejemplo n.º 4
0
  public EndpointResponse removeWorkflowClass(RemoveWorkflowClassRequest request) {
    try {
      workflowClassDao.remove(request.getWorkflowClassId());
      return EndpointHelper.createResponse(EndpointResponse.class, request);

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(EndpointResponse.class, request, e);
    }
  }
Ejemplo n.º 5
0
  public EndpointResponse removeJob(RemoveJobRequest request) {
    try {
      jobDao.remove(request.getJobId());
      return EndpointHelper.createResponse(EndpointResponse.class, request);

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(EndpointResponse.class, request, e);
    }
  }
Ejemplo n.º 6
0
  public ListWorkflowsResponse listWorkflows(ListWorkflowsRequest request) {
    try {
      ListWorkflowsResponse r = EndpointHelper.createResponse(ListWorkflowsResponse.class, request);
      r.setWorkflows(workflowDao.findWorkflowsInState(request.getWorkflowState()));
      return r;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(ListWorkflowsResponse.class, request, e);
    }
  }
Ejemplo n.º 7
0
  public ListJobsResponse listJobs(ListJobsRequest request) {
    try {
      ListJobsResponse r = EndpointHelper.createResponse(ListJobsResponse.class, request);
      r.setJobs(jobDao.findJobs(request.getWorkflowId(), request.getJobState()));
      return r;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(ListJobsResponse.class, request, e);
    }
  }
Ejemplo n.º 8
0
  public FindWorkflowResponse findWorkflow(FindWorkflowRequest request) {
    try {
      FindWorkflowResponse r = EndpointHelper.createResponse(FindWorkflowResponse.class, request);
      r.setWorkflow(workflowDao.get(request.getWorkflowId()));
      return r;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(FindWorkflowResponse.class, request, e);
    }
  }
Ejemplo n.º 9
0
  public EndpointResponse submitEvent(SubmitEventRequest request) {

    try {
      workflowEngine.submitEvent(request.getEvent());
      return EndpointHelper.createResponse(EndpointResponse.class, request);

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(EndpointResponse.class, request, e);
    }
  }
Ejemplo n.º 10
0
  public FindMediaChannelResponse findMediaChannel(FindMediaChannelRequest request) {
    try {
      FindMediaChannelResponse r =
          EndpointHelper.createResponse(FindMediaChannelResponse.class, request);
      r.setMediaChannel(mediaChannelDao.get(request.getMediaChannelId()));
      return r;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(FindMediaChannelResponse.class, request, e);
    }
  }
Ejemplo n.º 11
0
  public FindJobResponse findJob(FindJobRequest request) {

    try {
      FindJobResponse r = EndpointHelper.createResponse(FindJobResponse.class, request);
      r.setJob(jobDao.get(request.getJobId()));
      return r;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(FindJobResponse.class, request, e);
    }
  }
Ejemplo n.º 12
0
  public EndpointResponse submitJob(SubmitJobRequest request) {

    try {
      jobDao.add(request.getJob());
      jobDispatcher.notifyNewJobAdded();
      return EndpointHelper.createResponse(EndpointResponse.class, request);

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(EndpointResponse.class, request, e);
    }
  }
Ejemplo n.º 13
0
  public ListTransformationRulesResponse listTransformationRules(EndpointRequest request) {
    try {
      ListTransformationRulesResponse r =
          EndpointHelper.createResponse(ListTransformationRulesResponse.class, request);
      r.setTransformationRules(transformationRuleDao.findAll());
      return r;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(ListTransformationRulesResponse.class, request, e);
    }
  }
Ejemplo n.º 14
0
  public ListWorkflowClassesResponse listWorkflowClasses(ListWorkflowClassesRequest request) {
    try {
      ListWorkflowClassesResponse r =
          EndpointHelper.createResponse(ListWorkflowClassesResponse.class, request);
      r.setWorkflowClasses(workflowClassDao.findAll()); // todo more criteria
      return r;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(ListWorkflowsResponse.class, request, e);
    }
  }
Ejemplo n.º 15
0
  public CreateMediaChannelResponse createMediaChannel(CreateMediaChannelRequest request) {
    try {
      CreateMediaChannelResponse response =
          EndpointHelper.createResponse(CreateMediaChannelResponse.class, request);
      response.setMediaChannel(mediaChannelDao.add(request.getMediaChannel()));
      return response;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(CreateMediaChannelResponse.class, request, e);
    }
  }
Ejemplo n.º 16
0
  public ListMediaChannelsResponse listMediaChannels(ListMediaChannelsRequest request) {
    try {
      ListMediaChannelsResponse r =
          EndpointHelper.createResponse(ListMediaChannelsResponse.class, request);
      r.setMediaChannels(mediaChannelDao.findAll());
      return r;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(FindMediaChannelResponse.class, request, e);
    }
  }
Ejemplo n.º 17
0
  public CreateWorkflowClassResponse createWorkflowClass(CreateWorkflowClassRequest request) {
    try {
      CreateWorkflowClassResponse response =
          EndpointHelper.createResponse(CreateWorkflowClassResponse.class, request);
      response.setWorkflowClass(workflowClassDao.add(request.getWorkflowClass()));
      return response;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(CreateWorkflowClassResponse.class, request, e);
    }
  }
Ejemplo n.º 18
0
  public FindTransformationRuleResponse findTransformationRule(
      FindTransformationRuleRequest request) {
    try {
      FindTransformationRuleResponse r =
          EndpointHelper.createResponse(FindTransformationRuleResponse.class, request);
      r.setTransformationRule(transformationRuleDao.get(request.getTransformationRuleId()));
      return r;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(FindTransformationRuleResponse.class, request, e);
    }
  }
Ejemplo n.º 19
0
  public CreateTransformationRuleResponse createTransformationRule(
      CreateTransformationRuleRequest request) {
    try {
      CreateTransformationRuleResponse response =
          EndpointHelper.createResponse(CreateTransformationRuleResponse.class, request);
      response.setTransformationRule(transformationRuleDao.add(request.getTransformationRule()));
      return response;

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(CreateTransformationRuleResponse.class, request, e);
    }
  }
Ejemplo n.º 20
0
  public EndpointResponse removeWorkflow(RemoveWorkflowRequest request) {
    try {
      workflowDao.remove(request.getWorkflowId());

      for (Job j : jobDao.findJobs(request.getWorkflowId(), null)) {
        jobDao.remove(j.get_id());
      }

      return EndpointHelper.createResponse(EndpointResponse.class, request);

    } catch (Exception e) {
      return EndpointHelper.createErrorResponse(EndpointResponse.class, request, e);
    }
  }