1 7 8 package javax.security.sasl; 9 10 import javax.security.auth.callback.Callback ; 11 12 23 public class AuthorizeCallback implements Callback , java.io.Serializable { 24 28 private String authenticationID; 29 30 34 private String authorizationID; 35 36 41 private String authorizedID; 42 43 48 private boolean authorized; 49 50 56 public AuthorizeCallback(String authnID, String authzID) { 57 authenticationID = authnID; 58 authorizationID = authzID; 59 } 60 61 65 public String getAuthenticationID() { 66 return authenticationID; 67 } 68 69 73 public String getAuthorizationID() { 74 return authorizationID; 75 } 76 77 85 public boolean isAuthorized() { 86 return authorized; 87 } 88 89 95 public void setAuthorized(boolean ok) { 96 authorized = ok; 97 } 98 99 106 public String getAuthorizedID() { 107 if (!authorized) { 108 return null; 109 } 110 return (authorizedID == null) ? authorizationID : authorizedID; 111 } 112 113 122 public void setAuthorizedID(String id) { 123 authorizedID = id; 124 } 125 126 private static final long serialVersionUID = -2353344186490470805L; 127 } 128 | Popular Tags |