Section 15A. If any person in interest, including but not limited to an owner, contractor, or mortgage holder, claims (a) that any person who has provided labor or materials or has agreed to provide funding, financing or payment for labor or materials, refuses to continue to provide such funding, financing or payments of labor or materials solely because of the filing or recording of a notice of contract pursuant to section two or a statement of claim referencing a lien under section one, or (b) it appears from the notice of contract or a statement of account that the claimant has no valid lien by reason of the character of, or the contract for, the labor or materials or professional services or rental equipment, appliances or tools furnished and for which a lien is claimed, or (c) that a notice or other instrument has not been filed or recorded in accordance with the applicable provisions of this chapter, or (d) that for any other reason a claimed lien is invalid by reason of failure to comply with any provision of this chapter, or (e) that any party's rights are foreclosed by a judgment or release, or (f) that any party wrongfully refuses to execute a notice of completion as required by section two A or improperly files or records a notice of termination under section two B, such person may apply to the superior court for the county where such land lies or in the district court in the judicial district where such land lies, for an order (i) ruling on the matter involved or (ii) summarily discharging of record the alleged lien or notice as the case may be. The holder of any recorded mortgage upon the affected property shall receive notice of and be entitled to appear and be heard in any proceeding brought under this section. An order of notice to appear and show cause why the relief demanded in the complaint should not be granted shall be served upon the necessary parties no later than seven days prior to the date of the scheduled hearing. If the necessary parties cannot be found, such service may be made as the court shall direct. The application shall be made upon a verified complaint accompanied by other written proof of the facts upon which the application is made. Upon granting or denying the application, the court shall enter a final judgment on the matter involved or expeditiously order such further proceedings as are just.