Brian Stanke | 2b4f32d | 2016-02-03 14:22:10 -0500 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Brian Stanke | 2b4f32d | 2016-02-03 14:22:10 -0500 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Claudine Chiu | 31ad527 | 2016-02-17 20:56:24 +0000 | [diff] [blame] | 17 | package org.onosproject.net.key; |
Brian Stanke | 2b4f32d | 2016-02-03 14:22:10 -0500 | [diff] [blame] | 18 | |
| 19 | /** |
| 20 | * Representation of an SNMP community name authentication token. |
| 21 | */ |
Brian Stanke | 9bf8d7c | 2016-02-11 10:17:23 -0500 | [diff] [blame] | 22 | public final class CommunityName extends DeviceKey { |
Brian Stanke | 2b4f32d | 2016-02-03 14:22:10 -0500 | [diff] [blame] | 23 | private final String name; |
| 24 | |
| 25 | /** |
| 26 | * Private constructor for a community name. |
| 27 | * |
| 28 | * @param name community name |
| 29 | */ |
| 30 | private CommunityName(String name) { |
| 31 | this.name = name; |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Static method to construct a community name. |
| 36 | * |
| 37 | * @param name community name |
| 38 | * @return community name |
| 39 | */ |
| 40 | static CommunityName communityName(String name) { |
| 41 | return new CommunityName(name); |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Returns the community name. |
| 46 | * |
| 47 | * @return name |
| 48 | */ |
| 49 | public String name() { |
| 50 | return name; |
| 51 | } |
| 52 | } |