Submits an operation attempt.

@param attempt The attempt to submit.
166656
private <T extends OperationRequest, U extends OperationResponse> void invoke(OperationAttempt<T, U> attempt) {
    if (state.getState() == PrimitiveState.CLOSED) {
      attempt.fail(new PrimitiveException.ClosedSession("session closed"));
    } else {
      attempts.put(attempt.sequence, attempt);
      attempt.send();
      attempt.future.whenComplete((r, e) -> attempts.remove(attempt.sequence));
    }
  }
240644
void submit() {

        if (isValid()) {
            if (m_project == null) {
                createProject();
            } else {
                saveProject();
            }
            m_table.loadProjects();
            m_window.close();
        }
    }
1360482
public static boolean executeAddOperation(final ConnectionFactory connectionFactory, final LdapEntry entry) {
        try (val connection = createConnection(connectionFactory)) {
            val operation = new AddOperation(connection);
            operation.execute(new AddRequest(entry.getDn(), entry.getAttributes()));
            return true;
        } catch (final LdapException e) {
            LOGGER.error(e.getMessage(), e);
        }
        return false;
    }
773854
void setError(Exception error) {
    if (this.error != null) {
      throw new IllegalStateException(
          "Cannot reassign the error value of a response!");
    }
    this.error = error;
    this.complete = true;
    try {
      this.states.put(RESPONSE_COMPLETE);
    } catch (InterruptedException e) {
      log.error("Interrupted trying to indicate an error condition.", e);
    }
  }
905896
@Override
    public SQLException attempt() {
        try {
            Connection con = this.connectionSpec.getOrCreate();
            con.setReadOnly(true);
            try {
                Statement stmt = con.createStatement(
                        ResultSet.TYPE_FORWARD_ONLY,
                        ResultSet.CONCUR_READ_ONLY);
                stmt.setFetchSize(AbstractSQLGenerator.FETCH_SIZE);
                if (this.queryTimeout != null) {
                    stmt.setQueryTimeout(this.queryTimeout);
                }
                try {
                    SQLExecutor.executeSQL(con, stmt, this.query,
                            this.resultProcessor);
                    stmt.close();
                    stmt = null;
                } finally {
                    if (stmt != null) {
                        try {
                            stmt.close();
                        } catch (SQLException e) {
                        }
                    }
                }
                con.close();
                con = null;
            } finally {
                if (con != null) {
                    try {
                        con.close();
                    } catch (SQLException e) {
                    }
                }
            }
            return null;
        } catch (SQLException ex) {
            return ex;
        }
    }
85418
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString diff_response_validator = new MPSString();
		diff_response_validator.validate(operationType, diff_response, "\"diff_response\"");
		
		MPSIPAddress ns_ip_address_validator = new MPSIPAddress();
		ns_ip_address_validator.validate(operationType, ns_ip_address, "\"ns_ip_address\"");
		
		MPSString source_file_validator = new MPSString();
		source_file_validator.validate(operationType, source_file, "\"source_file\"");
		
		MPSString target_file_validator = new MPSString();
		target_file_validator.validate(operationType, target_file, "\"target_file\"");
		
		MPSString source_command_validator = new MPSString();
		source_command_validator.validate(operationType, source_command, "\"source_command\"");
		
		MPSString target_command_validator = new MPSString();
		target_command_validator.validate(operationType, target_command, "\"target_command\"");
		
	}
1276077
private <T> void submitCommand(CommandRequest request, CompletableFuture<T> future) {
    submit(new CommandAttempt<>(sequencer.nextRequest(), request, future));
  }
196863
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSInt enum_key_validator = new MPSInt();
		enum_key_validator.validate(operationType, enum_key, "\"enum_key\"");
		
		MPSString enum_value_validator = new MPSString();
		enum_value_validator.validate(operationType, enum_value, "\"enum_value\"");
		
	}
801865
private void applyExecute(ExecuteOperation operation) {
    Session session = context.getOrCreateSession(operation.session(), operation.node());
    if (operation.operation() != null) {
      try {
        context.service().apply(new DefaultCommit<>(
            context.setIndex(operation.index()),
            operation.operation().id(),
            operation.operation().value(),
            context.setSession(session),
            context.setTimestamp(operation.timestamp())));
      } catch (Exception e) {
        log.warn("Failed to apply operation: {}", e);
      } finally {
        context.setSession(null);
      }
    }
  }
966152
void submit() {

        CmsResource target = m_context.getResources().get(0);
        String resPath = m_context.getCms().getSitePath(target);
        try {
            m_context.getCms().copyResourceToProject(resPath);

            m_context.finish(Collections.singletonList(target.getStructureId()));
        } catch (CmsException e) {
            m_context.error(e);
        }
    }
