1
14
15 package com.liferay.portal.dao.shard;
16
17 import com.liferay.portal.kernel.dao.shard.Shard;
18
19 import javax.sql.DataSource;
20
21
26 public class ShardImpl implements Shard {
27
28 public String getCurrentShardName() {
29 return _shardAdvice.getCurrentShardName();
30 }
31
32 public DataSource getDataSource() {
33 return _shardAdvice.getDataSource();
34 }
35
36 public boolean isEnabled() {
37 if (_shardAdvice != null) {
38 return true;
39 }
40 else {
41 return false;
42 }
43 }
44
45 public String popCompanyService() {
46 String value = null;
47
48 if (_shardAdvice != null) {
49 value = _shardAdvice.popCompanyService();
50 }
51
52 return value;
53 }
54
55 public void pushCompanyService(long companyId) {
56 if (_shardAdvice != null) {
57 _shardAdvice.pushCompanyService(companyId);
58 }
59 }
60
61 public void pushCompanyService(String shardName) {
62 if (_shardAdvice != null) {
63 _shardAdvice.pushCompanyService(shardName);
64 }
65 }
66
67 public void setShardAdvice(ShardAdvice shardAdvice) {
68 _shardAdvice = shardAdvice;
69 }
70
71 private static ShardAdvice _shardAdvice;
72
73 }