28.01.2015 Views

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

username<strong>and</strong>theresourceoriginallyposted,<strong>and</strong>theneitherreturnsthe resourcebeinggrantedtotheuser,orreturnsaDeniedexception.1 gainaccess.Toprovideaccesscontrol,werequiretheownertoprovidea portintoanaccesscontrolfunction.Theaccesscontrolfunctionacceptsa postingtheresource.Therequestorofaresourcesuppliesaresourcename <strong>and</strong>receivesbackapolymorph,whichtherequestormustthenunwrap. Theownerofaresourcemaynotwishtoallowanyarbitraryuserto 4.Additional<strong>Hermes</strong>Constructs65<br />

Hereistheinterface: RepositoryExternal:using()definitions Resource:polymorph;<br />

PostOut:outportofPostIn; PostIn:inportofPostInterfaceffullg; PostInterface:callmessage( AccessFunction:AccessOut)--accesscontrolfunction constant(ResourceName,AccessFunction) exitffullg exceptionDuplicateNameffullg; PostedResource:Resource,--resourcebeingposted ResourceName:Charstring,--namebeinggiventoresource<br />

AccessInterface:callmessage( AccessIn:inportofAccessInterfacefinit(UserName),init(PostedResource)g; AccessOut:outportofAccessIn; constant(UserName,PostedResource) exitffullg exceptionAccessDeniedfinit(UserName),init(PostedResource)g; ReturnedResource:Resource)--theresourcegranted UserName:Charstring,--nameoftherequestor<br />

RequestInterface:callmessage( PostedResource:Resource,--resourceoriginallyposted<br />

RequestOut:outportofRequestIn; RequestIn:inportofRequestInterfacefinit(ResourceName)g; constant(ResourceName) Resource:Resource)--theresourcegranted exitffullg exceptionNotFoundfinit(ResourceName)g exceptionAccessDeniedfinit(ResourceName)g; ResourceName:Charstring,--nameofresourcebeingrequested<br />

ratherthantheportintotheresource. throughalter,forexample,inwhichcaseitwillreturnaportintothelter Theaccesscontrolfunctionmaydecidetograntlimitedaccesstotheresource 1Theresourcereturnedmayormaynotbethesameastheresourceposted.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!