Interface PinServiceLocal

    • Field Detail

      • PRINCIPAL_LENGTH

        static final int PRINCIPAL_LENGTH
        Length in chars of the generated pin's principal.
        See Also:
        Constant Field Values
      • SALT_LENGTH

        static final int SALT_LENGTH
        Length in chars of the generated pin's salt.
        See Also:
        Constant Field Values
    • Method Detail

      • checkPin

        void checkPin​(Pin pin,
                      String plainPinValue,
                      ChannelAccessAccessor channelAccess)
        Checks the plain pin's value sent by a client ensuring it matched the value stored in the given Pin entity.
      • getIfActive

        Pair<Pin,​ChannelAccessAccessor> getIfActive​(PinLocatorVO pinLocator,
                                                          Channel channel)
        Returns both the Pin and its channel access configuration for the current channel if it is active: exists, not expired and active on channel. Otherwise, returns null.
      • locatePin

        Pin locatePin​(PinLocatorVO locator,
                      boolean ownPin)
        Locates a device pin, either by id or principal. If the ownPin parameter is true then the located pin (if any) must belong to the logged user.
      • pinEnabled

        boolean pinEnabled​(BasicUser user)
        Returns whether the given user has at least one channel with PIN enabled.
      • relatedEntityRemoved

        <T extends NetworkedEntity> void relatedEntityRemoved​(T entity,
                                                              Supplier<T> newEntitySupplier)
        Searches for all Pin instances related to the entity being removed and for all of those, sets the new entity obtained from the supplier as the new related one.
        If the supplier returns null then all related pins are removed.
      • removeExpired

        long removeExpired()
        Removes all expired PINs