author | martin |
Thu, 30 Oct 2014 07:31:41 -0700 | |
changeset 28059 | e576535359cc |
parent 25859 | 3317bb8137f4 |
child 30044 | bab15bbe2ca3 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
23010
6dadb192ad81
8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents:
20742
diff
changeset
|
2 |
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package com.sun.security.auth; |
|
27 |
||
28 |
/** |
|
29 |
* <p> This class extends <code>NTSid</code> |
|
30 |
* and represents a Windows NT user's primary group SID. |
|
31 |
* |
|
32 |
* <p> Principals such as this <code>NTSidPrimaryGroupPrincipal</code> |
|
33 |
* may be associated with a particular <code>Subject</code> |
|
34 |
* to augment that <code>Subject</code> with an additional |
|
35 |
* identity. Refer to the <code>Subject</code> class for more information |
|
36 |
* on how to achieve this. Authorization decisions can then be based upon |
|
37 |
* the Principals associated with a <code>Subject</code>. |
|
38 |
* |
|
39 |
* @see java.security.Principal |
|
40 |
* @see javax.security.auth.Subject |
|
41 |
*/ |
|
20742
4ae78e8060d6
8008662: Add @jdk.Exported to JDK-specific/exported APIs
alanb
parents:
7179
diff
changeset
|
42 |
@jdk.Exported |
2 | 43 |
public class NTSidPrimaryGroupPrincipal extends NTSid { |
44 |
||
45 |
private static final long serialVersionUID = 8011978367305190527L; |
|
46 |
||
47 |
/** |
|
48 |
* Create an <code>NTSidPrimaryGroupPrincipal</code> with a Windows NT |
|
49 |
* group SID. |
|
50 |
* |
|
51 |
* <p> |
|
52 |
* |
|
53 |
* @param name the primary Windows NT group SID for this user. <p> |
|
54 |
* |
|
55 |
* @exception NullPointerException if the <code>name</code> |
|
56 |
* is <code>null</code>. |
|
57 |
*/ |
|
58 |
public NTSidPrimaryGroupPrincipal(String name) { |
|
59 |
super(name); |
|
60 |
} |
|
61 |
||
62 |
/** |
|
63 |
* Return a string representation of this |
|
64 |
* <code>NTSidPrimaryGroupPrincipal</code>. |
|
65 |
* |
|
66 |
* <p> |
|
67 |
* |
|
68 |
* @return a string representation of this |
|
69 |
* <code>NTSidPrimaryGroupPrincipal</code>. |
|
70 |
*/ |
|
71 |
public String toString() { |
|
72 |
java.text.MessageFormat form = new java.text.MessageFormat |
|
73 |
(sun.security.util.ResourcesMgr.getString |
|
7179
4afb81e50183
6987827: security/util/Resources.java needs improvement
weijun
parents:
5506
diff
changeset
|
74 |
("NTSidPrimaryGroupPrincipal.name", |
2 | 75 |
"sun.security.util.AuthResources")); |
76 |
Object[] source = {getName()}; |
|
77 |
return form.format(source); |
|
78 |
} |
|
79 |
||
80 |
/** |
|
81 |
* Compares the specified Object with this |
|
82 |
* <code>NTSidPrimaryGroupPrincipal</code> |
|
83 |
* for equality. Returns true if the given object is also a |
|
84 |
* <code>NTSidPrimaryGroupPrincipal</code> and the two |
|
85 |
* NTSidPrimaryGroupPrincipals have the same SID. |
|
86 |
* |
|
87 |
* <p> |
|
88 |
* |
|
89 |
* @param o Object to be compared for equality with this |
|
90 |
* <code>NTSidPrimaryGroupPrincipal</code>. |
|
91 |
* |
|
28059
e576535359cc
8067377: My hobby: caning, then then canning, the the can-can
martin
parents:
25859
diff
changeset
|
92 |
* @return true if the specified Object is equal to this |
2 | 93 |
* <code>NTSidPrimaryGroupPrincipal</code>. |
94 |
*/ |
|
95 |
public boolean equals(Object o) { |
|
96 |
if (o == null) |
|
97 |
return false; |
|
98 |
||
99 |
if (this == o) |
|
100 |
return true; |
|
101 |
||
102 |
if (!(o instanceof NTSidPrimaryGroupPrincipal)) |
|
103 |
return false; |
|
104 |
||
105 |
return super.equals(o); |
|
106 |
} |
|
107 |
||
108 |
} |