Tabnine Logo
MetaService.getJobDef
Code IndexAdd Tabnine to your IDE (free)

How to use
getJobDef
method
in
com.enioka.admin.MetaService

Best Java code snippets using com.enioka.admin.MetaService.getJobDef (Showing top 6 results out of 315)

origin: com.enioka.jqm/jqm-admin

public static void syncJobDefs(DbConn cnx, List<JobDefDto> dtos)
{
  for (JobDefDto existing : getJobDef(cnx))
  {
    boolean foundInNewSet = false;
    for (JobDefDto newdto : dtos)
    {
      if (newdto.getId() != null && newdto.getId().equals(existing.getId()))
      {
        foundInNewSet = true;
        break;
      }
    }
    if (!foundInNewSet)
    {
      deleteJobDef(cnx, existing.getId());
    }
  }
  for (JobDefDto dto : dtos)
  {
    upsertJobDef(cnx, dto);
  }
}
origin: enioka/jqm

public static void syncJobDefs(DbConn cnx, List<JobDefDto> dtos)
{
  for (JobDefDto existing : getJobDef(cnx))
  {
    boolean foundInNewSet = false;
    for (JobDefDto newdto : dtos)
    {
      if (newdto.getId() != null && newdto.getId().equals(existing.getId()))
      {
        foundInNewSet = true;
        break;
      }
    }
    if (!foundInNewSet)
    {
      deleteJobDef(cnx, existing.getId());
    }
  }
  for (JobDefDto dto : dtos)
  {
    upsertJobDef(cnx, dto);
  }
}
origin: enioka/jqm

JobDefDto dto = MetaService.getJobDef(cnx, i);
Assert.assertEquals(0, dto.getParameters().size());
JobDefDto dto2 = MetaService.getJobDef(cnx, i);
Assert.assertEquals(1, dto2.getSchedules().size());
Assert.assertEquals("5 * * * *", dto2.getSchedules().get(0).getCronExpression());
dto2 = MetaService.getJobDef(cnx, i);
Assert.assertEquals(update.getTimeInMillis(), dto2.getSchedules().get(0).getLastUpdated().getTimeInMillis());
MetaService.upsertJobDef(cnx, dto2);
cnx.commit();
dto2 = MetaService.getJobDef(cnx, i);
Assert.assertEquals(1, dto2.getSchedules().get(0).getParameters().size());
Assert.assertNotEquals(update.getTimeInMillis(), dto2.getSchedules().get(0).getLastUpdated().getTimeInMillis());
MetaService.upsertJobDef(cnx, dto2);
cnx.commit();
dto2 = MetaService.getJobDef(cnx, i);
Assert.assertEquals(0, dto2.getSchedules().get(0).getParameters().size());
MetaService.upsertJobDef(cnx, dto2);
cnx.commit();
dto2 = MetaService.getJobDef(cnx, i);
Assert.assertEquals(0, dto2.getSchedules().size());
dto2 = MetaService.getJobDef(cnx, i);
Assert.assertEquals(2, dto2.getSchedules().size());
origin: enioka/jqm

@Test // Commented - waiting for one minute is long.
public void testSimpleSchedule()
{
  int id = CreationTools.createJobDef(null, true, "pyl.EngineApiSendMsg", null, "jqm-tests/jqm-test-pyl/target/test.jar",
      TestHelpers.qVip, 42, "MarsuApplication", null, "Franquin", "ModuleMachin", "other", "other", true, cnx);
  int scheduleId = JobRequest.create("MarsuApplication", "test user").setRecurrence("* * * * *").addParameter("key1", "value1")
      .submit();
  JobDef jd_client = JqmClientFactory.getClient().getJobDefinition("MarsuApplication");
  Assert.assertEquals(id, (int) jd_client.getId());
  Assert.assertEquals(1, jd_client.getSchedules().size());
  Assert.assertEquals(scheduleId, jd_client.getSchedules().get(0).getId());
  Assert.assertEquals("* * * * *", jd_client.getSchedules().get(0).getCronExpression());
  addAndStartEngine();
  TestHelpers.waitFor(1, 150000, cnx);
  Assert.assertEquals(1, TestHelpers.getOkCount(cnx));
  JobDefDto jd = MetaService.getJobDef(cnx, id);
  Assert.assertEquals(1, jd.getSchedules().size());
  JqmClientFactory.getClient().removeRecurrence(scheduleId);
  jd = MetaService.getJobDef(cnx, id);
  Assert.assertEquals(0, jd.getSchedules().size());
  Assert.assertTrue(Query.create().run().get(0).isFromSchedule());
}
origin: enioka/jqm

JobDefDto jd = MetaService.getJobDef(cnx, idJobDef);
Assert.assertEquals(3, (int) jd.getSchedules().get(0).getPriority());
Assert.assertEquals("* * * * *", jd.getSchedules().get(0).getCronExpression());
jd = MetaService.getJobDef(cnx, idJobDef);
Assert.assertEquals("1 * * * *", jd.getSchedules().get(0).getCronExpression());
jd = MetaService.getJobDef(cnx, idJobDef);
Assert.assertEquals(TestHelpers.qSlow, jd.getSchedules().get(0).getQueue());
jd = MetaService.getJobDef(cnx, idJobDef);
Assert.assertEquals(4, (int) jd.getSchedules().get(0).getPriority());
origin: enioka/jqm

Assert.assertEquals(1, MetaService.getJobDef(cnx, idJobDef1).getSchedules().size());
JqmClientFactory.getClient().removeRecurrence(idRec);
Assert.assertEquals(0, MetaService.getJobDef(cnx, idJobDef1).getSchedules().size());
com.enioka.adminMetaServicegetJobDef

Popular methods of MetaService

  • getNodes
  • getQueueMappings
  • upsertNode
  • changeUserPassword
  • getGlobalParameter
  • getJndiObjectResource
  • getNode
  • getRoles
  • upsertJndiObjectResource
    Update or insert a resource. Convention is that if dto.id is null, we always insert. If non null, al
  • upsertJobDef
  • addSubElementsToDto
  • deleteAllTransac
    This method is an exception - it does not deal with metadata but transactional data. It is included
  • addSubElementsToDto,
  • deleteAllTransac,
  • deleteGlobalParameter,
  • deleteJndiObjectResource,
  • deleteJobDef,
  • deleteQueue,
  • deleteQueueMapping,
  • deleteRole,
  • deleteUser

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Table (org.hibernate.mapping)
    A relational table
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now