
75 Wn.2d 260 (1969)
450 P.2d 802
In the Matter of the Application for a Writ of Habeas Corpus of CURTIS ADRIAN BAILEY, Respondent,
v.
A.M. GALLAGHER, as Sheriff of Grays Harbor County, et al., Appellants.[*]
No. 40262.
The Supreme Court of Washington, En Banc.
January 30, 1969.
The Attorney General, Stephen C. Way and H. John Hall, Assistants, for appellants.
Jack L. Burtch (of Burtch & Espedal), for respondent.
HAMILTON, J.
This case was consolidated for argument before this court with In re Riggins v. Rhay, ante p. 271, 450 P.2d 806 (1969), because it appeared that the dispositive issues were common to both causes. We have, however, concluded otherwise and, therefore, dispose of each matter by separate opinion.
Respondent, Curtis Adrian Bailey, was sentenced to imprisonment in the state penitentiary on three separate convictions of robbery, grand larceny, and taking an automobile without the owner's permission. During the course of his confinement, and on September 27, 1966, he was permitted to leave the enclosures of the penitentiary on parole subject to certain specified conditions to which he agreed. On February 2, 1968, he was taken into custody for alleged parole violations by appellant A.M. Gallagher, Sheriff of Grays Harbor County, Washington, pursuant to a detainer issued by his parole officer under the authority of RCW 9.95.120 and 72.04A.090.[1]
The procedure leading to a revocation of a parole is set forth in RCW 9.95.120. In essence, this statute provides that *262 when a parole officer has reason to believe a parolee under the officer's supervision has violated the conditions of his parole such officer may cause the arrest and detention of the parolee in a county jail pending a determination by the Board of Prison Terms and Paroles (hereafter referred to as the board) as to whether further revocation proceedings are in order. This initial arrest and detention is usually accomplished by the issuance of an order of detention. If, after such arrest and detention, the board, upon investigation determines the circumstances warrant a parole revocation *263 hearing, the normal procedure is to suspend the parole and direct that the parolee be returned to a state correctional institution, ordinarily the Washington State Correctional Center at Shelton, Washington. Within 30 days after arrival at such facility, the parolee is accorded a hearing before at least two members of the board. Following such hearing the board may either revoke or reinstate the parole.
While in the Grays Harbor County jail pending further action by the board relative to his parole status, respondent filed a petition for a writ of habeas corpus in the Superior Court for Grays Harbor County, alleging that he was being detained in contravention of his constitutional rights. This allegation was predicated upon respondent's contention that the revocation hearing procedures employed by the board denied due process of law to a parolee subject thereto. This petition was filed on February 23, 1968, before any further action toward the revocation of respondent's *264 parole had been taken other than his initial detention. Although respondent had been informally advised of the nature of the alleged parole violations at the time of his arrest, he was not formally notified of the specific allegations or the board's determination to hold a revocation hearing until after the filing of his petition in the superior court. The board was not made a party to respondent's proceeding, although it was permitted to appear as amicus curiae in the superior court and was later joined as a party appellant on appeal.
After a hearing, the superior court determined that the revocation hearing procedures which would be pursued by the board in respondent's case did not comply with due process requirements in various respects. Except for the delay in formally notifying respondent of the alleged violations of parole, respondent did not directly challenge nor did the superior court find that the initial arrest and detention of respondent was unconstitutional. Rather, as heretofore indicated, it was the procedures that would follow the board's decision to hold a revocation hearing which the superior court concluded would be in contravention of respondent's due process rights and it was upon this premise that the superior court ordered respondent's release.
On appeal, in addition to challenging the superior court's constitutional conclusions, appellants urge that the only justiciable issue before the superior court on respondent's petition was the validity of the initial arrest and detention of respondent in the Grays Harbor County jail. They contend that since no revocation hearing had been held, any conclusion that respondent's constitutional rights would be invaded at such hearing was speculative and premature.
Respondent asserts that appellants' argument avoids the "basic question." He contends that detention by the appellant sheriff necessarily brought the revocation hearing procedures into question, since such detention was occasioned under the authority of RCW 9.95.120, the statute defining the hearing procedures.
We agree with appellants.
*265 Respondent's basic objections to the revocation hearing procedures were that they did not (a) accord respondent the right to inspect the parole officer's investigatory report to the board; (b) provide for appointment of counsel to represent respondent at the hearing if he was unable to retain counsel at his own expense; (c) provide for compulsory process to secure witnesses on respondent's behalf; (d) allow for confrontation and cross-examination of adverse witnesses; and (e) permit the hearing to be held in the locality where the alleged violations occurred. All of these objections relate directly to the revocation hearing which may be held rather than to the validity of the initial arrest and detention prior to the hearing.
[1] The initial arrest and detention constitute a prelude to, but are not an integral part of the hearing that may or may not follow. Hence, the alleged infirmities of the parole revocation hearing procedures no more invalidate the arrest and detention aspects than detention as a result of an arrest made on probable cause would be invalidated by the possibility that a criminal defendant might be denied some constitutional rights at his future trial. The purposes, among others, of the initial arrest and detention in a county jail of a parolee charged with a violation of the conditions of his parole are to assure his presence during the period of time required for the board to make its determination as to the proper disposition to be made of his case, and to intermediately protect the public from a person reasonably believed to be a potential threat to society. The purpose of the revocation hearing, on the other hand, is to determine whether the parole should be revoked and the parolee reinstitutionalized. While it is true that RCW 9.95.120, as implemented by RCW 72.04A.090, contains the authority for the initial arrest and detention as well as describes the procedures to be followed at the hearing, it is clear that the two events are separable and distinct. The first may be accomplished and concluded without the necessity of the other.
[2] The function of a writ of habeas corpus is to inquire into the legality of the particular restraint being then imposed *266 upon the petitioner. In re Allen v. Rhay, 52 Wn.2d 609, 328 P.2d 367 (1958); In re Palmer v. Cranor, 45 Wn.2d 278, 273 P.2d 985 (1954). It is not to inquire into the validity of some future restraint that may or may not be imposed. Respondent's parole has not yet been revoked. No revocation hearing has been held, and it may well be that when such a hearing is held respondent may have no cause to complain of the procedures or the result. To now pass upon procedures which might or might not invade respondent's rights would be premature and fall into the category of an advisory opinion.
The constitutionality of the appellant sheriff's authority to detain respondent in the county jail pending the board's disposition was not directly challenged in the superior court nor did the superior court find it to be invalid. While we cannot commend the board's delay in formally notifying the respondent of the specific violations with which he was charged  and recommend that such notification be expedited in all future cases of this kind  we can find no constitutional infirmity in the statutory provisions authorizing the initial arrest and detention nor in the application thereof to respondent in the instant case. The writ sought by respondent should have been denied.
Accordingly, the order entered by the superior court is vacated and the cause is remanded with directions to dismiss respondent's petition.
ALL CONCUR.
NOTES
[*]  Reported in 450 P.2d 802.
[1]  "Whenever the board of prison terms and paroles or a probation and parole officer of this state has reason to believe a convicted person has breached a condition of his parole or violated the law of any state where he may then be or the rules and regulations of the board of prison terms and paroles, any probation and parole officer of this state may cause the arrest and detention of such convicted person pending a determination by the board whether the parole of such convicted person shall be revoked. All facts and circumstances surrounding the violation by such convicted person shall be reported to the board of prison terms and paroles by the probation and parole officer.

