Skip to content

Commit c2efe5d

Browse files
committed
Merge pull request #40 from simonbasle/vestigialTemplate
prepare bare template class, use preview of SDK 2.2.0
2 parents 366a333 + 3041a76 commit c2efe5d

File tree

5 files changed

+118
-10
lines changed

5 files changed

+118
-10
lines changed

pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<dist.key>DATACOUCH</dist.key>
2323

24-
<couchbase>2.1.3</couchbase>
24+
<couchbase>2.2.0-dp</couchbase>
2525
<jackson>2.3.2</jackson>
2626
<springdata.commons>1.11.0.BUILD-SNAPSHOT</springdata.commons>
2727
<validation>1.0.0.GA</validation>
@@ -126,6 +126,12 @@
126126
<id>spring-libs-snapshot</id>
127127
<url>https://repo.spring.io/libs-snapshot</url>
128128
</repository>
129+
<repository>
130+
<id>couchbase</id>
131+
<name>couchbase repo</name>
132+
<url>http://files.couchbase.com/maven2</url>
133+
<snapshots><enabled>false</enabled></snapshots>
134+
</repository>
129135
</repositories>
130136

131137
<pluginRepositories>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2012-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.data.couchbase.core;
18+
19+
20+
import com.couchbase.client.java.Bucket;
21+
22+
/**
23+
* Defines common operations on the Couchbase data source, most commonly implemented by {@link CouchbaseTemplate}.
24+
*
25+
* @author Michael Nitschinger
26+
* @author Simon Baslé
27+
*/
28+
public interface CouchbaseOperations {
29+
30+
/**
31+
* Returns the linked {@link Bucket} to this template.
32+
*
33+
* @return the client used for the template.
34+
*/
35+
Bucket getCouchbaseBucket();
36+
37+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright 2012-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.data.couchbase.core;
18+
19+
import com.couchbase.client.java.Bucket;
20+
import org.slf4j.Logger;
21+
import org.slf4j.LoggerFactory;
22+
23+
import org.springframework.context.ApplicationEventPublisher;
24+
import org.springframework.context.ApplicationEventPublisherAware;
25+
26+
/**
27+
* @author Michael Nitschinger
28+
* @author Oliver Gierke
29+
* @author Simon Baslé
30+
*/
31+
public class CouchbaseTemplate implements CouchbaseOperations, ApplicationEventPublisherAware {
32+
33+
private static final Logger LOGGER = LoggerFactory.getLogger(CouchbaseTemplate.class);
34+
35+
private final Bucket client;
36+
37+
private ApplicationEventPublisher eventPublisher;
38+
39+
public CouchbaseTemplate(final Bucket client) {
40+
this.client = client;
41+
}
42+
43+
@Override
44+
public void setApplicationEventPublisher(final ApplicationEventPublisher eventPublisher) {
45+
this.eventPublisher = eventPublisher;
46+
}
47+
48+
@Override
49+
public Bucket getCouchbaseBucket() {
50+
return client;
51+
}
52+
}
Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
1+
/*
2+
* Copyright 2012-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+
117
/**
218
* This package contains the specific implementations and core classes for
3-
* Spring Data Couchbase internals.
19+
* Spring Data Couchbase internals. It also contains Couchbase implementation
20+
* to support the Spring Data template abstraction.
21+
* <br/>
22+
* The template provides lower level access to the underlying database and also serves as the foundation for
23+
* repositories. Any time a repository is too high-level for you needs chances are good that the templates will serve
24+
* you well.
425
*/
526
package org.springframework.data.couchbase.core;

src/main/java/org/springframework/data/couchbase/template/package-info.java

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)