Methods Summary |
---|
public void | addHttpListenerRef(java.lang.String listenerId)
final String defaultVS = getHttpListener(listenerId).getDefaultVirtualServer();
final Set s = getHttpListeners(defaultVS);
s.add(listenerId);
setHttpListeners(defaultVS, s);
|
public void | changeHttpListenerRef(java.lang.String listenerId, java.lang.String oldVs, java.lang.String newVs)
Set s = getHttpListeners(oldVs);
s.remove(listenerId);
setHttpListeners(oldVs, s);
s = getHttpListeners(newVs);
s.add(listenerId);
setHttpListeners(newVs, s);
|
private void | checkArg(java.lang.Object o, java.lang.Object msg)
if (null == o)
{
throw new ConfigException(msg.toString());
}
|
public void | deleteHttpListenerRef(java.lang.String listenerId)
VirtualServer[] servers = config.getHttpService().getVirtualServer();
if (servers != null)
{
for (int i = 0; i < servers.length; i++)
{
Set httpListeners = getHttpListeners(servers[i].getId());
if (httpListeners.contains(listenerId))
{
httpListeners.remove(listenerId);
servers[i].setHttpListeners(setToStr(httpListeners));
}
}
}
|
protected com.sun.enterprise.config.serverbeans.HttpListener | getHttpListener(java.lang.String id)
HttpListener listener = config.getHttpService().getHttpListenerById(id);
checkArg(listener, strMgr.getString("http_listener_vs_assoc_mgr.no_such_element", id));
return listener;
|
java.util.Set | getHttpListeners(java.lang.String vsID)
return strToSet(getVirtualServer(vsID).getHttpListeners());
|
protected com.sun.enterprise.config.serverbeans.VirtualServer | getVirtualServer(java.lang.String id)
VirtualServer vs = config.getHttpService().getVirtualServerById(id);
checkArg(vs, strMgr.getString("http_listener_vs_assoc_mgr.no_such_element", id));
return vs;
|
void | setHttpListeners(java.lang.String vsID, java.util.Set httpListeners)
getVirtualServer(vsID).setHttpListeners(setToStr(httpListeners));
|
private java.lang.String | setToStr(java.util.Set httpListeners)
String s = null;
final Iterator it = httpListeners.iterator();
if (it.hasNext())
{
StringBuffer sb = new StringBuffer();
while (it.hasNext())
{
sb.append((String)it.next());
if (it.hasNext()) { sb.append(',"); }
}
s = sb.toString();
}
return s;
|
private java.util.Set | strToSet(java.lang.String httpListeners)
final Set s = new LinkedHashSet();
if (null != httpListeners)
{
StringTokenizer strTok = new StringTokenizer(httpListeners, ",");
while (strTok.hasMoreTokens())
{
s.add(strTok.nextToken());
}
}
return s;
|