001
014
015 package com.liferay.portal.dao.shard;
016
017 import com.liferay.portal.kernel.dao.shard.Shard;
018
019 import javax.sql.DataSource;
020
021
024 public class ShardImpl implements Shard {
025
026 public String getCurrentShardName() {
027 return _shardAdvice.getCurrentShardName();
028 }
029
030 public DataSource getDataSource() {
031 return _shardAdvice.getDataSource();
032 }
033
034 public boolean isEnabled() {
035 if (_shardAdvice != null) {
036 return true;
037 }
038 else {
039 return false;
040 }
041 }
042
043 public String popCompanyService() {
044 String value = null;
045
046 if (_shardAdvice != null) {
047 value = _shardAdvice.popCompanyService();
048 }
049
050 return value;
051 }
052
053 public void pushCompanyService(long companyId) {
054 if (_shardAdvice != null) {
055 _shardAdvice.pushCompanyService(companyId);
056 }
057 }
058
059 public void pushCompanyService(String shardName) {
060 if (_shardAdvice != null) {
061 _shardAdvice.pushCompanyService(shardName);
062 }
063 }
064
065 public void setShardAdvice(ShardAdvice shardAdvice) {
066 _shardAdvice = shardAdvice;
067 }
068
069 private static ShardAdvice _shardAdvice;
070
071 }