View Javadoc

1   /**
2    * Copyright 2005-2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.ksb.testclient1;
17  
18  import org.kuali.rice.ksb.messaging.remotedservices.Message;
19  import org.kuali.rice.ksb.messaging.remotedservices.MessageResource;
20  
21  /**
22   * service implementation for {@link MessageResource}
23   *
24   * @author Kuali Rice Team (rice.collab@kuali.org)
25   *
26   */
27  public class MessageResourceImpl implements MessageResource {
28  
29  	private Storage storage;
30  
31  	/**
32  	 * This overridden method ...
33  	 *
34  	 * @see org.kuali.rice.ksb.messaging.remotedservices.MessageResource#createMessage(org.kuali.rice.ksb.messaging.remotedservices.Message)
35  	 */
36  	public Message createMessage(Message message) {
37  		return storage.storeMessage(message);
38  	}
39  
40  	/**
41  	 * This overridden method ...
42  	 *
43  	 * @see org.kuali.rice.ksb.messaging.remotedservices.MessageResource#delete(java.lang.String)
44  	 */
45  	public void delete(String id) {
46  		storage.deleteMessage(id);
47  	}
48  
49  	/**
50  	 * This overridden method ...
51  	 *
52  	 * @see org.kuali.rice.ksb.messaging.remotedservices.MessageResource#retrieve(java.lang.String)
53  	 */
54  	public Message retrieve(String id) {
55  		return storage.retrieveMessage(id);
56  	}
57  
58  	/**
59  	 * This overridden method ...
60  	 *
61  	 * @see org.kuali.rice.ksb.messaging.remotedservices.MessageResource#update(org.kuali.rice.ksb.messaging.remotedservices.Message)
62  	 */
63  	public void update(Message message) {
64  		storage.storeMessage(message);
65  	}
66  
67  	/**
68  	 * @return the storage
69  	 */
70  	public Storage getStorage() {
71  		return this.storage;
72  	}
73  
74  	/**
75  	 * @param storage the storage to set
76  	 */
77  	public void setStorage(Storage storage) {
78  		this.storage = storage;
79  	}
80  
81  }