Hello,
what do you consider a "view URL" - a URL to the details page of Alfresco Share or a URL to the actual document. For the latter, please have a look at ScriptNode.getDownloadUrl() to see how you could generate a (standard) URL. For the details page of Alfresco Share it is a bit uncommon to do this in Java. If your Java is intended to run in the Repository, use the SysAdminParams to retrieve the host, port and context of Share, and suffix that with the page URL (which can be considered standard / stable), i.e. /page/document-details?nodeRef= - and then add the NodeRef as an URL-encoded String.
Since the concept of "view URL" really depends on what you want to provide to your users, there is no standard service that you can simply query to give you a one-fits-all URL…
Regards
Axel