Methods Summary |
---|
public java.lang.String | _getSchemaLocation()
if (beanProp().getAttrProp("xsi:schemaLocation", true) == null) {
createAttribute("xmlns:xsi", "xmlns:xsi", AttrProp.CDATA | AttrProp.IMPLIED, null, "http://www.w3.org/2001/XMLSchema-instance");
setAttributeValue("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
createAttribute("xsi:schemaLocation", "xsi:schemaLocation", AttrProp.CDATA | AttrProp.IMPLIED, null, null);
}
return getAttributeValue("xsi:schemaLocation");
|
public void | _setSchemaLocation(java.lang.String location)
if (beanProp().getAttrProp("xsi:schemaLocation", true) == null) {
createAttribute("xmlns:xsi", "xmlns:xsi", AttrProp.CDATA | AttrProp.IMPLIED, null, "http://www.w3.org/2001/XMLSchema-instance");
setAttributeValue("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
createAttribute("xsi:schemaLocation", "xsi:schemaLocation", AttrProp.CDATA | AttrProp.IMPLIED, null, location);
}
setAttributeValue("xsi:schemaLocation", location);
|
public static void | addComparator(org.netbeans.modules.schema2beans.BeanComparator c)
comparators.add(c);
|
public int | addElementProperty(ElementProperty value)
return addElementProperty(value, true);
|
public int | addElementProperty(ElementProperty value, boolean overwrite)
ElementProperty old = getElementPropertyByName(value.getName());
if(old != null) {
throw new ConfigException(StringManager.getManager(ClientContainer.class).getString("cannotAddDuplicate", "ElementProperty"));
}
return this.addValue(ELEMENT_PROPERTY, value, overwrite);
|
public int | addMessageSecurityConfig(MessageSecurityConfig value)
return addMessageSecurityConfig(value, true);
|
public int | addMessageSecurityConfig(MessageSecurityConfig value, boolean overwrite)
MessageSecurityConfig old = getMessageSecurityConfigByAuthLayer(value.getAuthLayer());
if(old != null) {
throw new ConfigException(StringManager.getManager(ClientContainer.class).getString("cannotAddDuplicate", "MessageSecurityConfig"));
}
return this.addValue(MESSAGE_SECURITY_CONFIG, value, overwrite);
|
public int | addTargetServer(TargetServer value)
return addTargetServer(value, true);
|
public int | addTargetServer(TargetServer value, boolean overwrite)
TargetServer old = getTargetServerByName(value.getName());
if(old != null) {
throw new ConfigException(StringManager.getManager(ClientContainer.class).getString("cannotAddDuplicate", "TargetServer"));
}
return this.addValue(TARGET_SERVER, value, overwrite);
|
public static com.sun.enterprise.config.clientbeans.ClientContainer | createGraph(org.w3c.dom.Node doc)
return new ClientContainer(doc, Common.NO_DEFAULT_VALUES);
|
public static com.sun.enterprise.config.clientbeans.ClientContainer | createGraph(java.io.File f)
java.io.InputStream in = new java.io.FileInputStream(f);
try {
return createGraph(in, false);
} finally {
in.close();
}
|
public static com.sun.enterprise.config.clientbeans.ClientContainer | createGraph(java.io.InputStream in)
return createGraph(in, false);
|
public static com.sun.enterprise.config.clientbeans.ClientContainer | createGraph(java.io.InputStream in, boolean validate)
try {
Document doc = GraphManager.createXmlDocument(in, validate);
return createGraph(doc);
}
catch (Exception t) {
throw new RuntimeException(Common.getMessage(
"DOMGraphCreateFailed_msg",
t));
}
|
public static com.sun.enterprise.config.clientbeans.ClientContainer | createGraph()
return new ClientContainer();
|
public void | dump(java.lang.StringBuffer str, java.lang.String indent)
String s;
Object o;
org.netbeans.modules.schema2beans.BaseBean n;
str.append(indent);
str.append("TargetServer["+this.sizeTargetServer()+"]"); // NOI18N
for(int i=0; i<this.sizeTargetServer(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
n = (org.netbeans.modules.schema2beans.BaseBean) this.getTargetServer(i);
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(TARGET_SERVER, i, str, indent);
}
str.append(indent);
str.append("AuthRealm"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getAuthRealm();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(AUTH_REALM, 0, str, indent);
str.append(indent);
str.append("ClientCredential"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getClientCredential();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(CLIENT_CREDENTIAL, 0, str, indent);
str.append(indent);
str.append("LogService"); // NOI18N
n = (org.netbeans.modules.schema2beans.BaseBean) this.getLogService();
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(LOG_SERVICE, 0, str, indent);
str.append(indent);
str.append("MessageSecurityConfig["+this.sizeMessageSecurityConfig()+"]"); // NOI18N
for(int i=0; i<this.sizeMessageSecurityConfig(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
n = (org.netbeans.modules.schema2beans.BaseBean) this.getMessageSecurityConfig(i);
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(MESSAGE_SECURITY_CONFIG, i, str, indent);
}
str.append(indent);
str.append("ElementProperty["+this.sizeElementProperty()+"]"); // NOI18N
for(int i=0; i<this.sizeElementProperty(); i++)
{
str.append(indent+"\t");
str.append("#"+i+":");
n = (org.netbeans.modules.schema2beans.BaseBean) this.getElementProperty(i);
if (n != null)
n.dump(str, indent + "\t"); // NOI18N
else
str.append(indent+"\tnull"); // NOI18N
this.dumpAttributes(ELEMENT_PROPERTY, i, str, indent);
}
|
public java.lang.String | dumpBeanNode()
StringBuffer str = new StringBuffer();
str.append("ClientContainer\n"); // NOI18N
this.dump(str, "\n "); // NOI18N
return str.toString();
|
public AuthRealm | getAuthRealm()
return (AuthRealm)this.getValue(AUTH_REALM);
|
public ClientCredential | getClientCredential()
return (ClientCredential)this.getValue(CLIENT_CREDENTIAL);
|
public static java.lang.String | getDefaultAttributeValue(java.lang.String attr)
if(attr == null) return null;
attr = attr.trim();
if(attr.equals(ClientTags.SEND_PASSWORD)) return "true".trim();
return null;
|
public static java.lang.String | getDefaultSendPassword()Get the default value of SendPassword from dtd
return "true".trim();
|
public ElementProperty | getElementProperty(int index)
return (ElementProperty)this.getValue(ELEMENT_PROPERTY, index);
|
public ElementProperty[] | getElementProperty()
return (ElementProperty[])this.getValues(ELEMENT_PROPERTY);
|
public ElementProperty | getElementPropertyByName(java.lang.String id)
if (null != id) { id = id.trim(); }
ElementProperty[] o = getElementProperty();
if (o == null) return null;
for (int i=0; i < o.length; i++) {
if(o[i].getAttributeValue(Common.convertName(ClientTags.NAME)).equals(id)) {
return o[i];
}
}
return null;
|
public LogService | getLogService()
return (LogService)this.getValue(LOG_SERVICE);
|
public MessageSecurityConfig | getMessageSecurityConfig(int index)
return (MessageSecurityConfig)this.getValue(MESSAGE_SECURITY_CONFIG, index);
|
public MessageSecurityConfig[] | getMessageSecurityConfig()
return (MessageSecurityConfig[])this.getValues(MESSAGE_SECURITY_CONFIG);
|
public MessageSecurityConfig | getMessageSecurityConfigByAuthLayer(java.lang.String id)
if (null != id) { id = id.trim(); }
MessageSecurityConfig[] o = getMessageSecurityConfig();
if (o == null) return null;
for (int i=0; i < o.length; i++) {
if(o[i].getAttributeValue(Common.convertName(ClientTags.AUTH_LAYER)).equals(id)) {
return o[i];
}
}
return null;
|
protected java.lang.String | getRelativeXPath()get the xpath representation for this element
returns something like abc[@name='value'] or abc
depending on the type of the bean
String ret = null;
ret = "client-container";
return (null != ret ? ret.trim() : null);
|
public TargetServer[] | getTargetServer()
return (TargetServer[])this.getValues(TARGET_SERVER);
|
public TargetServer | getTargetServer(int index)
return (TargetServer)this.getValue(TARGET_SERVER, index);
|
public TargetServer | getTargetServerByName(java.lang.String id)
if (null != id) { id = id.trim(); }
TargetServer[] o = getTargetServer();
if (o == null) return null;
for (int i=0; i < o.length; i++) {
if(o[i].getAttributeValue(Common.convertName(ClientTags.NAME)).equals(id)) {
return o[i];
}
}
return null;
|
protected void | initFromNode(org.w3c.dom.Node doc, int options)
if (doc == null)
{
doc = GraphManager.createRootElementNode("client-container"); // NOI18N
if (doc == null)
throw new Schema2BeansException(Common.getMessage(
"CantCreateDOMRoot_msg", "client-container"));
}
Node n = GraphManager.getElementNode("client-container", doc); // NOI18N
if (n == null)
throw new Schema2BeansException(Common.getMessage(
"DocRootNotInDOMGraph_msg", "client-container", doc.getFirstChild().getNodeName()));
this.graphManager.setXmlDocument(doc);
// Entry point of the createBeans() recursive calls
this.createBean(n, this.graphManager());
this.initialize(options);
|
protected void | initOptions(int options)
// The graph manager is allocated in the bean root
this.graphManager = new GraphManager(this);
this.createRoot("client-container", "ClientContainer", // NOI18N
Common.TYPE_1 | Common.TYPE_BEAN, ClientContainer.class);
// Properties (see root bean comments for the bean graph)
initPropertyTables(6);
this.createProperty("target-server", TARGET_SERVER,
Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY,
TargetServer.class);
this.createAttribute(TARGET_SERVER, "name", "Name",
AttrProp.CDATA | AttrProp.REQUIRED,
null, null);
this.createAttribute(TARGET_SERVER, "address", "Address",
AttrProp.CDATA | AttrProp.REQUIRED,
null, null);
this.createAttribute(TARGET_SERVER, "port", "Port",
AttrProp.CDATA | AttrProp.REQUIRED,
null, null);
this.createProperty("auth-realm", AUTH_REALM,
Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
AuthRealm.class);
this.createAttribute(AUTH_REALM, "name", "Name",
AttrProp.CDATA | AttrProp.REQUIRED,
null, null);
this.createAttribute(AUTH_REALM, "classname", "Classname",
AttrProp.CDATA | AttrProp.REQUIRED,
null, null);
this.createProperty("client-credential", CLIENT_CREDENTIAL,
Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
ClientCredential.class);
this.createAttribute(CLIENT_CREDENTIAL, "user-name", "UserName",
AttrProp.CDATA | AttrProp.REQUIRED,
null, null);
this.createAttribute(CLIENT_CREDENTIAL, "password", "Password",
AttrProp.CDATA | AttrProp.REQUIRED,
null, null);
this.createAttribute(CLIENT_CREDENTIAL, "realm", "Realm",
AttrProp.CDATA | AttrProp.IMPLIED,
null, null);
this.createProperty("log-service", LOG_SERVICE,
Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
LogService.class);
this.createAttribute(LOG_SERVICE, "file", "File",
AttrProp.CDATA | AttrProp.IMPLIED,
null, null);
this.createAttribute(LOG_SERVICE, "level", "Level",
AttrProp.CDATA,
null, "SEVERE");
this.createProperty("message-security-config", MESSAGE_SECURITY_CONFIG,
Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
MessageSecurityConfig.class);
this.createAttribute(MESSAGE_SECURITY_CONFIG, "auth-layer", "AuthLayer",
AttrProp.CDATA | AttrProp.REQUIRED,
null, null);
this.createAttribute(MESSAGE_SECURITY_CONFIG, "default-provider", "DefaultProvider",
AttrProp.CDATA | AttrProp.IMPLIED,
null, null);
this.createAttribute(MESSAGE_SECURITY_CONFIG, "default-client-provider", "DefaultClientProvider",
AttrProp.CDATA | AttrProp.IMPLIED,
null, null);
this.createProperty("property", ELEMENT_PROPERTY,
Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
ElementProperty.class);
this.createAttribute(ELEMENT_PROPERTY, "name", "Name",
AttrProp.CDATA | AttrProp.REQUIRED,
null, null);
this.createAttribute(ELEMENT_PROPERTY, "value", "Value",
AttrProp.CDATA | AttrProp.REQUIRED,
null, null);
this.createAttribute("send-password", "SendPassword",
AttrProp.CDATA,
null, "true");
this.initialize(options);
|
void | initialize(int options)
|
public boolean | isSendPassword()Getter for SendPassword of the Element client-container
return toBoolean(getAttributeValue(ClientTags.SEND_PASSWORD));
|
public AuthRealm | newAuthRealm()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new AuthRealm();
|
public ClientCredential | newClientCredential()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new ClientCredential();
|
public ElementProperty | newElementProperty()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new ElementProperty();
|
public LogService | newLogService()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new LogService();
|
public MessageSecurityConfig | newMessageSecurityConfig()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new MessageSecurityConfig();
|
public TargetServer | newTargetServer()Create a new bean using it's default constructor.
This does not add it to any bean graph.
return new TargetServer();
|
private void | readObject(java.io.ObjectInputStream in)
try{
init(comparators, runtimeVersion);
String strDocument = in.readUTF();
// System.out.println("strDocument='"+strDocument+"'");
ByteArrayInputStream bais = new ByteArrayInputStream(strDocument.getBytes());
Document doc = GraphManager.createXmlDocument(bais, false);
initOptions(Common.NO_DEFAULT_VALUES);
initFromNode(doc, Common.NO_DEFAULT_VALUES);
}
catch (Schema2BeansException e) {
throw new RuntimeException(e);
}
|
public static void | removeComparator(org.netbeans.modules.schema2beans.BeanComparator c)
comparators.remove(c);
|
public int | removeElementProperty(ElementProperty value)
return this.removeValue(ELEMENT_PROPERTY, value);
|
public int | removeElementProperty(ElementProperty value, boolean overwrite)
return this.removeValue(ELEMENT_PROPERTY, value, overwrite);
|
public int | removeMessageSecurityConfig(MessageSecurityConfig value)
return this.removeValue(MESSAGE_SECURITY_CONFIG, value);
|
public int | removeMessageSecurityConfig(MessageSecurityConfig value, boolean overwrite)
return this.removeValue(MESSAGE_SECURITY_CONFIG, value, overwrite);
|
public int | removeTargetServer(TargetServer value)
return this.removeValue(TARGET_SERVER, value);
|
public int | removeTargetServer(TargetServer value, boolean overwrite)
return this.removeValue(TARGET_SERVER, value, overwrite);
|
public void | setAuthRealm(AuthRealm value)
this.setValue(AUTH_REALM, value);
|
public void | setClientCredential(ClientCredential value)
this.setValue(CLIENT_CREDENTIAL, value);
|
public void | setElementProperty(int index, ElementProperty value)
this.setValue(ELEMENT_PROPERTY, index, value);
|
public void | setElementProperty(ElementProperty[] value)
this.setValue(ELEMENT_PROPERTY, value);
|
public void | setLogService(LogService value)
this.setValue(LOG_SERVICE, value);
|
public void | setMessageSecurityConfig(int index, MessageSecurityConfig value)
this.setValue(MESSAGE_SECURITY_CONFIG, index, value);
|
public void | setMessageSecurityConfig(MessageSecurityConfig[] value)
this.setValue(MESSAGE_SECURITY_CONFIG, value);
|
public void | setSendPassword(boolean v, boolean overwrite)Modify the SendPassword of the Element client-container
setAttributeValue(ClientTags.SEND_PASSWORD, ""+(v==true), overwrite);
|
public void | setSendPassword(boolean v)Modify the SendPassword of the Element client-container
setAttributeValue(ClientTags.SEND_PASSWORD, ""+(v==true));
|
public void | setTargetServer(int index, TargetServer value)
this.setValue(TARGET_SERVER, index, value);
|
public void | setTargetServer(TargetServer[] value)
this.setValue(TARGET_SERVER, value);
|
public int | sizeElementProperty()
return this.size(ELEMENT_PROPERTY);
|
public int | sizeMessageSecurityConfig()
return this.size(MESSAGE_SECURITY_CONFIG);
|
public int | sizeTargetServer()
return this.size(TARGET_SERVER);
|
public void | validate()
|
private void | writeObject(java.io.ObjectOutputStream out)
ByteArrayOutputStream baos = new ByteArrayOutputStream();
write(baos);
String str = baos.toString();;
// System.out.println("str='"+str+"'");
out.writeUTF(str);
|