Exemplo n.º 1
0
  @Override
  protected Object doExecute() throws Exception {
    checkFabricAvailable();
    if (delete) {
      set = false;
    }
    Version version =
        versionName != null
            ? fabricService.getVersion(versionName)
            : fabricService.getDefaultVersion();

    for (Profile profile : version.getProfiles()) {
      if (profileName.equals(profile.getId())) {
        editProfile(profile);
      }
    }
    return null;
  }
Exemplo n.º 2
0
 protected Profile[] getProfiles(Version version, List<String> names) {
   Profile[] allProfiles = version.getProfiles();
   List<Profile> profiles = new ArrayList<Profile>();
   if (names == null) {
     return new Profile[0];
   }
   for (String name : names) {
     Profile profile = null;
     for (Profile p : allProfiles) {
       if (name.equals(p.getId())) {
         profile = p;
         break;
       }
     }
     if (profile == null) {
       throw new IllegalArgumentException("Profile " + name + " not found.");
     }
     profiles.add(profile);
   }
   return profiles.toArray(new Profile[profiles.size()]);
 }