Records the result of updating a server group.

@param serverGroup the server group's name. Cannot be <code>null</code>
@param failed <code>true</code> if the server group update failed;
<code>false</code> if it succeeded
427638
public void recordServerGroupResult(final String serverGroup, final boolean failed) {

        synchronized (this) {
            if (groups.contains(serverGroup)) {
                responseCount++;
                if (failed) {
                    this.failed = true;
                }
                DomainControllerLogger.HOST_CONTROLLER_LOGGER.tracef("Recorded group result for '%s': failed = %s",
                        serverGroup, failed);
                notifyAll();
            }
            else {
                throw DomainControllerLogger.HOST_CONTROLLER_LOGGER.unknownServerGroup(serverGroup);
            }
        }
    }
705202
public static base_response update(nitro_service client, clusternodegroup resource) throws Exception {
		clusternodegroup updateresource = new clusternodegroup();
		updateresource.name = resource.name;
		updateresource.strict = resource.strict;
		return updateresource.update_resource(client);
	}
581054
@RequestMapping(value = "api/servergroup/{id}", method = RequestMethod.POST)
    public
    @ResponseBody
    ServerGroup updateServerGroup(Model model,
                                  @PathVariable int id,
                                  @RequestParam(required = false) Integer profileId,
                                  @RequestParam(required = false) String name,
                                  @RequestParam(required = false) Boolean activate,
                                  @RequestParam(required = false) String clientUUID,
                                  @RequestParam(value = "profileIdentifier", required = false) String profileIdentifier) throws Exception {
        if (profileId == null && profileIdentifier == null) {
            throw new Exception("profileId required");
        }
        if (profileId == null) {
            profileId = ProfileService.getInstance().getIdFromName(profileIdentifier);
        }
        if (name != null) {
            ServerRedirectService.getInstance().setGroupName(name, id);
        }

        if (activate != null) {
            if (clientUUID == null) {
                throw new Exception("clientUUID required");
            }

            int clientId = ClientService.getInstance().findClient(clientUUID, profileId).getId();

            if (activate) {
                ServerRedirectService.getInstance().activateServerGroup(id, clientId);
            } else {
                ServerRedirectService.getInstance().activateServerGroup(0, clientId);
            }
        }

        return ServerRedirectService.getInstance().getServerGroup(id, profileId);
    }
1089554
public void setReplicationGroup(java.util.Collection<Replica> replicationGroup) {
        if (replicationGroup == null) {
            this.replicationGroup = null;
            return;
        }

        this.replicationGroup = new java.util.ArrayList<Replica>(replicationGroup);
    }
129621
protected void failed ()
    {
        if (_buffer != null) {
            _buffer.delete();
            _buffer = null;
        }
        _state = UNLOADED;

        _observers.apply(new ObserverList.ObserverOp<Observer>() {
            public boolean apply (Observer observer) {
                observer.clipFailed(ClipBuffer.this);
                return true;
            }
        });
        _observers.clear();
    }
331631
public void setServerGroupLaunchConfigurations(java.util.Collection<ServerGroupLaunchConfiguration> serverGroupLaunchConfigurations) {
        if (serverGroupLaunchConfigurations == null) {
            this.serverGroupLaunchConfigurations = null;
            return;
        }

        this.serverGroupLaunchConfigurations = new java.util.ArrayList<ServerGroupLaunchConfiguration>(serverGroupLaunchConfigurations);
    }
1118668
public void setFailedScheduledUpdateGroupActions(java.util.Collection<FailedScheduledUpdateGroupActionRequest> failedScheduledUpdateGroupActions) {
        if (failedScheduledUpdateGroupActions == null) {
            this.failedScheduledUpdateGroupActions = null;
            return;
        }

        this.failedScheduledUpdateGroupActions = new com.amazonaws.internal.SdkInternalList<FailedScheduledUpdateGroupActionRequest>(
                failedScheduledUpdateGroupActions);
    }
747850
@Override
    public void updateServerLease(String recoveryIdentity, String recoveryGroup, boolean isServerStartup) throws Exception {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "updateServerLease", new Object[] { recoveryIdentity, recoveryGroup, isServerStartup, this });

        if (tc.isDebugEnabled())
            Tr.debug(tc, "Using recoveryIdentity " + recoveryIdentity + " and log directory " + _tranRecoveryLogDirStem);

        // At this point we already have a lock on the file prior to attempting to write to it.
        // And if we have successfully written to the lease file in this instantiation of the server, then
        // we don't want to rewrite, each time we update the lease.
        try {
            // Only "touch" the server file if it belongs to the local server
            if (recoveryIdentity.equals(_localRecoveryIdentity)) {
                if (_localLeaseLock != null) {
                    // Write the Transaction Log directory string to the file
                    if (!leaseLogWrittenInThisRun) {
                        try {
                            //fooWriter.write(_logDirStem); // was "\n"
                            ByteBuffer byteBuffer = null;
                            FileChannel fChannel = _localLeaseLock.getFileChannel();
                            byteBuffer = ByteBuffer.wrap(_tranRecoveryLogDirStem.getBytes());
                            fChannel.write(byteBuffer);
                            fChannel.force(false);
                            leaseLogWrittenInThisRun = true;
                            if (tc.isDebugEnabled())
                                Tr.debug(tc, "Have written to file");
                        } catch (IOException iox) {
                            if (tc.isDebugEnabled())
                                Tr.debug(tc, "Caught I/O exception when trying to write to file");
                        }
                    }

                    // "Touch" the file for this server
                    final File leaseFile = new File(_serverInstallLeaseLogDir + String.valueOf(File.separatorChar) + recoveryIdentity);
                    if (leaseLogWrittenInThisRun) {
                        boolean success = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
                            @Override
                            public Boolean run() {
                                return leaseFile.setLastModified(System.currentTimeMillis());
                            }
                        });
                        if (!success) {
                            // TODO Auto-generated catch block
                            if (tc.isDebugEnabled())
                                Tr.debug(tc, "Unable to set the last modification time for " + leaseFile);
                        }
                    }
                }
            } else {
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "Don't modify time as this is not the local server");
            }
        } catch (OverlappingFileLockException e) {
            // File is already locked in this thread or virtual machine, We're not expecting this to happen. Log the event
            if (tc.isDebugEnabled())
                Tr.debug(tc, "The file aleady appears to be locked in another thread");
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "updateServerLease", this);

    }
