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.security.client; 020 021 import org.apache.hadoop.classification.InterfaceAudience; 022 import org.apache.hadoop.classification.InterfaceAudience.Public; 023 import org.apache.hadoop.classification.InterfaceStability.Unstable; 024 import org.apache.hadoop.io.Text; 025 import org.apache.hadoop.security.token.Token; 026 import org.apache.hadoop.security.token.delegation.AbstractDelegationTokenIdentifier; 027 028 @Public 029 @Unstable 030 public class TimelineDelegationTokenIdentifier extends AbstractDelegationTokenIdentifier { 031 032 public static final Text KIND_NAME = new Text("TIMELINE_DELEGATION_TOKEN"); 033 034 public TimelineDelegationTokenIdentifier() { 035 036 } 037 038 /** 039 * Create a new timeline delegation token identifier 040 * 041 * @param owner the effective username of the token owner 042 * @param renewer the username of the renewer 043 * @param realUser the real username of the token owner 044 */ 045 public TimelineDelegationTokenIdentifier(Text owner, Text renewer, 046 Text realUser) { 047 super(owner, renewer, realUser); 048 } 049 050 @Override 051 public Text getKind() { 052 return KIND_NAME; 053 } 054 055 @InterfaceAudience.Private 056 public static class Renewer extends Token.TrivialRenewer { 057 @Override 058 protected Text getKind() { 059 return KIND_NAME; 060 } 061 } 062 063 }