Class UserDevice

    • Method Detail

      • getQuery

        public static ItemQuery<UserDevice> getQuery​(User user)
        Get a query configured to retrieve devices for the specified user.
        Parameters:
        user - The user to retreive devices for, null is allowed if the logged in user has generic READ permission for devices in which case all devices will be returned
        Returns:
        An ItemQuery object
      • getType

        public Item getType()
        Description copied from interface: Identifiable
        Get the type of item represented by the object. The returned value is one of the values defined in the Item enumeration.
        Specified by:
        getType in interface Identifiable
        Returns:
        A value indicating the type of item
      • initPermissions

        void initPermissions​(int granted,
                             int denied)
                      throws BaseException
        DELETE permission is granted if the logged in user is the owner of this device.
        Overrides:
        initPermissions in class BasicItem
        Parameters:
        granted - Permissions that have been granted by the subclass
        denied - Permissions that have been denied by the subclass
        Throws:
        BaseException - If the permissions couldn't be initialised
      • getEntryDate

        public Date getEntryDate()
        Description copied from interface: Registered
        Get the date that the item was registered in the database.
        Specified by:
        getEntryDate in interface Registered
        Returns:
        A date or null if this is not known
      • setEntryDate

        public void setEntryDate​(Date entryDate)
        Description copied from interface: Registered
        Set the date the entry was registered in the database. Implementations should only allow this property to be set before the item is first stored in the database. The intention of this method is to facilitate export/import of data between server.
        Specified by:
        setEntryDate in interface Registered
        Parameters:
        entryDate - A date or null to use today's date
      • getName

        public String getName()
        Description copied from interface: Nameable
        Get the name of the item.
        Specified by:
        getName in interface Nameable
        Returns:
        A String with the name of the item
      • getDescription

        public String getDescription()
        Description copied from interface: Nameable
        Get the description for the item.
        Specified by:
        getDescription in interface Nameable
        Returns:
        A String with a description of the item
      • getLastUsed

        public Date getLastUsed()
        Get the date and time the user last used this device.
        Returns:
        A Date object with the date and time
      • getUserAgent

        public String getUserAgent()
        Get the user agent string of this device.
      • getLastRemoteId

        public String getLastRemoteId()
        Get the remote ID of the host the user used for this device the last time. Typically it is the IP-address of the user's computer.
        Returns:
        A String object with remote ID
      • getLocation

        public String getLocation()
        Get the last known location of the device.
        Returns:
        A String object with location or null if not known
      • getLocationLatitude

        public Float getLocationLatitude()
        Get the last known location latitude of the device.
        Returns:
        A Float object with latitude or null if not known
      • getLocationLongitude

        public Float getLocationLongitude()
        Get the last known location longitude of the device.
        Returns:
        A Float object with longitude or null if not known