public byte[] getPhoto() throws IOException { String photo = this.attributeManager.getAttribute("photo"); byte[] pic = Utilities.decodeBinaryData(photo); return pic; } }
public static EventManager getInstance() { return (EventManager)ServiceManager.locate("common://EventManager"); } //------------------------------------------------------------------------------------
/** * Sets the list of places near the address associated with the context * * @param places */ public void setNearbyPlaces(List<Place> places) { this.attributeManager.setAttribute("places", places); }
/** * Gets an arbitrary attribute value from the context * * @param name * @return */ public Object getAttribute(String name) { return this.attributeManager.getAttribute(name); }
/** * Removes an attribute * * @param name */ public void removeAttribute(String name) { this.attributeManager.removeAttribute(name); }
/** * Sets arbitrary attributes representing the contextual data associated with this particular context * * @param name * @param value */ public void setAttribute(String name, String value) { this.attributeManager.setAttribute(name, value); }
public String[] scanForNew(Device device, Date lastScanTimestamp) { if(this.newCount != 0) { this.newCount--; return new String[]{Utilities.generateUID(), Utilities.generateUID(), Utilities.generateUID()}; } return null; }
/** * Removes an attribute associated with the context * * @param name */ public void removeAttribute(String name) { this.attributeManager.removeAttribute(name); } }
/** * Gets all the names that identify values of attributes in the context * * @return */ public String[] getNames() { return this.attributeManager.getNames(); }
/** * Gets all the values of attributes in the context * * @return */ public String[] getValues() { return this.attributeManager.getValues(); }
/** * Gets all the names that identify values of attributes in the context * * @return */ public String[] getNames() { return this.attributeManager.getNames(); }
public static Database getInstance() throws DBException { return (Database)ServiceManager.locate("simulator://Database"); } //----------Select operations------------------------------------------------------------------------------------------------------------
/** * Set the details associated with a place * * @param placeDetails */ public void setPlaceDetails(Place placeDetails) { this.attributeManager.setAttribute("placeDetails", placeDetails); }
/** * Get the details associated with a place * * @return */ public Place getPlaceDetails() { return (Place)this.attributeManager.getAttribute("placeDetails"); }
public void removeAttribute(String name) { this.attributes.removeAttribute(name); } //-------------------------------------------------------------------------------------------------------
/** * Set the radius of how far to look for nearby places * * @param radius */ public void setRadius(int radius) { this.attributeManager.setAttribute("radius", ""+radius); }
/** * Gets a related "map" of string data representing the contextual data associated * with this particular service request * * @param name * @return */ public Map<String,String> getMapAttribute(String name) { return (Map<String,String>)this.attributeManager.getAttribute(name); }
public void setSenderUri(String senderUri) { this.attributes.setAttribute("sender-uri", senderUri); } //------------------------------------------------------------------------------------------------------------
/** * Set the type of places to search for * * @return */ public List<String> getPlaceTypes() { return (List<String>)this.attributeManager.getAttribute("placeTypes"); }
/** * Sets the Latitude of the address associated with this context * * @param latitude */ public void setLatitude(String latitude) { this.attributeManager.setAttribute("latitude", latitude); }