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.util.List;
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 import org.apache.hadoop.classification.InterfaceStability.Unstable;
027 import org.apache.hadoop.yarn.api.ApplicationClientProtocol;
028 import org.apache.hadoop.yarn.util.Records;
029
030 /**
031 * <p><code>QueueUserACLInfo</code> provides information {@link QueueACL} for
032 * the given user.</p>
033 *
034 * @see QueueACL
035 * @see ApplicationClientProtocol#getQueueUserAcls(org.apache.hadoop.yarn.api.protocolrecords.GetQueueUserAclsInfoRequest)
036 */
037 @Public
038 @Stable
039 public abstract class QueueUserACLInfo {
040
041 @Private
042 @Unstable
043 public static QueueUserACLInfo newInstance(String queueName,
044 List<QueueACL> acls) {
045 QueueUserACLInfo info = Records.newRecord(QueueUserACLInfo.class);
046 info.setQueueName(queueName);
047 info.setUserAcls(acls);
048 return info;
049 }
050
051 /**
052 * Get the <em>queue name</em> of the queue.
053 * @return <em>queue name</em> of the queue
054 */
055 @Public
056 @Stable
057 public abstract String getQueueName();
058
059 @Private
060 @Unstable
061 public abstract void setQueueName(String queueName);
062
063 /**
064 * Get the list of <code>QueueACL</code> for the given user.
065 * @return list of <code>QueueACL</code> for the given user
066 */
067 @Public
068 @Stable
069 public abstract List<QueueACL> getUserAcls();
070
071 @Private
072 @Unstable
073 public abstract void setUserAcls(List<QueueACL> acls);
074 }