Package org.appng.api.model
Interface Site
-
- All Superinterfaces:
Identifiable<Integer>
,Nameable
,Named<Integer>
,Serializable
- All Known Implementing Classes:
SiteImpl
public interface Site extends Named<Integer>
ASite
is the highest level entry-point to the platform. Besides a unique name, it needs to have a domain and a host. A site can use any of the severalApplication
s which have been deployed to the platform.- Author:
- Matthias Müller
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Site.SiteState
The different states a site can have
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Application
getApplication(String name)
Set<Application>
getApplications()
Returns theApplication
s which are currently assigned to thisSite
.String
getDomain()
Returns the domain for thisSite
.Set<Named<Integer>>
getGroups()
String
getHost()
Returns the host for this sitePasswordPolicy
getPasswordPolicy()
Properties
getProperties()
Returns theProperties
for thisSite
.URLClassLoader
getSiteClassLoader()
Returns theURLClassLoader
for thisSite
, which contains all the jars provided by theApplication
s that are assigned to thisSite
.Date
getStartupTime()
Returns the time at which the site has been loaded during platform-startup.Site.SiteState
getState()
boolean
hasApplication(String name)
Checks whether theApplication
with the given name is assigned to thisSite
.boolean
hasState(Site.SiteState... states)
boolean
isActive()
Returnstrue
if thisSite
is active, which means it is being loaded at platform startup.boolean
isCreateRepository()
Returnstrue
if a JSP-repository folder has been created for thisSite
.File
readFile(String relativePath)
Returns theFile
defined by the given path, which is located relative to the site's repository-folder.boolean
sendEvent(Event event)
If clustering is enabled, sends anEvent
to other appNG nodesvoid
sendRedirect(Environment env, String target)
sends a redirect with HTTP-Status 301 (moved permanently)void
sendRedirect(Environment env, String target, Integer statusCode)
redirects the request to the given target.-
Methods inherited from interface org.appng.api.model.Identifiable
getId
-
Methods inherited from interface org.appng.api.model.Nameable
getDescription, getName
-
-
-
-
Method Detail
-
getApplications
Set<Application> getApplications()
Returns theApplication
s which are currently assigned to thisSite
.- Returns:
- the
Application
s currently assigned to thisSite
-
getApplication
Application getApplication(String name)
- Parameters:
name
- the name of theApplication
- Returns:
- the
Application
, if such aApplication
is assigned to thisSite
,null
otherwise
-
hasApplication
boolean hasApplication(String name)
Checks whether theApplication
with the given name is assigned to thisSite
.- Parameters:
name
- the name of theApplication
- Returns:
true
if theApplication
with the given name is assigned to thisSite
,false
otherwise
-
getHost
String getHost()
Returns the host for this site- Returns:
- the host
-
getProperties
Properties getProperties()
Returns theProperties
for thisSite
.- Returns:
- the
Properties
for thisSite
- See Also:
SiteProperties
-
getSiteClassLoader
URLClassLoader getSiteClassLoader()
Returns theURLClassLoader
for thisSite
, which contains all the jars provided by theApplication
s that are assigned to thisSite
.- Returns:
- the
URLClassLoader
-
isActive
boolean isActive()
Returnstrue
if thisSite
is active, which means it is being loaded at platform startup.- Returns:
true
if thisSite
is active,false
otherwise
-
isCreateRepository
boolean isCreateRepository()
Returnstrue
if a JSP-repository folder has been created for thisSite
.- Returns:
true
if a JSP-repository folder has been created
-
sendRedirect
void sendRedirect(Environment env, String target)
sends a redirect with HTTP-Status 301 (moved permanently)
-
sendRedirect
void sendRedirect(Environment env, String target, Integer statusCode)
redirects the request to the given target. If the target not starts with a slash ("/"), the target has to be a relative path to a certainApplication
of this site (like "application/page"). If the target does start with a slash, it is expected to be a target relative to the domain of this site.- Parameters:
env
- the actualEnvironment
target
- the redirect targetstatusCode
- -the HTTP status code to send. Use constants fromHttpServletRequest
-
readFile
File readFile(String relativePath)
Returns theFile
defined by the given path, which is located relative to the site's repository-folder.- Parameters:
relativePath
- the relative path of the file- Returns:
- the
File
, if such a path exists
-
getPasswordPolicy
PasswordPolicy getPasswordPolicy()
- Returns:
- the
PasswordPolicy
-
getStartupTime
Date getStartupTime()
Returns the time at which the site has been loaded during platform-startup.- Returns:
- the time, or
null
if the site has (yet) not been loaded.
-
sendEvent
boolean sendEvent(Event event)
If clustering is enabled, sends anEvent
to other appNG nodes- Parameters:
event
- the event to send- Returns:
true
if the event was sent successfully
-
getState
Site.SiteState getState()
-
hasState
boolean hasState(Site.SiteState... states)
-
-