Esempio n. 1
0
 public EmlGroupVo getByName(String principal) {
   int i = principal.indexOf("@");
   String userName = principal.substring(0, i);
   String host = principal.substring(i + 1);
   EmlGroup group = groupDao.selectGroup(userName, host);
   return new EmlGroupVo(group);
 }
Esempio n. 2
0
  @Transactional(value = "rest_tm")
  public void add(String clientId, EmlGroupVo groupVo) {

    groupVo.setClientId(clientId);

    // 그룹 설정 초기화
    groupVo.setServerConfig(new EmlGroupConfigVo());

    // 엔티티 생성

    EmlGroup group = new EmlGroup(groupVo);

    // 아이디 생성
    group.setId(idProvider.next());

    StringWriter writer = new StringWriter();
    try {
      objectMapper.writeValue(writer, groupVo.getServerConfig());
    } catch (IOException e) {
      e.printStackTrace();
    }

    group.setServerConfig(writer.toString());

    // 그룹 엔티티 추가
    logger.debug("그룹을 추가합니다.: " + group);
    groupDao.insert(group);

    groupVo.setId(group.getId());
  }
Esempio n. 3
0
  public EmlGroupVo get(String clientId, String groupId) {
    EmlGroup emlGroup = groupDao.selectGroup(groupId);

    EmlGroupVo emlGroupVo = new EmlGroupVo(emlGroup);
    try {
      EmlGroupConfigVo emlGroupConfigVo =
          objectMapper.readValue(emlGroup.getServerConfig(), EmlGroupConfigVo.class);
      emlGroupVo.setServerConfig(emlGroupConfigVo);

    } catch (IOException e) {
      e.printStackTrace();
    }
    return emlGroupVo;
  }
Esempio n. 4
0
  public List<EmlGroupVo> list(String clientId) {
    List<EmlGroup> emlGroupList = groupDao.list(clientId);
    List<EmlGroupVo> emlGroupVoList = new ArrayList<EmlGroupVo>();
    for (EmlGroup emlGroup : emlGroupList) {
      EmlGroupVo emlGroupVo = new EmlGroupVo(emlGroup);
      try {
        EmlGroupConfigVo emlGroupConfigVo =
            objectMapper.readValue(emlGroup.getServerConfig(), EmlGroupConfigVo.class);
        emlGroupVo.setServerConfig(emlGroupConfigVo);

      } catch (IOException e) {
        e.printStackTrace();
      }
      emlGroupVoList.add(emlGroupVo);
    }
    return emlGroupVoList;
  }
Esempio n. 5
0
 public EmlGroupVo getByName(String userName, String host) {
   EmlGroup group = groupDao.selectGroup(userName, host);
   return new EmlGroupVo(group);
 }
Esempio n. 6
0
 @Transactional(value = "rest_tm")
 public void updateState(String clientId, String groupId, String groupState) {
   groupDao.updateState(groupId, groupState);
 }
Esempio n. 7
0
 @Transactional(value = "rest_tm")
 public void updateQuota(String clientId, String groupId, long groupQuota) {
   groupDao.updateQuota(groupId, groupQuota);
 }
Esempio n. 8
0
 @Transactional(value = "rest_tm")
 public void updateName(String clientId, String groupId, String displayName) {
   groupDao.updateDisplayName(groupId, displayName);
 }
Esempio n. 9
0
 @Transactional(value = "rest_tm")
 public void remove(String clientId, String groupId) {
   groupDao.delete(groupId);
 }