1 18 19 package sync4j.exchange.items.common.manager; 20 21 import java.io.IOException ; 22 23 import sync4j.exchange.items.common.dao.ItemDAO; 24 import sync4j.exchange.items.common.model.Item; 25 import sync4j.exchange.DataAccessException; 26 27 35 public class ItemManager { 36 37 39 41 43 ItemDAO id = null ; 44 45 47 public ItemManager () 48 throws DataAccessException { 49 50 this.id = new ItemDAO (); 51 52 } 53 54 public ItemManager (String host , 55 int port ) 56 throws DataAccessException { 57 58 this.id = new ItemDAO (host, port); 59 } 60 61 63 71 public void deleteLocalItems(String sourceURI, String principal) 72 throws DataAccessException { 73 74 id.deleteLocalItems(sourceURI, principal); 75 76 } 77 78 88 public Item[] getLocalItems (String sourceURI, String principal) 89 throws DataAccessException { 90 91 return id.getLocalItems (sourceURI, principal); 92 93 } 94 95 106 public void addLocalItems (Item[] localItems , 107 String sourceURI , 108 String principal ) 109 throws DataAccessException { 110 111 id.addLocalItems (localItems, sourceURI, principal); 112 113 } 114 115 124 public void updateLocalItems(Item[] localItems , 125 String sourceURI , 126 String principal ) 127 throws DataAccessException { 128 129 this.deleteLocalItems (sourceURI, principal); 130 this.addLocalItems (localItems, sourceURI, principal); 131 132 } 133 134 145 public Item[] getExchangeItems(String username , 146 String credentials , 147 String exchangeFolder ) 148 throws DataAccessException { 149 150 return id.getAllExchangeItems(username , 151 credentials , 152 exchangeFolder); 153 } 154 155 156 167 public int getExchangeAccessStatus(String exchangeServerName , 168 String userName , 169 String credentials ) 170 throws DataAccessException { 171 172 return id.getExchangeAccessStatus(exchangeServerName , 173 userName , 174 credentials ); 175 } 176 177 178 } | Popular Tags |