class HostedVespaPolicy implements Policy {

    @Override
    public SuspensionReasons grantSuspensionRequest(OrchestratorContext context, ApplicationApi application)
            throws HostStateChangeDeniedException {
        var suspensionReasons = new SuspensionReasons();

        // Apply per-cluster policy
        for (ClusterApi cluster : application.getClusters()) {
            suspensionReasons.mergeWith(clusterPolicy.verifyGroupGoingDownIsFine(cluster));
        }

        // Ask Cluster Controller to set UP storage nodes in maintenance.
        // These storage nodes are guaranteed to be NO_REMARKS
        for (StorageNode storageNode : application.getUpStorageNodesInGroupInClusterOrder()) {
            storageNode.setNodeState(context, ClusterControllerNodeState.MAINTENANCE);
        }

        // Ensure all nodes in the group are marked as allowed to be down
        for (HostName hostName : application.getNodesInGroupWithStatus(HostStatus.NO_REMARKS)) {
            application.setHostState(context, hostName, HostStatus.ALLOWED_TO_BE_DOWN);
        }

        return suspensionReasons;
    }

    public  HostedVespaPolicy(HostedVespaClusterPolicy clusterPolicy,
                             ClusterControllerClientFactory clusterControllerClientFactory,
                             ApplicationApiFactory applicationApiFactory);

}