1 45 package org.exolab.jms.persistence; 46 47 import java.sql.Connection ; 48 import java.util.Enumeration ; 49 import java.util.HashMap ; 50 import java.util.Vector ; 51 52 import org.exolab.jms.authentication.User; 53 import org.exolab.jms.client.JmsDestination; 54 import org.exolab.jms.message.MessageImpl; 55 import org.exolab.jms.messagemgr.MessageHandle; 56 57 58 68 public abstract class PersistenceAdapter { 69 70 74 public abstract void close(); 75 76 84 public abstract long getLastId(Connection connection) 85 throws PersistenceException; 86 87 94 public abstract void updateIds(Connection connection, long id) 95 throws PersistenceException; 96 97 104 public abstract void addMessage(Connection connection, 105 MessageImpl message) 106 throws PersistenceException; 107 108 115 public abstract void updateMessage(Connection connection, 116 MessageImpl message) 117 throws PersistenceException; 118 119 126 public abstract void removeMessage(Connection connection, 127 String id) 128 throws PersistenceException; 129 130 138 public abstract void removeExpiredMessages(Connection connection) 139 throws PersistenceException; 140 141 149 public abstract void removeExpiredMessageHandles(Connection connection, 150 String consumer) 151 throws PersistenceException; 152 153 162 public abstract Vector getNonExpiredMessages(Connection connection, 163 JmsDestination destination) 164 throws PersistenceException; 165 166 174 public abstract MessageImpl getMessage(Connection connection, 175 String id) 176 throws PersistenceException; 177 178 189 public abstract Vector getMessages(Connection connection, 190 MessageHandle handle) 191 throws PersistenceException; 192 193 201 public abstract Vector getUnprocessedMessages(Connection connection) 202 throws PersistenceException; 203 204 211 public abstract void addMessageHandle(Connection connection, 212 MessageHandle handle) 213 throws PersistenceException; 214 215 222 public abstract void updateMessageHandle(Connection connection, 223 MessageHandle handle) 224 throws PersistenceException; 225 226 234 public abstract void removeMessageHandle(Connection connection, 235 MessageHandle handle) 236 throws PersistenceException; 237 238 251 public abstract Vector getMessageHandles(Connection connection, 252 JmsDestination destination, String name) 253 throws PersistenceException; 254 255 263 public abstract void addDurableConsumer(Connection connection, 264 String topic, String consumer) 265 throws PersistenceException; 266 267 274 public abstract void removeDurableConsumer(Connection connection, 275 String consumer) 276 throws PersistenceException; 277 278 286 public abstract boolean durableConsumerExists(Connection connection, 287 String name) 288 throws PersistenceException; 289 290 299 public abstract Enumeration getDurableConsumers(Connection connection, 300 String topic) 301 throws PersistenceException; 302 303 312 public abstract HashMap getAllDurableConsumers(Connection connection) 313 throws PersistenceException; 314 315 323 public abstract void addDestination(Connection connection, 324 String name, boolean queue) 325 throws PersistenceException; 326 327 336 public abstract void removeDestination(Connection connection, 337 String destination) 338 throws PersistenceException; 339 340 348 public abstract boolean checkDestination(Connection connection, 349 String name) 350 throws PersistenceException; 351 352 359 public abstract Enumeration getAllDestinations(Connection connection) 360 throws PersistenceException; 361 362 370 public abstract int getQueueMessageCount(Connection connection, 371 String name) 372 throws PersistenceException; 373 374 384 public abstract int getDurableConsumerMessageCount(Connection connection, 385 String destination, String name) 386 throws PersistenceException; 387 388 393 public abstract int purgeMessages(); 394 395 401 public abstract Connection getConnection() throws PersistenceException; 402 403 404 public abstract Enumeration getAllUsers(Connection connection) 405 throws PersistenceException; 406 407 public abstract void addUser(Connection connection, User user) 408 throws PersistenceException; 409 410 public abstract void removeUser(Connection connection, 411 User user) 412 throws PersistenceException; 413 414 public abstract void updateUser(Connection connection, 415 User user) 416 throws PersistenceException; 417 418 public abstract User getUser(Connection connection, 419 User user) 420 throws PersistenceException; 421 422 } 423 424 425 426 427 | Popular Tags |