001 /** 002 * Copyright 2005-2011 The Kuali Foundation 003 * 004 * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php 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 org.kuali.rice.ksb.testclient1; 017 018 import org.kuali.rice.ksb.messaging.remotedservices.Message; 019 import org.kuali.rice.ksb.messaging.remotedservices.MessageResource; 020 021 /** 022 * service implementation for {@link MessageResource} 023 * 024 * @author Kuali Rice Team (rice.collab@kuali.org) 025 * 026 */ 027 public class MessageResourceImpl implements MessageResource { 028 029 private Storage storage; 030 031 /** 032 * This overridden method ... 033 * 034 * @see org.kuali.rice.ksb.messaging.remotedservices.MessageResource#createMessage(org.kuali.rice.ksb.messaging.remotedservices.Message) 035 */ 036 public Message createMessage(Message message) { 037 return storage.storeMessage(message); 038 } 039 040 /** 041 * This overridden method ... 042 * 043 * @see org.kuali.rice.ksb.messaging.remotedservices.MessageResource#delete(java.lang.String) 044 */ 045 public void delete(String id) { 046 storage.deleteMessage(id); 047 } 048 049 /** 050 * This overridden method ... 051 * 052 * @see org.kuali.rice.ksb.messaging.remotedservices.MessageResource#retrieve(java.lang.String) 053 */ 054 public Message retrieve(String id) { 055 return storage.retrieveMessage(id); 056 } 057 058 /** 059 * This overridden method ... 060 * 061 * @see org.kuali.rice.ksb.messaging.remotedservices.MessageResource#update(org.kuali.rice.ksb.messaging.remotedservices.Message) 062 */ 063 public void update(Message message) { 064 storage.storeMessage(message); 065 } 066 067 /** 068 * @return the storage 069 */ 070 public Storage getStorage() { 071 return this.storage; 072 } 073 074 /** 075 * @param storage the storage to set 076 */ 077 public void setStorage(Storage storage) { 078 this.storage = storage; 079 } 080 081 }