|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.guiseframework.AbstractGuiseContainer
public abstract class AbstractGuiseContainer
An abstract base class for a Guise instance.
This implementation only works with Guise applications that descend from AbstractGuiseApplication.
| Constructor Summary | |
|---|---|
AbstractGuiseContainer(java.net.URI baseURI)
Container base URI constructor. |
|
| Method Summary | |
|---|---|
protected void |
addGuiseSession(GuiseSession guiseSession)
Adds and initializes a Guise session. |
com.globalmentor.net.URIPath |
getBasePath()
Reports the base path of the container. |
java.net.URI |
getBaseURI()
Reports the base URI of the container. |
java.io.InputStream |
getInputStream(java.net.URI uri)
Retrieves an input stream to the entity at the given URI. |
protected char[] |
getPassword(AbstractGuiseApplication application,
java.security.Principal principal)
Looks up the corresponding password for the given principal. |
protected java.security.Principal |
getPrincipal(AbstractGuiseApplication application,
java.lang.String id)
Looks up an application principal from the given ID. |
protected java.lang.String |
getRealm(AbstractGuiseApplication application,
java.net.URI resourceURI)
Determines the realm applicable for the resource indicated by the given URI. |
protected abstract java.io.InputStream |
getResourceInputStream(java.lang.String resourcePath)
Retrieves an input stream to the resource at the given path. |
protected abstract boolean |
hasResource(java.lang.String resourcePath)
Determines if the application has a resource available stored at the given resource path. |
protected void |
installApplication(AbstractGuiseApplication application,
java.net.URI baseURI,
java.io.File homeDirectory,
java.io.File logDirectory,
java.io.File tempDirectory)
Installs the given application at the given base path. |
protected boolean |
isAuthorized(AbstractGuiseApplication application,
java.net.URI resourceURI,
java.security.Principal principal,
java.lang.String realm)
Checks whether the given principal is authorized to access the resouce at the given application path. |
protected void |
removeGuiseSession(GuiseSession guiseSession)
Removes and destroys a Guise session. |
com.globalmentor.net.URIPath |
resolvePath(com.globalmentor.net.URIPath path)
Resolves a relative or absolute path against the container base path. |
java.net.URI |
resolveURI(java.net.URI uri)
Resolves URI against the container base path. |
protected void |
uninstallApplication(AbstractGuiseApplication application)
Uninstalls the given application. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractGuiseContainer(java.net.URI baseURI)
baseURI - The base URI of the container, an absolute URI that ends with the base path, which ends with a slash ('/'), indicating the base path of the application base paths.
java.lang.NullPointerException - if the base URI is null.
java.lang.IllegalArgumentException - if the base URI is not absolute or does not end with a slash ('/') character.| Method Detail |
|---|
public java.net.URI getBaseURI()
getBaseURI in interface GuiseContainerpublic com.globalmentor.net.URIPath getBasePath()
getBasePath in interface GuiseContainerprotected void addGuiseSession(GuiseSession guiseSession)
guiseSession - The Guise session to add.GuiseApplication.registerSession(GuiseSession),
GuiseSession.initialize()protected void removeGuiseSession(GuiseSession guiseSession)
guiseSession - The Guise session to remove.GuiseSession.destroy(),
GuiseApplication.unregisterSession(GuiseSession)
protected void installApplication(AbstractGuiseApplication application,
java.net.URI baseURI,
java.io.File homeDirectory,
java.io.File logDirectory,
java.io.File tempDirectory)
throws java.io.IOException
application - The application to install.baseURI - The base URI at which the application is being installed.homeDirectory - The home directory of the application.logDirectory - The log directory of the application.tempDirectory - The temporary directory of the application.
java.lang.NullPointerException - if the application, base URI, home directory, log directory, and/or temporary directory is null.
java.lang.IllegalArgumentException - if the given base URI is not absolute or the path of which is not absolute or not a collection.
java.lang.IllegalStateException - if the application is already installed in some container.
java.lang.IllegalStateException - if there is already an application installed in this container at the given base path.
java.io.IOException - if there is an I/O error when installing the application.protected void uninstallApplication(AbstractGuiseApplication application)
application - The application to uninstall.
java.lang.NullPointerException - if the application is null.
java.lang.IllegalStateException - if the application is not installed in this container.public com.globalmentor.net.URIPath resolvePath(com.globalmentor.net.URIPath path)
resolvePath in interface GuiseContainerpath - The path to be resolved.
java.lang.NullPointerException - if the given path is null.
java.lang.IllegalArgumentException - if the provided path specifies a URI scheme (i.e. the URI is absolute) and/or authority (in which case resolveURI(URI) should be used instead).getBasePath()public java.net.URI resolveURI(java.net.URI uri)
resolveURI in interface GuiseContaineruri - The URI to be resolved.
java.lang.NullPointerException - if the given URI is null.getBasePath()protected abstract boolean hasResource(java.lang.String resourcePath)
resourcePath - A container-relative path to a resource in the resource storage area.
true if a resource exists at the given resource path.
java.lang.IllegalArgumentException - if the given resource path is absolute.
java.lang.IllegalArgumentException - if the given path is not a valid path.protected abstract java.io.InputStream getResourceInputStream(java.lang.String resourcePath)
resourcePath - A container-relative path to a resource in the resource storage area.
null if no resource exists at the given resource path.
java.lang.IllegalArgumentException - if the given resource path is absolute.
java.lang.IllegalArgumentException - if the given path is not a valid path.
public java.io.InputStream getInputStream(java.net.URI uri)
throws java.io.IOException
getInputStream in interface GuiseContaineruri - A URI to the entity; either absolute or relative to the container.
null if no entity exists at the given resource path.
java.lang.NullPointerException - if the given URI is null.
java.io.IOException - if there was an error connecting to the entity at the given URI.getBaseURI()
protected java.security.Principal getPrincipal(AbstractGuiseApplication application,
java.lang.String id)
application - The application for which a principal should be returned for the given ID.id - The ID of the principal.
null if no principal could be determined.
protected char[] getPassword(AbstractGuiseApplication application,
java.security.Principal principal)
application - The application for which a password should e retrieved for the given principal.principal - The principal for which a password should be returned.
null if no password is associated with the given principal.
protected java.lang.String getRealm(AbstractGuiseApplication application,
java.net.URI resourceURI)
application - The application for which a realm should be returned for the given resouce URI.resourceURI - The URI of the resource requested.
null if the given resource is not in a known realm.GuiseApplication.relativizeURI(URI)
protected boolean isAuthorized(AbstractGuiseApplication application,
java.net.URI resourceURI,
java.security.Principal principal,
java.lang.String realm)
application - The application for which a principal should be authorized for a given resouce URI.resourceURI - The URI of the resource requested.principal - The principal requesting authentication, or null if the principal is not known.realm - The realm with which the resource is associated, or null if the realm is not known.
true if the given principal is authorized to access the resource represented by the given resource URI.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||