xlawrence 2005/02/11 14:43:12 CET
Added files: calClient/src/java/org/jahia/suite/calendar/calServer StorableFactory.java SyncManagerFactory.java TransportReceiverFactory.java Log: Added Factory implementation classes Revision Changes Path 1.1 +40 -0 uwcal_JSR168/calClient/src/java/org/jahia/suite/calendar/calServer/StorableFactory.java (new) http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/calClient/src/java/org/jahia/suite/calendar/calServer/StorableFactory.java?rev=1.1&content-type=text/plain 1.1 +60 -0 uwcal_JSR168/calClient/src/java/org/jahia/suite/calendar/calServer/SyncManagerFactory.java (new) http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/calClient/src/java/org/jahia/suite/calendar/calServer/SyncManagerFactory.java?rev=1.1&content-type=text/plain 1.1 +61 -0 uwcal_JSR168/calClient/src/java/org/jahia/suite/calendar/calServer/TransportReceiverFactory.java (new) http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/calClient/src/java/org/jahia/suite/calendar/calServer/TransportReceiverFactory.java?rev=1.1&content-type=text/plain Index: StorableFactory.java ==================================================================== /* * StorableFactory.java * * Created on 10. février 2005, 16:33 */ package org.jahia.suite.calendar.calServer; import org.jahia.suite.calendar.framework.StorableFactoryIF; import org.jahia.suite.calendar.framework.Storable; /** * * @author Xavier Lawrence */ public class StorableFactory implements StorableFactoryIF { public static final String UWCAL = "UWCAL"; /** * @see StorableFactoryIF */ public Storable createStorable(String key) { if (UWCAL.equals(key)) { throw new RuntimeException("Please use: "+ "createStorable(String key, String userName, String device)"); } throw new IllegalArgumentException("Unknown key value: "+key); } /** * @see StorableFactoryIF */ public Storable createStorable(String key, String userName, String device) { if (UWCAL.equals(key)) { return new UwCalConnector(userName, device); } throw new IllegalArgumentException("Unknown key value: "+key); } } Index: SyncManagerFactory.java ==================================================================== /* * ____. * __/\ ______| |__/\. _______ * __ .____| | \ | +----+ \ * _______| /--| | | - \ _ | : - \_________ * \\______: :---| : : | : | \________> * |__\---\_____________:______: :____|____:_____\ * /_____| * * . . . i n j a h i a w e t r u s t . . . * * * * ----- BEGIN LICENSE BLOCK ----- * Version: JCSL 1.0 * * The contents of this file are subject to the Jahia Community Source License * 1.0 or later (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.jahia.org/license * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the rights, obligations and limitations governing use of the contents * of the file. The Original and Upgraded Code is the Jahia CMS and Portal * Server. The developer of the Original and Upgraded Code is JAHIA Ltd. JAHIA * Ltd. owns the copyrights in the portions it created. All Rights Reserved. * * The Shared Modifications are Jahia View Helper. * * The Developer of the Shared Modifications is Jahia Solution Sàrl. * Portions created by the Initial Developer are Copyright (C) 2002 by the * Initial Developer. All Rights Reserved. * * ----- END LICENSE BLOCK ----- */ package org.jahia.suite.calendar.calServer; import org.jahia.suite.calendar.framework.SyncManagerFactoryIF; import org.jahia.suite.calendar.framework.SyncManager; /** * * @author Xavier Lawrence */ public class SyncManagerFactory implements SyncManagerFactoryIF { public static final String BASIC = "BASIC"; /** * @see SyncManagerFactoryIF */ public SyncManager createSyncManager(String key) { if (BASIC.equals(key)) { return SyncManagerImpl.getInstance(); } throw new IllegalArgumentException("Unknown key value: "+key); } } Index: TransportReceiverFactory.java ==================================================================== /* * ____. * __/\ ______| |__/\. _______ * __ .____| | \ | +----+ \ * _______| /--| | | - \ _ | : - \_________ * \\______: :---| : : | : | \________> * |__\---\_____________:______: :____|____:_____\ * /_____| * * . . . i n j a h i a w e t r u s t . . . * * * * ----- BEGIN LICENSE BLOCK ----- * Version: JCSL 1.0 * * The contents of this file are subject to the Jahia Community Source License * 1.0 or later (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.jahia.org/license * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the rights, obligations and limitations governing use of the contents * of the file. The Original and Upgraded Code is the Jahia CMS and Portal * Server. The developer of the Original and Upgraded Code is JAHIA Ltd. JAHIA * Ltd. owns the copyrights in the portions it created. All Rights Reserved. * * The Shared Modifications are Jahia View Helper. * * The Developer of the Shared Modifications is Jahia Solution Sàrl. * Portions created by the Initial Developer are Copyright (C) 2002 by the * Initial Developer. All Rights Reserved. * * ----- END LICENSE BLOCK ----- */ package org.jahia.suite.calendar.calServer; import org.jahia.suite.calendar.framework.TransportReceiverFactoryIF; import org.jahia.suite.calendar.framework.TransportReceiver; /** * * @author Xavier Lawrence */ public class TransportReceiverFactory implements TransportReceiverFactoryIF { public static final String JMS = "JMS"; /** * @see TransportReceiverFactoryIF */ public TransportReceiver createTransportReceiver(String key) { if (JMS.equals(key)) { return new JMSAgent(JMSAgent.CAL_SERVER_QUEUE, "calServer", "calServer"); } throw new IllegalArgumentException("Unknown key value: "+key); } }