class TransportDropPublicationAction extends AbstractDDLTransportAction<DropPublicationRequest, AcknowledgedResponse> {

    public static final String ACTION_NAME = "internal:crate:replication/logical/publication/drop";


    @Inject
    public TransportDropPublicationAction(TransportService transportService,
                                          ClusterService clusterService,
                                          ThreadPool threadPool) {
        super(ACTION_NAME,
              transportService,
              clusterService,
              threadPool,
              DropPublicationRequest::new,
              AcknowledgedResponse::new,
              AcknowledgedResponse::new,
              "drop-publication");
    }

    @Override
    public ClusterStateTaskExecutor<DropPublicationRequest> clusterStateTaskExecutor(DropPublicationRequest request) {
        return new DDLClusterStateTaskExecutor<>() {
            @Override
            protected ClusterState execute(ClusterState currentState, DropPublicationRequest request) throws Exception {<FILL_FUNCTION_BODY>}
        };
    }

    @Override
    protected ClusterBlockException checkBlock(DropPublicationRequest request,
                                               ClusterState state) {
        return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_WRITE);
    }
}

                Metadata currentMetadata = currentState.metadata();
                Metadata.Builder mdBuilder = Metadata.builder(currentMetadata);

                PublicationsMetadata oldMetadata = (PublicationsMetadata) mdBuilder.getCustom(PublicationsMetadata.TYPE);
                if (oldMetadata == null && request.ifExists() == false) {
                    throw new PublicationUnknownException(request.name());
                } else if (oldMetadata != null) {
                    if (oldMetadata.publications().containsKey(request.name())) {

                        PublicationsMetadata newMetadata = PublicationsMetadata.newInstance(oldMetadata);
                        newMetadata.publications().remove(request.name());
                        assert !newMetadata.equals(oldMetadata) : "must not be equal to guarantee the cluster change action";
                        mdBuilder.putCustom(PublicationsMetadata.TYPE, newMetadata);

                        return ClusterState.builder(currentState).metadata(mdBuilder).build();
                    } else if (request.ifExists() == false) {
                        throw new PublicationUnknownException(request.name());
                    }
                }

                return currentState;
            
<methods>public void <init>(java.lang.String, org.elasticsearch.transport.TransportService, org.elasticsearch.cluster.service.ClusterService, org.elasticsearch.threadpool.ThreadPool, Reader<io.crate.replication.logical.action.DropPublicationRequest>, Reader<org.elasticsearch.action.support.master.AcknowledgedResponse>, Function<java.lang.Boolean,org.elasticsearch.action.support.master.AcknowledgedResponse>, java.lang.String) ,public abstract ClusterStateTaskExecutor<io.crate.replication.logical.action.DropPublicationRequest> clusterStateTaskExecutor(io.crate.replication.logical.action.DropPublicationRequest) <variables>private final non-sealed Function<java.lang.Boolean,org.elasticsearch.action.support.master.AcknowledgedResponse> ackedResponseFunction,private final non-sealed Reader<org.elasticsearch.action.support.master.AcknowledgedResponse> reader,private final non-sealed java.lang.String source