|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.uwyn.rife.engine.Site
public class Site
A Site contains all the elements that will be used to handle
web requests
| Field Summary | |
|---|---|
static String |
DEFAULT_PARTICIPANT_NAME
|
| Constructor Summary | |
|---|---|
protected |
Site()
|
| Method Summary | |
|---|---|
void |
addListener(SiteListener listener)
Adds the specified listener to receive site-related events. |
void |
clearCaches()
Clears the cached data |
boolean |
containsId(String id)
Indicates whether an absolute element ID is present in the site. |
boolean |
containsUrl(String url)
Indicates whether a certain URL has a mapping in this site. |
ElementToService |
findElementForRequest(String elementUrl)
Looks for an element that corresponds to a particular request URL. |
void |
fireModified()
Notifies the registered listeners that one of the site's resources has been detected as being modified. |
static String |
getAbsoluteId(String id,
ElementInfo reference)
Transforms the provided element ID into an absolute element ID. |
static String |
getCanonicalId(String id)
Transforms the provided element ID into a canonical ID without any parent indicators. |
ContinuationManager |
getContinuationManager()
Retrieves the continuation manager that is used by this site. |
Collection<String> |
getIds()
Retrieves the collection of all the element IDs that are present in this site. |
static Site |
getRepInstance()
Retrieves the default object as a Site from the participant
that was returned by getRepParticipant(). |
static Participant |
getRepParticipant()
Retrieves the participant named " ParticipantSite" from the
default repository. |
ResourceFinder |
getResourceFinder()
Retrieves the resource finder that was used to populate this site. |
Map<UrlResource,Long> |
getResourceModificationTimes()
Retrieves a map of all the resources that were used to construct the site and their last modification time. |
Collection<String> |
getUrls()
Retrieves the collection of all the URLs that are present in this site. |
static boolean |
hasRepInstance()
Indicates whether the default repository has a participant named " ParticipantSite". |
void |
populateFromOther(Site otherSite)
Populates this site instance from another site instance. |
void |
removeListener(SiteListener listener)
Removes the site listener so that it no longer receives any events. |
void |
resetLastModificationCheck()
Resets the last modification check so that the next request will always check for modifications. |
ElementInfo |
resolveId(String id)
Retrieves the element information in this site that corresponds to provided absolute element ID. |
ElementInfo |
resolveId(String id,
ElementInfo reference)
Retrieves the element information in this site that corresponds to provided element ID. |
ElementInfo |
resolveUrl(String url,
String pathinfo)
Looks up the information of the element that is responsible for handling a certain URL and pathinfo. |
ElementInfo |
searchFallback(String url)
Searches which element would be used as a fallback for a particilar URL. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_PARTICIPANT_NAME
| Constructor Detail |
|---|
protected Site()
| Method Detail |
|---|
public Map<UrlResource,Long> getResourceModificationTimes()
null if the site was totally built manually or if the
SITE_AUTO_RELOAD configuration parameter was not set to
true at the time of construction.
public void resetLastModificationCheck()
public void clearCaches()
public void populateFromOther(Site otherSite)
This method is typically used during the implementation of a SiteListener.modified(com.uwyn.rife.engine.Site)
method. Doing this, will ensure that the active request as well as
subsequent requests will be executed against the data of the other site
instance.
otherSite - the other site that will be used to replace this site's
data withpublic static boolean hasRepInstance()
ParticipantSite".
true if that participant was present; or
false otherwise
Rep.getDefaultRepository(),
Participantpublic static Participant getRepParticipant()
ParticipantSite" from the
default repository.
null if no such participant was present
Rep.getDefaultRepository(),
Participantpublic static Site getRepInstance()
Site from the participant
that was returned by getRepParticipant().
null if no "ParticipantSite" participant was
present in the default repository
getRepParticipant(),
Participant.getObject()public ResourceFinder getResourceFinder()
public ContinuationManager getContinuationManager()
public Collection<String> getIds()
public ElementInfo searchFallback(String url)
throws EngineException
url - the URL for which a fallback should be found
null if no fallback is available for that URL
EngineExceptionpublic boolean containsUrl(String url)
url - the URL that should be looked up
true if the URL corresponds to and element; or
false otherwise
public ElementInfo resolveUrl(String url,
String pathinfo)
throws EngineException
url - the URL that should be looked uppathinfo - the pathinfo that should be taken into account
null if the URL and pathinfo aren't registered in this site
EngineExceptionpublic ElementToService findElementForRequest(String elementUrl)
This method will determine the best element match by stepping up the path segments. It will also look for fallback elements, cater for trailing slashes, and figure out the correct pathinfo.
Basically, this is the method that is used by the Gate to
figure out which element to service when a request arrives.
elementUrl - the URL that will be used to search for the element
ElementToService when an element match
was found; or
null if no suitable element could be found.
public Collection<String> getUrls()
public boolean containsId(String id)
id - the absolute element ID that should be looked up
true if the element ID could be found; or
false otherwise
public ElementInfo resolveId(String id)
throws EngineException
id - the absolute element ID that should be looked up
null if the absolute element ID couldn't be found
EngineException
public ElementInfo resolveId(String id,
ElementInfo reference)
throws EngineException
id - the element ID that should be looked upreference - the element information that should be used as a
reference to look up the element information from when a relative ID
is provided
null if the element ID couldn't be found
EngineException
public static String getAbsoluteId(String id,
ElementInfo reference)
id - the element ID that should be transformedreference - the element information that should be used as a
reference to look up the element information from when a relative ID
is provided
public static String getCanonicalId(String id)
id - the element ID that should be transformed
public void addListener(SiteListener listener)
listener is null, no exception is thrown and no action
is performed.
listener - The site listener that will be added.SiteListener,
removeListener(SiteListener)public void removeListener(SiteListener listener)
null.
listener - The site listener that will be removed.SiteListener,
addListener(SiteListener)public void fireModified()
SiteListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||