001
014
015 package com.liferay.portal.service.impl;
016
017 import com.liferay.portal.kernel.exception.SystemException;
018 import com.liferay.portal.kernel.util.StringUtil;
019 import com.liferay.portal.model.ClusterGroup;
020 import com.liferay.portal.service.base.ClusterGroupLocalServiceBaseImpl;
021
022 import java.util.List;
023
024
028 public class ClusterGroupLocalServiceImpl
029 extends ClusterGroupLocalServiceBaseImpl {
030
031 @Override
032 public ClusterGroup addClusterGroup(
033 String name, List<String> clusterNodeIds)
034 throws SystemException {
035
036 long clusterGroupId = counterLocalService.increment();
037
038 ClusterGroup clusterGroup = clusterGroupPersistence.create(
039 clusterGroupId);
040
041 clusterGroup.setName(name);
042 clusterGroup.setClusterNodeIds(StringUtil.merge(clusterNodeIds));
043
044 return clusterGroupPersistence.update(clusterGroup, false);
045 }
046
047 @Override
048 public ClusterGroup addWholeClusterGroup(String name)
049 throws SystemException {
050
051 long clusterGroupId = counterLocalService.increment();
052
053 ClusterGroup clusterGroup = clusterGroupPersistence.create(
054 clusterGroupId);
055
056 clusterGroup.setName(name);
057 clusterGroup.setWholeCluster(true);
058
059 return clusterGroupPersistence.update(clusterGroup, false);
060 }
061
062 }