Package org.sonatype.nexus.rest.model

Examples of org.sonatype.nexus.rest.model.ScheduledServicePropertyResource


      startDate = DateUtils.round(startDate, Calendar.DAY_OF_MONTH);
      scheduledTask.setCronCommand("0 0 12 ? * WED");

      scheduledTask.setTypeId(UpdateIndexTaskDescriptor.ID);

      ScheduledServicePropertyResource prop = new ScheduledServicePropertyResource();
      prop.setKey("repositoryId");
      prop.setValue("all_repo");
      scheduledTask.addProperty(prop);
    }
    return scheduledTask;
  }
View Full Code Here


  protected List<ScheduledServicePropertyResource> formatServiceProperties(Map<String, String> map) {
    List<ScheduledServicePropertyResource> list = new ArrayList<ScheduledServicePropertyResource>();

    for (String key : map.keySet()) {
      if (!TaskUtils.isPrivateProperty(key)) {
        ScheduledServicePropertyResource prop = new ScheduledServicePropertyResource();
        prop.setKey(key);
        prop.setValue(map.get(key));
        list.add(prop);
      }
    }

    return list;
View Full Code Here

    String serviceType = model.getTypeId();

    NexusTask<?> task = getNexusScheduler().createTaskInstance(serviceType);

    for (Iterator iter = model.getProperties().iterator(); iter.hasNext(); ) {
      ScheduledServicePropertyResource prop = (ScheduledServicePropertyResource) iter.next();
      task.addParameter(prop.getKey(), prop.getValue());
    }

    TaskUtils.setAlertEmail(task, model.getAlertEmail());
    TaskUtils.setId(task, model.getId());
    TaskUtils.setName(task, model.getName());
View Full Code Here

      scheduledTask.setTypeId("UpdateIndexTask");
    }
    scheduledTask.setSchedule("manual");

    if (repoId != null) {
      ScheduledServicePropertyResource prop = new ScheduledServicePropertyResource();
      prop.setKey("repositoryId");
      prop.setValue(repoId);
      scheduledTask.addProperty(prop);
    }

    Status status = TaskScheduleUtil.create(scheduledTask);
    Assert.assertTrue(status.isSuccess());
View Full Code Here

        (RepositoryProxyResource) repositoryMessageUtil.getRepository(REPO_RELEASE_PROXY_REPO1);
    proxy.getRemoteStorage().setRemoteStorageUrl("http://localhost:" + proxyPort + "/");
    repositoryMessageUtil.updateRepo(proxy);

    // expire caches
    ScheduledServicePropertyResource repoOrGroupProp = new ScheduledServicePropertyResource();
    repoOrGroupProp.setKey("repositoryId");
    repoOrGroupProp.setValue(REPO_RELEASE_PROXY_REPO1);
    TaskScheduleUtil.runTask(ExpireCacheTaskDescriptor.ID, repoOrGroupProp);

    // run snapshot remover
    runSnapshotRemover("nexus-test-harness-snapshot-repo", 0, 0, true);
View Full Code Here

  protected void runSnapshotRemover(String repositoryId, int minSnapshotsToKeep, int removeOlderThanDays,
                                    boolean removeIfReleaseExists)
      throws Exception
  {
    ScheduledServicePropertyResource repositoryProp = new ScheduledServicePropertyResource();
    repositoryProp.setKey("repositoryId");
    repositoryProp.setValue(repositoryId);

    ScheduledServicePropertyResource keepSnapshotsProp = new ScheduledServicePropertyResource();
    keepSnapshotsProp.setKey("minSnapshotsToKeep");
    keepSnapshotsProp.setValue(String.valueOf(minSnapshotsToKeep));

    ScheduledServicePropertyResource ageProp = new ScheduledServicePropertyResource();
    ageProp.setKey("removeOlderThanDays");
    ageProp.setValue(String.valueOf(removeOlderThanDays));

    ScheduledServicePropertyResource removeReleasedProp = new ScheduledServicePropertyResource();
    removeReleasedProp.setKey("removeIfReleaseExists");
    removeReleasedProp.setValue(String.valueOf(removeIfReleaseExists));

    TaskScheduleUtil.runTask(SnapshotRemovalTaskDescriptor.ID, repositoryProp, keepSnapshotsProp, ageProp,
        removeReleasedProp);
  }
View Full Code Here

    base.setTypeId("TypeId");
    base.setName("Name");
    base.setAlertEmail("foo@bar.org");
    base.setEnabled(true);

    ScheduledServicePropertyResource prop1 = new ScheduledServicePropertyResource();
    prop1.setKey("id1");
    prop1.setValue("value1");
    base.addProperty(prop1);

    ScheduledServicePropertyResource prop2 = new ScheduledServicePropertyResource();
    prop2.setKey("id2");
    prop2.setValue("value2");
    base.addProperty(prop2);

    status.setResource(base);

    ScheduledServiceResourceStatusResponse resource = new ScheduledServiceResourceStatusResponse();
View Full Code Here

    resource.setTypeId("TypeId");
    resource.setName("Name");
    resource.setAlertEmail("foo@bar.org");
    resource.setEnabled(true);

    ScheduledServicePropertyResource prop1 = new ScheduledServicePropertyResource();
    prop1.setKey("id1");
    prop1.setValue("value1");
    resource.addProperty(prop1);

    ScheduledServicePropertyResource prop2 = new ScheduledServicePropertyResource();
    prop2.setKey("id2");
    prop2.setValue("value2");
    resource.addProperty(prop2);

    ScheduledServiceResourceResponse resourceResponse = new ScheduledServiceResourceResponse();
    resourceResponse.setData(resource);
View Full Code Here

    resource.setTypeId("TypeId");
    resource.setAlertEmail("foo@bar.org");
    resource.setName("Name");
    resource.setEnabled(true);

    ScheduledServicePropertyResource prop1 = new ScheduledServicePropertyResource();
    prop1.setKey("id1");
    prop1.setValue("value1");
    resource.addProperty(prop1);

    ScheduledServicePropertyResource prop2 = new ScheduledServicePropertyResource();
    prop2.setKey("id2");
    prop2.setValue("value2");
    resource.addProperty(prop2);

    ScheduledServiceResourceResponse resourceResponse = new ScheduledServiceResourceResponse();
    resourceResponse.setData(resource);
View Full Code Here

    resource.setAlertEmail("foo@bar.org");
    resource.setName("Name");
    resource.setEnabled(true);
    resource.setRecurringTime("recurringTime");

    ScheduledServicePropertyResource prop1 = new ScheduledServicePropertyResource();
    prop1.setKey("id1");
    prop1.setValue("value1");
    resource.addProperty(prop1);

    ScheduledServicePropertyResource prop2 = new ScheduledServicePropertyResource();
    prop2.setKey("id2");
    prop2.setValue("value2");
    resource.addProperty(prop2);

    ScheduledServiceResourceResponse resourceResponse = new ScheduledServiceResourceResponse();
    resourceResponse.setData(resource);
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.rest.model.ScheduledServicePropertyResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.