@Transactional public class DefaultAppRegistryService extends AbstractAppRegistryCommon implements AppRegistryService
DefaultAppRegistryService objects and supports on-demand loading of
Resources.
Stores AppRegistration with up to two keys:
mavenProperties, METADATA_KEY_SUFFIX, resourceLoader, toStringAndUriFunc| Constructor and Description |
|---|
DefaultAppRegistryService(AppRegistrationRepository appRegistrationRepository,
org.springframework.core.io.ResourceLoader resourceLoader,
org.springframework.cloud.deployer.resource.maven.MavenProperties mavenProperties) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
appExist(String name,
ApplicationType type)
Checks if an application with such name and type exists and is set as default.
|
boolean |
appExist(String name,
ApplicationType type,
String version)
Checks if an
AppRegistration with this name, type and version exists. |
void |
delete(String name,
ApplicationType type,
String version)
Deletes an
AppRegistration. |
AppRegistration |
find(String name,
ApplicationType type) |
AppRegistration |
find(String name,
ApplicationType type,
String version) |
List<AppRegistration> |
findAll() |
org.springframework.data.domain.Page<AppRegistration> |
findAll(org.springframework.data.domain.Pageable pageable) |
org.springframework.data.domain.Page<AppRegistration> |
findAllByTypeAndNameIsLike(ApplicationType type,
String name,
org.springframework.data.domain.Pageable pageable) |
AppRegistration |
getDefaultApp(String name,
ApplicationType type) |
protected boolean |
isOverwrite(AppRegistration app,
boolean overwrite) |
AppRegistration |
save(AppRegistration app)
Save an
AppRegistration instance. |
AppRegistration |
save(String name,
ApplicationType type,
String version,
URI uri,
URI metadataUri)
Saves a new
AppRegistration identified by its name, type, version and URIs. |
void |
setDefaultApp(String name,
ApplicationType type,
String version)
Set an application with name, type and version as the default for all name:type
applications.
|
getAppMetadataResource, getAppResource, importAll, loadProperties, metadataUriFromProperties, toValidAppRegistration, warnOnMalformedURIclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAppMetadataResource, getAppResource, importAllpublic DefaultAppRegistryService(AppRegistrationRepository appRegistrationRepository, org.springframework.core.io.ResourceLoader resourceLoader, org.springframework.cloud.deployer.resource.maven.MavenProperties mavenProperties)
public AppRegistration find(String name, ApplicationType type)
find in interface AppRegistryCommonname - application nametype - application typpublic AppRegistration find(String name, ApplicationType type, String version)
find in interface AppRegistryCommonname - application nametype - application typepublic AppRegistration getDefaultApp(String name, ApplicationType type)
getDefaultApp in interface AppRegistryServicename - application nametype - application versionpublic void setDefaultApp(String name, ApplicationType type, String version)
AppRegistryServicesetDefaultApp in interface AppRegistryServicename - application nametype - application typeversion - application version.public List<AppRegistration> findAll()
findAll in interface AppRegistryCommonAppRegistration's including multiple version for the same
application.public org.springframework.data.domain.Page<AppRegistration> findAllByTypeAndNameIsLike(ApplicationType type, String name, org.springframework.data.domain.Pageable pageable)
findAllByTypeAndNameIsLike in interface AppRegistryServiceAppRegistration versions for given name and type. Uses the pagination.public org.springframework.data.domain.Page<AppRegistration> findAll(org.springframework.data.domain.Pageable pageable)
findAll in interface AppRegistryServiceAppRegistration's including multiple version for the same
application. Uses the pagination.public AppRegistration save(String name, ApplicationType type, String version, URI uri, URI metadataUri)
AppRegistryServiceAppRegistration identified by its name, type, version and URIs.save in interface AppRegistryServicename - Name of the AppRegistration to savetype - Type of the AppRegistration to saveversion - Version of the AppRegistration to saveuri - Resource uri of the AppRegistration to savemetadataUri - metadata of the AppRegistration to savepublic AppRegistration save(AppRegistration app)
AppRegistryCommonAppRegistration instance.save in interface AppRegistryCommonapp - appRegistration to savepublic void delete(String name, ApplicationType type, String version)
AppRegistration. If the AppRegistration does not exist, a
NoSuchAppRegistrationException will be thrown.delete in interface AppRegistryServicename - Name of the AppRegistration to deletetype - Type of the AppRegistration to deleteversion - Version of the AppRegistration to deleteprotected boolean isOverwrite(AppRegistration app, boolean overwrite)
isOverwrite in class AbstractAppRegistryCommonpublic boolean appExist(String name, ApplicationType type)
AppRegistryCommonappExist in interface AppRegistryCommonname - applicaiton nametype - applicaiton typepublic boolean appExist(String name, ApplicationType type, String version)
AppRegistryServiceAppRegistration with this name, type and version exists.appExist in interface AppRegistryServicename - application nametype - application typeversion - application version.Copyright © 2018 Pivotal Software, Inc.. All rights reserved.