1 19 20 package com.sslexplorer.policyframework; 21 22 23 25 public class NoPermissionException extends Exception { 26 private final ResourceType resourceType; 27 private final Principal principal; 28 29 32 public NoPermissionException(String message) { 33 this(message, null, null, null); 34 } 35 36 40 public NoPermissionException(Principal principal, ResourceType resourceType) { 41 this("", null, principal, resourceType); 42 } 43 44 49 public NoPermissionException(String message, Principal principal, ResourceType resourceType) { 50 this(message, null, principal, resourceType); 51 } 52 53 59 public NoPermissionException(String message, Throwable cause, Principal principal, ResourceType resourceType) { 60 super(message, cause); 61 this.principal = principal; 62 this.resourceType = resourceType; 63 } 64 65 68 public String getPrincipalName() { 69 return principal == null ? "" : principal.getPrincipalName(); 70 } 71 72 75 public ResourceType getResourceType() { 76 return resourceType; 77 } 78 } | Popular Tags |