001package org.intellimate.izou.sdk.frameworks.presence.resources; 002 003import org.intellimate.izou.identification.Identification; 004import org.intellimate.izou.sdk.frameworks.presence.provider.Presence; 005import org.intellimate.izou.sdk.resource.Resource; 006 007import java.util.HashMap; 008 009/** 010 * returns true if the user might be around. 011 * Please note: this resource is an educated guess and does not guarantee presence. 012 * Addons that are only indicating presence (for example through scanning wifi) should not respond if some stronger 013 * indicators are present. 014 * @author LeanderK 015 * @version 1.0 016 */ 017public class PresenceResource extends Resource<HashMap<String, Object>> { 018 public static final String ID = "izou.presence.resources.presence"; 019 020 /** 021 * creates a new Resource. 022 * This method is thread-safe. 023 * 024 * @param provider the Provider of the Resource 025 */ 026 public PresenceResource(Identification provider) { 027 super(ID, provider); 028 } 029 030 /** 031 * creates a new Resource. 032 * This method is thread-safe. 033 * 034 * @param provider the Provider of the Resource 035 * @param presence the resource 036 */ 037 public PresenceResource(Identification provider, Presence presence) { 038 super(ID, provider, presence.export()); 039 } 040 041 /** 042 * creates a new Resource. 043 * This method is thread-safe. 044 * 045 * @param provider the Provider of the Resource 046 * @param consumer the ID of the Consumer 047 */ 048 public PresenceResource(Identification provider, Identification consumer) { 049 super(ID, provider, consumer); 050 } 051 052 /** 053 * creates a new Resource. 054 * This method is thread-safe. 055 * 056 * @param provider the Provider of the Resource 057 * @param presence the resource 058 * @param consumer the ID of the Consumer 059 */ 060 public PresenceResource(Identification provider, Presence presence, Identification consumer) { 061 super(ID, provider, presence.export(), consumer); 062 } 063}