859059
public ServerGroup addServerGroup(String groupName) {
        ServerGroup group = new ServerGroup();

        BasicNameValuePair[] params = {
            new BasicNameValuePair("name", groupName),
            new BasicNameValuePair("profileIdentifier", this._profileName)
        };
        try {
            JSONObject response = new JSONObject(doPost(BASE_SERVERGROUP, params));
            group = getServerGroupFromJSON(response);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
        return group;
    }
145080
public List<ServerMonitoringStatistics> getMonitoringStats(Group group, ServerMonitoringFilter config) {
        checkNotNull(config, "Config must be not a null");
        return client.getMonitoringStatistics(
            idByRef(group),
            converter.createMonitoringStatisticRequest(config));
    }
1088118
private ServerGroupRecord model2ServerGroup(String groupName, ModelNode model) {
        ServerGroupRecord record = factory.serverGroup().as();

        record.setName(groupName);
        record.setProfileName(model.get("profile").asString());
        record.setSocketBinding(model.get("socket-binding-group").asString());

        Jvm jvm = ModelAdapter.model2JVM(factory, model);

        if(jvm!=null)
            jvm.setInherited(false);  // on this level they can't inherit from anyone

        record.setJvm(jvm);

        List<PropertyRecord> propertyRecords = ModelAdapter.model2Property(factory, model);
        record.setProperties(propertyRecords);

        return record;
    }
990131
@Override
    public void updateGroupMembers(IEntityGroup group) throws GroupsException {
        throwExceptionIfNotInternallyManaged();
        getGroupStore().updateMembers(group);
        if (cacheInUse()) {
            cacheUpdate(group);
        }
        synchronizeGroupMembersOnUpdate(group);
    }
202066
@RequestMapping(value = "api/servergroup", method = RequestMethod.POST)
    public
    @ResponseBody
    ServerGroup createServerGroup(Model model,
                                  @RequestParam(value = "name") String name,
                                  @RequestParam(value = "profileId", required = false) Integer profileId,
                                  @RequestParam(value = "profileIdentifier", required = false) String profileIdentifier) throws Exception {
        if (profileId == null && profileIdentifier == null) {
            throw new Exception("profileId required");
        }
        if (profileId == null) {
            profileId = ProfileService.getInstance().getIdFromName(profileIdentifier);
        }
        int groupId = ServerRedirectService.getInstance().addServerGroup(name, profileId);
        return ServerRedirectService.getInstance().getServerGroup(groupId, profileId);
    }
924009
public void launchAddAssignmentWizard(final String serverGroup) {
        new Async<FunctionContext>().single(new FunctionContext(),
                new Outcome<FunctionContext>() {
                    @Override
                    public void onFailure(final FunctionContext context) {
                        Console.error(Console.CONSTANTS.unableToAddDeployment(), context.getErrorMessage());
                    }

                    @Override
                    public void onSuccess(final FunctionContext context) {
                        List<Content> contentRepository = context.pop();
                        List<Content> unassigned = new ArrayList<>();
                        for (Content content : contentRepository) {
                            if (content.getAssignments().isEmpty()) {
                                unassigned.add(content);
                            }
                        }
                        addDeploymentWizard.open(unassigned, serverGroup);
                    }
                },
                new DeploymentFunctions.LoadContentAssignments(dispatcher, serverGroup)
        );
    }
77619
protected void synchronizeGroupMembersOnDelete(IEntityGroup group) throws GroupsException {
        GroupMemberImpl gmi = null;

        for (Iterator it = group.getChildren().iterator(); it.hasNext(); ) {
            gmi = (GroupMemberImpl) it.next();
            gmi.invalidateInParentGroupsCache(Collections.singleton((IGroupMember) gmi));
            if (cacheInUse()) {
                cacheUpdate(gmi);
            }
        }
    }
9533
private void updateDagStatusInternal(final boolean failed) {
    if (this.status == Status.KILLING) {
      /*
      It's possible that some nodes have failed when the dag is killed.
      Since killing a dag signals an intent from an operator, it is more important to make
      the dag status reflect the result of that explict intent. e.g. if the killing is a
      result of handing a job failure, users more likely want to know that someone has taken
      an action rather than that a job has failed. Operators can still see the individual job
      status.
      */
      changeStatus(Status.KILLED);
    } else if (failed) {
      changeStatus(Status.FAILURE);
    } else {
      changeStatus(Status.SUCCESS);
    }
  }
333786
public boolean commmitAsync(KafkaMessage msg, String groupId) {
        KafkaMsgConsumer kafkaConsumer = cacheConsumers.get(groupId);
        return kafkaConsumer != null ? kafkaConsumer.commitAsync(msg) : false;
    }