class AddServerTask extends AckedClusterStateUpdateTask<AcknowledgedResponse> {

    private final ForeignDataWrappers foreignDataWrappers;
    private final CreateServerRequest request;

    public AddServerTask(ForeignDataWrappers foreignDataWrappers, CreateServerRequest request) {
        super(Priority.NORMAL, request);
        this.foreignDataWrappers = foreignDataWrappers;
        this.request = request;
    }

    @Override
    protected AcknowledgedResponse newResponse(boolean acknowledged) {
        return new AcknowledgedResponse(acknowledged);
    }

    @Override
    public ClusterState execute(ClusterState currentState) throws Exception {<FILL_FUNCTION_BODY>}
}

        if (!foreignDataWrappers.contains(request.fdw())) {
            throw new IllegalArgumentException(
                "foreign-data wrapper " + request.fdw() + " does not exist");
        }
        ServersMetadata serversMetadata = currentState.metadata().custom(
            ServersMetadata.TYPE,
            ServersMetadata.EMPTY
        );
        String serverName = request.name();
        if (serversMetadata.contains(serverName)) {
            if (request.ifNotExists()) {
                return currentState;
            }
            throw new ServerAlreadyExistsException(serverName);
        }

        var newServersMetadata = serversMetadata.add(
            serverName,
            request.fdw(),
            request.owner(),
            request.options()
        );
        return ClusterState.builder(currentState)
            .metadata(
                Metadata.builder(currentState.metadata())
                    .putCustom(ServersMetadata.TYPE, newServersMetadata)
            )
            .build();
    
<methods>public io.crate.common.unit.TimeValue ackTimeout() ,public CompletableFuture<org.elasticsearch.action.support.master.AcknowledgedResponse> completionFuture() ,public boolean mustAck(org.elasticsearch.cluster.node.DiscoveryNode) ,public void onAckTimeout() ,public void onAllNodesAcked(java.lang.Exception) ,public void onFailure(java.lang.String, java.lang.Exception) ,public io.crate.common.unit.TimeValue timeout() <variables>private final non-sealed CompletableFuture<org.elasticsearch.action.support.master.AcknowledgedResponse> future,private final non-sealed org.elasticsearch.cluster.ack.AckedRequest request