001/**002* Licensed to the Apache Software Foundation (ASF) under one003* or more contributor license agreements. See the NOTICE file004* distributed with this work for additional information005* regarding copyright ownership. The ASF licenses this file006* to you under the Apache License, Version 2.0 (the007* "License"); you may not use this file except in compliance008* with the License. You may obtain a copy of the License at009*010* http://www.apache.org/licenses/LICENSE-2.0011*012* Unless required by applicable law or agreed to in writing, software013* 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 and016* limitations under the License.017*/018019package org.apache.hadoop.yarn.security;020021import java.lang.annotation.Annotation;022023import org.apache.hadoop.classification.InterfaceAudience.Public;024import org.apache.hadoop.classification.InterfaceStability.Stable;025import org.apache.hadoop.conf.Configuration;026import org.apache.hadoop.security.KerberosInfo;027import org.apache.hadoop.security.SecurityInfo;028import org.apache.hadoop.security.token.TokenIdentifier;029import org.apache.hadoop.security.token.TokenInfo;030import org.apache.hadoop.security.token.TokenSelector;031import org.apache.hadoop.yarn.api.ApplicationMasterProtocolPB;032033@Public034@Stable035public class SchedulerSecurityInfo extends SecurityInfo {036037 @Override038 public KerberosInfo getKerberosInfo(Class<?> protocol, Configuration conf) {039 return null;040 }041042 @Override043 public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {044 if (!ApplicationMasterProtocolPB.class.isAssignableFrom(protocol)) {045 return null;046 }047 return new TokenInfo() {048049 @Override050 public Class<? extends Annotation> annotationType() {051 return null;052 }053054 @Override055 public Class<? extends TokenSelector<? extends TokenIdentifier>>056 value() {057 return AMRMTokenSelector.class;058 }059 };060 }061}