001 /* 002 * Copyright 2010 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package com.hs.mail.imap.dao; 017 018 import java.util.List; 019 020 import javax.mail.Quota; 021 022 import com.hs.mail.imap.user.Alias; 023 import com.hs.mail.imap.user.User; 024 025 /** 026 * 027 * @author Won Chul Doh 028 * @since Mar 17, 2010 029 * 030 */ 031 public interface UserDao { 032 033 public User getUser(long id); 034 035 public long getUserID(String address); 036 037 public User getUserByAddress(String address); 038 039 public int getUserCount(String domain); 040 041 public List<User> getUserList(String domain, int page, int pageSize); 042 043 public long addUser(User user); 044 045 public int updateUser(User user); 046 047 public int deleteUser(long id); 048 049 public Alias getAlias(long id); 050 051 public int getAliasCount(String domain); 052 053 public List<Alias> getAliasList(String domain, int page, int pageSize); 054 055 public List<Alias> expandAlias(String alias); 056 057 public long addAlias(Alias alias); 058 059 public int updateAlias(Alias alias); 060 061 public int deleteAlias(long id); 062 063 public long getQuotaLimit(long ownerID); 064 065 public long getQuotaUsage(long ownerID); 066 067 public Quota getQuota(long ownerID, String quotaRoot); 068 069 public void setQuota(long ownerID, Quota quota); 070 071 }