1 27 28 package org.objectweb.jonas_ws.wsgen.ddmodifier; 29 30 import org.w3c.dom.Document ; 31 import org.w3c.dom.Element ; 32 33 38 public class WebJettyDDModifier extends DeploymentDescModifier { 39 40 41 private static final String REALM_CLASS = "org.objectweb.jonas.security.realm.web.jetty50.Standard"; 42 43 44 private static final String CONTEXT_CLASS = "org.mortbay.jetty.servlet.WebApplicationContext"; 45 46 47 private static final String DEFAULT_REALM_NAME = "Endpoint Authentication Area"; 48 49 54 public WebJettyDDModifier(Document doc) { 55 super(doc.getDocumentElement(), doc); 56 } 57 58 63 public void configRealm (String realm) { 64 configRealm (DEFAULT_REALM_NAME, realm); 65 } 66 67 73 public void configRealm(String realmName, String realm) { 74 Element configureElement = getElement(); 75 configureElement.appendChild(setRealmName(realmName)); 76 configureElement.appendChild(setRealm(realm, realmName)); 77 } 78 79 80 86 private Element setRealmName (String realmName) { 87 Element callElement = newElement("Call"); 88 callElement.setAttribute("name", "setRealmName"); 89 90 Element argElement = newElement("Arg", realmName); 91 callElement.appendChild(argElement); 92 93 return callElement; 94 } 95 96 103 private Element setRealm (String realm, String realmName) { 104 Element callElement = newElement ("Call"); 105 callElement.setAttribute("name", "setRealm"); 106 107 Element argElement = newElement ("Arg"); 108 109 Element newElement = newElement ("New"); 110 newElement.setAttribute("class", REALM_CLASS); 111 112 Element argRealmName = newElement ("Arg", realmName); 113 Element argRealm = newElement ("Arg", realm); 114 115 newElement.appendChild(argRealmName); 116 newElement.appendChild(argRealm); 117 118 argElement.appendChild(newElement); 119 callElement.appendChild(argElement); 120 121 return callElement; 122 } 123 } 124 | Popular Tags |