@Transactional public class DefaultAppRegistryService extends AbstractAppRegistryCommon implements AppRegistryService
DefaultAppRegistryService
objects and supports on-demand loading of
Resource
s.
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, warnOnMalformedURI
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAppMetadataResource, getAppResource, importAll
public 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 AppRegistryCommon
name
- application nametype
- application typpublic AppRegistration find(String name, ApplicationType type, String version)
find
in interface AppRegistryCommon
name
- application nametype
- application typepublic AppRegistration getDefaultApp(String name, ApplicationType type)
getDefaultApp
in interface AppRegistryService
name
- application nametype
- application versionpublic void setDefaultApp(String name, ApplicationType type, String version)
AppRegistryService
setDefaultApp
in interface AppRegistryService
name
- application nametype
- application typeversion
- application version.public List<AppRegistration> findAll()
findAll
in interface AppRegistryCommon
AppRegistration
'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 AppRegistryService
AppRegistration
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 AppRegistryService
AppRegistration
's including multiple version for the same
application. Uses the pagination.public AppRegistration save(String name, ApplicationType type, String version, URI uri, URI metadataUri)
AppRegistryService
AppRegistration
identified by its name, type, version and URIs.save
in interface AppRegistryService
name
- 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)
AppRegistryCommon
AppRegistration
instance.save
in interface AppRegistryCommon
app
- 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 AppRegistryService
name
- 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 AbstractAppRegistryCommon
public boolean appExist(String name, ApplicationType type)
AppRegistryCommon
appExist
in interface AppRegistryCommon
name
- applicaiton nametype
- applicaiton typepublic boolean appExist(String name, ApplicationType type, String version)
AppRegistryService
AppRegistration
with this name, type and version exists.appExist
in interface AppRegistryService
name
- application nametype
- application typeversion
- application version.Copyright © 2019 Pivotal Software, Inc.. All rights reserved.