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 019package org.apache.hadoop.yarn.api.records; 020 021import java.nio.ByteBuffer; 022 023import org.apache.hadoop.classification.InterfaceAudience.Private; 024import org.apache.hadoop.classification.InterfaceAudience.Public; 025import org.apache.hadoop.classification.InterfaceStability.Evolving; 026import org.apache.hadoop.classification.InterfaceStability.Stable; 027import org.apache.hadoop.security.token.delegation.AbstractDelegationTokenIdentifier; 028 029/** 030 * The Delegation tokens have a identifier which maps to 031 * {@link AbstractDelegationTokenIdentifier}. 032 * 033 */ 034@Public 035@Evolving 036public interface DelegationToken { 037 /** 038 * Get the token identifier. 039 * @return token identifier 040 */ 041 @Public 042 @Stable 043 ByteBuffer getIdentifier(); 044 045 @Private 046 @Stable 047 void setIdentifier(ByteBuffer identifier); 048 049 /** 050 * Get the token password 051 * @return token password 052 */ 053 @Public 054 @Stable 055 ByteBuffer getPassword(); 056 057 @Private 058 @Stable 059 void setPassword(ByteBuffer password); 060 061 /** 062 * Get the token kind. 063 * @return token kind 064 */ 065 @Public 066 @Stable 067 String getKind(); 068 069 @Private 070 @Stable 071 void setKind(String kind); 072 073 /** 074 * Get the service to which the token is allocated. 075 * @return service to which the token is allocated 076 */ 077 @Public 078 @Stable 079 String getService(); 080 081 @Private 082 @Stable 083 void setService(String service); 084}