1 23 24 27 28 package com.sun.enterprise.admin.target; 29 30 import java.io.Serializable ; 32 33 import com.sun.enterprise.config.ConfigContext; 35 import com.sun.enterprise.config.ConfigException; 36 37 import com.sun.enterprise.util.i18n.StringManager; 38 import com.sun.enterprise.config.serverbeans.Server; 39 import com.sun.enterprise.config.serverbeans.ServerHelper; 40 import com.sun.enterprise.config.serverbeans.Cluster; 41 import com.sun.enterprise.config.serverbeans.ClusterHelper; 42 import com.sun.enterprise.config.serverbeans.ConfigAPIHelper; 43 import com.sun.enterprise.config.serverbeans.Config; 44 import com.sun.enterprise.config.serverbeans.NodeAgentHelper; 45 import com.sun.enterprise.config.serverbeans.NodeAgent; 46 import com.sun.enterprise.config.serverbeans.ResourceRef; 47 import com.sun.enterprise.config.serverbeans.ApplicationRef; 48 49 public class DomainTarget extends Target 50 { 51 54 private static final StringManager strMgr = 55 StringManager.getManager(DomainTarget.class); 56 57 protected DomainTarget(String name, ConfigContext cc) 58 { 59 super(name, cc); 60 } 61 62 public TargetType getType() 63 { 64 return TargetType.DOMAIN; 65 } 66 67 public String getTargetObjectName(String [] tokens) 68 { 69 checkTokens(tokens, 1); 70 return (tokens[0] + ":type=domain,category=config"); 71 } 72 73 public ConfigTarget getConfigTarget() throws Exception 74 { 75 throw new Exception (strMgr.getString("target.no_config_for_domain")); 76 } 77 78 public String getConfigRef() throws ConfigException 79 { 80 return null; 81 } 82 83 86 public Server[] getServers() throws ConfigException 87 { 88 return ServerHelper.getServersInDomain(getConfigContext()); 89 } 90 91 94 public Cluster[] getClusters() throws ConfigException 95 { 96 return ClusterHelper.getClustersInDomain(getConfigContext()); 97 } 98 99 102 public Config[] getConfigs() throws ConfigException 103 { 104 return ConfigAPIHelper.getConfigsInDomain(getConfigContext()); 105 } 106 107 110 public NodeAgent[] getNodeAgents() throws ConfigException 111 { 112 return NodeAgentHelper.getNodeAgentsInDomain(getConfigContext()); 113 } 114 115 public ApplicationRef[] getApplicationRefs() throws ConfigException 116 { 117 throw new ConfigException(strMgr.getString("target.not_supported", 118 "getApplicationRefs", getType().getName())); 119 } 120 121 public ResourceRef[] getResourceRefs() throws ConfigException 122 { 123 throw new ConfigException(strMgr.getString("target.not_supported", 124 "getResourceRefs", getType().getName())); 125 } 126 } 127 128 | Popular Tags |