Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
8a95d5d7
Commit
8a95d5d7
authored
Nov 30, 2016
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Spring Data GemFire Starter and Sample
Closes gh-7465
parent
655bffb8
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
0 additions
and
746 deletions
+0
-746
pom.xml
spring-boot-dependencies/pom.xml
+0
-11
pom.xml
spring-boot-samples/pom.xml
+0
-1
pom.xml
spring-boot-samples/spring-boot-sample-data-gemfire/pom.xml
+0
-45
SampleDataGemFireApplication.java
...ava/sample/data/gemfire/SampleDataGemFireApplication.java
+0
-107
SampleDataGemFireProperties.java
...mple/data/gemfire/config/SampleDataGemFireProperties.java
+0
-42
Gemstone.java
...re/src/main/java/sample/data/gemfire/domain/Gemstone.java
+0
-92
GemstoneRepository.java
.../java/sample/data/gemfire/service/GemstoneRepository.java
+0
-41
GemstoneService.java
...ain/java/sample/data/gemfire/service/GemstoneService.java
+0
-68
GemstoneServiceImpl.java
...java/sample/data/gemfire/service/GemstoneServiceImpl.java
+0
-139
IllegalGemstoneException.java
...sample/data/gemfire/service/IllegalGemstoneException.java
+0
-30
SampleDataGemFireApplicationTests.java
...ample/data/gemfire/SampleDataGemFireApplicationTests.java
+0
-97
pom.xml
spring-boot-starters/pom.xml
+0
-1
pom.xml
...ng-boot-starters/spring-boot-starter-data-gemfire/pom.xml
+0
-71
spring.provides
...-data-gemfire/src/main/resources/META-INF/spring.provides
+0
-1
No files found.
spring-boot-dependencies/pom.xml
View file @
8a95d5d7
...
@@ -72,7 +72,6 @@
...
@@ -72,7 +72,6 @@
<flyway.version>
3.2.1
</flyway.version>
<flyway.version>
3.2.1
</flyway.version>
<freemarker.version>
2.3.25-incubating
</freemarker.version>
<freemarker.version>
2.3.25-incubating
</freemarker.version>
<elasticsearch.version>
2.4.1
</elasticsearch.version>
<elasticsearch.version>
2.4.1
</elasticsearch.version>
<gemfire.version>
8.2.0
</gemfire.version>
<glassfish-el.version>
3.0.0
</glassfish-el.version>
<glassfish-el.version>
3.0.0
</glassfish-el.version>
<gradle.version>
2.9
</gradle.version>
<gradle.version>
2.9
</gradle.version>
<groovy.version>
2.4.7
</groovy.version>
<groovy.version>
2.4.7
</groovy.version>
...
@@ -327,11 +326,6 @@
...
@@ -327,11 +326,6 @@
<artifactId>
spring-boot-starter-data-elasticsearch
</artifactId>
<artifactId>
spring-boot-starter-data-elasticsearch
</artifactId>
<version>
2.0.0.BUILD-SNAPSHOT
</version>
<version>
2.0.0.BUILD-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-gemfire
</artifactId>
<version>
2.0.0.BUILD-SNAPSHOT
</version>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
...
@@ -675,11 +669,6 @@
...
@@ -675,11 +669,6 @@
<artifactId>
jackson-module-parameter-names
</artifactId>
<artifactId>
jackson-module-parameter-names
</artifactId>
<version>
${jackson.version}
</version>
<version>
${jackson.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.gemstone.gemfire
</groupId>
<artifactId>
gemfire
</artifactId>
<version>
${gemfire.version}
</version>
</dependency>
<dependency>
<dependency>
<groupId>
com.github.ben-manes.caffeine
</groupId>
<groupId>
com.github.ben-manes.caffeine
</groupId>
<artifactId>
caffeine
</artifactId>
<artifactId>
caffeine
</artifactId>
...
...
spring-boot-samples/pom.xml
View file @
8a95d5d7
...
@@ -36,7 +36,6 @@
...
@@ -36,7 +36,6 @@
<module>
spring-boot-sample-data-cassandra
</module>
<module>
spring-boot-sample-data-cassandra
</module>
<module>
spring-boot-sample-data-couchbase
</module>
<module>
spring-boot-sample-data-couchbase
</module>
<module>
spring-boot-sample-data-elasticsearch
</module>
<module>
spring-boot-sample-data-elasticsearch
</module>
<module>
spring-boot-sample-data-gemfire
</module>
<module>
spring-boot-sample-data-jpa
</module>
<module>
spring-boot-sample-data-jpa
</module>
<module>
spring-boot-sample-data-mongodb
</module>
<module>
spring-boot-sample-data-mongodb
</module>
<module>
spring-boot-sample-data-neo4j
</module>
<module>
spring-boot-sample-data-neo4j
</module>
...
...
spring-boot-samples/spring-boot-sample-data-gemfire/pom.xml
deleted
100644 → 0
View file @
655bffb8
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<!-- Your own application should inherit from spring-boot-starter-parent -->
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-samples
</artifactId>
<version>
2.0.0.BUILD-SNAPSHOT
</version>
</parent>
<artifactId>
spring-boot-sample-data-gemfire
</artifactId>
<name>
Spring Boot Data GemFire Sample
</name>
<description>
Spring Boot Data GemFire Sample
</description>
<url>
http://projects.spring.io/spring-boot/
</url>
<organization>
<name>
Pivotal Software, Inc.
</name>
<url>
http://www.spring.io
</url>
</organization>
<properties>
<main.basedir>
${basedir}/../..
</main.basedir>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-gemfire
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
</project>
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/SampleDataGemFireApplication.java
deleted
100644 → 0
View file @
655bffb8
/*
* Copyright 2012-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
data
.
gemfire
;
import
java.util.Properties
;
import
com.gemstone.gemfire.cache.Cache
;
import
com.gemstone.gemfire.cache.RegionAttributes
;
import
sample.data.gemfire.config.SampleDataGemFireProperties
;
import
sample.data.gemfire.domain.Gemstone
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.data.gemfire.CacheFactoryBean
;
import
org.springframework.data.gemfire.GemfireTransactionManager
;
import
org.springframework.data.gemfire.RegionAttributesFactoryBean
;
import
org.springframework.data.gemfire.ReplicatedRegionFactoryBean
;
import
org.springframework.data.gemfire.repository.config.EnableGemfireRepositories
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
/**
* The GemstoneAppConfiguration class for allowing Spring Boot to pick up additional
* application Spring configuration meta-data for GemFire, which must be specified in
* Spring Data GemFire's XML namespace.
*
* @author John Blum
*/
@SpringBootApplication
@EnableGemfireRepositories
@EnableTransactionManagement
@EnableConfigurationProperties
(
SampleDataGemFireProperties
.
class
)
public
class
SampleDataGemFireApplication
{
private
static
final
String
GEMSTONES_REGION_NAME
=
"Gemstones"
;
private
final
SampleDataGemFireProperties
properties
;
public
SampleDataGemFireApplication
(
SampleDataGemFireProperties
applicationProperties
)
{
this
.
properties
=
applicationProperties
;
}
@Bean
public
CacheFactoryBean
gemfireCache
()
{
CacheFactoryBean
cache
=
new
CacheFactoryBean
();
cache
.
setClose
(
true
);
cache
.
setProperties
(
getCacheProperties
());
return
cache
;
}
private
Properties
getCacheProperties
()
{
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
"name"
,
SampleDataGemFireApplication
.
class
.
getSimpleName
());
properties
.
setProperty
(
"mcast-port"
,
"0"
);
properties
.
setProperty
(
"locators"
,
""
);
properties
.
setProperty
(
"log-level"
,
this
.
properties
.
getLogLevel
());
return
properties
;
}
@Bean
(
name
=
GEMSTONES_REGION_NAME
)
public
ReplicatedRegionFactoryBean
<
Long
,
Gemstone
>
gemstonesRegion
(
Cache
cache
,
RegionAttributes
<
Long
,
Gemstone
>
attributes
)
{
ReplicatedRegionFactoryBean
<
Long
,
Gemstone
>
region
=
new
ReplicatedRegionFactoryBean
<
Long
,
Gemstone
>();
region
.
setAttributes
(
attributes
);
region
.
setClose
(
false
);
region
.
setCache
(
cache
);
region
.
setName
(
GEMSTONES_REGION_NAME
);
region
.
setPersistent
(
false
);
return
region
;
}
@Bean
@SuppressWarnings
({
"unchecked"
,
"deprecation"
})
public
RegionAttributesFactoryBean
gemstonesRegionAttributes
()
{
RegionAttributesFactoryBean
attributes
=
new
RegionAttributesFactoryBean
();
attributes
.
setKeyConstraint
(
Long
.
class
);
attributes
.
setValueConstraint
(
Gemstone
.
class
);
return
attributes
;
}
@Bean
public
GemfireTransactionManager
gemfireTransactionManager
(
Cache
gemfireCache
)
{
return
new
GemfireTransactionManager
(
gemfireCache
);
}
public
static
void
main
(
final
String
[]
args
)
{
SpringApplication
.
run
(
SampleDataGemFireApplication
.
class
,
args
);
}
}
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/config/SampleDataGemFireProperties.java
deleted
100644 → 0
View file @
655bffb8
/*
* Copyright 2012-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
data
.
gemfire
.
config
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
/**
* Configuration properties for Gemfire sample.
*
* @author John Blum
*/
@ConfigurationProperties
(
prefix
=
"sample.data.gemfire"
)
public
class
SampleDataGemFireProperties
{
/**
* Caching log level.
*/
private
String
logLevel
=
"config"
;
public
String
getLogLevel
()
{
return
this
.
logLevel
;
}
public
void
setLogLevel
(
String
logLevel
)
{
this
.
logLevel
=
logLevel
;
}
}
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/domain/Gemstone.java
deleted
100644 → 0
View file @
655bffb8
/*
* Copyright 2012-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
data
.
gemfire
.
domain
;
import
java.io.Serializable
;
import
org.springframework.core.style.ToStringCreator
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.gemfire.mapping.Region
;
import
org.springframework.util.ObjectUtils
;
/**
* The Gemstone class is an abstract data type modeling a Gemstone, such as a diamond or a
* ruby.
*
* @author John Blum
*/
@Region
(
"Gemstones"
)
public
class
Gemstone
implements
Serializable
{
@Id
private
Long
id
;
private
String
name
;
public
Gemstone
()
{
}
public
Gemstone
(
Long
id
)
{
this
.
id
=
id
;
}
public
Gemstone
(
Long
id
,
String
name
)
{
this
.
id
=
id
;
this
.
name
=
name
;
}
public
Long
getId
()
{
return
this
.
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
this
.
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
==
this
)
{
return
true
;
}
if
(
obj
==
null
||
!
obj
.
getClass
().
equals
(
getClass
()))
{
return
false
;
}
return
ObjectUtils
.
nullSafeEquals
(
this
.
getName
(),
((
Gemstone
)
obj
).
getName
());
}
@Override
public
int
hashCode
()
{
return
ObjectUtils
.
nullSafeHashCode
(
getName
());
}
@Override
public
String
toString
()
{
ToStringCreator
creator
=
new
ToStringCreator
(
this
);
creator
.
append
(
"id"
,
this
.
id
);
creator
.
append
(
"name"
,
this
.
name
);
return
creator
.
toString
();
}
}
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/service/GemstoneRepository.java
deleted
100644 → 0
View file @
655bffb8
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
data
.
gemfire
.
service
;
import
sample.data.gemfire.domain.Gemstone
;
import
org.springframework.data.gemfire.repository.GemfireRepository
;
/**
* The GemstoneRepository interface is an extension of the GemfireRepository abstraction
* for encapsulating data access and persistence operations (CRUD) on Gemstone domain
* objects.
*
* @author John Blum
*/
public
interface
GemstoneRepository
extends
GemfireRepository
<
Gemstone
,
Long
>
{
/**
* Finds a particular Gemstone in the GemFire Cache by name.
* @param <T> the Class type of the Gemstone domain object to find.
* @param name a String value indicating the name of the Gemstone to find.
* @return a Gemstone by name.
* @see sample.data.gemfire.domain.Gemstone
*/
<
T
extends
Gemstone
>
T
findByName
(
String
name
);
}
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/service/GemstoneService.java
deleted
100644 → 0
View file @
655bffb8
/*
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
data
.
gemfire
.
service
;
import
sample.data.gemfire.domain.Gemstone
;
/**
* The GemstoneService interface is a Service interface object contract defining business
* operations for processing Gemstone domain objects.
*
* @author John Blum
*/
public
interface
GemstoneService
{
/**
* Returns a count of the number of Gemstones in the GemFire Cache.
* @return a long value indicating the number of Gemstones in the GemFire Cache.
*/
long
count
();
/**
* Gets a Gemstone by ID.
* @param id a long value indicating the identifier of the Gemstone.
* @return a Gemstone with ID, or null if no Gemstone exists with ID.
* @see sample.data.gemfire.domain.Gemstone
*/
Gemstone
get
(
Long
id
);
/**
* Gets a Gemstone by name.
* @param name a String value indicating the name of the Gemstone.
* @return a Gemstone with name, or null if no Gemstone exists with name.
* @see sample.data.gemfire.domain.Gemstone
*/
Gemstone
get
(
String
name
);
/**
* Return a listing of Gemstones currently stored in the GemFire Cache.
* @return an Iterable object to iterate over the list of Gemstones currently stored
* in the GemFire Cache.
* @see java.lang.Iterable
* @see sample.data.gemfire.domain.Gemstone
*/
Iterable
<
Gemstone
>
list
();
/**
* Saves the specified Gemstone to the GemFire Cache.
* @param gemstone the Gemstone to save in the GemFire Cache.
* @return the saved Gemstone.
* @see sample.data.gemfire.domain.Gemstone
*/
Gemstone
save
(
Gemstone
gemstone
);
}
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/service/GemstoneServiceImpl.java
deleted
100644 → 0
View file @
655bffb8
/*
* Copyright 2012-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
data
.
gemfire
.
service
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
import
javax.annotation.PostConstruct
;
import
sample.data.gemfire.domain.Gemstone
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
/**
* The GemstoneServiceImpl class is a Service object implementing the GemstoneService
* interface containing business logic and rules in addition to data services for
* processing Gemstones.
*
* @author John Blum
*/
@Service
(
"gemstoneService"
)
public
class
GemstoneServiceImpl
implements
GemstoneService
{
protected
static
final
List
<
String
>
APPROVED_GEMS
;
static
{
APPROVED_GEMS
=
Collections
.
unmodifiableList
(
Arrays
.
asList
((
"ALEXANDRITE,AQUAMARINE,DIAMOND,OPAL,PEARL,"
+
"RUBY,SAPPHIRE,SPINEL,TOPAZ"
).
split
(
","
)));
}
private
final
GemstoneRepository
repository
;
public
GemstoneServiceImpl
(
GemstoneRepository
gemstoneRepository
)
{
this
.
repository
=
gemstoneRepository
;
}
@PostConstruct
public
void
init
()
{
System
.
out
.
printf
(
"[%1$s] initialized!%n"
,
getClass
().
getSimpleName
());
}
/**
* Returns a count of the number of Gemstones in the GemFire Cache.
* @return a long value indicating the number of Gemstones in the GemFire Cache.
*/
@Override
@Transactional
(
readOnly
=
true
)
public
long
count
()
{
return
this
.
repository
.
count
();
}
/**
* Gets a Gemstone by ID.
* @param id a long value indicating the identifier of the Gemstone.
* @return a Gemstone with ID, or null if no Gemstone exists with ID.
* @see sample.data.gemfire.domain.Gemstone
*/
@Override
@Transactional
(
readOnly
=
true
)
public
Gemstone
get
(
Long
id
)
{
return
this
.
repository
.
findOne
(
id
);
}
/**
* Gets a Gemstone by name.
* @param name a String value indicating the name of the Gemstone.
* @return a Gemstone with name, or null if no Gemstone exists with name.
* @see sample.data.gemfire.domain.Gemstone
*/
@Override
@Transactional
(
readOnly
=
true
)
public
Gemstone
get
(
String
name
)
{
return
this
.
repository
.
findByName
(
name
);
}
/**
* Return a listing of Gemstones currently stored in the GemFire Cache.
* @return an Iterable object to iterate over the list of Gemstones currently stored
* in the GemFire Cache.
* @see java.lang.Iterable
* @see sample.data.gemfire.domain.Gemstone
*/
@Override
@Transactional
(
readOnly
=
true
)
public
Iterable
<
Gemstone
>
list
()
{
return
this
.
repository
.
findAll
();
}
/**
* Saves the specified Gemstone to the GemFire Cache.
* @param gemstone the Gemstone to save in the GemFire Cache.
* @return the saved Gemstone.
* @see sample.data.gemfire.domain.Gemstone
*/
@Override
@Transactional
public
Gemstone
save
(
Gemstone
gemstone
)
{
Assert
.
notNull
(
gemstone
,
"The Gemstone to save must not be null!"
);
Assert
.
notNull
(
gemstone
.
getName
(),
"The name of the Gemstone must be specified!"
);
// NOTE deliberately (& naively) validate the Gemstone after mutating data access
// in GemFire rather than before to demonstrate transactions in GemFire.
Gemstone
savedGemstone
=
validate
(
this
.
repository
.
save
(
gemstone
));
Assert
.
state
(
savedGemstone
.
equals
(
get
(
gemstone
.
getId
())),
String
.
format
(
"Failed to find Gemstone (%1$s) in "
+
"GemFire's Cache Region 'Gemstones'!"
,
gemstone
));
System
.
out
.
printf
(
"Saved Gemstone [%1$s]%n"
,
savedGemstone
.
getName
());
return
gemstone
;
}
Gemstone
validate
(
Gemstone
gemstone
)
{
if
(!
APPROVED_GEMS
.
contains
(
gemstone
.
getName
().
toUpperCase
()))
{
// NOTE if the Gemstone is not valid, throw error...
// Should cause transaction to rollback in GemFire!
System
.
err
.
printf
(
"Illegal Gemstone [%1$s]!%n"
,
gemstone
.
getName
());
throw
new
IllegalGemstoneException
(
String
.
format
(
"[%1$s] is not a valid Gemstone!"
,
gemstone
.
getName
()));
}
return
gemstone
;
}
}
spring-boot-samples/spring-boot-sample-data-gemfire/src/main/java/sample/data/gemfire/service/IllegalGemstoneException.java
deleted
100644 → 0
View file @
655bffb8
/*
* Copyright 2012-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
data
.
gemfire
.
service
;
/**
* Exception thrown from {@link GemstoneService}.
*
* @author John Blum
*/
public
class
IllegalGemstoneException
extends
IllegalArgumentException
{
public
IllegalGemstoneException
(
String
message
)
{
super
(
message
);
}
}
spring-boot-samples/spring-boot-sample-data-gemfire/src/test/java/sample/data/gemfire/SampleDataGemFireApplicationTests.java
deleted
100644 → 0
View file @
655bffb8
/*
* Copyright 2012-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
data
.
gemfire
;
import
java.util.concurrent.atomic.AtomicLong
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
sample.data.gemfire.domain.Gemstone
;
import
sample.data.gemfire.service.GemstoneService
;
import
sample.data.gemfire.service.IllegalGemstoneException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
* Tests for {@link SampleDataGemFireApplication}.
*
* @author John Blum
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
SampleDataGemFireApplicationTests
{
@Autowired
private
GemstoneService
service
;
private
final
AtomicLong
idGenerator
=
new
AtomicLong
(
0L
);
@Test
public
void
gemstonesAppServiceEndpoints
()
{
assertThat
(
this
.
service
.
count
()).
isEqualTo
(
0
);
assertThat
(
this
.
service
.
list
()).
isEmpty
();
this
.
service
.
save
(
createGemstone
(
"Diamond"
));
this
.
service
.
save
(
createGemstone
(
"Ruby"
));
assertThat
(
this
.
service
.
count
()).
isEqualTo
(
2
);
assertThat
(
this
.
service
.
list
()).
contains
(
getGemstones
(
"Diamond"
,
"Ruby"
));
try
{
this
.
service
.
save
(
createGemstone
(
"Coal"
));
}
catch
(
IllegalGemstoneException
ignore
)
{
// expected
}
assertThat
(
this
.
service
.
count
()).
isEqualTo
(
2
);
assertThat
(
this
.
service
.
list
()).
contains
(
getGemstones
(
"Diamond"
,
"Ruby"
));
this
.
service
.
save
(
createGemstone
(
"Pearl"
));
this
.
service
.
save
(
createGemstone
(
"Sapphire"
));
assertThat
(
this
.
service
.
count
()).
isEqualTo
(
4
);
assertThat
(
this
.
service
.
list
())
.
contains
(
getGemstones
(
"Diamond"
,
"Ruby"
,
"Pearl"
,
"Sapphire"
));
try
{
this
.
service
.
save
(
createGemstone
(
"Quartz"
));
}
catch
(
IllegalGemstoneException
ignore
)
{
// expected
}
assertThat
(
this
.
service
.
count
()).
isEqualTo
(
4
);
assertThat
(
this
.
service
.
list
())
.
contains
(
getGemstones
(
"Diamond"
,
"Ruby"
,
"Pearl"
,
"Sapphire"
));
assertThat
(
this
.
service
.
get
(
"Diamond"
)).
isEqualTo
(
createGemstone
(
"Diamond"
));
assertThat
(
this
.
service
.
get
(
"Pearl"
)).
isEqualTo
(
createGemstone
(
"Pearl"
));
}
private
Gemstone
[]
getGemstones
(
String
...
names
)
{
Gemstone
[]
gemstones
=
new
Gemstone
[
names
.
length
];
for
(
int
i
=
0
;
i
<
names
.
length
;
i
++)
{
gemstones
[
i
]
=
createGemstone
(
null
,
names
[
i
]);
}
return
gemstones
;
}
private
Gemstone
createGemstone
(
String
name
)
{
return
createGemstone
(
this
.
idGenerator
.
incrementAndGet
(),
name
);
}
private
Gemstone
createGemstone
(
Long
id
,
String
name
)
{
return
new
Gemstone
(
id
,
name
);
}
}
spring-boot-starters/pom.xml
View file @
8a95d5d7
...
@@ -31,7 +31,6 @@
...
@@ -31,7 +31,6 @@
<module>
spring-boot-starter-data-cassandra
</module>
<module>
spring-boot-starter-data-cassandra
</module>
<module>
spring-boot-starter-data-couchbase
</module>
<module>
spring-boot-starter-data-couchbase
</module>
<module>
spring-boot-starter-data-elasticsearch
</module>
<module>
spring-boot-starter-data-elasticsearch
</module>
<module>
spring-boot-starter-data-gemfire
</module>
<module>
spring-boot-starter-data-jpa
</module>
<module>
spring-boot-starter-data-jpa
</module>
<module>
spring-boot-starter-data-mongodb
</module>
<module>
spring-boot-starter-data-mongodb
</module>
<module>
spring-boot-starter-data-neo4j
</module>
<module>
spring-boot-starter-data-neo4j
</module>
...
...
spring-boot-starters/spring-boot-starter-data-gemfire/pom.xml
deleted
100644 → 0
View file @
655bffb8
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starters
</artifactId>
<version>
2.0.0.BUILD-SNAPSHOT
</version>
</parent>
<artifactId>
spring-boot-starter-data-gemfire
</artifactId>
<name>
Spring Boot Data GemFire Starter
</name>
<description>
Starter for using GemFire distributed data store and Spring Data
GemFire
</description>
<url>
http://projects.spring.io/spring-boot/
</url>
<organization>
<name>
Pivotal Software, Inc.
</name>
<url>
http://www.spring.io
</url>
</organization>
<properties>
<main.basedir>
${basedir}/../..
</main.basedir>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.data
</groupId>
<artifactId>
spring-data-gemfire
</artifactId>
<exclusions>
<exclusion>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<repositories>
<repository>
<id>
repo.spring.io
</id>
<url>
http://repo.spring.io/libs-release
</url>
<releases>
<enabled>
true
</enabled>
</releases>
<snapshots>
<enabled>
false
</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>
org.basepom.maven
</groupId>
<artifactId>
duplicate-finder-maven-plugin
</artifactId>
<executions>
<execution>
<id>
duplicate-dependencies
</id>
<phase>
validate
</phase>
<goals>
<goal>
check
</goal>
</goals>
<configuration>
<ignoredResourcePatterns>
<ignoredResourcePattern>
changelog.txt
</ignoredResourcePattern>
</ignoredResourcePatterns>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
spring-boot-starters/spring-boot-starter-data-gemfire/src/main/resources/META-INF/spring.provides
deleted
100644 → 0
View file @
655bffb8
provides: spring-data-gemfire
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment