com.ibm.wiotp.sdk.devicemgmt.resource

Class Resource<T>

    • Constructor Detail

      • Resource

        public Resource(String resourceResourceName)
      • Resource

        public Resource(String resourceResourceName,
                        T value)
    • Method Detail

      • getValue

        public T getValue()
      • setValue

        public void setValue(T value)
      • setValue

        public void setValue(T value,
                             boolean fireEvent)
      • fireEvent

        protected void fireEvent(boolean fire)
      • fireEvent

        public void fireEvent(String event)
      • notifyExternalListeners

        public void notifyExternalListeners()
      • add

        public void add(Resource child)
      • remove

        public boolean remove(Resource child)
      • remove

        public Resource remove(String resourceResourceName)
        Removes the child with the specified resourceResourceName and returns it. If no child with the specified resourceResourceName is found, the return value is null.
        Parameters:
        resourceResourceName - the resourceResourceName
        Returns:
        the removed resource or null
      • getParent

        public Resource getParent()
      • setParent

        public void setParent(Resource parent)
      • getResourceName

        public String getResourceName()
      • getCanonicalName

        public String getCanonicalName()
      • toJsonObject

        public abstract com.google.gson.JsonElement toJsonObject()
      • addPropertyChangeListener

        public void addPropertyChangeListener(PropertyChangeListener listener)
        Add a new listener to be notified when the value is changed.
        Parameters:
        listener - PropertyChangeListener
      • addPropertyChangeListener

        public void addPropertyChangeListener(Resource.ChangeListenerType type,
                                              PropertyChangeListener listener)
        Add a new listener to be notified when the location is changed.
        Parameters:
        type - The type of listener
        listener - PropertyChangeListener
      • removePropertyChangeListener

        public void removePropertyChangeListener(PropertyChangeListener listener)
        Remove the specified listener.
        Parameters:
        listener - PropertyChangeListener
      • update

        public abstract int update(com.google.gson.JsonElement json)
      • update

        public abstract int update(com.google.gson.JsonElement json,
                                   boolean fireEvent)
      • waitForResponse

        public void waitForResponse(boolean responseRequired)
        Requests that Watson IoT Platform to respond when it receives update notification. This implies that the update call will be blocked until a response is received or timed out.
        Parameters:
        responseRequired - boolean specifying whether response is required or not
      • getRC

        public int getRC()
        Returns the return code of the last location update notification.
        Note 200 is successful.
        Returns:
        Return code
      • setRC

        public void setRC(int rc)
        Used by the client library to set return code received in the response from Watson IoT Platform.
        Parameters:
        rc - return code to be set
      • getResponseRequired

        public boolean getResponseRequired()

Copyright © 2019. All rights reserved.