/* * Created on Aug 18, 2004 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package net.reliableresponse.notification.device; import java.util.Hashtable; import net.reliableresponse.notification.broker.BrokerFactory; import net.reliableresponse.notification.broker.ConfigurationBroker; import net.reliableresponse.notification.providers.AIMNotificationProvider; import net.reliableresponse.notification.providers.NotificationProvider; /** * @author drig * * Copyright 2004 - David Rudder */ public class AIMDevice extends AbstractDevice { String account; public AIMDevice () { } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#getSettings() */ public DeviceSetting[] getAvailableSettings() { DeviceSetting[] settings = new DeviceSetting[1]; settings[0] = new DeviceSetting ("Account Name", String.class, null, true, null); return settings; } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#initialize(java.util.Hashtable) */ public void initialize(Hashtable options) { account = (String)options.get("Account Name"); } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#getName() */ public String getName() { return "AIM"; } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#getDescription() */ public String getDescription() { return "AIM account at "+account; } public String getAccount() { return account; } public int getMaxBytesSize() { return 600; } public int getMaxCharactersSize() { return getMaxBytesSize(); } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#supportsSendingText() */ public boolean supportsSendingText() { return true; } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#supportsSendingAudio() */ public boolean supportsSendingAudio() { return false; } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#supportsSendingImages() */ public boolean supportsSendingImages() { return false; } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#supportsSendingVideo() */ public boolean supportsSendingVideo() { return false; } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#supportsReceivingText() */ public boolean supportsReceivingText() { return false; } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#supportsReceivingAudio() */ public boolean supportsReceivingAudio() { return false; } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#supportsReceivingImages() */ public boolean supportsReceivingImages() { return false; } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#supportsReceivingVideo() */ public boolean supportsReceivingVideo() { return false; } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#supportsDeviceStatus() */ public boolean supportsDeviceStatus() { return true; } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#supportsMessageStatus() */ public boolean supportsMessageStatus() { return false; } /** * Returns the settings that have been set in this object * @return The settings that were supplied in the initialization */ public Hashtable getSettings() { Hashtable settings = new Hashtable(); settings.put ("Account Name", account); return settings; } /* (non-Javadoc) * @see net.reliableresponse.notification.device.Device#getNotificationProvider() */ public NotificationProvider getNotificationProvider() { ConfigurationBroker broker = BrokerFactory.getConfigurationBroker(); return new AIMNotificationProvider(); } public String toString() { return "AIM @"+getAccount(); } /** * This returns a short identifier for this device, typically the address */ public String getShortIdentifier() { return getAccount(); } }