├── .gitignore
├── .mvn
├── jvm.config
├── maven.config
└── wrapper
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── .settings.xml
├── .travis.yml
├── CODE_OF_CONDUCT.adoc
├── LICENSE
├── README.adoc
├── mvnw
├── mvnw.cmd
├── pom.xml
├── spring-cloud-deployer-admin-completion
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── deployer
│ │ └── admin
│ │ └── completion
│ │ ├── BooleanValueHintProvider.java
│ │ ├── CompletionConfiguration.java
│ │ ├── CompletionProposal.java
│ │ ├── CompletionUtils.java
│ │ ├── DefaultValueHintProvider.java
│ │ ├── EnumValueHintProvider.java
│ │ ├── RecoveryStrategy.java
│ │ ├── ValueHintProvider.java
│ │ └── package-info.java
│ └── test
│ ├── java
│ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── deployer
│ │ └── admin
│ │ └── completion
│ │ ├── Expresso.java
│ │ └── Proposals.java
│ ├── resources
│ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── dataflow
│ │ └── completion
│ │ ├── apps
│ │ ├── basic-task
│ │ │ └── META-INF
│ │ │ │ ├── spring-configuration-metadata-whitelist.properties
│ │ │ │ └── spring-configuration-metadata.json
│ │ ├── filter-processor
│ │ │ └── META-INF
│ │ │ │ ├── spring-configuration-metadata-whitelist.properties
│ │ │ │ └── spring-configuration-metadata.json
│ │ ├── hdfs-source
│ │ │ └── META-INF
│ │ │ │ ├── spring-configuration-metadata-whitelist.properties
│ │ │ │ └── spring-configuration-metadata.json
│ │ ├── http-source
│ │ │ └── META-INF
│ │ │ │ ├── spring-configuration-metadata-whitelist.properties
│ │ │ │ └── spring-configuration-metadata.json
│ │ ├── log-sink
│ │ │ └── META-INF
│ │ │ │ ├── spring-configuration-metadata-whitelist.properties
│ │ │ │ └── spring-configuration-metadata.json
│ │ └── plum-task
│ │ │ └── META-INF
│ │ │ ├── spring-configuration-metadata-whitelist.properties
│ │ │ └── spring-configuration-metadata.json
│ │ └── boot_versions
│ │ ├── README.txt
│ │ ├── boot13-1.0.0.BUILD-SNAPSHOT.jar
│ │ └── boot14-1.0.0.BUILD-SNAPSHOT.jar
│ └── support
│ ├── boot13
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── acme
│ │ │ └── boot13
│ │ │ ├── AnotherEnumClass13.java
│ │ │ ├── Main.java
│ │ │ └── MyConfigProperties13.java
│ │ └── resources
│ │ └── META-INF
│ │ └── spring-configuration-metadata-whitelist.properties
│ ├── boot14
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── acme
│ │ │ └── boot14
│ │ │ ├── AnotherEnumClass14.java
│ │ │ ├── Main.java
│ │ │ └── MyConfigProperties14.java
│ │ └── resources
│ │ └── META-INF
│ │ └── spring-configuration-metadata-whitelist.properties
│ ├── common
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── acme
│ │ └── common
│ │ ├── ConfigProperties.java
│ │ └── SomeEnum.java
│ └── pom.xml
├── spring-cloud-deployer-admin-configuration-metadata
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── springframework
│ │ │ └── cloud
│ │ │ └── deployer
│ │ │ └── admin
│ │ │ └── configuration
│ │ │ └── metadata
│ │ │ ├── ApplicationConfigurationMetadataResolver.java
│ │ │ ├── ApplicationConfigurationMetadataResolverAutoConfiguration.java
│ │ │ ├── BootApplicationConfigurationMetadataResolver.java
│ │ │ ├── BootClassLoaderFactory.java
│ │ │ ├── DelegatingApplicationConfigurationMetadataResolver.java
│ │ │ └── package-info.java
│ └── resources
│ │ └── META-INF
│ │ └── spring.factories
│ └── test
│ ├── java
│ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── deployer
│ │ └── admin
│ │ └── configuration
│ │ └── metadata
│ │ └── BootApplicationConfigurationMetadataResolverTests.java
│ └── resources
│ └── org
│ └── springframework
│ └── cloud
│ └── deployer
│ └── admin
│ └── configuration
│ └── metadata
│ └── apps
│ ├── filter-processor
│ └── META-INF
│ │ ├── spring-configuration-metadata-whitelist.properties
│ │ └── spring-configuration-metadata.json
│ └── no-whitelist
│ └── META-INF
│ └── spring-configuration-metadata.json
├── spring-cloud-deployer-admin-core
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── deployer
│ │ └── admin
│ │ └── core
│ │ ├── ApplicationDefinition.java
│ │ ├── DataFlowAppDefinition.java
│ │ ├── dsl
│ │ ├── AppNode.java
│ │ ├── AppParser.java
│ │ ├── ApplicationParser.java
│ │ ├── ArgumentNode.java
│ │ ├── AstNode.java
│ │ ├── CheckPointedParseException.java
│ │ ├── DSLMessage.java
│ │ ├── DestinationNode.java
│ │ ├── LabelNode.java
│ │ ├── ParseException.java
│ │ ├── SinkDestinationNode.java
│ │ ├── SourceDestinationNode.java
│ │ ├── StreamNode.java
│ │ ├── StreamParser.java
│ │ ├── Token.java
│ │ ├── TokenKind.java
│ │ ├── Tokenizer.java
│ │ ├── Tokens.java
│ │ └── package-info.java
│ │ └── package-info.java
│ └── test
│ └── java
│ └── org
│ └── springframework
│ └── cloud
│ └── deployer
│ └── admin
│ └── core
│ └── dsl
│ └── StreamParserTests.java
├── spring-cloud-deployer-admin-dependencies
└── pom.xml
├── spring-cloud-deployer-admin-registry
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── springframework
│ └── cloud
│ └── deployer
│ └── admin
│ └── registry
│ ├── AppRegistration.java
│ ├── AppRegistry.java
│ ├── EavRegistryRepository.java
│ ├── RdbmsEavRegistryRepository.java
│ ├── RdbmsUriRegistry.java
│ ├── package-info.java
│ └── support
│ ├── NoSuchAppRegistrationException.java
│ └── package-info.java
├── spring-cloud-deployer-admin-rest-client
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── deployer
│ │ └── admin
│ │ └── rest
│ │ └── client
│ │ ├── AppRegistryOperations.java
│ │ ├── AppRegistryTemplate.java
│ │ ├── ApplicationOperations.java
│ │ ├── ApplicationTemplate.java
│ │ ├── CompletionOperations.java
│ │ ├── CompletionTemplate.java
│ │ ├── DataFlowClientException.java
│ │ ├── DataFlowOperations.java
│ │ ├── DataFlowServerException.java
│ │ ├── DataFlowTemplate.java
│ │ ├── RuntimeOperations.java
│ │ ├── RuntimeTemplate.java
│ │ ├── VndErrorResponseErrorHandler.java
│ │ └── package-info.java
│ └── test
│ ├── java
│ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── deployer
│ │ └── admin
│ │ └── rest
│ │ └── client
│ │ └── DataflowTemplateTests.java
│ └── resources
│ ├── JobExecutionJson.txt
│ └── SingleJobExecutionJson.txt
├── spring-cloud-deployer-admin-rest-resource
├── .jdk8
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── deployer
│ │ └── admin
│ │ └── rest
│ │ ├── package-info.java
│ │ ├── resource
│ │ ├── AppInstanceStatusResource.java
│ │ ├── AppRegistrationResource.java
│ │ ├── AppStatusResource.java
│ │ ├── ApplicationDefinitionResource.java
│ │ ├── ApplicationDeploymentResource.java
│ │ ├── CompletionProposalsResource.java
│ │ ├── DetailedAppRegistrationResource.java
│ │ ├── FeaturesInfoResource.java
│ │ ├── package-info.java
│ │ └── security
│ │ │ ├── SecurityInfoResource.java
│ │ │ └── package-info.java
│ │ └── util
│ │ ├── DeploymentPropertiesUtils.java
│ │ └── package-info.java
│ └── test
│ └── java
│ └── org
│ └── springframework
│ └── cloud
│ └── deployer
│ └── admin
│ └── rest
│ └── job
│ └── support
│ └── DeploymentPropertiesUtilsTests.java
├── spring-cloud-deployer-admin-server-core
├── .jdk8
├── README.adoc
├── pom.xml
└── src
│ ├── main
│ ├── docker
│ │ └── Dockerfile
│ ├── java
│ │ └── org
│ │ │ └── springframework
│ │ │ └── cloud
│ │ │ └── deployer
│ │ │ └── admin
│ │ │ └── server
│ │ │ ├── EnableDataFlowServer.java
│ │ │ ├── completion
│ │ │ └── package-info.java
│ │ │ ├── config
│ │ │ ├── DataFlowControllerAutoConfiguration.java
│ │ │ ├── DataFlowServerAutoConfiguration.java
│ │ │ ├── DataFlowServerConfiguration.java
│ │ │ ├── DefaultEnvironmentPostProcessor.java
│ │ │ ├── EnableDataFlowServerConfiguration.java
│ │ │ ├── apps
│ │ │ │ ├── CommonApplicationProperties.java
│ │ │ │ └── package-info.java
│ │ │ ├── features
│ │ │ │ ├── ApplicationConfiguration.java
│ │ │ │ ├── FeaturesConfiguration.java
│ │ │ │ ├── FeaturesProperties.java
│ │ │ │ └── package-info.java
│ │ │ ├── package-info.java
│ │ │ ├── security
│ │ │ │ ├── BasicAuthSecurityConfiguration.java
│ │ │ │ ├── FileAuthenticationConfiguration.java
│ │ │ │ ├── LdapAuthenticationConfiguration.java
│ │ │ │ ├── OAuthSecurityConfiguration.java
│ │ │ │ ├── package-info.java
│ │ │ │ └── support
│ │ │ │ │ ├── LdapSecurityProperties.java
│ │ │ │ │ ├── LdapSecurityPropertiesValid.java
│ │ │ │ │ ├── LdapSecurityPropertiesValidator.java
│ │ │ │ │ ├── OnOAuth2Disabled.java
│ │ │ │ │ ├── OnSecurityEnabledAndOAuth2Disabled.java
│ │ │ │ │ └── OnSecurityEnabledAndOAuth2Enabled.java
│ │ │ └── web
│ │ │ │ ├── WebConfiguration.java
│ │ │ │ └── package-info.java
│ │ │ ├── controller
│ │ │ ├── AppAlreadyRegisteredException.java
│ │ │ ├── AppRegistryController.java
│ │ │ ├── ApplicationAlreadyDeployedException.java
│ │ │ ├── ApplicationAlreadyDeployingException.java
│ │ │ ├── ApplicationDefinitionController.java
│ │ │ ├── ApplicationDeploymentController.java
│ │ │ ├── CompletionController.java
│ │ │ ├── FeaturesController.java
│ │ │ ├── RestControllerAdvice.java
│ │ │ ├── RootController.java
│ │ │ ├── RuntimeAppsController.java
│ │ │ ├── UiController.java
│ │ │ ├── WhitelistProperties.java
│ │ │ ├── package-info.java
│ │ │ ├── security
│ │ │ │ ├── LoginController.java
│ │ │ │ ├── SecurityController.java
│ │ │ │ ├── package-info.java
│ │ │ │ └── support
│ │ │ │ │ └── AuthenticationRequest.java
│ │ │ └── support
│ │ │ │ ├── InvalidStreamDefinitionException.java
│ │ │ │ └── package-info.java
│ │ │ ├── package-info.java
│ │ │ ├── repository
│ │ │ ├── AbstractRdbmsKeyValueRepository.java
│ │ │ ├── ApplicationDefinitionRepository.java
│ │ │ ├── DeploymentIdRepository.java
│ │ │ ├── DuplicateTaskException.java
│ │ │ ├── NoSuchApplicationDefinitionException.java
│ │ │ ├── NoSuchTaskDefinitionException.java
│ │ │ ├── NoSuchTaskExecutionException.java
│ │ │ ├── RdbmsApplicationDefinitionRepository.java
│ │ │ ├── RdbmsDeploymentIdRepository.java
│ │ │ ├── package-info.java
│ │ │ └── support
│ │ │ │ ├── AbstractSqlPagingQueryProvider.java
│ │ │ │ ├── DatabaseType.java
│ │ │ │ ├── DataflowRdbmsInitializer.java
│ │ │ │ ├── Db2PagingQueryProvider.java
│ │ │ │ ├── H2PagingQueryProvider.java
│ │ │ │ ├── HsqlPagingQueryProvider.java
│ │ │ │ ├── JdbcParameterUtils.java
│ │ │ │ ├── MySqlPagingQueryProvider.java
│ │ │ │ ├── OraclePagingQueryProvider.java
│ │ │ │ ├── Order.java
│ │ │ │ ├── PagingQueryProvider.java
│ │ │ │ ├── PostgresPagingQueryProvider.java
│ │ │ │ ├── SearchPageable.java
│ │ │ │ ├── SqlPagingQueryProviderFactoryBean.java
│ │ │ │ ├── SqlPagingQueryUtils.java
│ │ │ │ ├── SqlServerPagingQueryProvider.java
│ │ │ │ └── package-info.java
│ │ │ ├── service
│ │ │ ├── impl
│ │ │ │ ├── ManualOAuthAuthenticationProvider.java
│ │ │ │ └── package-info.java
│ │ │ └── package-info.java
│ │ │ └── support
│ │ │ ├── CannotDetermineApplicationTypeException.java
│ │ │ └── package-info.java
│ └── resources
│ │ ├── META-INF
│ │ ├── dataflow-server-defaults.yml
│ │ └── spring.factories
│ │ ├── banner.txt
│ │ ├── schema-db2-applications.sql
│ │ ├── schema-db2-common.sql
│ │ ├── schema-db2-deployment.sql
│ │ ├── schema-db2-streams.sql
│ │ ├── schema-db2-tasks.sql
│ │ ├── schema-h2-applications.sql
│ │ ├── schema-h2-common.sql
│ │ ├── schema-h2-deployment.sql
│ │ ├── schema-h2-streams.sql
│ │ ├── schema-h2-tasks.sql
│ │ ├── schema-hsqldb-applications.sql
│ │ ├── schema-hsqldb-common.sql
│ │ ├── schema-hsqldb-deployment.sql
│ │ ├── schema-hsqldb-streams.sql
│ │ ├── schema-hsqldb-tasks.sql
│ │ ├── schema-mysql-applications.sql
│ │ ├── schema-mysql-common.sql
│ │ ├── schema-mysql-deployment.sql
│ │ ├── schema-mysql-streams.sql
│ │ ├── schema-mysql-tasks.sql
│ │ ├── schema-oracle10g-applications.sql
│ │ ├── schema-oracle10g-common.sql
│ │ ├── schema-oracle10g-deployment.sql
│ │ ├── schema-oracle10g-streams.sql
│ │ ├── schema-oracle10g-tasks.sql
│ │ ├── schema-postgresql-applications.sql
│ │ ├── schema-postgresql-common.sql
│ │ ├── schema-postgresql-deployment.sql
│ │ ├── schema-postgresql-streams.sql
│ │ ├── schema-postgresql-tasks.sql
│ │ ├── schema-sqlserver-applications.sql
│ │ ├── schema-sqlserver-common.sql
│ │ ├── schema-sqlserver-deployment.sql
│ │ ├── schema-sqlserver-streams.sql
│ │ └── schema-sqlserver-tasks.sql
│ └── test
│ ├── java
│ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── deployer
│ │ └── admin
│ │ └── server
│ │ ├── config
│ │ ├── DefaultEnvironmentPostProcessorTests.java
│ │ └── security
│ │ │ ├── FileAuthenticationConfigurationTests.java
│ │ │ ├── OnSecurityEnabledAndOAuth2DisabledTests.java
│ │ │ └── OnSecurityEnabledAndOAuth2EnabledTests.java
│ │ ├── configuration
│ │ └── TestDependencies.java
│ │ ├── controller
│ │ └── AppRegistryControllerTests.java
│ │ ├── registry
│ │ ├── DataFlowUriRegistryPopulator.java
│ │ └── RdbmsUriRegistryTests.java
│ │ └── repository
│ │ └── support
│ │ └── SearchPageableTests.java
│ └── resources
│ ├── META-INF
│ └── test-apps.properties
│ ├── app-registry-bad.properties
│ ├── app-registry.properties
│ ├── apps
│ ├── filter-processor
│ │ └── META-INF
│ │ │ └── spring-configuration-metadata.json
│ ├── foo-task
│ │ └── META-INF
│ │ │ └── .vcs-dont-ignore
│ ├── hdfs-source
│ │ └── META-INF
│ │ │ └── spring-configuration-metadata.json
│ ├── http-source
│ │ └── META-INF
│ │ │ └── spring-configuration-metadata.json
│ ├── log-sink
│ │ └── META-INF
│ │ │ └── spring-configuration-metadata.json
│ └── whitelist-source
│ │ └── META-INF
│ │ ├── spring-configuration-metadata-whitelist.properties
│ │ └── spring-configuration-metadata.json
│ ├── dataflow-server.yml
│ └── test.yml
├── spring-cloud-deployer-admin-server-local
├── README.adoc
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── deployer
│ │ └── admin
│ │ └── server
│ │ └── local
│ │ ├── LocalDataFlowServer.java
│ │ └── package-info.java
│ └── resources
│ └── application.yml
├── spring-cloud-deployer-admin-shell-core
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── springframework
│ │ │ └── cloud
│ │ │ └── deployer
│ │ │ └── admin
│ │ │ └── shell
│ │ │ ├── EnableDataFlowShell.java
│ │ │ ├── ShellApplication.java
│ │ │ ├── ShellCommandLineParser.java
│ │ │ ├── ShellCommandLineRunner.java
│ │ │ ├── ShellProperties.java
│ │ │ ├── Target.java
│ │ │ ├── TargetHolder.java
│ │ │ ├── autoconfigure
│ │ │ ├── BaseShellAutoConfiguration.java
│ │ │ └── package-info.java
│ │ │ ├── command
│ │ │ ├── AppRegistryCommands.java
│ │ │ ├── ApplicationCommands.java
│ │ │ ├── Assertions.java
│ │ │ ├── ConfigCommands.java
│ │ │ ├── ConsoleUserInput.java
│ │ │ ├── DataFlowTables.java
│ │ │ ├── HttpCommands.java
│ │ │ ├── RuntimeCommands.java
│ │ │ ├── UserInput.java
│ │ │ ├── package-info.java
│ │ │ └── support
│ │ │ │ ├── HttpClientUtils.java
│ │ │ │ └── package-info.java
│ │ │ ├── config
│ │ │ ├── DataFlowBannerProvider.java
│ │ │ ├── DataFlowPromptProvider.java
│ │ │ ├── DataFlowShell.java
│ │ │ ├── ShellCommandLineConfiguration.java
│ │ │ └── package-info.java
│ │ │ ├── converter
│ │ │ ├── CompletionConverter.java
│ │ │ ├── MediaTypeConverter.java
│ │ │ ├── NumberFormatConverter.java
│ │ │ ├── QualifiedApplicationNameConverter.java
│ │ │ └── package-info.java
│ │ │ └── package-info.java
│ └── resources
│ │ ├── META-INF
│ │ └── spring.factories
│ │ ├── dataflow-banner.txt
│ │ ├── logback.xml
│ │ └── usage.txt
│ └── test
│ ├── java
│ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── deployer
│ │ └── admin
│ │ └── shell
│ │ ├── AbstractShellIntegrationTest.java
│ │ └── command
│ │ ├── AppRegistryCommandsTests.java
│ │ ├── AssertionsTests.java
│ │ ├── ConfigCommandTests.java
│ │ └── RuntimeCommandsTests.java
│ └── resources
│ ├── META-INF
│ ├── spring
│ │ └── spring-shell-plugin.xml
│ ├── test-stream-apps.properties
│ └── test-task-apps.properties
│ ├── appRegistryCommandsTests-apps.properties
│ ├── application.properties
│ ├── dataflow-banner.txt
│ ├── testRenderParameterInfoDataAsTableWithMaxWidth.txt
│ ├── testRenderTableWithRowShorthand-expected-output.txt
│ ├── testRenderTextTable-expected-output.txt
│ ├── testRenderTextTable-single-column-expected-output.txt
│ └── testRenderTextTable-single-column-width4-expected-output.txt
├── spring-cloud-deployer-admin-shell
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── springframework
│ └── cloud
│ └── deployer
│ └── admin
│ └── shell
│ └── app
│ └── ShellApplication.java
└── spring-cloud-starter-deployer-admin-server-local
├── pom.xml
└── src
├── main
└── resources
│ └── dataflow-server.yml
└── test
├── java
└── org
│ └── springframework
│ └── cloud
│ └── deployer
│ └── admin
│ └── server
│ └── local
│ ├── LocalConfigurationTests.java
│ ├── LocalDataflowResource.java
│ ├── TestUtils.java
│ ├── dataflowapp
│ └── LocalTestDataFlowServer.java
│ ├── nodataflowapp
│ └── LocalTestNoDataFlowServer.java
│ └── security
│ ├── ApacheDSContainerWithSecurity.java
│ ├── LdapServerResource.java
│ ├── LocalServerSecurityWithLdapSearchAndBindSslTests.java
│ ├── LocalServerSecurityWithLdapSearchAndBindTests.java
│ ├── LocalServerSecurityWithLdapSimpleBindAndDefaultManagementTests.java
│ ├── LocalServerSecurityWithLdapSimpleBindTests.java
│ └── SecurityTestUtils.java
└── resources
├── logback-test.xml
└── org
└── springframework
└── cloud
└── deployer
└── admin
└── server
└── local
└── security
├── dataflow.keystore
├── dataflow.truststore
├── ldapSearchAndBind.yml
├── ldapSimpleBind.yml
├── ldapSimpleBindWithDefaultManagementSecurity.yml
├── ldapSslSearchAndBind.yml
└── testUsers.ldif
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | .#*
3 | *#
4 | *.sw*
5 | _site/
6 | .factorypath
7 | .gradletasknamecache
8 | .DS_Store
9 | /application.yml
10 | /application.properties
11 | asciidoctor.css
12 | atlassian-ide-plugin.xml
13 | bin/
14 | build/
15 | dump.rdb
16 | out
17 | spring-shell.log
18 | target/
19 | test-output
20 |
21 | # Eclipse artifacts, including WTP generated manifests
22 | .classpath
23 | .project
24 | .settings/
25 | .springBeans
26 | spring-*/src/main/java/META-INF/MANIFEST.MF
27 |
28 | # IDEA artifacts and output dirs
29 | *.iml
30 | *.ipr
31 | *.iws
32 | .idea/*
33 | rebel.xml
34 |
--------------------------------------------------------------------------------
/.mvn/jvm.config:
--------------------------------------------------------------------------------
1 | -Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom
--------------------------------------------------------------------------------
/.mvn/maven.config:
--------------------------------------------------------------------------------
1 | -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local -P spring
2 |
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-cloud-dashboard/3442c3bec5390c647e156176c5635d7dc9045235/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
2 |
--------------------------------------------------------------------------------
/.settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | repo.spring.io
6 | ${env.CI_DEPLOY_USERNAME}
7 | ${env.CI_DEPLOY_PASSWORD}
8 |
9 |
10 |
11 |
12 |
18 | spring
19 | true
20 |
21 |
22 | spring-snapshots
23 | Spring Snapshots
24 | http://repo.spring.io/libs-snapshot-local
25 |
26 | true
27 |
28 |
29 |
30 | spring-milestones
31 | Spring Milestones
32 | http://repo.spring.io/libs-milestone-local
33 |
34 | false
35 |
36 |
37 |
38 | spring-releases
39 | Spring Releases
40 | http://repo.spring.io/release
41 |
42 | false
43 |
44 |
45 |
46 |
47 |
48 | spring-snapshots
49 | Spring Snapshots
50 | http://repo.spring.io/libs-snapshot-local
51 |
52 | true
53 |
54 |
55 |
56 | spring-milestones
57 | Spring Milestones
58 | http://repo.spring.io/libs-milestone-local
59 |
60 | false
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: false
2 | cache:
3 | directories:
4 | - $HOME/.m2
5 | language: java
6 | jdk:
7 | - oraclejdk8
8 | services:
9 | - redis-server
10 | install: true
11 | script:
12 | - '[ "${TRAVIS_PULL_REQUEST}" != "false" ] || ./mvnw package -Pfull -U -Dmaven.test.redirectTestOutputToFile=false'
13 | - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] || ./mvnw package -DskipTests -U -Dmaven.test.redirectTestOutputToFile=false'
14 |
15 |
--------------------------------------------------------------------------------
/README.adoc:
--------------------------------------------------------------------------------
1 | # This repository is no longer actively maintained by VMware, Inc.
2 |
3 |
4 | == Spring Cloud Deployer Admin
5 |
6 | === Building
7 |
8 | Clone the repo and type
9 |
10 | ----
11 | $ ./mvnw clean install
12 | ----
13 |
14 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 |
5 | org.springframework.cloud
6 | spring-cloud-deployer-admin-parent
7 | 1.0.0.BUILD-SNAPSHOT
8 |
9 | spring-cloud-deployer-admin-completion
10 |
11 |
12 | org.springframework.cloud
13 | spring-cloud-deployer-admin-core
14 |
15 |
16 | org.springframework.cloud
17 | spring-cloud-deployer-admin-registry
18 |
19 |
20 | org.springframework.cloud
21 | spring-cloud-deployer-admin-configuration-metadata
22 |
23 |
24 | org.springframework.boot
25 | spring-boot-starter-test
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/main/java/org/springframework/cloud/deployer/admin/completion/BooleanValueHintProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.completion;
18 |
19 | import java.util.Arrays;
20 | import java.util.Collections;
21 | import java.util.List;
22 |
23 | import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
24 | import org.springframework.boot.configurationmetadata.ValueHint;
25 |
26 | /**
27 | * Returns the closed set of {@literal true} and {@literal false} for properties
28 | * that are of type Boolean.
29 | *
30 | * @author Eric Bottard
31 | */
32 | public class BooleanValueHintProvider implements ValueHintProvider {
33 |
34 | private static final List BOOLEANS;
35 | static {
36 | ValueHint yes = new ValueHint();
37 | yes.setValue(true);
38 | ValueHint no = new ValueHint();
39 | no.setValue(false);
40 | BOOLEANS = Collections.unmodifiableList(Arrays.asList(yes, no));
41 | }
42 |
43 | @Override
44 | public List generateValueHints(ConfigurationMetadataProperty property, ClassLoader classLoader) {
45 | return "java.lang.Boolean".equals(property.getType())
46 | ? BOOLEANS
47 | : Collections.emptyList();
48 | }
49 |
50 | @Override
51 | public boolean isExclusive(ConfigurationMetadataProperty property) {
52 | return true;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/main/java/org/springframework/cloud/deployer/admin/completion/CompletionUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.completion;
18 |
19 | import java.util.List;
20 |
21 | import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
22 |
23 | /**
24 | * Various utility methods used throughout the completion package.
25 | *
26 | * @author Eric Bottard
27 | * @author Mark Fisher
28 | */
29 | public class CompletionUtils {
30 |
31 | /**
32 | * Return whether the given property name should be considered matching the candidate configuration property, also
33 | * taking into account the list of whitelist properties (which are tested on their short name).
34 | */
35 | static boolean isMatchingProperty(String propertyName, ConfigurationMetadataProperty property, List whiteListedProps) {
36 | if (property.getId().equals(propertyName)) {
37 | return true; // For any prop
38 | } // Handle special case of short form for whitelist
39 | else {
40 | for (ConfigurationMetadataProperty white : whiteListedProps) {
41 | if (property.getId().equals(white.getId())) { // prop#equals() not implemented
42 | return property.getName().equals(propertyName);
43 | }
44 | }
45 | return false;
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/main/java/org/springframework/cloud/deployer/admin/completion/DefaultValueHintProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.completion;
18 |
19 | import java.util.List;
20 |
21 | import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
22 | import org.springframework.boot.configurationmetadata.ValueHint;
23 | import org.springframework.boot.configurationmetadata.ValueProvider;
24 |
25 | /**
26 | * A default {@link ValueHintProvider} that returns hints explicitly
27 | * defined by a property.
28 | *
29 | * @author Eric Bottard
30 | */
31 | public class DefaultValueHintProvider implements ValueHintProvider {
32 |
33 | @Override
34 | public List generateValueHints(ConfigurationMetadataProperty property, ClassLoader classLoader) {
35 | return property.getValueHints();
36 | }
37 |
38 | @Override
39 | public boolean isExclusive(ConfigurationMetadataProperty property) {
40 | for (ValueProvider valueProvider : property.getValueProviders()) {
41 | if ("any".equals(valueProvider.getName())) {
42 | return false;
43 | }
44 | }
45 | return true;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/main/java/org/springframework/cloud/deployer/admin/completion/EnumValueHintProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.completion;
18 |
19 | import java.util.ArrayList;
20 | import java.util.List;
21 |
22 | import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
23 | import org.springframework.boot.configurationmetadata.ValueHint;
24 | import org.springframework.util.ClassUtils;
25 |
26 | /**
27 | * A {@link ValueHintProvider} that returns possible values when the
28 | * property is an {@link Enum}.
29 | *
30 | * @author Eric Bottard
31 | */
32 | public class EnumValueHintProvider implements ValueHintProvider {
33 |
34 | @Override
35 | public List generateValueHints(ConfigurationMetadataProperty property, ClassLoader classLoader) {
36 | List result = new ArrayList<>();
37 | if (ClassUtils.isPresent(property.getType(), classLoader)) {
38 | Class> clazz = ClassUtils.resolveClassName(property.getType(), classLoader);
39 | if (clazz.isEnum()) {
40 | for (Object o : clazz.getEnumConstants()) {
41 | ValueHint hint = new ValueHint();
42 | hint.setValue(o);
43 | result.add(hint);
44 | }
45 | }
46 | }
47 | return result;
48 | }
49 |
50 | @Override
51 | public boolean isExclusive(ConfigurationMetadataProperty property) {
52 | return true;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/main/java/org/springframework/cloud/deployer/admin/completion/RecoveryStrategy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.completion;
18 |
19 | import java.util.List;
20 |
21 | /**
22 | * Used to provide completions on ill-formed stream definitions, after an initial (failed) parse.
23 | *
24 | * @param the kind of exception that is intercepted during parsing
25 | *
26 | * @author Eric Bottard
27 | */
28 | public interface RecoveryStrategy {
29 |
30 | /**
31 | * Whether this completion should be triggered.
32 | */
33 | boolean shouldTrigger(String dslStart, Exception exception);
34 |
35 | /**
36 | * Perform code completion by adding proposals to the {@code proposals} list.
37 | */
38 | void addProposals(String dsl, E exception, int detailLevel, List proposals);
39 | }
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/main/java/org/springframework/cloud/deployer/admin/completion/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains classes related to code-completion of stream definitions expressed
3 | * in the Spring Cloud Dataflow DSL.
4 | *
5 | * @author Eric Bottard
6 | */
7 | package org.springframework.cloud.deployer.admin.completion;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/java/org/springframework/cloud/deployer/admin/completion/Expresso.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.completion;
18 |
19 | /**
20 | * An enum value used as a configuration property value in {@link StreamCompletionProviderTests}.
21 | *
22 | * @author Eric Bottard
23 | */
24 | public enum Expresso {
25 | SINGLE, DOUBLE;
26 | }
27 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/java/org/springframework/cloud/deployer/admin/completion/Proposals.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.completion;
18 |
19 | import org.hamcrest.FeatureMatcher;
20 | import org.springframework.cloud.deployer.admin.completion.CompletionProposal;
21 |
22 | /**
23 | * Contains helper Hamcrest matchers for testing completion proposal related code.
24 | *
25 | * @author Eric Bottard
26 | */
27 | class Proposals {
28 | static org.hamcrest.Matcher proposalThat(org.hamcrest.Matcher matcher) {
29 | return new FeatureMatcher(matcher, "a proposal whose text", "text") {
30 | @Override
31 | protected String featureValueOf(CompletionProposal actual) {
32 | return actual.getText();
33 | }
34 | };
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/apps/basic-task/META-INF/spring-configuration-metadata-whitelist.properties:
--------------------------------------------------------------------------------
1 | configuration-properties.classes=foo.bar.BasicProperties
2 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/apps/basic-task/META-INF/spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "groups": [
3 | {
4 | "name": "basic",
5 | "type": "foo.bar.BasicProperties",
6 | "sourceType": "foo.bar.BasicProperties"
7 | }
8 | ],"properties": [
9 | {
10 | "name": "basic.expression",
11 | "type": "org.springframework.expression.Expression",
12 | "description": "A predicate to evaluate",
13 | "sourceType": "foo.bar.BasicProperties",
14 | "defaultValue": "true"
15 | },
16 | {
17 | "name": "basic.fooble",
18 | "type": "org.springframework.expression.Expression",
19 | "description": "A predicate to evaluate",
20 | "sourceType": "foo.bar.BasicProperties",
21 | "defaultValue": "true"
22 | },
23 | {
24 | "name": "basic.expresso",
25 | "type": "org.springframework.cloud.dataflow.completion.Expresso",
26 | "description": "A property of type enum and whose name starts like 'expression'",
27 | "sourceType": "foo.bar.BasicProperties"
28 | }
29 | ],
30 | "hints": []
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/apps/filter-processor/META-INF/spring-configuration-metadata-whitelist.properties:
--------------------------------------------------------------------------------
1 | configuration-properties.classes=foo.bar.FilterProperties
2 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/apps/filter-processor/META-INF/spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "groups": [
3 | {
4 | "name": "filter",
5 | "type": "foo.bar.FilterProperties",
6 | "sourceType": "foo.bar.FilterProperties"
7 | }
8 | ],"properties": [
9 | {
10 | "name": "filter.expression",
11 | "type": "org.springframework.expression.Expression",
12 | "description": "A predicate to evaluate",
13 | "sourceType": "foo.bar.FilterProperties",
14 | "defaultValue": "true"
15 | },
16 | {
17 | "name": "filter.expresso",
18 | "type": "org.springframework.cloud.dataflow.completion.Expresso",
19 | "description": "A property of type enum and whose name starts like 'expression'",
20 | "sourceType": "foo.bar.FilterProperties"
21 | }
22 | ],
23 | "hints": []
24 | }
25 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/apps/hdfs-source/META-INF/spring-configuration-metadata-whitelist.properties:
--------------------------------------------------------------------------------
1 | configuration-properties.classes=com.foo.DifferentHdfsProperties
2 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/apps/hdfs-source/META-INF/spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "groups": [
3 | {
4 | "name": "some.long.prefix",
5 | "type": "foo.bar.HdfsProperties",
6 | "sourceType": "foo.bar.HdfsProperties"
7 | },
8 | {
9 | "name": "some.long.prefix.nested",
10 | "type": "foo.bar.OtherHdfsProperties",
11 | "sourceType": "foo.bar.HdfsProperties"
12 | },
13 | {
14 | "name": "hdfs",
15 | "type": "com.foo.DifferentHdfsProperties",
16 | "sourceType": "com.foo.DifferentHdfsProperties"
17 | }
18 | ],
19 | "properties": [
20 | {
21 | "name": "hdfs.directory",
22 | "type": "java.lang.String",
23 | "description": "A path",
24 | "sourceType": "com.foo.DifferentHdfsProperties",
25 | "defaultValue": "/tmp"
26 | },
27 | {
28 | "name": "some.long.prefix.option1",
29 | "type": "java.lang.String",
30 | "description": "An option",
31 | "sourceType": "foo.bar.HdfsProperties",
32 | "defaultValue": "foo"
33 | },
34 | {
35 | "name": "some.long.prefix.option2",
36 | "type": "java.lang.String",
37 | "description": "Another option",
38 | "sourceType": "foo.bar.HdfsProperties",
39 | "defaultValue": "bar"
40 | },
41 | {
42 | "name": "some.long.prefix.nested.itworks",
43 | "type": "java.lang.String",
44 | "description": "Nested option",
45 | "sourceType": "foo.bar.HdfsProperties",
46 | "defaultValue": "wizz"
47 | }
48 | ],
49 | "hints": []
50 | }
51 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/apps/http-source/META-INF/spring-configuration-metadata-whitelist.properties:
--------------------------------------------------------------------------------
1 | configuration-properties.classes=foo.bar.HttpProperties
2 | configuration-properties.names = server.port
3 |
4 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/apps/http-source/META-INF/spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "groups": [
3 | {
4 | "name": "http",
5 | "type": "foo.bar.HttpProperties",
6 | "sourceType": "foo.bar.HttpProperties"
7 | },
8 | {
9 | "name": "server",
10 | "type": "foo.bar.ServerProperties",
11 | "sourceType": "foo.bar.ServerProperties"
12 | }
13 | ],
14 | "properties": [
15 | {
16 | "name": "http.use-ssl",
17 | "type": "java.lang.Boolean",
18 | "description": "Whether to use SSL encryption or not",
19 | "sourceType": "foo.bar.HttpProperties"
20 | },
21 | {
22 | "name": "server.port",
23 | "type": "java.lang.Integer",
24 | "description": "The port to listen on",
25 | "sourceType": "foo.bar.ServerProperties"
26 | }
27 | ],
28 |
29 | "hints": []
30 | }
31 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/apps/log-sink/META-INF/spring-configuration-metadata-whitelist.properties:
--------------------------------------------------------------------------------
1 | primary.prefix=spring.cloud.stream.app
2 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/apps/log-sink/META-INF/spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "groups": [
3 | {
4 | "name": "log",
5 | "type": "com.foo.LogProperties",
6 | "sourceType": "com.foo.LogProperties"
7 | }
8 | ],
9 | "properties": [
10 | {
11 | "name": "log.level",
12 | "type": "java.lang.String",
13 | "description": "The logger level",
14 | "sourceType": "com.foo.LogProperties",
15 | "defaultValue": "debug"
16 | }
17 | ],
18 | "hints": [
19 | {
20 | "name": "level",
21 | "values": [
22 | {
23 | "value": "debug"
24 | },
25 | {
26 | "value": "info"
27 | },
28 | {
29 | "value": "warn"
30 | },
31 | {
32 | "value": "error"
33 | }
34 | ]
35 | }
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/apps/plum-task/META-INF/spring-configuration-metadata-whitelist.properties:
--------------------------------------------------------------------------------
1 | configuration-properties.classes=foo.bar.PlumProperties
2 | configuration-properties.names = server.port
3 |
4 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/apps/plum-task/META-INF/spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "groups": [
3 | {
4 | "name": "plum",
5 | "type": "foo.bar.PlumProperties",
6 | "sourceType": "foo.bar.PlumProperties"
7 | },
8 | {
9 | "name": "server",
10 | "type": "foo.bar.ServerProperties",
11 | "sourceType": "foo.bar.ServerProperties"
12 | }
13 | ],
14 | "properties": [
15 | {
16 | "name": "plum.use-ssl",
17 | "type": "java.lang.Boolean",
18 | "description": "Whether to use SSL encryption or not",
19 | "sourceType": "foo.bar.PlumProperties"
20 | },
21 | {
22 | "name": "server.port",
23 | "type": "java.lang.Integer",
24 | "description": "The port to listen on",
25 | "sourceType": "foo.bar.ServerProperties"
26 | }
27 | ],
28 |
29 | "hints": []
30 | }
31 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/boot_versions/README.txt:
--------------------------------------------------------------------------------
1 | The contents of these 2 boot uberjars has been created using the src/test/support maven project(s).
2 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/boot_versions/boot13-1.0.0.BUILD-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-cloud-dashboard/3442c3bec5390c647e156176c5635d7dc9045235/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/boot_versions/boot13-1.0.0.BUILD-SNAPSHOT.jar
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/boot_versions/boot14-1.0.0.BUILD-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-cloud-dashboard/3442c3bec5390c647e156176c5635d7dc9045235/spring-cloud-deployer-admin-completion/src/test/resources/org/springframework/cloud/dataflow/completion/boot_versions/boot14-1.0.0.BUILD-SNAPSHOT.jar
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/support/boot13/src/main/java/com/acme/boot13/AnotherEnumClass13.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.acme.boot13;
18 |
19 | /**
20 | * An enum used in configuration properties class.
21 | */
22 | public enum AnotherEnumClass13 {
23 | low, high;
24 | }
25 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/support/boot13/src/main/java/com/acme/boot13/Main.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.acme.boot13;
18 |
19 | public class Main {
20 |
21 | public static void main(String[] args) {
22 | System.out.println("Hello World");
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/support/boot13/src/main/java/com/acme/boot13/MyConfigProperties13.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.acme.boot13;
18 |
19 | import org.springframework.boot.context.properties.ConfigurationProperties;
20 |
21 | /**
22 | * @author Eric Bottard
23 | */
24 | @ConfigurationProperties("boot13")
25 | public class MyConfigProperties13 {
26 |
27 | private AnotherEnumClass13 level;
28 |
29 | public AnotherEnumClass13 getLevel() {
30 | return level;
31 | }
32 |
33 | public void setLevel(AnotherEnumClass13 level) {
34 | this.level = level;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/support/boot13/src/main/resources/META-INF/spring-configuration-metadata-whitelist.properties:
--------------------------------------------------------------------------------
1 | configuration-properties.classes=\
2 | com.acme.boot13.MyConfigProperties13, \
3 | com.acme.common.ConfigProperties
4 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/support/boot14/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 | com.acme
6 | boot14
7 | 1.0.0.BUILD-SNAPSHOT
8 |
9 | org.springframework.boot
10 | spring-boot-starter-parent
11 | 1.4.0.RELEASE
12 |
13 |
14 |
15 | UTF-8
16 |
17 |
18 |
19 |
20 | org.springframework.boot
21 | spring-boot-starter
22 | 1.4.0.RELEASE
23 |
24 |
25 | org.springframework.boot
26 | spring-boot-configuration-processor
27 | 1.4.0.RELEASE
28 | true
29 |
30 |
31 | com.acme
32 | common
33 | 1.0.0.BUILD-SNAPSHOT
34 |
35 |
36 |
37 |
38 |
39 | org.springframework.boot
40 | spring-boot-maven-plugin
41 | 1.4.0.RELEASE
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/support/boot14/src/main/java/com/acme/boot14/AnotherEnumClass14.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.acme.boot14;
18 |
19 | /**
20 | * An enum class used in configuration properties
21 | */
22 | public enum AnotherEnumClass14 {
23 | very_high, very_low;
24 | }
25 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/support/boot14/src/main/java/com/acme/boot14/Main.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.acme.boot14;
18 |
19 | public class Main {
20 |
21 | public static void main(String[] args) {
22 | System.out.println("Hello World");
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/support/boot14/src/main/java/com/acme/boot14/MyConfigProperties14.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.acme.boot14;
18 |
19 | import org.springframework.boot.context.properties.ConfigurationProperties;
20 |
21 | /**
22 | * @author Eric Bottard
23 | */
24 | @ConfigurationProperties("boot14")
25 | public class MyConfigProperties14 {
26 |
27 | private AnotherEnumClass14 level;
28 |
29 | public AnotherEnumClass14 getLevel() {
30 | return level;
31 | }
32 |
33 | public void setLevel(AnotherEnumClass14 level) {
34 | this.level = level;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/support/boot14/src/main/resources/META-INF/spring-configuration-metadata-whitelist.properties:
--------------------------------------------------------------------------------
1 | configuration-properties.classes=\
2 | com.acme.boot14.MyConfigProperties14, \
3 | com.acme.common.ConfigProperties
4 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/support/common/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 | com.acme
6 | common
7 | 1.0.0.BUILD-SNAPSHOT
8 |
9 | org.springframework.boot
10 | spring-boot-starter-parent
11 | 1.3.0.RELEASE
12 |
13 |
14 |
15 | UTF-8
16 |
17 |
18 |
19 |
20 | org.springframework.boot
21 | spring-boot-starter
22 | 1.3.0.RELEASE
23 |
24 |
25 | org.springframework.boot
26 | spring-boot-configuration-processor
27 | 1.3.0.RELEASE
28 | true
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/support/common/src/main/java/com/acme/common/ConfigProperties.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.acme.common;
18 |
19 | import org.springframework.boot.context.properties.ConfigurationProperties;
20 |
21 | /**
22 | * @author Eric Bottard
23 | */
24 | @ConfigurationProperties("common")
25 | public class ConfigProperties {
26 | /**
27 | * Some number.
28 | */
29 | private SomeEnum number = SomeEnum.two;
30 |
31 | /**
32 | * Some string.
33 | */
34 | private String someString = "hello";
35 |
36 | public String getSomeString() {
37 | return someString;
38 | }
39 |
40 | public void setSomeString(String someString) {
41 | this.someString = someString;
42 | }
43 |
44 |
45 |
46 | public SomeEnum getNumber() {
47 | return number;
48 | }
49 |
50 | public void setNumber(SomeEnum number) {
51 | this.number = number;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/support/common/src/main/java/com/acme/common/SomeEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.acme.common;
18 |
19 | /**
20 | * An enum class used in {@link ConfigProperties}. Useful to test, because this class has to be accessible
21 | * to the ClassLoader used to retrieve metadata.
22 | *
23 | * @author Eric Bottard
24 | */
25 | public enum SomeEnum {
26 | one, two, three;
27 | }
28 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-completion/src/test/support/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 | com.acme
6 | parent
7 | 1.0.0.BUILD-SNAPSHOT
8 | pom
9 |
10 | UTF-8
11 |
12 |
13 |
14 | common
15 | boot13
16 | boot14
17 |
18 |
19 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-configuration-metadata/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 |
5 | org.springframework.cloud
6 | spring-cloud-deployer-admin-parent
7 | 1.0.0.BUILD-SNAPSHOT
8 |
9 | spring-cloud-deployer-admin-configuration-metadata
10 |
11 | UTF-8
12 |
13 |
14 |
15 |
16 | org.springframework.boot
17 | spring-boot-starter
18 |
19 |
20 | org.springframework.boot
21 | spring-boot-loader
22 |
23 |
24 | org.springframework.boot
25 | spring-boot-configuration-metadata
26 |
27 |
28 | org.springframework.boot
29 | spring-boot-starter-test
30 | test
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-configuration-metadata/src/main/java/org/springframework/cloud/deployer/admin/configuration/metadata/ApplicationConfigurationMetadataResolverAutoConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.configuration.metadata;
18 |
19 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
20 | import org.springframework.context.annotation.Configuration;
21 | import org.springframework.context.annotation.Bean;
22 |
23 | /**
24 | * Automatically exposes an {@link ApplicationConfigurationMetadataResolver} if none is already registered.
25 | *
26 | * @author Eric Bottard
27 | */
28 | @Configuration
29 | public class ApplicationConfigurationMetadataResolverAutoConfiguration {
30 |
31 | @Bean
32 | @ConditionalOnMissingBean(ApplicationConfigurationMetadataResolver.class)
33 | public ApplicationConfigurationMetadataResolver metadataResolver() {
34 | return new DelegatingApplicationConfigurationMetadataResolver(new BootApplicationConfigurationMetadataResolver());
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-configuration-metadata/src/main/java/org/springframework/cloud/deployer/admin/configuration/metadata/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Root package of Spring Cloud Data Flow Configuration Metadata.
3 | */
4 | package org.springframework.cloud.deployer.admin.configuration.metadata;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-configuration-metadata/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration:\
2 | org.springframework.cloud.deployer.admin.configuration.metadata.ApplicationConfigurationMetadataResolverAutoConfiguration
3 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-configuration-metadata/src/test/resources/org/springframework/cloud/deployer/admin/configuration/metadata/apps/filter-processor/META-INF/spring-configuration-metadata-whitelist.properties:
--------------------------------------------------------------------------------
1 | configuration-properties.classes=foo.bar.FilterProperties
2 | configuration-properties.names=some.other.property.whitelisted.prefix.expresso2
3 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-configuration-metadata/src/test/resources/org/springframework/cloud/deployer/admin/configuration/metadata/apps/filter-processor/META-INF/spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "groups": [
3 | {
4 | "name": "filter",
5 | "type": "foo.bar.FilterProperties",
6 | "sourceType": "foo.bar.FilterProperties"
7 | }
8 | ],
9 | "properties": [
10 | {
11 | "name": "filter.expression",
12 | "type": "org.springframework.expression.Expression",
13 | "description": "A predicate to evaluate",
14 | "sourceType": "foo.bar.FilterProperties",
15 | "defaultValue": "true"
16 | },
17 | {
18 | "name": "some.other.property.whitelisted.prefix.expresso2",
19 | "type": "org.springframework.cloud.dataflow.completion.Expresso",
20 | "description": "A property of type enum and whose name starts like 'expression'",
21 | "sourceType": "com.acme.SomeDifferentProperties"
22 | },
23 | {
24 | "name": "some.prefix.hidden.by.default.secret",
25 | "type": "java.lang.String",
26 | "description": "Some hidden option",
27 | "sourceType": "com.acme.OtherProperties"
28 | }
29 | ],
30 | "hints": []
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-configuration-metadata/src/test/resources/org/springframework/cloud/deployer/admin/configuration/metadata/apps/no-whitelist/META-INF/spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "groups": [
3 | {
4 | "name": "filter",
5 | "type": "foo.bar.FilterProperties",
6 | "sourceType": "foo.bar.FilterProperties"
7 | }
8 | ],
9 | "properties": [
10 | {
11 | "name": "filter.expression",
12 | "type": "org.springframework.expression.Expression",
13 | "description": "A predicate to evaluate",
14 | "sourceType": "foo.bar.FilterProperties",
15 | "defaultValue": "true"
16 | },
17 | {
18 | "name": "some.other.property.whitelisted.prefix.expresso2",
19 | "type": "org.springframework.cloud.dataflow.completion.Expresso",
20 | "description": "A property of type enum and whose name starts like 'expression'",
21 | "sourceType": "com.acme.SomeDifferentProperties"
22 | },
23 | {
24 | "name": "some.prefix.hidden.by.default.secret",
25 | "type": "java.lang.String",
26 | "description": "Some hidden option",
27 | "sourceType": "com.acme.OtherProperties"
28 | }
29 | ],
30 | "hints": []
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-core/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 | spring-cloud-deployer-admin-core
5 | jar
6 |
7 | org.springframework.cloud
8 | spring-cloud-deployer-admin-parent
9 | 1.0.0.BUILD-SNAPSHOT
10 |
11 |
12 |
13 | org.springframework
14 | spring-core
15 |
16 |
17 | org.springframework.cloud
18 | spring-cloud-deployer-spi
19 |
20 |
21 | com.fasterxml.jackson.core
22 | jackson-annotations
23 |
24 |
25 | org.springframework.boot
26 | spring-boot-starter-logging
27 |
28 |
29 | org.springframework.boot
30 | spring-boot-starter-test
31 | test
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-core/src/main/java/org/springframework/cloud/deployer/admin/core/dsl/ArgumentNode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.core.dsl;
18 |
19 | /**
20 | * Represents an argument like "--name=value".
21 | *
22 | * @author Andy Clement
23 | */
24 | public class ArgumentNode extends AstNode {
25 |
26 | private final String name;
27 |
28 | private final String value;
29 |
30 | public ArgumentNode(String name, String value, int startPos, int endPos) {
31 | super(startPos, endPos);
32 | this.name = name;
33 | this.value = value;
34 | }
35 |
36 | public String getName() {
37 | return name;
38 | }
39 |
40 | public String getValue() {
41 | return value;
42 | }
43 |
44 | @Override
45 | public String stringify(boolean includePositionalInfo) {
46 | return toString();
47 | }
48 |
49 | @Override
50 | public String toString() {
51 | return "--" + name + "=" + value;
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-core/src/main/java/org/springframework/cloud/deployer/admin/core/dsl/AstNode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.core.dsl;
18 |
19 | /**
20 | * Common supertype for the ast nodes built during stream parsing.
21 | *
22 | * @author Andy Clement
23 | */
24 | public abstract class AstNode {
25 |
26 | protected int startPos;
27 |
28 | protected int endPos;
29 |
30 | public AstNode(int startPos, int endPos) {
31 | this.startPos = startPos;
32 | this.endPos = endPos;
33 | }
34 |
35 | public int getStartPos() {
36 | return startPos;
37 | }
38 |
39 | public int getEndPos() {
40 | return endPos;
41 | }
42 |
43 | /**
44 | * @return a string representation of the AST. Useful for debugging/testing.
45 | */
46 | public abstract String stringify(boolean includePositionInfo);
47 |
48 | public String stringify() {
49 | return stringify(false);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-core/src/main/java/org/springframework/cloud/deployer/admin/core/dsl/LabelNode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.core.dsl;
18 |
19 | /**
20 | * Represents a label attached to a module.
21 | *
22 | * @author Andy Clement
23 | */
24 | public class LabelNode extends AstNode {
25 |
26 | private final String label;
27 |
28 | public LabelNode(String label, int startpos, int endpos) {
29 | super(startpos, endpos);
30 | this.label = label;
31 | }
32 |
33 | @Override
34 | public String stringify(boolean includePositionalInfo) {
35 | StringBuilder s = new StringBuilder();
36 | s.append("(").append("Label:").append(label);
37 | if (includePositionalInfo) {
38 | s.append(":");
39 | s.append(getStartPos()).append(">").append(getEndPos());
40 | }
41 | s.append(")");
42 | return s.toString();
43 | }
44 |
45 | public String toString() {
46 | return label + ":";
47 | }
48 |
49 | public String getLabelName() {
50 | return label;
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-core/src/main/java/org/springframework/cloud/deployer/admin/core/dsl/SinkDestinationNode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.core.dsl;
18 |
19 | /**
20 | * @author Andy Clement
21 | */
22 | public class SinkDestinationNode extends AstNode {
23 |
24 | private final DestinationNode destinationNode;
25 |
26 | public SinkDestinationNode(DestinationNode destinationNode, int startPos) {
27 | super(startPos, destinationNode.endPos);
28 | this.destinationNode = destinationNode;
29 | }
30 |
31 | /** @inheritDoc */
32 | @Override
33 | public String stringify(boolean includePositionalInfo) {
34 | return ">" + destinationNode.stringify(includePositionalInfo);
35 | }
36 |
37 | @Override
38 | public String toString() {
39 | return " > " + destinationNode.toString();
40 | }
41 |
42 | public DestinationNode getDestinationNode() {
43 | return destinationNode;
44 | }
45 |
46 | public String getDestinationName() {
47 | return destinationNode.getDestinationName();
48 | }
49 |
50 | public SinkDestinationNode copyOf() {
51 | return new SinkDestinationNode(destinationNode.copyOf(), super.startPos);
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-core/src/main/java/org/springframework/cloud/deployer/admin/core/dsl/SourceDestinationNode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.core.dsl;
18 |
19 | /**
20 | * @author Andy Clement
21 | */
22 | public class SourceDestinationNode extends AstNode {
23 |
24 | private final DestinationNode destinationNode;
25 |
26 | public SourceDestinationNode(DestinationNode destinationNode, int endPos) {
27 | super(destinationNode.startPos, endPos);
28 | this.destinationNode = destinationNode;
29 | }
30 |
31 | /** @inheritDoc */
32 | @Override
33 | public String stringify(boolean includePositionalInfo) {
34 | return destinationNode.stringify(includePositionalInfo) + ">";
35 | }
36 |
37 | @Override
38 | public String toString() {
39 | return destinationNode.toString() + " > ";
40 | }
41 |
42 | public DestinationNode getDestinationNode() {
43 | return destinationNode;
44 | }
45 |
46 | public SourceDestinationNode copyOf() {
47 | return new SourceDestinationNode(destinationNode.copyOf(), super.endPos);
48 | }
49 |
50 | public String getDestinationName() {
51 | return destinationNode.getDestinationName();
52 | }
53 |
54 | public ArgumentNode[] getArguments() {
55 | return this.getDestinationNode().getArguments();
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-core/src/main/java/org/springframework/cloud/deployer/admin/core/dsl/TokenKind.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.core.dsl;
18 |
19 | /**
20 | * Enumeration of all the token types that may be found in a DSL definition stream.
21 | *
22 | * @author Andy Clement
23 | */
24 | public enum TokenKind {
25 | IDENTIFIER,
26 | DOUBLE_MINUS("--"),
27 | EQUALS("="),
28 | AND("&"),
29 | PIPE("|"),
30 | NEWLINE("\n"),
31 | COLON(":"),
32 | GT(">"),
33 | SEMICOLON(";"),
34 | REFERENCE("@"),
35 | DOT("."),
36 | LITERAL_STRING, ;
37 |
38 | char[] tokenChars;
39 |
40 | private boolean hasPayload; // is there more to this token than simply the kind
41 |
42 | TokenKind(String tokenString) {
43 | tokenChars = tokenString.toCharArray();
44 | hasPayload = tokenChars.length == 0;
45 | }
46 |
47 | private TokenKind() {
48 | this("");
49 | }
50 |
51 | @Override
52 | public String toString() {
53 | return this.name() + (tokenChars.length != 0 ? "(" + new String(tokenChars) + ")" : "");
54 | }
55 |
56 | public boolean hasPayload() {
57 | return hasPayload;
58 | }
59 |
60 | public int getLength() {
61 | return tokenChars.length;
62 | }
63 |
64 | /**
65 | * @return the chars representing simple fixed token (eg. : > --)
66 | */
67 | public char[] getTokenChars() {
68 | return tokenChars;
69 | }
70 | }
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-core/src/main/java/org/springframework/cloud/deployer/admin/core/dsl/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Base package for processing DeploymentUnit(Stream/Job) DSL.
19 | */
20 |
21 | package org.springframework.cloud.deployer.admin.core.dsl;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-core/src/main/java/org/springframework/cloud/deployer/admin/core/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Root package of the Spring Cloud Data Flow domain model.
3 | */
4 |
5 | package org.springframework.cloud.deployer.admin.core;
6 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-registry/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 | spring-cloud-deployer-admin-registry
5 | spring-cloud-deployer-admin-registry
6 | jar
7 |
8 | org.springframework.cloud
9 | spring-cloud-deployer-admin-parent
10 | 1.0.0.BUILD-SNAPSHOT
11 |
12 |
13 |
14 | org.springframework
15 | spring-core
16 |
17 |
18 | com.fasterxml.jackson.core
19 | jackson-annotations
20 |
21 |
22 | org.springframework.cloud
23 | spring-cloud-deployer-admin-core
24 |
25 |
26 | org.springframework.cloud
27 | spring-cloud-deployer-resource-support
28 |
29 |
30 | org.springframework.boot
31 | spring-boot-starter-data-redis
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-starter-jdbc
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-registry/src/main/java/org/springframework/cloud/deployer/admin/registry/EavRegistryRepository.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.registry;
18 |
19 | import java.util.Map;
20 |
21 | import org.springframework.stereotype.Repository;
22 |
23 | @Repository
24 | public interface EavRegistryRepository extends org.springframework.data.repository.Repository {
25 |
26 | void save(String namespace, String attribute, String value);
27 |
28 | String findOne(String namespace, String attribute);
29 |
30 | Map findAll(String namespace);
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-registry/src/main/java/org/springframework/cloud/deployer/admin/registry/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Root package of the Data Flow registry support.
3 | */
4 |
5 | package org.springframework.cloud.deployer.admin.registry;
6 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-registry/src/main/java/org/springframework/cloud/deployer/admin/registry/support/NoSuchAppRegistrationException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.cloud.deployer.admin.registry.support;
17 |
18 | import org.springframework.cloud.deployer.admin.registry.AppRegistration;
19 |
20 | /**
21 | * Thrown when an {@link AppRegistration} of a given name and {code type}
22 | * was expected but did not exist.
23 | *
24 | * @author Gunnar Hillert
25 | */
26 | public class NoSuchAppRegistrationException extends RuntimeException {
27 |
28 | private static final long serialVersionUID = 1L;
29 |
30 | public NoSuchAppRegistrationException(String name, String type) {
31 | super(String.format("The '%s:%s' application could not be found.", type, name));
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-registry/src/main/java/org/springframework/cloud/deployer/admin/registry/support/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains {@link org.springframework.cloud.deployer.admin.registry.AppRegistration}
3 | * support classes.
4 | */
5 | package org.springframework.cloud.deployer.admin.registry.support;
6 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-client/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 | spring-cloud-deployer-admin-rest-client
5 | jar
6 | http://projects.spring.io/spring-cloud/
7 |
8 | Pivotal Software, Inc.
9 | http://www.spring.io
10 |
11 |
12 | org.springframework.cloud
13 | spring-cloud-deployer-admin-parent
14 | 1.0.0.BUILD-SNAPSHOT
15 |
16 |
17 |
18 | org.springframework.cloud
19 | spring-cloud-deployer-admin-rest-resource
20 |
21 |
22 | org.springframework.plugin
23 | spring-plugin-core
24 |
25 |
26 | com.fasterxml.jackson.core
27 | jackson-databind
28 |
29 |
30 | joda-time
31 | joda-time
32 |
33 |
34 | org.apache.httpcomponents
35 | httpclient
36 |
37 |
38 | org.springframework.boot
39 | spring-boot-starter-test
40 | test
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-client/src/main/java/org/springframework/cloud/deployer/admin/rest/client/ApplicationOperations.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.rest.client;
18 |
19 | import java.util.Map;
20 |
21 | import org.springframework.cloud.deployer.admin.rest.resource.ApplicationDefinitionResource;
22 | import org.springframework.hateoas.PagedResources;
23 |
24 | public interface ApplicationOperations {
25 |
26 | /**
27 | * List applications known to the system.
28 | */
29 | public PagedResources list();
30 |
31 | /**
32 | * Create a new application, optionally deploying it.
33 | */
34 | public ApplicationDefinitionResource createApplication(String name, String definition, boolean deploy);
35 |
36 | /**
37 | * Deploy an already created application.
38 | */
39 | public void deploy(String name, Map properties);
40 |
41 | /**
42 | * Undeploy a deployed application, retaining its definition.
43 | */
44 | public void undeploy(String name);
45 |
46 | /**
47 | * Undeploy all currently deployed applications.
48 | */
49 | public void undeployAll();
50 |
51 | /**
52 | * Destroy an existing application.
53 | */
54 | public void destroy(String name);
55 |
56 | /**
57 | * Destroy all applications known to the system.
58 | */
59 | public void destroyAll();
60 | }
61 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-client/src/main/java/org/springframework/cloud/deployer/admin/rest/client/CompletionOperations.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.rest.client;
18 |
19 | import org.springframework.cloud.deployer.admin.rest.resource.CompletionProposalsResource;
20 |
21 | /**
22 | * Interface defining operations related to providing code completion in the DSL.
23 | *
24 | * @author Eric Bottard
25 | */
26 | public interface CompletionOperations {
27 |
28 | /**
29 | * Return the list of streamCompletions that are compatible with the given DSL prefix.
30 | *
31 | * @param prefix the provided prefix value from DSL
32 | * @param levelOfDetail integer value that specifies the level of detail user wants in stream completions
33 | */
34 | CompletionProposalsResource streamCompletions(String prefix, int levelOfDetail);
35 |
36 | /**
37 | * Return the list of taskCompletions that are compatible with the given DSL prefix.
38 | *
39 | * @param prefix the provided prefix value from DSL
40 | * @param levelOfDetail integer value that specifies the level of detail user wants in task completions
41 | */
42 | CompletionProposalsResource taskCompletions(String prefix, int levelOfDetail);
43 | }
44 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-client/src/main/java/org/springframework/cloud/deployer/admin/rest/client/DataFlowClientException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.rest.client;
18 |
19 | import org.springframework.hateoas.VndErrors;
20 |
21 | /**
22 | * A Java exception that wraps the serialized {@link VndErrors} object.
23 | *
24 | * @author Eric Bottard
25 | * @author Mark Fisher
26 | */
27 | @SuppressWarnings("serial")
28 | public class DataFlowClientException extends RuntimeException {
29 |
30 | private VndErrors vndErrors;
31 |
32 | public DataFlowClientException(VndErrors error) {
33 | this.vndErrors = error;
34 | }
35 |
36 | @Override
37 | public String getMessage() {
38 | StringBuilder builder = new StringBuilder();
39 | for (VndErrors.VndError e : vndErrors) {
40 | builder.append(e.getMessage()).append('\n');
41 | }
42 | return builder.toString();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-client/src/main/java/org/springframework/cloud/deployer/admin/rest/client/DataFlowOperations.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.rest.client;
18 |
19 | /**
20 | * Interface the REST clients implement to interact with spring-cloud-dataflow REST API.
21 | *
22 | * @author Ilayaperumal Gopinathan
23 | * @author Glenn Renfro
24 | * @author Mark Fisher
25 | * @author Janne Valkealahti
26 | */
27 | public interface DataFlowOperations {
28 |
29 | /**
30 | * Application registry related operations.
31 | */
32 | AppRegistryOperations appRegistryOperations();
33 |
34 | /**
35 | * DSL Completion related operations.
36 | */
37 | CompletionOperations completionOperations();
38 |
39 | /**
40 | * Runtime related opertations.
41 | */
42 | RuntimeOperations runtimeOperations();
43 |
44 | /**
45 | * Application related operations.
46 | */
47 | ApplicationOperations applicationOperations();
48 | }
49 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-client/src/main/java/org/springframework/cloud/deployer/admin/rest/client/DataFlowServerException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.rest.client;
18 |
19 | /**
20 | * A Java exception thrown when the server returns unexpected data.
21 | *
22 | * @author Gary Russell
23 | */
24 | @SuppressWarnings("serial")
25 | public class DataFlowServerException extends RuntimeException {
26 |
27 | public DataFlowServerException(String message) {
28 | super(message);
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-client/src/main/java/org/springframework/cloud/deployer/admin/rest/client/RuntimeOperations.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.rest.client;
18 |
19 | import org.springframework.cloud.deployer.admin.rest.resource.AppStatusResource;
20 | import org.springframework.hateoas.PagedResources;
21 |
22 | /**
23 | * Defines operations available for obtaining information about deployed apps.
24 | *
25 | * @author Eric Bottard
26 | * @author Mark Fisher
27 | */
28 | public interface RuntimeOperations {
29 |
30 | /**
31 | * Return runtime information about all deployed apps.
32 | */
33 | PagedResources status();
34 |
35 | /**
36 | * Return runtime information about a single app deployment.
37 | */
38 | AppStatusResource status(String deploymentId);
39 | }
40 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-client/src/main/java/org/springframework/cloud/deployer/admin/rest/client/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Defines the operations of the Spring Cloud Data Flow REST Client.
3 | */
4 | package org.springframework.cloud.deployer.admin.rest.client;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-resource/.jdk8:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-cloud-dashboard/3442c3bec5390c647e156176c5635d7dc9045235/spring-cloud-deployer-admin-rest-resource/.jdk8
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-resource/src/main/java/org/springframework/cloud/deployer/admin/rest/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Root package of Spring Cloud Data Flow Rest.
3 | */
4 | package org.springframework.cloud.deployer.admin.rest;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-resource/src/main/java/org/springframework/cloud/deployer/admin/rest/resource/AppInstanceStatusResource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.rest.resource;
18 |
19 | import java.util.Map;
20 |
21 | import org.springframework.hateoas.ResourceSupport;
22 |
23 | /**
24 | * REST representation for an AppInstanceStatus.
25 | *
26 | * @author Eric Bottard
27 | * @author Mark Fisher
28 | */
29 | public class AppInstanceStatusResource extends ResourceSupport {
30 |
31 | private String instanceId;
32 |
33 | private String state;
34 |
35 | private Map attributes;
36 |
37 | private AppInstanceStatusResource() {
38 | // noarg constructor for serialization
39 | }
40 |
41 | public AppInstanceStatusResource(String instanceId, String state, Map attributes) {
42 | this.instanceId = instanceId;
43 | this.state = state;
44 | this.attributes = attributes;
45 | }
46 |
47 | public String getInstanceId() {
48 | return instanceId;
49 | }
50 |
51 | public String getState() {
52 | return state;
53 | }
54 |
55 | public Map getAttributes() {
56 | return attributes;
57 | }
58 |
59 | public void setInstanceId(String instanceId) {
60 | this.instanceId = instanceId;
61 | }
62 |
63 | public void setState(String state) {
64 | this.state = state;
65 | }
66 |
67 | public void setAttributes(Map attributes) {
68 | this.attributes = attributes;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-resource/src/main/java/org/springframework/cloud/deployer/admin/rest/resource/ApplicationDefinitionResource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.rest.resource;
18 |
19 | import org.springframework.hateoas.PagedResources;
20 | import org.springframework.hateoas.ResourceSupport;
21 |
22 | /**
23 | * A HATEOAS representation of an application definition.
24 | *
25 | * @author Janne Valkealahti
26 | */
27 | public class ApplicationDefinitionResource extends ResourceSupport {
28 |
29 | private String name;
30 | private String dslText;
31 | private String status;
32 |
33 | ApplicationDefinitionResource() {
34 | }
35 |
36 | public ApplicationDefinitionResource(String name, String dslText) {
37 | this.name = name;
38 | this.dslText = dslText;
39 | }
40 |
41 | public String getName() {
42 | return name;
43 | }
44 |
45 | public String getDslText() {
46 | return dslText;
47 | }
48 |
49 | /**
50 | * Return the status of this task (i.e. running, complete, etc)
51 | *
52 | * @return task status
53 | */
54 | public String getStatus() {
55 | return status;
56 | }
57 |
58 | /**
59 | * Set the status of this task (i.e. running, complete, etc)
60 | *
61 | * @param status task status
62 | */
63 | public void setStatus(String status) {
64 | this.status = status;
65 | }
66 |
67 | public static class Page extends PagedResources {
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-resource/src/main/java/org/springframework/cloud/deployer/admin/rest/resource/ApplicationDeploymentResource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.rest.resource;
18 |
19 | import org.springframework.hateoas.PagedResources;
20 | import org.springframework.hateoas.ResourceSupport;
21 |
22 | /**
23 | * A HATEOAS representation of an application deployment.
24 | *
25 | * @author Eric Bottard
26 | */
27 | public class ApplicationDeploymentResource extends ResourceSupport {
28 |
29 | public static class Page extends PagedResources {
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-resource/src/main/java/org/springframework/cloud/deployer/admin/rest/resource/FeaturesInfoResource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.rest.resource;
18 |
19 | import org.springframework.hateoas.ResourceSupport;
20 |
21 | /**
22 | * Provides features information.
23 | *
24 | * @author Ilayaperumal Gopinathan
25 | */
26 | public class FeaturesInfoResource extends ResourceSupport {
27 | /**
28 | * Default constructor for serialization frameworks.
29 | */
30 | public FeaturesInfoResource() {
31 | }
32 |
33 | private boolean analyticsEnabled = true;
34 |
35 | private boolean streamsEnabled = true;
36 |
37 | public boolean isAnalyticsEnabled() {
38 | return this.analyticsEnabled;
39 | }
40 |
41 | public void setAnalyticsEnabled(boolean analyticsEnabled) {
42 | this.analyticsEnabled = analyticsEnabled;
43 | }
44 |
45 | public boolean isStreamsEnabled() {
46 | return this.streamsEnabled;
47 | }
48 |
49 | public void setStreamsEnabled(boolean streamsEnabled) {
50 | this.streamsEnabled = streamsEnabled;
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-resource/src/main/java/org/springframework/cloud/deployer/admin/rest/resource/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Spring Cloud Data Flow REST HATEOAS Resource support.
3 | */
4 |
5 | package org.springframework.cloud.deployer.admin.rest.resource;
6 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-resource/src/main/java/org/springframework/cloud/deployer/admin/rest/resource/security/SecurityInfoResource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.rest.resource.security;
18 |
19 | import org.springframework.hateoas.ResourceSupport;
20 |
21 | /**
22 | * Provides security related meta-information. E.g. is security enabled, username
23 | * etc.
24 | *
25 | * @author Gunnar Hillert
26 | */
27 | public class SecurityInfoResource extends ResourceSupport {
28 |
29 | private boolean authenticationEnabled;
30 |
31 | private boolean authenticated;
32 |
33 | private String username;
34 |
35 | /**
36 | * Default constructor for serialization frameworks.
37 | */
38 | public SecurityInfoResource() {
39 | }
40 |
41 | public boolean isAuthenticationEnabled() {
42 | return authenticationEnabled;
43 | }
44 |
45 | public void setAuthenticationEnabled(boolean authenticationEnabled) {
46 | this.authenticationEnabled = authenticationEnabled;
47 | }
48 |
49 | public boolean isAuthenticated() {
50 | return authenticated;
51 | }
52 |
53 | public void setAuthenticated(boolean authenticated) {
54 | this.authenticated = authenticated;
55 | }
56 |
57 | public String getUsername() {
58 | return username;
59 | }
60 |
61 | public void setUsername(String username) {
62 | this.username = username;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-resource/src/main/java/org/springframework/cloud/deployer/admin/rest/resource/security/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides security-related REST resources.
3 | */
4 | package org.springframework.cloud.deployer.admin.rest.resource.security;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-rest-resource/src/main/java/org/springframework/cloud/deployer/admin/rest/util/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains utilities for the Dataflow REST support.
3 | */
4 | package org.springframework.cloud.deployer.admin.rest.util;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/.jdk8:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-cloud-dashboard/3442c3bec5390c647e156176c5635d7dc9045235/spring-cloud-deployer-admin-server-core/.jdk8
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/README.adoc:
--------------------------------------------------------------------------------
1 | == Spring Cloud Data Flow Server Core
2 |
3 | The `spring-cloud-dataflow-server-core` subproject of `spring-cloud-dataflow` provides a common
4 | REST API and UI that can be used to create a Data Flow Server for a particular deployment
5 | environment when combined with an implementation of the `spring-cloud-deployer` SPI for that
6 | environment.
7 |
8 | The REST API includes a `StreamDefinitionController` and `TaskDefinitionController` that manage
9 | stream and task definitions by delegating to the `StreamDefinitionRepository` and
10 | `TaskDefinitionRepository`, respectively. The `StreamDeploymentController` and
11 | `TaskDeploymentController` delegate to the `AppDeployer` and `TaskLauncher` provided by the
12 | underlying `spring-cloud-deployer` SPI implementation. Other controllers provide endpoints for
13 | managing the `AppRegistry`, viewing counters, etc.
14 |
15 | For a simple getting-started experience, see the `spring-cloud-dataflow-server-local` (sibling)
16 | project. The build for that project produces a boot-executable `LocalDataFlowServer` that relies on
17 | an implementation of the Spring Cloud Deployer SPI that launches each stream app as a new JVM
18 | process on the same host as the `LocalDataFlowServer` itself. By default the local server is
19 | auto-populated with apps generated from the
20 | link:https://github.com/spring-cloud/spring-cloud-stream-app-starters[`spring-cloud-stream-app-starters`]
21 | project.
22 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM java:8
2 | VOLUME /tmp
3 | ADD *.jar data-admin.jar
4 | RUN bash -c 'touch /data-admin.jar'
5 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/data-admin.jar"]
6 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/EnableDataFlowServer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server;
18 |
19 | import java.lang.annotation.Documented;
20 | import java.lang.annotation.ElementType;
21 | import java.lang.annotation.Inherited;
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 | import java.lang.annotation.Target;
25 |
26 | import org.springframework.cloud.deployer.admin.server.config.EnableDataFlowServerConfiguration;
27 | import org.springframework.context.annotation.Import;
28 |
29 | /**
30 | * Activates a Spring Cloud Data Flow Server implementation.
31 | *
32 | * @author Josh Long
33 | */
34 | @Target({ElementType.TYPE})
35 | @Retention(RetentionPolicy.RUNTIME)
36 | @Documented
37 | @Inherited
38 | @Import(EnableDataFlowServerConfiguration.class)
39 | public @interface EnableDataFlowServer {
40 | }
41 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/completion/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains classes for the auto-completion support.
3 | */
4 | package org.springframework.cloud.deployer.admin.server.completion;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/DataFlowServerAutoConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.config;
18 |
19 | import org.springframework.boot.autoconfigure.AutoConfigureBefore;
20 | import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
21 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
22 | import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
23 | import org.springframework.context.annotation.Configuration;
24 | import org.springframework.context.annotation.Import;
25 |
26 | /**
27 | * Auto-configuration for dataflow server.
28 | *
29 | * @author Janne Valkealahti
30 | *
31 | */
32 | @Configuration
33 | @AutoConfigureBefore(value = JacksonAutoConfiguration.class)
34 | @ConditionalOnBean(EnableDataFlowServerConfiguration.Marker.class)
35 | @Import(DataFlowServerConfiguration.class)
36 | @ConditionalOnProperty(prefix = "dataflow.server", name = "enabled", havingValue = "true", matchIfMissing = true)
37 | public class DataFlowServerAutoConfiguration {
38 | }
39 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/EnableDataFlowServerConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.config;
18 |
19 | import org.springframework.cloud.deployer.admin.server.EnableDataFlowServer;
20 | import org.springframework.context.annotation.Bean;
21 | import org.springframework.context.annotation.Configuration;
22 |
23 | /**
24 | * Configuration for {@link EnableDataFlowServer} which adds
25 | * a marker bean which auto-config classes can use to conditionally
26 | * check if auto configuration should be activated.
27 | *
28 | * @author Janne Valkealahti
29 | */
30 | @Configuration
31 | public class EnableDataFlowServerConfiguration {
32 |
33 | @Bean
34 | public Marker enableConfigServerMarker() {
35 | return new Marker();
36 | }
37 |
38 | class Marker {}
39 | }
40 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/apps/CommonApplicationProperties.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.config.apps;
18 |
19 | import java.util.Map;
20 | import java.util.concurrent.ConcurrentHashMap;
21 |
22 | import org.springframework.boot.context.properties.ConfigurationProperties;
23 |
24 | /**
25 | * Common properties for applications deployed via Spring Cloud Data Flow.
26 | *
27 | * @author Marius Bogoevici
28 | */
29 | @ConfigurationProperties("spring.cloud.dataflow.applicationProperties")
30 | public class CommonApplicationProperties {
31 |
32 | private Map stream = new ConcurrentHashMap<>();
33 |
34 | public Map getStream() {
35 | return this.stream;
36 | }
37 |
38 | public void setStream(Map stream) {
39 | this.stream = stream;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/apps/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Package for the classes that have common application configuration properties.
3 | */
4 | package org.springframework.cloud.deployer.admin.server.config.apps;
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/features/ApplicationConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.config.features;
18 |
19 | import javax.sql.DataSource;
20 |
21 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
22 | import org.springframework.cloud.deployer.admin.server.repository.ApplicationDefinitionRepository;
23 | import org.springframework.cloud.deployer.admin.server.repository.RdbmsApplicationDefinitionRepository;
24 | import org.springframework.context.annotation.Bean;
25 | import org.springframework.context.annotation.Configuration;
26 |
27 | @Configuration
28 | public class ApplicationConfiguration {
29 |
30 | @Bean
31 | @ConditionalOnMissingBean
32 | public ApplicationDefinitionRepository applicationDefinitionRepository(DataSource dataSource) {
33 | return new RdbmsApplicationDefinitionRepository(dataSource);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/features/FeaturesConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.cloud.deployer.admin.server.config.features;
17 |
18 | import javax.sql.DataSource;
19 |
20 | import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
21 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
22 | import org.springframework.cloud.deployer.admin.server.repository.DeploymentIdRepository;
23 | import org.springframework.cloud.deployer.admin.server.repository.RdbmsDeploymentIdRepository;
24 | import org.springframework.context.annotation.Bean;
25 | import org.springframework.context.annotation.Configuration;
26 | import org.springframework.context.annotation.Import;
27 |
28 | /**
29 | * Configuration class that imports analytics, stream and task configuration classes. Also
30 | * holds any common beans on the above configuration classes.
31 | *
32 | * @author Ilayaperumal Gopinathan
33 | */
34 | @Configuration
35 | @Import({ ApplicationConfiguration.class })
36 | public class FeaturesConfiguration {
37 |
38 | @Bean
39 | @ConditionalOnMissingBean
40 | public DeploymentIdRepository deploymentIdRepository(DataSource dataSource) {
41 | return new RdbmsDeploymentIdRepository(dataSource);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/features/FeaturesProperties.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.cloud.deployer.admin.server.config.features;
17 |
18 | import org.springframework.boot.context.properties.ConfigurationProperties;
19 |
20 | /**
21 | * Configuration properties for all the features that need to be enabled/disabled at the dataflow server.
22 | *
23 | * @author Ilayaperumal Gopinathan
24 | */
25 | @ConfigurationProperties(prefix = FeaturesProperties.FEATURES_PREFIX)
26 | public class FeaturesProperties {
27 |
28 | public static final String FEATURES_PREFIX = "spring.cloud.dataflow.features";
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/features/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains specific features' configuration classes.
3 | */
4 | package org.springframework.cloud.deployer.admin.server.config.features;
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Spring Cloud Data Flow Server configuration classes.
3 | */
4 | package org.springframework.cloud.deployer.admin.server.config;
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/security/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains security related configuration classes.
3 | */
4 | package org.springframework.cloud.deployer.admin.server.config.security;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/security/support/LdapSecurityPropertiesValid.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.cloud.deployer.admin.server.config.security.support;
17 |
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | import javax.validation.Constraint;
24 | import javax.validation.Payload;
25 |
26 | /**
27 | * @author Gunnar Hillert
28 | * @since 1.1.0
29 | */
30 | @Target(ElementType.TYPE)
31 | @Retention(RetentionPolicy.RUNTIME)
32 | @Constraint(validatedBy = LdapSecurityPropertiesValidator.class)
33 | public @interface LdapSecurityPropertiesValid {
34 | String message() default "{org.springframework.cloud.dataflow.server.config.security.support.LdapSecurityPropertiesValid.message}";
35 | Class>[] groups() default {};
36 | Class extends Payload>[] payload() default {};
37 | }
38 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/security/support/OnOAuth2Disabled.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.cloud.deployer.admin.server.config.security.support;
17 |
18 | import org.springframework.boot.autoconfigure.condition.NoneNestedConditions;
19 | import org.springframework.context.annotation.Condition;
20 | import org.springframework.context.annotation.Conditional;
21 |
22 | /**
23 | * {@link Condition} that is only valid if {@code security.basic.enabled} is
24 | * {@code true} and the property {@code security.oauth2} exists.
25 | *
26 | * @author Gunnar Hillert
27 | * @since 1.1.0
28 | *
29 | */
30 | public class OnOAuth2Disabled extends NoneNestedConditions {
31 |
32 | public OnOAuth2Disabled() {
33 | super(ConfigurationPhase.REGISTER_BEAN);
34 | }
35 |
36 | @Conditional(OnSecurityEnabledAndOAuth2Enabled.class)
37 | static class OauthEnabled { }
38 | }
39 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/security/support/OnSecurityEnabledAndOAuth2Disabled.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.cloud.deployer.admin.server.config.security.support;
17 |
18 | import org.springframework.boot.autoconfigure.condition.AllNestedConditions;
19 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
20 | import org.springframework.context.annotation.Condition;
21 | import org.springframework.context.annotation.Conditional;
22 |
23 | /**
24 | * {@link Condition} that is only valid if {@code security.basic.enabled} is
25 | * {@code true} and the property {@code security.oauth2.client.client-id}
26 | * does NOT exists.
27 | *
28 | * @author Gunnar Hillert
29 | * @since 1.1.0
30 | *
31 | */
32 | public class OnSecurityEnabledAndOAuth2Disabled extends AllNestedConditions {
33 |
34 | public OnSecurityEnabledAndOAuth2Disabled() {
35 | super(ConfigurationPhase.REGISTER_BEAN);
36 | }
37 |
38 | @ConditionalOnProperty("security.basic.enabled")
39 | static class BasicSecurityEnabledEnabled { }
40 |
41 | @Conditional(OnOAuth2Disabled.class)
42 | static class OauthEnabled { }
43 | }
44 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/security/support/OnSecurityEnabledAndOAuth2Enabled.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.cloud.deployer.admin.server.config.security.support;
17 |
18 | import org.springframework.boot.autoconfigure.condition.AllNestedConditions;
19 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
20 | import org.springframework.context.annotation.Condition;
21 |
22 | /**
23 | * {@link Condition} that is only valid if {@code security.basic.enabled} is
24 | * {@code true} and the property {@code security.oauth2.client.client-id} exists.
25 | *
26 | * @author Gunnar Hillert
27 | * @since 1.1.0
28 | *
29 | */
30 | public class OnSecurityEnabledAndOAuth2Enabled extends AllNestedConditions {
31 |
32 | public OnSecurityEnabledAndOAuth2Enabled() {
33 | super(ConfigurationPhase.REGISTER_BEAN);
34 | }
35 |
36 | @ConditionalOnProperty(name = "security.basic.enabled", havingValue = "true")
37 | static class SecurityEnabled { }
38 |
39 | @ConditionalOnProperty(name = "security.oauth2.client.client-id")
40 | static class OAuth2Enabled { }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/config/web/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains web configuration classes.
3 | */
4 | package org.springframework.cloud.deployer.admin.server.config.web;
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/controller/AppAlreadyRegisteredException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.cloud.deployer.admin.server.controller;
17 |
18 | import org.springframework.cloud.deployer.admin.registry.AppRegistration;
19 |
20 | /**
21 | *
22 | * @author Glenn Renfro
23 | * @author Mark Fisher
24 | * @author Gunnar Hillert
25 | * @author Eric Bottard
26 | * @author Gary Russell
27 | * @author Patrick Peralta
28 | *
29 | */
30 | public class AppAlreadyRegisteredException extends IllegalStateException {
31 |
32 | private static final long serialVersionUID = 1L;
33 |
34 | private final AppRegistration previous;
35 |
36 | public AppAlreadyRegisteredException(AppRegistration previous) {
37 | this.previous = previous;
38 | }
39 |
40 | @Override
41 | public String getMessage() {
42 | return String.format("The '%s:%s' application is already registered as %s", previous.getType(), previous.getName(), previous.getUri());
43 | }
44 |
45 | public AppRegistration getPrevious() {
46 | return previous;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/controller/ApplicationAlreadyDeployedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.controller;
18 |
19 | /**
20 | * Thrown when a application is already deployed when the controller gets a request to deploy it.
21 | *
22 | * @author Janne Valkealahti
23 | */
24 | public class ApplicationAlreadyDeployedException extends RuntimeException {
25 |
26 | private static final long serialVersionUID = 1206240149790331171L;
27 |
28 | public ApplicationAlreadyDeployedException(String name) {
29 | super(String.format("Application '%s' is already deployed", name));
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/controller/ApplicationAlreadyDeployingException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.controller;
18 |
19 | /**
20 | * Thrown when a v is already being deployed when the controller gets a request to deploy it.
21 | *
22 | * @author Janne Valkealahti
23 | */
24 | public class ApplicationAlreadyDeployingException extends RuntimeException {
25 |
26 | private static final long serialVersionUID = -5252621049404817590L;
27 |
28 | public ApplicationAlreadyDeployingException(String name) {
29 | super(String.format("Application '%s' is already being deployed", name));
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/controller/FeaturesController.java:
--------------------------------------------------------------------------------
1 | package org.springframework.cloud.deployer.admin.server.controller;
2 |
3 | import org.springframework.cloud.deployer.admin.rest.resource.FeaturesInfoResource;
4 | import org.springframework.cloud.deployer.admin.server.config.features.FeaturesProperties;
5 | import org.springframework.hateoas.ExposesResourceFor;
6 | import org.springframework.http.HttpStatus;
7 | import org.springframework.web.bind.annotation.RequestMapping;
8 | import org.springframework.web.bind.annotation.RequestMethod;
9 | import org.springframework.web.bind.annotation.ResponseBody;
10 | import org.springframework.web.bind.annotation.ResponseStatus;
11 | import org.springframework.web.bind.annotation.RestController;
12 |
13 | /**
14 | * REST controller that provides features that are enabled/disabled on the dataflow server.
15 | *
16 | * @author Ilayaperumal Gopinathan
17 | */
18 | @RestController
19 | @RequestMapping("/features")
20 | @ExposesResourceFor(FeaturesInfoResource.class)
21 | public class FeaturesController {
22 |
23 | private final FeaturesProperties featuresProperties;
24 |
25 | public FeaturesController(FeaturesProperties featuresProperties) {
26 | this.featuresProperties = featuresProperties;
27 | }
28 |
29 | /**
30 | * Return features that are enabled/disabled on the dataflow server.
31 | */
32 | @ResponseBody
33 | @RequestMapping(method = RequestMethod.GET)
34 | @ResponseStatus(HttpStatus.OK)
35 | public FeaturesInfoResource getSecurityInfo() {
36 | FeaturesInfoResource featuresInfoResource = new FeaturesInfoResource();
37 | return featuresInfoResource;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/controller/UiController.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015-2016 the original author or authors.
3 | * Licensed under the Apache License, Version 2.0 (the "License");
4 | * you may not use this file except in compliance with the License.
5 | * You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software
10 | * distributed under the License is distributed on an "AS IS" BASIS,
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | * See the License for the specific language governing permissions and
13 | * limitations under the License.
14 | */
15 |
16 | package org.springframework.cloud.deployer.admin.server.controller;
17 |
18 | import org.springframework.stereotype.Controller;
19 | import org.springframework.web.bind.annotation.RequestMapping;
20 |
21 | /**
22 | * A simple (web, not REST) controller to trigger a redirect to the index page of the
23 | * admin ui (which comes packaged as a dependency).
24 | *
25 | * @author Eric Bottard
26 | * @author Gunnar Hillert
27 | */
28 | @Controller
29 | public class UiController {
30 |
31 | private static final String WEB_UI_INDEX_PAGE_ROUTE = "/dashboard";
32 |
33 | @RequestMapping(WEB_UI_INDEX_PAGE_ROUTE)
34 | public String index() {
35 | return "redirect:" + WEB_UI_INDEX_PAGE_ROUTE + "/index.html";
36 | }
37 |
38 | /**
39 | * Turn a relative link of the UI app to an absolute one, prepending its path.
40 | */
41 | public static String dashboard(String path) {
42 | return WEB_UI_INDEX_PAGE_ROUTE + path;
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/controller/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Spring Cloud Data Flow Server Controllers.
3 | */
4 | package org.springframework.cloud.deployer.admin.server.controller;
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/controller/security/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides security-related Controllers.
3 | */
4 | package org.springframework.cloud.deployer.admin.server.controller.security;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/controller/security/support/AuthenticationRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.cloud.deployer.admin.server.controller.security.support;
17 |
18 | /**
19 | *
20 | * @author Gunnar Hillert
21 | *
22 | */
23 | public class AuthenticationRequest {
24 |
25 | private String username;
26 |
27 | private String password;
28 |
29 | public AuthenticationRequest() {
30 | }
31 |
32 | public AuthenticationRequest(String username, String password) {
33 | this.username = username;
34 | this.password = password;
35 | }
36 |
37 | /**
38 | * @return the username
39 | */
40 | public String getUsername() {
41 | return username;
42 | }
43 |
44 | /**
45 | * @param username the username to set
46 | */
47 | public void setUsername(String username) {
48 | this.username = username;
49 | }
50 |
51 | /**
52 | * @return the password
53 | */
54 | public String getPassword() {
55 | return password;
56 | }
57 |
58 | /**
59 | * @param password the password to set
60 | */
61 | public void setPassword(String password) {
62 | this.password = password;
63 | }
64 |
65 | @Override
66 | public String toString() {
67 | return "AuthenticationRequest [username=" + username + ", password=" + password + "]";
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/controller/support/InvalidStreamDefinitionException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.cloud.deployer.admin.server.controller.support;
17 |
18 | /**
19 | * Thrown by controller classes to indicate issues with the provided stream
20 | * definition.
21 | *
22 | * @author Gunnar Hillert
23 | *
24 | */
25 | public class InvalidStreamDefinitionException extends RuntimeException {
26 |
27 | private static final long serialVersionUID = 1L;
28 |
29 | public InvalidStreamDefinitionException(String message) {
30 | super(message);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/controller/support/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains supporting classes and utilities for the web controllers.
3 | */
4 | package org.springframework.cloud.deployer.admin.server.controller.support;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Root package of Spring Cloud Data Flow Core.
3 | */
4 | package org.springframework.cloud.deployer.admin.server;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/repository/ApplicationDefinitionRepository.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.repository;
18 |
19 | import org.springframework.cloud.deployer.admin.core.ApplicationDefinition;
20 | import org.springframework.cloud.deployer.admin.server.repository.support.SearchPageable;
21 | import org.springframework.data.domain.Page;
22 | import org.springframework.data.repository.PagingAndSortingRepository;
23 |
24 | public interface ApplicationDefinitionRepository extends PagingAndSortingRepository{
25 |
26 | Pagesearch(SearchPageable searchPageable);
27 | }
28 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/repository/DeploymentIdRepository.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.repository;
18 |
19 | import org.springframework.stereotype.Repository;
20 |
21 | /**
22 | * Interface for repository that maps deployment keys to IDs.
23 | *
24 | * @author Janne Valkealahti
25 | * @author Mark Fisher
26 | * @author Ilayaperumal Gopinathan
27 | */
28 | @Repository
29 | public interface DeploymentIdRepository extends org.springframework.data.repository.Repository {
30 |
31 | /**
32 | * Associates a given app deployment key with an identifier.
33 | *
34 | * @param key the app deployment key
35 | * @param id the identifier
36 | */
37 | void save(String key, String id);
38 |
39 | /**
40 | * Find an identifier by its key.
41 | *
42 | * @param key the app deployment key
43 | * @return the identifier
44 | */
45 | String findOne(String key);
46 |
47 | /**
48 | * Delete the entries associated with the app deployment key.
49 | *
50 | * @param key the app deployment key
51 | */
52 | void delete(String key);
53 | }
54 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/repository/DuplicateTaskException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.repository;
18 |
19 | /**
20 | * Thrown to indicate that the creation of a task failed
21 | * because a task with the given name already exists.
22 | *
23 | * @author Michael Minella
24 | */
25 | public class DuplicateTaskException extends RuntimeException {
26 |
27 | private static final long serialVersionUID = 4902348644982085508L;
28 |
29 | public DuplicateTaskException() {
30 | super();
31 | }
32 |
33 | public DuplicateTaskException(String message) {
34 | super(message);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/repository/NoSuchApplicationDefinitionException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.repository;
18 |
19 | /**
20 | * Thrown when an application definition of a given name was expected but did not exist.
21 | *
22 | * @author Janne Valkealahti
23 | */
24 | public class NoSuchApplicationDefinitionException extends RuntimeException {
25 |
26 | private static final long serialVersionUID = -2076558156231774477L;
27 | private final String name;
28 |
29 | public NoSuchApplicationDefinitionException(String name) {
30 | this(name, "Could not find application definition named " + name);
31 | }
32 |
33 | public NoSuchApplicationDefinitionException(String name, String message) {
34 | super(message);
35 | this.name = name;
36 | }
37 |
38 | /**
39 | * Return the name of the stream definition that could not be found.
40 | */
41 | public String getName() {
42 | return name;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/repository/NoSuchTaskDefinitionException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.repository;
18 |
19 | /**
20 | * Thrown when a task definition of a given name was expected but did not exist.
21 | *
22 | * @author Eric Bottard
23 | */
24 | public class NoSuchTaskDefinitionException extends RuntimeException {
25 |
26 | public NoSuchTaskDefinitionException(String name) {
27 | super(String.format("Could not find task definition named %s", name));
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/repository/NoSuchTaskExecutionException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.repository;
18 |
19 | import org.springframework.cloud.task.repository.TaskExecution;
20 |
21 | /**
22 | * @author Glenn Renfro
23 | */
24 | public class NoSuchTaskExecutionException extends RuntimeException{
25 |
26 | /**
27 | * Create a new exception.
28 | *
29 | * @param id the id of the {@link TaskExecution} that could not be found
30 | */
31 | public NoSuchTaskExecutionException(long id) {
32 | super("Could not find TaskExecution with id " + id);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/repository/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Spring Cloud Data Flow Server Repositories.
3 | */
4 | package org.springframework.cloud.deployer.admin.server.repository;
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/repository/support/H2PagingQueryProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.repository.support;
18 |
19 | import org.springframework.data.domain.Pageable;
20 |
21 | /**
22 | * H2 implementation of a {@link PagingQueryProvider} using database specific features.
23 | *
24 | * @author Glenn Renfro
25 | */
26 | public class H2PagingQueryProvider extends AbstractSqlPagingQueryProvider {
27 |
28 | @Override
29 | public String getPageQuery(Pageable pageable) {
30 | String topClause = new StringBuilder().append("LIMIT ")
31 | .append(pageable.getOffset()).append(" ")
32 | .append(pageable.getPageSize()).toString();
33 | return SqlPagingQueryUtils.generateTopJumpToQuery(this, topClause);
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/repository/support/HsqlPagingQueryProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.repository.support;
18 |
19 | import org.springframework.data.domain.Pageable;
20 |
21 | /**
22 | * HSQLDB implementation of a {@link PagingQueryProvider} using database specific features.
23 | *
24 | * @author Glenn Renfro
25 | */
26 | public class HsqlPagingQueryProvider extends AbstractSqlPagingQueryProvider {
27 |
28 | @Override
29 | public String getPageQuery(Pageable pageable) {
30 | String topClause = new StringBuilder().append("LIMIT ")
31 | .append(pageable.getOffset()).append(" ")
32 | .append(pageable.getPageSize()).toString();
33 | return SqlPagingQueryUtils.generateTopJumpToQuery(this, topClause);
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/repository/support/MySqlPagingQueryProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.repository.support;
18 |
19 | import org.springframework.data.domain.Pageable;
20 |
21 | /**
22 | * MySQL implementation of a {@link PagingQueryProvider} using database specific features.
23 | *
24 | * @author Glenn Renfro
25 | */
26 | public class MySqlPagingQueryProvider extends AbstractSqlPagingQueryProvider {
27 | @Override
28 | public String getPageQuery(Pageable pageable) {
29 | String topClause = new StringBuilder().append("LIMIT ")
30 | .append(pageable.getOffset()).append(", ")
31 | .append(pageable.getPageSize()).toString();
32 | return SqlPagingQueryUtils.generateLimitJumpToQuery(this, topClause);
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/repository/support/OraclePagingQueryProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.repository.support;
18 |
19 | import org.springframework.data.domain.Pageable;
20 |
21 | /**
22 | * Oracle implementation of a {@link PagingQueryProvider} using database specific features.
23 | *
24 | * @author Glenn Renfro
25 | */
26 | public class OraclePagingQueryProvider extends AbstractSqlPagingQueryProvider {
27 |
28 | @Override
29 | public String getPageQuery(Pageable pageable) {
30 | int offset = pageable.getOffset()+1;
31 | return generateRowNumSqlQueryWithNesting(getSelectClause(), false, "TMP_ROW_NUM >= "
32 | + offset + " AND TMP_ROW_NUM < " + (offset+pageable.getPageSize()));
33 | }
34 |
35 | private String generateRowNumSqlQueryWithNesting(String selectClause,
36 | boolean remainingPageQuery,
37 | String rowNumClause) {
38 | StringBuilder sql = new StringBuilder();
39 | sql.append("SELECT ").append(selectClause).append(" FROM (SELECT ").append(selectClause)
40 | .append(", ").append("ROWNUM as TMP_ROW_NUM");
41 | sql.append(" FROM (SELECT ").append(selectClause).append(" FROM ").append(this.getFromClause());
42 | SqlPagingQueryUtils.buildWhereClause(this, remainingPageQuery, sql);
43 | sql.append(" ORDER BY ").append(SqlPagingQueryUtils.buildSortClause(this));
44 | sql.append(")) WHERE ").append(rowNumClause);
45 |
46 | return sql.toString();
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/repository/support/Order.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.repository.support;
18 |
19 | /**
20 | * The direction of the sort in an ORDER BY clause.
21 | *
22 | * @author Glenn Renfro
23 | */
24 | public enum Order {
25 | ASCENDING, DESCENDING
26 | }
27 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/repository/support/PostgresPagingQueryProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.repository.support;
18 |
19 | import org.springframework.data.domain.Pageable;
20 |
21 | /**
22 | * Postgres implementation of a {@link PagingQueryProvider} using database specific features.
23 | *
24 | * @author Glenn Renfro
25 | */
26 | public class PostgresPagingQueryProvider extends AbstractSqlPagingQueryProvider {
27 |
28 | @Override
29 | public String getPageQuery(Pageable pageable) {
30 | String limitClause = new StringBuilder().append("LIMIT ").
31 | append(pageable.getPageSize()).append(" OFFSET ").
32 | append(pageable.getOffset()).toString();
33 | return SqlPagingQueryUtils.generateLimitJumpToQuery(this, limitClause);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/repository/support/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides RDBMS-related support classes including
3 | * {@link org.springframework.cloud.deployer.admin.server.repository.support.PagingQueryProvider}
4 | * implementations for supported databases.
5 | */
6 | package org.springframework.cloud.deployer.admin.server.repository.support;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/service/impl/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains Service implementations for the Dataflow Server.
3 | */
4 | package org.springframework.cloud.deployer.admin.server.service.impl;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/service/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains various Services (Interfaces) that are part of the Dataflow Server.
3 | */
4 | package org.springframework.cloud.deployer.admin.server.service;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/support/CannotDetermineApplicationTypeException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.cloud.deployer.admin.server.support;
17 |
18 | /**
19 | * Exception is thrown by {@link DataFlowServerUtil} to indicate that
20 | * the {@link ApplicationType} for a provided {@link StreamAppDefinition} cannot be
21 | * determined.
22 | *
23 | * @author Gunnar Hillert
24 | *
25 | */
26 | public class CannotDetermineApplicationTypeException extends RuntimeException {
27 |
28 | private static final long serialVersionUID = 1L;
29 |
30 | public CannotDetermineApplicationTypeException(String message) {
31 | super(message);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/java/org/springframework/cloud/deployer/admin/server/support/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains support classes and utilities for the Data Flow server
3 | * package.
4 | */
5 | package org.springframework.cloud.deployer.admin.server.support;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/META-INF/dataflow-server-defaults.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | autoconfigure:
3 | exclude: org.springframework.boot.autoconfigure.session.SessionAutoConfiguration
4 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.boot.env.EnvironmentPostProcessor=\
2 | org.springframework.cloud.deployer.admin.server.config.DefaultEnvironmentPostProcessor
3 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
4 | org.springframework.cloud.deployer.admin.server.config.DataFlowServerAutoConfiguration,\
5 | org.springframework.cloud.deployer.admin.server.config.DataFlowControllerAutoConfiguration
6 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/banner.txt:
--------------------------------------------------------------------------------
1 | ____ ____ _ __
2 | / ___| _ __ _ __${AnsiColor.GREEN}(_)${AnsiColor.DEFAULT}_ __ __ _ / ___| | ___ _ _ __| |
3 | \___ \| '_ \| '__| | '_ \ / _` | | | | |/ _ \| | | |/ _` |
4 | ___) | |_) | | | | | | | (_| | | |___| | (_) | |_| | (_| |
5 | |____/| .__/|_| |_|_| |_|\__, | \____|_|\___/ \__,_|\__,_|
6 | ____ |_| _ __|___/ ${AnsiColor.BLUE} __________${AnsiColor.DEFAULT}
7 | | _ \ __ _| |_ __ _ | ___| | _____ __ ${AnsiColor.BLUE} \ \ \ \ \ \${AnsiColor.DEFAULT}
8 | | | | |/ _` | __/ _` | | |_ | |/ _ \ \ /\ / / ${AnsiColor.BLUE} \ \ \ \ \ \${AnsiColor.DEFAULT}
9 | | |_| | (_| | || (_| | | _| | | (_) \ V V / ${AnsiColor.BLUE} / / / / / /${AnsiColor.DEFAULT}
10 | |____/ \__,_|\__\__,_| |_| |_|\___/ \_/\_/ ${AnsiColor.BLUE} /_/_/_/_/_/${AnsiColor.DEFAULT}
11 |
12 | ${application.title} ${AnsiColor.GREEN}${application.formatted-version}${AnsiColor.DEFAULT}
13 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-db2-applications.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE APPLICATION_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION CLOB DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-db2-common.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE URI_REGISTRY (
2 | NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | URI VARCHAR(255) NOT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-db2-deployment.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE DEPLOYMENT_IDS (
2 | DEPLOYMENT_KEY VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEPLOYMENT_ID VARCHAR(255) NOT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-db2-streams.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE STREAM_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION CLOB DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-db2-tasks.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE TASK_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION CLOB DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-h2-applications.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE APPLICATION_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION CLOB DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-h2-common.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE URI_REGISTRY (
2 | NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | URI VARCHAR(255) NOT NULL
4 | );
5 | CREATE TABLE EAV_REGISTRY_ATTRIBUTES (
6 | ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
7 | NAME VARCHAR(255) NOT NULL
8 | );
9 | CREATE TABLE EAV_REGISTRY_ATTRIBUTE_VALUES (
10 | ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
11 | ATTRIBUTE_ID INT,
12 | NAMESPACE VARCHAR(255) NOT NULL,
13 | VALUE VARCHAR(255) NOT NULL
14 | );
15 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-h2-deployment.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE DEPLOYMENT_IDS (
2 | DEPLOYMENT_KEY VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEPLOYMENT_ID VARCHAR(255) NOT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-h2-streams.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE STREAM_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION CLOB DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-h2-tasks.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE TASK_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION CLOB DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-hsqldb-applications.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE APPLICATION_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION CLOB DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-hsqldb-common.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE URI_REGISTRY (
2 | NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | URI VARCHAR(255) NOT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-hsqldb-deployment.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE DEPLOYMENT_IDS (
2 | DEPLOYMENT_KEY VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEPLOYMENT_ID VARCHAR(255) NOT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-hsqldb-streams.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE STREAM_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION CLOB DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-hsqldb-tasks.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE TASK_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION CLOB DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-mysql-applications.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE APPLICATION_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION TEXT DEFAULT NULL
4 | ) ENGINE=InnoDB;
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-mysql-common.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE URI_REGISTRY (
2 | NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | URI VARCHAR(255) NOT NULL
4 | )ENGINE=InnoDB;
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-mysql-deployment.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE DEPLOYMENT_IDS (
2 | DEPLOYMENT_KEY VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEPLOYMENT_ID VARCHAR(255) NOT NULL
4 | )ENGINE=InnoDB;
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-mysql-streams.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE STREAM_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION TEXT DEFAULT NULL
4 | ) ENGINE=InnoDB;
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-mysql-tasks.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE TASK_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION TEXT DEFAULT NULL
4 | ) ENGINE=InnoDB;
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-oracle10g-applications.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE APPLICATION_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION CLOB DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-oracle10g-common.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE URI_REGISTRY (
2 | NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | URI VARCHAR(255) NOT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-oracle10g-deployment.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE DEPLOYMENT_IDS (
2 | DEPLOYMENT_KEY VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEPLOYMENT_ID VARCHAR(255) NOT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-oracle10g-streams.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE STREAM_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION CLOB DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-oracle10g-tasks.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE TASK_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION CLOB DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-postgresql-applications.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE APPLICATION_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION TEXT DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-postgresql-common.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE URI_REGISTRY (
2 | NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | URI VARCHAR(255) NOT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-postgresql-deployment.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE DEPLOYMENT_IDS (
2 | DEPLOYMENT_KEY VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEPLOYMENT_ID VARCHAR(255) NOT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-postgresql-streams.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE STREAM_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION TEXT DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-postgresql-tasks.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE TASK_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION TEXT DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-sqlserver-applications.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE APPLICATION_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION VARCHAR(max) DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-sqlserver-common.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE URI_REGISTRY (
2 | NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | URI VARCHAR(255) NOT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-sqlserver-deployment.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE DEPLOYMENT_IDS (
2 | DEPLOYMENT_KEY VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEPLOYMENT_ID VARCHAR(255) NOT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-sqlserver-streams.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE STREAM_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION VARCHAR(max) DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/main/resources/schema-sqlserver-tasks.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE TASK_DEFINITIONS (
2 | DEFINITION_NAME VARCHAR(255) NOT NULL PRIMARY KEY,
3 | DEFINITION VARCHAR(max) DEFAULT NULL
4 | );
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/test/java/org/springframework/cloud/deployer/admin/server/config/security/FileAuthenticationConfigurationTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.cloud.deployer.admin.server.config.security;
17 |
18 | import org.junit.Test;
19 |
20 | import static org.hamcrest.CoreMatchers.is;
21 | import static org.junit.Assert.assertThat;
22 | import static org.mockito.Mockito.mock;
23 |
24 | import org.springframework.cloud.deployer.admin.server.config.security.FileAuthenticationConfiguration;
25 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
26 |
27 | /**
28 | *
29 | * @author Gunnar Hillert
30 | */
31 | public class FileAuthenticationConfigurationTests {
32 |
33 | @Test
34 | public void testInitAuthenticationManagerBuilder() throws Exception {
35 |
36 | try {
37 | final FileAuthenticationConfiguration fileAuthenticationConfiguration =
38 | new FileAuthenticationConfiguration();
39 | fileAuthenticationConfiguration.init(mock(AuthenticationManagerBuilder.class));
40 | }
41 | catch (IllegalArgumentException anIllegalArgumentException) {
42 | assertThat(anIllegalArgumentException.getMessage(),
43 | is("No user specified. Please specify at least 1 user (e.g. "
44 | + "via 'dataflow.security.authentication.file.users')"));
45 | }
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/test/resources/META-INF/test-apps.properties:
--------------------------------------------------------------------------------
1 | source.time=maven://org.springframework.cloud.stream.app:time-source-rabbit:1.0.0.BUILD-SNAPSHOT
2 | processor.filter=maven://org.springframework.cloud.stream.app:filter-processor-rabbit:1.0.0.BUILD-SNAPSHOT
3 | sink.log=maven://org.springframework.cloud.stream.app:log-sink-rabbit:1.0.0.BUILD-SNAPSHOT
4 | task.timestamp=maven://org.springframework.cloud.task.app:timestamp-task:1.0.0.BUILD-SNAPSHOT
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/test/resources/app-registry-bad.properties:
--------------------------------------------------------------------------------
1 |
2 | Bitly
3 | moved here
4 |
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/test/resources/app-registry.properties:
--------------------------------------------------------------------------------
1 | sink.foo=file:///bar
2 | source.bar=file:///foo
3 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/test/resources/apps/filter-processor/META-INF/spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "properties": [
3 | {
4 | "name": "expression",
5 | "type": "org.springframework.expression.Expression",
6 | "description": "A predicate to evaluate",
7 | "sourceType": "foo.bar.FilterProperties",
8 | "defaultValue": "true"
9 | },
10 | {
11 | "name": "expresso",
12 | "type": "org.springframework.cloud.dataflow.completion.Expresso",
13 | "description": "A property of type enum and whose name starts like 'expression'",
14 | "sourceType": "foo.bar.FilterProperties"
15 | }
16 | ],
17 | "hints": []
18 | }
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/test/resources/apps/foo-task/META-INF/.vcs-dont-ignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-attic/spring-cloud-dashboard/3442c3bec5390c647e156176c5635d7dc9045235/spring-cloud-deployer-admin-server-core/src/test/resources/apps/foo-task/META-INF/.vcs-dont-ignore
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/test/resources/apps/hdfs-source/META-INF/spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "groups": [
3 | {
4 | "name": "some.long.prefix",
5 | "type": "foo.bar.HdfsProperties",
6 | "sourceType": "foo.bar.HdfsProperties"
7 | },
8 | {
9 | "name": "some.long.prefix.nested",
10 | "type": "foo.bar.OtherHdfsProperties",
11 | "sourceType": "foo.bar.HdfsProperties"
12 | }
13 | ],
14 | "properties": [
15 | {
16 | "name": "directory",
17 | "type": "java.lang.String",
18 | "description": "A path",
19 | "sourceType": "com.foo.DifferentHdfsProperties",
20 | "defaultValue": "/tmp"
21 | },
22 | {
23 | "name": "some.long.prefix.option1",
24 | "type": "java.lang.String",
25 | "description": "An option",
26 | "sourceType": "foo.bar.HdfsProperties",
27 | "defaultValue": "foo"
28 | },
29 | {
30 | "name": "some.long.prefix.option2",
31 | "type": "java.lang.String",
32 | "description": "Another option",
33 | "sourceType": "foo.bar.HdfsProperties",
34 | "defaultValue": "bar"
35 | },
36 | {
37 | "name": "some.long.prefix.nested.itworks",
38 | "type": "java.lang.String",
39 | "description": "Nested option",
40 | "sourceType": "foo.bar.HdfsProperties",
41 | "defaultValue": "wizz"
42 | }
43 | ],
44 | "hints": []
45 | }
46 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/test/resources/apps/http-source/META-INF/spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "groups": [
3 | {
4 | "name": "",
5 | "type": "foo.bar.HttpProperties",
6 | "sourceType": "foo.bar.HttpProperties"
7 | }
8 | ],
9 | "properties": [
10 | {
11 | "name": "port",
12 | "type": "java.lang.Integer",
13 | "description": "The port to listen on",
14 | "sourceType": "foo.bar.HttpProperties",
15 | "defaultValue": 8080
16 | },
17 | {
18 | "name": "use.ssl",
19 | "type": "java.lang.Boolean",
20 | "description": "Whether to use SSL encryption or not",
21 | "sourceType": "foo.bar.HttpProperties"
22 | }
23 | ],
24 | "hints": []
25 | }
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/test/resources/apps/log-sink/META-INF/spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "properties": [
3 | {
4 | "name": "level",
5 | "type": "java.lang.String",
6 | "description": "The logger level",
7 | "sourceType": "com.foo.LogProperties",
8 | "defaultValue": "debug"
9 | }
10 | ],
11 | "hints": [
12 | {
13 | "name": "level",
14 | "values": [
15 | {
16 | "value": "debug"
17 | },
18 | {
19 | "value": "info"
20 | },
21 | {
22 | "value": "warn"
23 | },
24 | {
25 | "value": "error"
26 | }
27 | ]
28 | }
29 | ]
30 | }
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/test/resources/apps/whitelist-source/META-INF/spring-configuration-metadata-whitelist.properties:
--------------------------------------------------------------------------------
1 | configuration-properties.classes=foo.TimeProperties,foo.DateProperties
2 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/test/resources/apps/whitelist-source/META-INF/spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "groups": [
3 | {
4 | "name": "time",
5 | "type": "foo.TimeProperties",
6 | "sourceType": "foo.TimeProperties"
7 | },
8 | {
9 | "name": "date",
10 | "type": "foo.DateProperties",
11 | "sourceType": "foo.DateProperties"
12 | },
13 | {
14 | "name": "something.else",
15 | "type": "foo.SomethingElseProperties",
16 | "sourceType": "foo.SomethingElseProperties"
17 | }
18 | ],
19 | "properties": [
20 | {
21 | "name": "time.format",
22 | "type": "java.lang.String",
23 | "sourceType": "foo.TimeProperties",
24 | "defaultValue": "ss"
25 | },
26 | {
27 | "name": "date.format",
28 | "type": "java.lang.String",
29 | "sourceType": "foo.DateProperties",
30 | "defaultValue": "dd"
31 | },
32 | {
33 | "name": "date.timezone",
34 | "type": "java.lang.String",
35 | "sourceType": "foo.DateProperties",
36 | "defaultValue": "GMT"
37 | },
38 | {
39 | "name": "something.else.prop",
40 | "type": "java.lang.String",
41 | "sourceType": "foo.SomethingElseProperties",
42 | "defaultValue": "whatever"
43 | },
44 | {
45 | "name": "date.some-long-property",
46 | "type": "java.lang.String",
47 | "sourceType": "foo.DateProperties",
48 | "defaultValue": "whatever"
49 | }
50 | ],
51 | "hints": []
52 | }
53 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/test/resources/dataflow-server.yml:
--------------------------------------------------------------------------------
1 | management:
2 | contextPath: /bar
3 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-core/src/test/resources/test.yml:
--------------------------------------------------------------------------------
1 | management:
2 | contextPath: /foo
3 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-local/src/main/java/org/springframework/cloud/deployer/admin/server/local/LocalDataFlowServer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.server.local;
18 |
19 | import org.springframework.boot.SpringApplication;
20 | import org.springframework.boot.autoconfigure.SpringBootApplication;
21 | import org.springframework.cloud.deployer.admin.server.EnableDataFlowServer;
22 |
23 | /**
24 | * Bootstrap class for the local Spring Cloud Data Flow Server.
25 | *
26 | * @author Mark Fisher
27 | * @author Ilayaperumal Gopinathan
28 | * @author Janne Valkealahti
29 | */
30 | @SpringBootApplication
31 | @EnableDataFlowServer
32 | public class LocalDataFlowServer {
33 |
34 | public static void main(String[] args) {
35 | SpringApplication.run(LocalDataFlowServer.class, args);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-local/src/main/java/org/springframework/cloud/deployer/admin/server/local/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Root package for the local version of Spring Cloud Data Flow Server.
3 | */
4 | package org.springframework.cloud.deployer.admin.server.local;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-server-local/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | info:
2 | app:
3 | name: "@project.artifactId@"
4 | description: "@project.name@"
5 | version: "@project.version@"
6 |
7 | #server:
8 | # port: 8443
9 | # ssl:
10 | # enabled: true
11 | # key-alias: dataflow
12 | # key-store: "/your/path/to/dataflow.keystore"
13 | # key-store-type: jks
14 | # key-store-password: dataflow
15 | # key-password: dataflow
16 |
17 | # Basic Authentication:
18 |
19 | #security:
20 | # basic:
21 | # enabled: true
22 | # realm: Spring Cloud Data Flow
23 | # user:
24 | # name: your-username
25 | # password: your-password
26 |
27 | # Oauth 2 support:
28 |
29 | #security:
30 | # basic:
31 | # enabled: true
32 | # oauth2:
33 | # client:
34 | # client-id: myclient
35 | # client-secret: mysecret
36 | # access-token-uri: http://127.0.0.1:9999/oauth/token
37 | # user-authorization-uri: http://127.0.0.1:9999/oauth/authorize
38 | # resource:
39 | # user-info-uri: http://127.0.0.1:9999/me
40 |
41 | # If you prefer to use Eureka to locate the Config Server, you can do that by setting
42 | # spring.cloud.config.discovery.enabled=true (default "false"). The net result of that is
43 | # that client apps all need a bootstrap.yml (or an environment variable) with the Eureka
44 | # server address, e.g. in eureka.client.serviceUrl.defaultZone
45 | #
46 | #---
47 | #spring:
48 | # cloud:
49 | # config:
50 | # discovery:
51 | # enabled: true
52 | #eureka:
53 | # client:
54 | # serviceUrl:
55 | # defaultZone: http://localhost:8761/eureka/
56 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-shell-core/src/main/java/org/springframework/cloud/deployer/admin/shell/EnableDataFlowShell.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.shell;
18 |
19 | import java.lang.annotation.Target;
20 | import java.lang.annotation.Documented;
21 | import java.lang.annotation.ElementType;
22 | import java.lang.annotation.Inherited;
23 | import java.lang.annotation.Retention;
24 | import java.lang.annotation.RetentionPolicy;
25 |
26 | import org.springframework.cloud.deployer.admin.shell.config.ShellCommandLineConfiguration;
27 | import org.springframework.context.annotation.Import;
28 |
29 | /**
30 | * Activates the Spring Cloud Data Flow shell.
31 | *
32 | * @author Josh Long
33 | */
34 | @Target(ElementType.TYPE)
35 | @Retention(RetentionPolicy.RUNTIME)
36 | @Documented
37 | @Inherited
38 | @Import(ShellCommandLineConfiguration.class)
39 | public @interface EnableDataFlowShell {
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-shell-core/src/main/java/org/springframework/cloud/deployer/admin/shell/ShellApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.shell;
18 |
19 | import org.springframework.boot.Banner;
20 | import org.springframework.boot.autoconfigure.SpringBootApplication;
21 | import org.springframework.boot.builder.SpringApplicationBuilder;
22 |
23 | /**
24 | * Bootstrap class for spring shell.
25 | *
26 | * @author Ilayaperumal Gopinathan
27 | * @author Josh Long
28 | */
29 | @EnableDataFlowShell
30 | @SpringBootApplication
31 | public class ShellApplication {
32 |
33 | public static void main(String[] args) throws Exception {
34 | new SpringApplicationBuilder()
35 | .sources(ShellApplication.class )
36 | .bannerMode(Banner.Mode.OFF)
37 | .run(args);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-shell-core/src/main/java/org/springframework/cloud/deployer/admin/shell/ShellProperties.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package org.springframework.cloud.deployer.admin.shell;
17 |
18 | import org.springframework.boot.context.properties.ConfigurationProperties;
19 | import org.springframework.shell.SimpleShellCommandLineOptions;
20 | import org.springframework.stereotype.Component;
21 |
22 | /**
23 | * Spring Boot {@link ConfigurationProperties} to specify well known Spring Shell properties.
24 | * The property prefix is spring.shell
.
25 | *
26 | * @author Mark Pollack
27 | */
28 | @ConfigurationProperties(prefix = "spring.shell")
29 | public class ShellProperties {
30 |
31 | /**
32 | * The maximum number of lines to store in the command history file.
33 | */
34 | private int historySize = SimpleShellCommandLineOptions.DEFAULT_HISTORY_SIZE;
35 |
36 | /**
37 | * The file to read that contains shell commands
38 | */
39 | private String commandFile;
40 |
41 | public int getHistorySize() {
42 | return historySize;
43 | }
44 |
45 | public void setHistorySize(int historySize) {
46 | this.historySize = historySize;
47 | }
48 |
49 | public String getCommandFile() {
50 | return commandFile;
51 | }
52 |
53 | public void setCommandFile(String commandFile) {
54 | this.commandFile = commandFile;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-shell-core/src/main/java/org/springframework/cloud/deployer/admin/shell/TargetHolder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-2017 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.shell;
18 |
19 | import org.springframework.cloud.deployer.admin.shell.command.ConfigCommands;
20 | import org.springframework.util.Assert;
21 |
22 | /**
23 | * A target holder, wrapping a {@link Target} that encapsulates not only the Target URI but
24 | * also success/error messages + status.
25 | *
26 | * @author Gunnar Hillert
27 | * @since 1.0
28 | *
29 | * @see Target
30 | *
31 | */
32 | public class TargetHolder {
33 |
34 | private Target target;
35 |
36 | /**
37 | * Constructor.
38 | */
39 | public TargetHolder() {
40 | }
41 |
42 | /**
43 | * Return the {@link Target} which encapsulates not only the Target URI but also success/error messages + status.
44 | *
45 | * @return Should never be null. Initialized by {@link ConfigCommands#afterPropertiesSet()}
46 | */
47 | public Target getTarget() {
48 | return target;
49 | }
50 |
51 | /**
52 | * Set the Dataflow Server {@link Target}.
53 | *
54 | * @param target Must not be null.
55 | */
56 | public void setTarget(Target target) {
57 | Assert.notNull(target, "The provided target must not be null.");
58 | this.target = target;
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-shell-core/src/main/java/org/springframework/cloud/deployer/admin/shell/autoconfigure/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Contains classes for the integration of Spring Boot and Spring Shell.
3 | */
4 | package org.springframework.cloud.deployer.admin.shell.autoconfigure;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-shell-core/src/main/java/org/springframework/cloud/deployer/admin/shell/command/UserInput.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.shell.command;
18 |
19 | /**
20 | * Abstraction for a mechanism used to get user interactive user input.
21 | *
22 | * @author Eric Bottard
23 | * @author Marius Bogoevici
24 | */
25 | public interface UserInput {
26 |
27 | /**
28 | * Display a prompt text to the user and expect one of {@code options} in return.
29 | *
30 | * @param prompt the a message to prompt the user with
31 | * @param defaultValue the default value to be returned if the user simply presses Enter
32 | * @param options valid input option set
33 | */
34 | public String promptWithOptions(String prompt, String defaultValue, String... options);
35 |
36 | /**
37 | * Display a prompt text to the user and expect them to enter a free-form value. Optionally, the input is echoed.
38 | *
39 | * @param prompt the a message to prompt the user with
40 | * @param defaultValue the default value to be returned if the user simply presses Enter
41 | * @param echo echo the input to output (set to false for sensitive input, e.g. passwords)
42 | */
43 | public String prompt(String prompt, String defaultValue, boolean echo);
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-shell-core/src/main/java/org/springframework/cloud/deployer/admin/shell/command/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Command classes for the Spring Cloud Data Flow Shell.
3 | */
4 | package org.springframework.cloud.deployer.admin.shell.command;
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-shell-core/src/main/java/org/springframework/cloud/deployer/admin/shell/command/support/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides supporting classes and utilities for the shell command classes.
3 | */
4 | package org.springframework.cloud.deployer.admin.shell.command.support;
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-shell-core/src/main/java/org/springframework/cloud/deployer/admin/shell/config/DataFlowPromptProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.shell.config;
18 |
19 | import org.springframework.beans.factory.annotation.Autowired;
20 | import org.springframework.core.Ordered;
21 | import org.springframework.core.annotation.Order;
22 | import org.springframework.shell.plugin.PromptProvider;
23 | import org.springframework.stereotype.Component;
24 |
25 | /**
26 | * A provider that sets the shell prompt to 'dataflow' if the server is available, 'server-unknown' otherwise.
27 | *
28 | * @author Ilayaperumal Gopinathan
29 | */
30 | @Component
31 | @Order(Ordered.HIGHEST_PRECEDENCE)
32 | public class DataFlowPromptProvider implements PromptProvider {
33 |
34 | @Autowired
35 | private DataFlowShell shell;
36 |
37 | @Override
38 | public String getProviderName() {
39 | return "dataflow";
40 | }
41 |
42 | @Override
43 | public String getPrompt() {
44 | if (shell.getDataFlowOperations() == null) {
45 | return "server-unknown:>";
46 | }
47 | else {
48 | return "dataflow:>";
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-shell-core/src/main/java/org/springframework/cloud/deployer/admin/shell/config/DataFlowShell.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.shell.config;
18 |
19 | import org.springframework.cloud.deployer.admin.rest.client.DataFlowOperations;
20 | import org.springframework.stereotype.Component;
21 |
22 | /**
23 | * REST client component that holds all the available operations for
24 | * communicating with the Spring Cloud Data Flow REST server.
25 | *
26 | * @author Ilayaperumal Gopinathan
27 | */
28 | @Component
29 | public class DataFlowShell {
30 |
31 | private DataFlowOperations dataFlowOperations;
32 |
33 | public DataFlowOperations getDataFlowOperations() {
34 | return dataFlowOperations;
35 | }
36 |
37 | public void setDataFlowOperations(DataFlowOperations dataFlowOperations) {
38 | this.dataFlowOperations = dataFlowOperations;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-shell-core/src/main/java/org/springframework/cloud/deployer/admin/shell/config/ShellCommandLineConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.shell.config;
18 |
19 |
20 | import org.springframework.boot.CommandLineRunner;
21 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
22 | import org.springframework.cloud.deployer.admin.shell.ShellCommandLineRunner;
23 | import org.springframework.context.annotation.Bean;
24 | import org.springframework.context.annotation.Configuration;
25 |
26 | /**
27 | * Configuration class for the command line runner
28 | *
29 | * @author Josh Long
30 | * @author Mark Pollack
31 | */
32 | @Configuration
33 | public class ShellCommandLineConfiguration {
34 |
35 | /**
36 | * Return the interactive command line runner. The {@link ConditionalOnMissingBean} annotation is used so that
37 | * this interactive command line runner is not created when running the shell in the same process as the
38 | * Data Flow server.
39 | * @return the interactive shell
40 | */
41 | @Bean
42 | @ConditionalOnMissingBean(type="org.springframework.cloud.deployer.resource.registry.UriRegistry")
43 | public ShellCommandLineRunner commandLineRunner() {
44 | return new ShellCommandLineRunner();
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-shell-core/src/main/java/org/springframework/cloud/deployer/admin/shell/config/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Configuration classes for the Spring Cloud Data Flow Shell.
3 | */
4 | package org.springframework.cloud.deployer.admin.shell.config;
5 |
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-shell-core/src/main/java/org/springframework/cloud/deployer/admin/shell/converter/MediaTypeConverter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.deployer.admin.shell.converter;
18 |
19 | import java.util.List;
20 |
21 | import org.springframework.http.MediaType;
22 | import org.springframework.shell.core.Completion;
23 | import org.springframework.shell.core.Converter;
24 | import org.springframework.shell.core.MethodTarget;
25 | import org.springframework.stereotype.Component;
26 |
27 | /**
28 | * Knows how to parse String representations of {@link MediaType}.
29 | *
30 | * @author Eric Bottard
31 | */
32 | @Component
33 | public class MediaTypeConverter implements Converter {
34 |
35 | @Override
36 | public boolean supports(Class> type, String optionContext) {
37 | return MediaType.class.isAssignableFrom(type);
38 | }
39 |
40 | @Override
41 | public MediaType convertFromText(String value, Class> targetType, String optionContext) {
42 | return MediaType.parseMediaType(value);
43 | }
44 |
45 | @Override
46 | public boolean getAllPossibleValues(List completions, Class> targetType, String existingData,
47 | String optionContext, MethodTarget target) {
48 | return false;
49 | }
50 |
51 | }
--------------------------------------------------------------------------------
/spring-cloud-deployer-admin-shell-core/src/main/java/org/springframework/cloud/deployer/admin/shell/converter/NumberFormatConverter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 the original author or authors.
3 | * Licensed under the Apache License, Version 2.0 (the "License");
4 | * you may not use this file except in compliance with the License.
5 | * You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software
10 | * distributed under the License is distributed on an "AS IS" BASIS,
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | * See the License for the specific language governing permissions and
13 | * limitations under the License.
14 | */
15 |
16 | package org.springframework.cloud.deployer.admin.shell.converter;
17 |
18 | import java.text.DecimalFormat;
19 | import java.text.NumberFormat;
20 | import java.util.List;
21 |
22 | import org.springframework.shell.core.Completion;
23 | import org.springframework.shell.core.Converter;
24 | import org.springframework.shell.core.MethodTarget;
25 | import org.springframework.stereotype.Component;
26 |
27 | /**
28 | * Knows how to convert from a String to a new {@link NumberFormat} instance.
29 | *
30 | * @author Eric Bottard
31 | */
32 | @Component
33 | public class NumberFormatConverter implements Converter {
34 |
35 | public static final String DEFAULT = "