001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements.  See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership.  The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the
007     * "License"); you may not use this file except in compliance
008     * with the License.  You may obtain a copy of the License at
009     *
010     *     http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing, software
013     * distributed under the License is distributed on an "AS IS" BASIS,
014     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015     * See the License for the specific language governing permissions and
016     * limitations under the License.
017     */
018    
019    package org.apache.hadoop.yarn.api.records;
020    
021    import java.nio.ByteBuffer;
022    
023    import org.apache.hadoop.classification.InterfaceAudience.Private;
024    import org.apache.hadoop.classification.InterfaceAudience.Public;
025    import org.apache.hadoop.classification.InterfaceStability.Stable;
026    
027    /**
028     * <p><code>Token</code> is the security entity used by the framework
029     * to verify authenticity of any resource.</p>
030     */
031    @Public
032    @Stable
033    public interface Token {
034      /**
035       * Get the token identifier.
036       * @return token identifier
037       */
038      @Public
039      @Stable
040      ByteBuffer getIdentifier();
041      
042      @Private
043      @Stable
044      void setIdentifier(ByteBuffer identifier);
045    
046      /**
047       * Get the token password
048       * @return token password
049       */
050      @Public
051      @Stable
052      ByteBuffer getPassword();
053      
054      @Private
055      @Stable
056      void setPassword(ByteBuffer password);
057    
058      /**
059       * Get the token kind.
060       * @return token kind
061       */
062      @Public
063      @Stable
064      String getKind();
065      
066      @Private
067      @Stable
068      void setKind(String kind);
069    
070      /**
071       * Get the service to which the token is allocated.
072       * @return service to which the token is allocated
073       */
074      @Public
075      @Stable
076      String getService();
077    
078      @Private
079      @Stable
080      void setService(String service);
081    
082    }