public class AppRegistry extends AbstractAppRegistryCommon implements AppRegistryCommon
UriRegistry
that operates on higher level
AppRegistration
objects and supports on-demand loading of Resource
s.
Stores AppRegistration with up to two keys:
METADATA_KEY_SUFFIX, toStringAndUriFunc
Constructor and Description |
---|
AppRegistry(org.springframework.cloud.deployer.resource.registry.UriRegistry uriRegistry,
AppResourceCommon appResourceService) |
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.
|
void |
delete(String name,
ApplicationType type)
Deletes an
AppRegistration . |
AppRegistration |
find(String name,
ApplicationType type) |
List<AppRegistration> |
findAll() |
org.springframework.data.domain.Page<AppRegistration> |
findAll(org.springframework.data.domain.Pageable pageable) |
protected boolean |
isOverwrite(AppRegistration app,
boolean overwrite) |
AppRegistration |
save(AppRegistration app)
Save an
AppRegistration instance. |
AppRegistration |
save(String name,
ApplicationType type,
URI uri,
URI metadataUri) |
Stream<AppRegistration> |
toValidAppRegistration(Map.Entry<String,URI> kv,
URI metadataURI)
Builds a
Stream from key/value mapping. |
getAppMetadataResource, getAppResource, getResourceVersion, getResourceVersion, getResourceWithoutVersion, importAll, loadProperties, metadataUriFromProperties, warnOnMalformedURI
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
find, getAppMetadataResource, getAppResource, getResourceVersion, getResourceVersion, getResourceWithoutVersion, importAll
public AppRegistry(org.springframework.cloud.deployer.resource.registry.UriRegistry uriRegistry, AppResourceCommon appResourceService)
public AppRegistration find(String name, ApplicationType type)
find
in interface AppRegistryCommon
name
- application nametype
- application typpublic List<AppRegistration> findAll()
findAll
in interface AppRegistryCommon
AppRegistration
's including multiple version for the same
application.public org.springframework.data.domain.Page<AppRegistration> findAll(org.springframework.data.domain.Pageable pageable)
public AppRegistration save(String name, ApplicationType type, URI uri, URI metadataUri)
public Stream<AppRegistration> toValidAppRegistration(Map.Entry<String,URI> kv, URI metadataURI)
AbstractAppRegistryCommon
Stream
from key/value mapping.toValidAppRegistration
in class AbstractAppRegistryCommon
kv
- key/value representing app key (key) and app URI (value)metadataURI
- metadataUri computed from a given app keyprotected boolean isOverwrite(AppRegistration app, boolean overwrite)
isOverwrite
in class AbstractAppRegistryCommon
public AppRegistration save(AppRegistration app)
AppRegistryCommon
AppRegistration
instance.save
in interface AppRegistryCommon
app
- appRegistration to savepublic void delete(String name, ApplicationType type)
AppRegistration
. If the AppRegistration
does not exist, a
NoSuchAppRegistrationException
will be thrown.name
- Name of the AppRegistration to deletetype
- Type of the AppRegistration to deletepublic boolean appExist(String name, ApplicationType type)
AppRegistryCommon
appExist
in interface AppRegistryCommon
name
- applicaiton nametype
- applicaiton typeCopyright © 2018 Pivotal Software, Inc.. All rights reserved.