1 23 24 package com.sun.enterprise.admin.servermgmt.pe; 25 26 import java.io.File ; 27 28 import com.sun.enterprise.util.OS; 29 import com.sun.enterprise.util.io.FileUtils; 30 import com.sun.enterprise.admin.util.TokenValue; 31 import com.sun.enterprise.admin.util.TokenValueSet; 32 import com.sun.enterprise.admin.servermgmt.DomainConfig; 33 34 public final class PEDomainXmlTokens 35 { 36 public static final String CONFIG_MODEL_NAME_TOKEN_NAME = "CONFIG_MODEL_NAME"; 37 public static final String CONFIG_MODEL_NAME_TOKEN_VALUE = "server-config"; 38 39 public static final String HOST_NAME_TOKEN_NAME = "HOST_NAME"; 40 public static final String DOMAIN_NAME_TOKEN_NAME = "DOMAIN_NAME"; 41 42 public static final String HTTP_PORT_TOKEN_NAME = "HTTP_PORT"; 43 44 public static final String ORB_LISTENER_PORT_TOKEN_NAME = "ORB_LISTENER_PORT"; 45 46 public static final String JMS_PROVIDER_PASSWORD_TOKEN_NAME= "JMS_PROVIDER_PASSWORD"; 47 48 public static final String JMS_PROVIDER_PORT_TOKEN_NAME= "JMS_PROVIDER_PORT"; 49 50 public static final String JMS_PROVIDER_USERID_TOKEN_NAME= "JMS_PROVIDER_USERID"; 51 52 public static final String SERVER_ID_TOKEN_NAME= "SERVER_ID"; 53 54 public static final String ADMIN_PORT_TOKEN_NAME= "ADMIN_PORT"; 55 56 public static final String HTTP_SSL_PORT_TOKEN_NAME= "HTTP_SSL_PORT"; 57 58 public static final String ORB_SSL_PORT_TOKEN_NAME= "ORB_SSL_PORT"; 59 60 public static final String ORB_MUTUALAUTH_PORT_TOKEN_NAME= "ORB_MUTUALAUTH_PORT"; 61 62 public static final String JMX_SYSTEM_CONNECTOR_PORT_TOKEN_NAME="JMX_SYSTEM_CONNECTOR_PORT"; 66 67 public static TokenValueSet getTokenValueSet(DomainConfig domainConfig) 68 { 69 final String installRoot = 70 (String )domainConfig.get(DomainConfig.K_INSTALL_ROOT); 71 final String domainRoot = 72 (String )domainConfig.get(DomainConfig.K_DOMAINS_ROOT); 73 74 final TokenValueSet tokens = new TokenValueSet(); 75 76 String instanceName = (String )domainConfig.get(DomainConfig.K_SERVERID); 77 if((instanceName == null) || (instanceName.equals(""))) 78 instanceName = PEFileLayout.DEFAULT_INSTANCE_NAME; 79 80 TokenValue tv = new TokenValue(CONFIG_MODEL_NAME_TOKEN_NAME, 81 CONFIG_MODEL_NAME_TOKEN_VALUE); 82 tokens.add(tv); 83 84 tv = new TokenValue(HOST_NAME_TOKEN_NAME, 85 (String )domainConfig.get(DomainConfig.K_HOST_NAME)); 86 tokens.add(tv); 87 88 final Integer adminPort = 89 (Integer )domainConfig.get(DomainConfig.K_ADMIN_PORT); 90 tv = new TokenValue(ADMIN_PORT_TOKEN_NAME, adminPort.toString()); 91 tokens.add(tv); 92 93 final Integer httpPort = 94 (Integer )domainConfig.get(DomainConfig.K_INSTANCE_PORT); 95 tv = new TokenValue(HTTP_PORT_TOKEN_NAME, httpPort.toString()); 96 tokens.add(tv); 97 98 final Integer orbPort = 99 (Integer )domainConfig.get(DomainConfig.K_ORB_LISTENER_PORT); 100 tv = new TokenValue(ORB_LISTENER_PORT_TOKEN_NAME, orbPort.toString()); 101 tokens.add(tv); 102 103 tv = new TokenValue(JMS_PROVIDER_PASSWORD_TOKEN_NAME, 104 (String )domainConfig.get(DomainConfig.K_JMS_PASSWORD)); 105 tokens.add(tv); 106 107 final Integer jmsPort = 108 (Integer )domainConfig.get(DomainConfig.K_JMS_PORT); 109 tv = new TokenValue(JMS_PROVIDER_PORT_TOKEN_NAME, jmsPort.toString()); 110 tokens.add(tv); 111 112 tv = new TokenValue(JMS_PROVIDER_USERID_TOKEN_NAME, 113 (String )domainConfig.get(DomainConfig.K_JMS_USER)); 114 tokens.add(tv); 115 116 tv = new TokenValue(SERVER_ID_TOKEN_NAME, 117 instanceName); 118 tokens.add(tv); 119 120 final Integer httpSslPort = 121 (Integer )domainConfig.get(DomainConfig.K_HTTP_SSL_PORT); 122 tv = new TokenValue(HTTP_SSL_PORT_TOKEN_NAME, httpSslPort.toString()); 123 tokens.add(tv); 124 125 final Integer orbSslPort = 126 (Integer )domainConfig.get(DomainConfig.K_IIOP_SSL_PORT); 127 tv = new TokenValue(ORB_SSL_PORT_TOKEN_NAME, orbSslPort.toString()); 128 tokens.add(tv); 129 130 final Integer orbMutualAuthPort = 131 (Integer )domainConfig.get(DomainConfig.K_IIOP_MUTUALAUTH_PORT); 132 tv = new TokenValue(ORB_MUTUALAUTH_PORT_TOKEN_NAME, orbMutualAuthPort.toString()); 133 tokens.add(tv); 134 135 final Integer jmxPort = 136 (Integer )domainConfig.get(DomainConfig.K_JMX_PORT); 137 tv = new TokenValue(JMX_SYSTEM_CONNECTOR_PORT_TOKEN_NAME, jmxPort.toString()); 138 tokens.add(tv); 139 140 tv = new TokenValue(DOMAIN_NAME_TOKEN_NAME, domainConfig.getRepositoryName()); 141 tokens.add(tv); 142 143 144 return ( tokens ); 145 } 146 } 147 | Popular Tags |