Class TokenBuilder


  • @Deprecated
    public final class TokenBuilder
    extends Object
    Deprecated.
    As of 0.9 in favor of Token.Builder.
    A builder for vault tokens.
    Since:
    0.4.0
    Author:
    Stefan Kalscheuer
    • Constructor Detail

      • TokenBuilder

        public TokenBuilder()
        Deprecated.
    • Method Detail

      • withId

        public TokenBuilder withId​(String id)
        Deprecated.
        Add token ID. (optional)
        Parameters:
        id - the ID
        Returns:
        self
      • withType

        public TokenBuilder withType​(Token.Type type)
        Deprecated.
        Specify token type.
        Parameters:
        type - the type
        Returns:
        self
        Since:
        0.9
      • withDisplayName

        public TokenBuilder withDisplayName​(String displayName)
        Deprecated.
        Add display name.
        Parameters:
        displayName - the display name
        Returns:
        self
      • withTtl

        public TokenBuilder withTtl​(Integer ttl)
        Deprecated.
        Set desired time to live.
        Parameters:
        ttl - the ttl
        Returns:
        self
      • withNumUses

        public TokenBuilder withNumUses​(Integer numUses)
        Deprecated.
        Set desired number of uses.
        Parameters:
        numUses - the number of uses
        Returns:
        self
      • withNoParent

        public TokenBuilder withNoParent​(boolean noParent)
        Deprecated.
        Set TRUE if the token should be created without parent.
        Parameters:
        noParent - if TRUE, token is created as orphan
        Returns:
        self
      • asOrphan

        public TokenBuilder asOrphan()
        Deprecated.
        Create token without parent. Convenience method for withNoParent()
        Returns:
        self
      • withParent

        public TokenBuilder withParent()
        Deprecated.
        Create token with parent. Convenience method for withNoParent()
        Returns:
        self
      • withNoDefaultPolicy

        public TokenBuilder withNoDefaultPolicy​(boolean noDefaultPolicy)
        Deprecated.
        Set TRUE if the default policy should not be part of this token.
        Parameters:
        noDefaultPolicy - if TRUE, default policy is not attached
        Returns:
        self
      • withDefaultPolicy

        public TokenBuilder withDefaultPolicy()
        Deprecated.
        Attach default policy to token. Convenience method for withNoDefaultPolicy()
        Returns:
        self
      • withoutDefaultPolicy

        public TokenBuilder withoutDefaultPolicy()
        Deprecated.
        Do not attach default policy to token. Convenience method for withNoDefaultPolicy()
        Returns:
        self
      • withPolicies

        public TokenBuilder withPolicies​(String... policies)
        Deprecated.
        Add given policies.
        Parameters:
        policies - the policies
        Returns:
        self
        Since:
        0.5.0
      • withPolicies

        public TokenBuilder withPolicies​(List<String> policies)
        Deprecated.
        Add given policies.
        Parameters:
        policies - the policies
        Returns:
        self
      • withPolicy

        public TokenBuilder withPolicy​(String policy)
        Deprecated.
        Add a single policy.
        Parameters:
        policy - the policy
        Returns:
        self
      • withMeta

        public TokenBuilder withMeta​(Map<String,​String> meta)
        Deprecated.
        Add meta data.
        Parameters:
        meta - the metadata
        Returns:
        self
      • withMeta

        public TokenBuilder withMeta​(String key,
                                     String value)
        Deprecated.
        Add meta data.
        Parameters:
        key - the key
        value - the value
        Returns:
        self
      • withRenewable

        public TokenBuilder withRenewable​(Boolean renewable)
        Deprecated.
        Set if token is renewable.
        Parameters:
        renewable - TRUE, if renewable
        Returns:
        self
      • renewable

        public TokenBuilder renewable()
        Deprecated.
        Set token to be renewable. Convenience method for withRenewable()
        Returns:
        self
      • notRenewable

        public TokenBuilder notRenewable()
        Deprecated.
        Set token to be not renewable. Convenience method for withRenewable()
        Returns:
        self
      • build

        public Token build()
        Deprecated.
        Build the token based on given parameters.
        Returns:
        the token