1 23 package com.sun.enterprise.deployment; 24 25 import com.sun.enterprise.deployment.web.SecurityConstraint; 26 import com.sun.enterprise.deployment.web.UserDataConstraint; 27 import com.sun.enterprise.deployment.web.AuthorizationConstraint; 28 import com.sun.enterprise.deployment.web.WebResourceCollection; 29 30 import java.util.*; 31 32 33 38 39 public class SecurityConstraintImpl extends Descriptor implements SecurityConstraint, java.io.Serializable { 40 private Set webResourceCollections; 41 private AuthorizationConstraint authorizationConstraint; 42 private UserDataConstraint userDataConstraint; 43 44 45 public SecurityConstraintImpl() { 46 47 } 48 49 50 public SecurityConstraintImpl(SecurityConstraintImpl other) { 51 this.webResourceCollections = new HashSet(other.webResourceCollections); 52 if (other.authorizationConstraint != null) { 53 this.authorizationConstraint = new AuthorizationConstraintImpl((AuthorizationConstraintImpl) other.authorizationConstraint); 54 } 55 if (other.userDataConstraint != null) { 56 this.userDataConstraint = new UserDataConstraintImpl(); 57 this.userDataConstraint.setTransportGuarantee(other.userDataConstraint.getTransportGuarantee()); 58 } 59 } 60 61 62 64 public Set getWebResourceCollectionSet() { 65 if (this.webResourceCollections == null) { 66 this.webResourceCollections = new HashSet(); 67 } 68 return this.webResourceCollections; 69 } 70 71 72 public Enumeration getWebResourceCollections() { 73 return (new Vector(this.getWebResourceCollectionSet())).elements(); 74 } 75 76 77 public void addWebResourceCollection(WebResourceCollection webResourceCollection) { 78 this.getWebResourceCollectionSet().add(webResourceCollection); 79 } 80 81 public void addWebResourceCollection(WebResourceCollectionImpl webResourceCollection) { 82 addWebResourceCollection((WebResourceCollection) webResourceCollection); 83 } 84 85 86 public void removeWebResourceCollection(WebResourceCollection webResourceCollection) { 87 this.getWebResourceCollectionSet().remove(webResourceCollection); 88 } 89 90 91 public AuthorizationConstraint getAuthorizationConstraint() { 92 return this.authorizationConstraint; 93 } 94 95 96 public void setAuthorizationConstraint(AuthorizationConstraint authorizationConstraint) { 97 this.authorizationConstraint = authorizationConstraint; 98 } 99 100 101 public void setAuthorizationConstraint(AuthorizationConstraintImpl authorizationConstraint) { 102 setAuthorizationConstraint((AuthorizationConstraint) authorizationConstraint); 103 } 104 105 106 public UserDataConstraint getUserDataConstraint() { 107 return this.userDataConstraint; 108 } 109 110 public void setUserDataConstraint(UserDataConstraint userDataConstraint) { 111 this.userDataConstraint = userDataConstraint; 112 } 113 114 public void setUserDataConstraint(UserDataConstraintImpl userDataConstraint) { 115 setUserDataConstraint((UserDataConstraint) userDataConstraint); 116 } 117 118 119 public void print(StringBuffer toStringBuffer) { 120 toStringBuffer.append("SecurityConstraint: "); 121 toStringBuffer.append(" webResourceCollections: ").append(webResourceCollections); 122 toStringBuffer.append(" authorizationConstraint ").append(authorizationConstraint); 123 toStringBuffer.append(" userDataConstraint ").append(userDataConstraint); 124 125 } 126 127 } 128 | Popular Tags |