"On the basis of the report by the probation and parole officer, or at any time upon its own discretion, the board may revise or modify the conditions of parole or order the suspension of parole by the issuance of a written order bearing its seal which order shall be sufficient warrant for all peace officers to take into custody any convicted person who may be on parole and retain such person in their custody until arrangements can be made by the board of prison terms and paroles for his return to the institution from which he was paroled. Any such revision or modification of the conditions of parole or the order suspending parole shall be personally served upon the parolee.
"All chiefs of police, marshals of cities and towns, sheriffs of counties, and all police, prison, and peace officers and constables shall execute any such order in the same manner as any ordinary criminal process.
"Whenever a parole prisoner is accused of a violation of his parole, other than the commission of, and conviction for, a felony or misdemeanor under the laws of this state or the laws of any state where he may then be, he shall be entitled to a fair and impartial hearing of such charges within thirty days from the time that he was returned to the institution from which he was paroled before at least two members of the parole board. Upon such hearing such paroled prisoner shall be allowed to be heard and may defend himself, and may be represented by an attorney and he shall have the right to present evidence and witnesses in his behalf. After such hearing the board of prison terms and paroles shall make an order either (1) revoking the parole of such convicted person, or (2) reinstating the parole previously granted. In the event the parole is revoked, the board of prison terms and paroles shall make an order determining a new minimum sentence, not exceeding the maximum penalty provided by law for the crime for which he was originally convicted, or the maximum fixed by the court.
"In the event that the board of prison terms and paroles suspends a parole by reason of an alleged parole violation or in the event that a parole is suspended pending the disposition of a new criminal charge, the board of prison terms and paroles shall have the power to nullify the order of suspension and reinstate the individual to parole under previous conditions or any new conditions that the board of prison terms and paroles may determine advisable. Before the board of prison terms and paroles shall nullify an order of suspension and reinstate a parole they shall have determined that the best interests of society and the individual shall best be served by such reinstatement rather than a return to a penal institution." RCW 9.95.120.
"Whenever a parolee breaches a condition or conditions under which he was granted parole, or violates any law of the state or rules and regulations of the board of prison terms and paroles, any probation and parole officer may arrest such parolee without a warrant, pending a determination by the board. The facts and circumstances of such conduct of the parolee shall be reported by the probation and parole officer, with recommendations, to the board of prison terms and paroles, who may order the revocation or suspension of parole, revise or modify the conditions of parole or take such other action as may be deemed appropriate in accordance with RCW 9.95.120.
"....
"In the event a probation and parole officer shall arrest a parolee or probationer in accordance with the provisions of this section, such parolee or probationer shall be confined and detained in the county jail of the county in which the parolee or probationer was taken into custody, and the sheriff of such county shall receive and keep in the county jail, where room is available, all prisoners delivered thereto by the probation and parole officer, until discharged according to law." RCW 72.04A.090.
