Package org.appng.api
Interface ApplicationConfigProvider
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
ApplicationConfigProviderImpl
public interface ApplicationConfigProvider extends Closeable
Provides the basic configuration of aApplication
, which is theApplicationInfo
parsed from theapplication-info.xml
and all definedPageDefinition
s,Event
s,Action
s,Datasource
s and also theApplicationRootConfig
.- Author:
- Matthias Müller
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ApplicationConfigProvider
cloneConfig(MarshallService marshallService)
Clones thisApplicationConfigProvider
, which is necessary because thevoid
close()
Action
getAction(String eventId, String actionId)
Map<String,Action>
getActions(String eventId)
ApplicationInfo
getApplicationInfo()
ApplicationRootConfig
getApplicationRootConfig()
Returns theApplicationRootConfig
.Datasource
getDatasource(String id)
Returns theDatasource
with the given id, if present.Map<String,Datasource>
getDataSources()
Returns a map of allDatasource
s, using the id as the key.String
getDefaultPage()
Returns the id of the default-page, which is thePageDefinition
with the type 'index
'.Event
getEvent(String id)
Returns theEvent
with the given id, if present.Set<String>
getEventIds()
Returns all ids from all knownEvent
sPageDefinition
getPage(String id)
Returns thePageDefinition
with the given id, if present.Map<String,PageDefinition>
getPages()
Returns a map of allPageDefinition
s, using the id as the key.String
getResourceNameForApplicationRootConfig()
Returns the name of theResource
where theApplicationRootConfig
was defined.String
getResourceNameForDataSource(String dataSourceId)
Returns the name of theResource
where theDatasource
with the given id was defined.String
getResourceNameForEvent(String eventId)
String
getResourceNameForPage(String pageId)
Returns the name of theResource
where thePageDefinition
with the given id was defined.Resources
getResources()
-
-
-
Method Detail
-
cloneConfig
ApplicationConfigProvider cloneConfig(MarshallService marshallService) throws InvalidConfigurationException
Clones thisApplicationConfigProvider
, which is necessary because the- Parameters:
marshallService
- aMarshallService
to read the configuration files, only needed if appNG is in development-mode- Returns:
- a new ApplicationConfigProvider
- Throws:
InvalidConfigurationException
- if there is some configuration error inside the application
-
getApplicationRootConfig
ApplicationRootConfig getApplicationRootConfig()
Returns theApplicationRootConfig
.- Returns:
- the
ApplicationRootConfig
-
getDefaultPage
String getDefaultPage()
Returns the id of the default-page, which is thePageDefinition
with the type 'index
'.- Returns:
- the id of the default-page
-
getPage
PageDefinition getPage(String id)
Returns thePageDefinition
with the given id, if present.- Parameters:
id
- the id of thePageDefinition
to get- Returns:
- the
PageDefinition
with the given id, ornull
if no suchPageDefinition
exists
-
getPages
Map<String,PageDefinition> getPages()
Returns a map of allPageDefinition
s, using the id as the key.- Returns:
- a map of all
PageDefinition
s
-
getDatasource
Datasource getDatasource(String id)
Returns theDatasource
with the given id, if present.- Parameters:
id
- the id of theDatasource
to get- Returns:
- the
Datasource
with the given id, ornull
if no suchDatasource
exists
-
getDataSources
Map<String,Datasource> getDataSources()
Returns a map of allDatasource
s, using the id as the key.- Returns:
- a map of all
Datasource
s
-
getResourceNameForPage
String getResourceNameForPage(String pageId)
Returns the name of theResource
where thePageDefinition
with the given id was defined.- Parameters:
pageId
- the id of thePageDefinition
- Returns:
- the name of the
Resource
where thePageDefinition
with the given id was defined, ornull
if there is no suchPageDefinition
-
getResourceNameForDataSource
String getResourceNameForDataSource(String dataSourceId)
Returns the name of theResource
where theDatasource
with the given id was defined.- Parameters:
dataSourceId
- the id of theDatasource
- Returns:
- the name of the
Resource
where theDatasource
with the given id was defined, ornull
if there is no suchDatasource
-
getResourceNameForApplicationRootConfig
String getResourceNameForApplicationRootConfig()
Returns the name of theResource
where theApplicationRootConfig
was defined.- Returns:
- the name of the
Resource
where theApplicationRootConfig
was defined.
-
getApplicationInfo
ApplicationInfo getApplicationInfo()
- Returns:
- the
ApplicationInfo
-
getResources
Resources getResources()
-
close
void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-