Class RefreshableTokenDataImpl

    • Constructor Detail

      • RefreshableTokenDataImpl

        public RefreshableTokenDataImpl​(String accessToken,
                                        String scope,
                                        String oauthLogin,
                                        int timeToLiveSeconds,
                                        long teamCityUserId,
                                        long createTime)
    • Method Detail

      • getAccessibleEntities

        @Nullable
        public Set<String> getAccessibleEntities()
        Description copied from interface: RefreshableTokenData
        A token could be not only limited by its scope, but also by the entities that can be accessed with it, such as repositories for example
        Specified by:
        getAccessibleEntities in interface RefreshableTokenData
        Returns:
        a set of ids or names of such entities, if null no such restrictions apply
      • setAccessibleEntities

        public void setAccessibleEntities​(@Nullable
                                          Collection<String> accessibleEntities)
        Description copied from interface: RefreshableTokenData
        Sets accessible entities
        Specified by:
        setAccessibleEntities in interface RefreshableTokenData
        Parameters:
        accessibleEntities - a collection of ids or names of entities that can be accessed with the token, null if no such restrictions apply
      • isAllowedForEntity

        public boolean isAllowedForEntity​(String entityId)
        Specified by:
        isAllowedForEntity in interface RefreshableTokenData
        Parameters:
        entityId - entity id or name
        Returns:
        true if the token is explicitly permitted to access this entity or if it has no such restrictions
      • isPermanent

        public boolean isPermanent()
        Specified by:
        isPermanent in interface RefreshableTokenData
        Returns:
        true if token is permanent and never expires, false otherwise
      • getTeamCityUserId

        public long getTeamCityUserId()
        Specified by:
        getTeamCityUserId in interface RefreshableTokenData
        Returns:
        teamcity user id associated with the token, a negative value if the token is non-personal
      • setRefreshToken

        public void setRefreshToken​(@NotNull
                                    String refreshToken)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • addContextKeys

        public void addContextKeys​(@Nullable
                                   Collection<String> contextKeys)
        Description copied from interface: RefreshableTokenData
        Adds context keys defining where the token is applicable
        Specified by:
        addContextKeys in interface RefreshableTokenData
        Parameters:
        contextKeys - context keys collection or null if the token is supposed to be applicable everywhere
      • getRecordCreateTimeMs

        @Nullable
        public Long getRecordCreateTimeMs()
        Description copied from interface: RefreshableTokenData
        This returns the logical creation timestamp of the token record. This means the first time this particular token record was initially persisted. The value will not change even if the token is refreshed / replaced.
        Specified by:
        getRecordCreateTimeMs in interface RefreshableTokenData
        Returns:
        the timestamp of the logical token record's creation in milliseconds since the epoch, or null if the value isn't known
      • setRecordCreateTimeMs

        public void setRecordCreateTimeMs​(@Nullable
                                          Long recordCreateTimeMs)
      • setName

        public void setName​(@Nullable
                            String name)
      • getFailedToRefresh

        @Nullable
        public Boolean getFailedToRefresh()
        Specified by:
        getFailedToRefresh in interface RefreshableTokenData
        Returns:
        optional marker if this token has been flagged as failing to refresh in the past
      • setFailedToRefresh

        public void setFailedToRefresh​(@Nullable
                                       Boolean failedToRefresh)