blob: 5433fd9642f9f1174ba154485360b9e2b524ce6f [file] [log] [blame]
Jonathan Hart612651f2019-11-25 09:21:43 -08001/*
2 * Copyright 2020-present Open Networking Foundation
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
17package org.opencord.aaa;
18
19import org.onlab.packet.MacAddress;
20import org.onosproject.net.ConnectPoint;
21
22/**
23 * Describes state of an authentication attempt.
24 */
25public class AuthenticationRecord {
26
27 private final ConnectPoint supplicantConnectPoint;
28
29 private final byte[] username;
30
31 private final MacAddress supplicantAddress;
32
33 private final String state;
34
35 /**
36 * Creates a new authentication record.
37 *
38 * @param supplicantConnectPoint connect point
39 * @param username user name
40 * @param supplicantAddress MAC address of supplicant
41 * @param state authentication state
42 */
43 public AuthenticationRecord(ConnectPoint supplicantConnectPoint, byte[] username,
44 MacAddress supplicantAddress, String state) {
45 this.supplicantConnectPoint = supplicantConnectPoint;
46 this.username = username;
47 this.supplicantAddress = supplicantAddress;
48 this.state = state;
49 }
50
51 /**
52 * Gets the connect point of supplicant.
53 *
54 * @return connect point
55 */
56 public ConnectPoint supplicantConnectPoint() {
57 return supplicantConnectPoint;
58 }
59
60 /**
61 * Gets the username of supplicant.
62 *
63 * @return username
64 */
65 public byte[] username() {
66 return username;
67 }
68
69 /**
70 * Gets the MAC address of the supplicant.
71 *
72 * @return MAC address
73 */
74 public MacAddress supplicantAddress() {
75 return supplicantAddress;
76 }
77
78 /**
79 * Gets the current state of the authentication attempt.
80 *
81 * @return state
82 */
83 public String state() {
84 return state;
85 }
86}