Class AppSettingsRepository
- java.lang.Object
-
- de.narimo.georepo.server.repository.AppSettingsRepository
-
public class AppSettingsRepository extends Object
-
-
Constructor Summary
Constructors Constructor Description AppSettingsRepository()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidactivateAppkey(String appkey, de.narimo.commons.dto.User user)Activates an appkey.static voidcreateAppBaseLayerConfigTable()static voidcreateAppConfigTable()static voidcreateAppDetailsConfigTable()static StringcreateAppKey(de.narimo.commons.dto.User user, AppKey appkey)static voidcreateAppLayerConfigTable()static voidcreateAppManifestTable()static voiddeactivateAppkey(String appkey, de.narimo.commons.dto.User user)Deactivates an appkey.static AppBaseLayersConfigurationgetAppBaseLayersConfiguration(String appkey)static AppConfigurationgetAppConfiguration(String appkey)static AppDetailsConfigurationgetAppDetailsConfiguration(String appkey)static AppKeygetAppKey(String appkey)static Map<String,AppKey>getAppkeyInvoiceDetails(String appkey, de.narimo.commons.dto.User user)static List<AppKey>getAppKeysByTemplateKey(String templateKey)Returns all appkeys that have been created from a given template app key or is the template key itself.static AppLayersConfigurationgetAppLayersConfiguration(String appkey)static AppManifestConfigurationgetAppManifestConfiguration(String appkey)static intgetAppProvider(String appKey, de.narimo.commons.dto.User user)Returns the userid of the user that is the app provider, i.e.static List<AppKey>getMyAppKeys(de.narimo.commons.dto.User user)static ExtendedAppKeygetPublicAppKeyInformation(String appkey, de.narimo.commons.dto.User user)Returns information about an appkey that can be publicly handed out.static booleanisAppkeyActivated(String appkey, de.narimo.commons.dto.User user)static booleanisAppOwner(String appkey, de.narimo.commons.dto.User user)static voidsaveAppBaseLayersConfiguration(AppBaseLayersConfiguration appBaseLayersConfiguration)static voidsaveAppConfiguration(AppConfiguration appConfiguration)static voidsaveAppDetailsConfiguration(AppDetailsConfiguration appDetailsConfiguration)static voidsaveAppLayersConfiguration(AppLayersConfiguration appLayersConfiguration)static voidsaveAppManifest(AppManifestConfiguration appManifestConfiguration)
-
-
-
Method Detail
-
getPublicAppKeyInformation
public static ExtendedAppKey getPublicAppKeyInformation(String appkey, de.narimo.commons.dto.User user)
Returns information about an appkey that can be publicly handed out.
-
getAppKeysByTemplateKey
public static List<AppKey> getAppKeysByTemplateKey(String templateKey)
Returns all appkeys that have been created from a given template app key or is the template key itself. Only activated appkeys will be returned.- Parameters:
templateKey-- Returns:
-
saveAppConfiguration
public static void saveAppConfiguration(AppConfiguration appConfiguration)
-
saveAppLayersConfiguration
public static void saveAppLayersConfiguration(AppLayersConfiguration appLayersConfiguration)
-
saveAppBaseLayersConfiguration
public static void saveAppBaseLayersConfiguration(AppBaseLayersConfiguration appBaseLayersConfiguration)
-
saveAppDetailsConfiguration
public static void saveAppDetailsConfiguration(AppDetailsConfiguration appDetailsConfiguration)
-
isAppOwner
public static boolean isAppOwner(String appkey, de.narimo.commons.dto.User user)
-
createAppConfigTable
public static void createAppConfigTable() throws SQLException- Throws:
SQLException
-
createAppLayerConfigTable
public static void createAppLayerConfigTable() throws SQLException- Throws:
SQLException
-
createAppBaseLayerConfigTable
public static void createAppBaseLayerConfigTable() throws SQLException- Throws:
SQLException
-
createAppDetailsConfigTable
public static void createAppDetailsConfigTable() throws SQLException- Throws:
SQLException
-
createAppManifestTable
public static void createAppManifestTable() throws SQLException- Throws:
SQLException
-
getAppConfiguration
public static AppConfiguration getAppConfiguration(String appkey) throws SQLException
- Throws:
SQLException
-
getAppLayersConfiguration
public static AppLayersConfiguration getAppLayersConfiguration(String appkey) throws SQLException
- Throws:
SQLException
-
getAppBaseLayersConfiguration
public static AppBaseLayersConfiguration getAppBaseLayersConfiguration(String appkey) throws SQLException
- Throws:
SQLException
-
getAppDetailsConfiguration
public static AppDetailsConfiguration getAppDetailsConfiguration(String appkey) throws javax.ws.rs.NotFoundException, SQLException
- Throws:
javax.ws.rs.NotFoundExceptionSQLException
-
isAppkeyActivated
public static boolean isAppkeyActivated(String appkey, de.narimo.commons.dto.User user)
-
getAppkeyInvoiceDetails
public static Map<String,AppKey> getAppkeyInvoiceDetails(String appkey, de.narimo.commons.dto.User user)
-
getAppProvider
public static int getAppProvider(String appKey, de.narimo.commons.dto.User user)
Returns the userid of the user that is the app provider, i.e. the owner of the templateKey app for a given appKey.- Parameters:
appkey-user-- Returns:
-
activateAppkey
public static void activateAppkey(String appkey, de.narimo.commons.dto.User user) throws javax.ws.rs.ForbiddenException, IllegalStateException
Activates an appkey. If the appkey is already activated, throws anIllegalStateException- Parameters:
appkey-user-- Throws:
javax.ws.rs.ForbiddenExceptionIllegalStateException
-
deactivateAppkey
public static void deactivateAppkey(String appkey, de.narimo.commons.dto.User user) throws javax.ws.rs.ForbiddenException, IllegalStateException
Deactivates an appkey. Internal usage only, do not deactivate an app by user request since this needs handling of invoices, etc.!- Parameters:
appkey-user-- Throws:
javax.ws.rs.ForbiddenExceptionIllegalStateException
-
saveAppManifest
public static void saveAppManifest(AppManifestConfiguration appManifestConfiguration)
-
getAppManifestConfiguration
public static AppManifestConfiguration getAppManifestConfiguration(String appkey) throws SQLException, javax.ws.rs.NotFoundException
- Throws:
SQLExceptionjavax.ws.rs.NotFoundException
-
-