1127217
@Override
    public void actionCommit() {

        List<Throwable> errors = new ArrayList<Throwable>();

        try {
            // if new create it first
            if (m_group.getId() == null) {
                CmsGroup newGroup = getCms().createGroup(
                    m_paramOufqn + m_group.getSimpleName(),
                    m_group.getDescription(),
                    m_group.isEnabled() ? I_CmsPrincipal.FLAG_ENABLED : I_CmsPrincipal.FLAG_DISABLED,
                    getParentGroup());
                m_group = newGroup;
            } else {
                if (getParentGroup() != null) {
                    m_group.setParentId(getCms().readGroup(getParentGroup()).getId());
                } else {
                    m_group.setParentId(CmsUUID.getNullUUID());
                }
            }
            // write the edited group
            getCms().writeGroup(m_group);
            // refresh the list
            Map<?, ?> objects = (Map<?, ?>)getSettings().getListObject();
            if (objects != null) {
                objects.remove(getListClass());
                objects.remove(A_CmsUsersList.class.getName());
            }
        } catch (Throwable t) {
            errors.add(t);
        }

        if (errors.isEmpty() && isNewGroup()) {
            if ((getParamCloseLink() != null) && (getParamCloseLink().indexOf("path=" + getListRootPath()) > -1)) {
                // set closelink
                Map<String, String[]> argMap = new HashMap<String, String[]>();
                argMap.put("groupid", new String[] {m_group.getId().toString()});
                argMap.put("groupname", new String[] {m_group.getName()});
                argMap.put("oufqn", new String[] {m_paramOufqn});
                setParamCloseLink(CmsToolManager.linkForToolPath(getJsp(), getListRootPath() + "/edit", argMap));
            }
        }
        // set the list of errors to display when saving failed
        setCommitErrors(errors);
    }
612291
void submit() {

        try {
            saveData();
            m_context.finish(null);
        } catch (Exception e) {
            m_context.error(e);
        }
    }
510426
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSIPAddress source_ip_address_validator = new MPSIPAddress();
		source_ip_address_validator.validate(operationType, source_ip_address, "\"source_ip_address\"");
		
		MPSIPAddress target_ip_address_arr_validator = new MPSIPAddress();
		if(target_ip_address_arr != null)
		{
			for(int i=0; i<target_ip_address_arr.length; i++)
			{
				target_ip_address_arr_validator.validate(operationType, target_ip_address_arr[i], "target_ip_address_arr["+i+"]");
			}
		}
		
	}
1350550
@Override
    public void actionCommit() {

        List<Throwable> errors = new ArrayList<Throwable>();

        try {

            // if new create it first
            if (!m_searchManager.getSearchIndexesAll().contains(m_index)) {
                // check the index name for invalid characters
                CmsStringUtil.checkName(
                    m_index.getName(),
                    INDEX_NAME_CONSTRAINTS,
                    Messages.ERR_SEARCHINDEX_BAD_INDEXNAME_4,
                    Messages.get());
                // empty or null name and uniqueness check in add method
                m_searchManager.addSearchIndex(m_index);
            }
            // check if field configuration has been updated, if thus set field configuration to the now used
            if (!m_index.getFieldConfigurationName().equals(m_index.getFieldConfiguration().getName())) {
                m_index.setFieldConfiguration(
                    m_searchManager.getFieldConfiguration(m_index.getFieldConfigurationName()));
            }
            writeConfiguration();

        } catch (Throwable t) {
            errors.add(t);
        }

        // set the list of errors to display when saving failed
        setCommitErrors(errors);
    }
1229597
private void tryRunNext() {
        while (runningSemaphore.tryAcquire()) {
            ExecutionTask execution = queue.poll();
            if (execution != null) {
                // Note: we've removed the execution from the queue so we're committed to running it
                // if we fail to do so for any reason, we need to call the exception handler to fail the execution
                try {
                    execution.submit();
                } catch (Throwable e) {
                    // Any exception here is unexpected
                    runningSemaphore.release();
                    execution.exceptionHandler.handle(e);
                }
            } else {
                runningSemaphore.release();
                break;
            }
        }
    }
913420
public void setAttempts(java.util.Collection<AttemptDetail> attempts) {
        if (attempts == null) {
            this.attempts = null;
            return;
        }

        this.attempts = new java.util.ArrayList<AttemptDetail>(attempts);
    }
398473
private void perform(int operation, int position, long bs, int length) {
		checkBitsLength(length);
		position = adjPosition(position);
		checkMutable();
		performAdj(operation, position, bs, length);
	}