use of org.glassfish.orb.admin.config.IiopListener in project Payara by payara.
the class AbstractRemoteCertificateManagementCommand method resolveKeyStore.
/**
* Resolves the keystore location and the password required to access it.
*/
protected void resolveKeyStore() {
Config config = servers.getServer(target).getConfig();
if (listener != null) {
// Check if listener is an HTTP listener
List<Protocol> protocols = config.getNetworkConfig().getProtocols().getProtocol();
for (Protocol protocol : protocols) {
if (protocol.getName().equals(listener)) {
Ssl sslConfig = protocol.getSsl();
if (sslConfig != null) {
if (StringUtils.ok(sslConfig.getKeyStore())) {
keystore = new File(TranslatedConfigView.expandConfigValue(sslConfig.getKeyStore()));
keystorePassword = TranslatedConfigView.expandConfigValue(sslConfig.getKeyStorePassword()).toCharArray();
}
}
}
}
if (keystore == null) {
// Check if listener is an IIOP listener
List<IiopListener> listeners = iiopService.getIiopListener();
for (IiopListener listener : listeners) {
if (listener.getId().equals(listener)) {
Ssl sslConfig = listener.getSsl();
if (StringUtils.ok(sslConfig.getKeyStore())) {
keystore = new File(TranslatedConfigView.expandConfigValue(sslConfig.getKeyStore()));
keystorePassword = TranslatedConfigView.expandConfigValue(sslConfig.getKeyStorePassword()).toCharArray();
}
}
}
}
}
// Default to getting it from the JVM options if no non-default value found
if (keystore == null) {
List<String> jvmOptions = config.getJavaConfig().getJvmOptions();
for (String jvmOption : jvmOptions) {
if (jvmOption.startsWith("-Djavax.net.ssl.keyStore")) {
keystore = new File(TranslatedConfigView.expandConfigValue(jvmOption.substring(jvmOption.indexOf("=") + 1)));
}
}
}
// If it's STILL null, just go with default
if (keystore == null) {
keystore = serverEnvironment.getJKS();
}
// If the password hasn't been set, go with master
if (keystorePassword == null) {
MasterPasswordImpl masterPasswordService = serviceLocator.getService(MasterPasswordImpl.class);
keystorePassword = masterPasswordService.getMasterPassword();
}
}
use of org.glassfish.orb.admin.config.IiopListener in project Payara by payara.
the class AbstractRemoteCertificateManagementCommand method resolveTrustStore.
/**
* Resolves the truststore location and the password required to access it.
*/
protected void resolveTrustStore() {
Config config = servers.getServer(target).getConfig();
if (listener != null) {
// Check if listener is an HTTP listener
List<Protocol> protocols = config.getNetworkConfig().getProtocols().getProtocol();
for (Protocol protocol : protocols) {
if (protocol.getName().equals(listener)) {
Ssl sslConfig = protocol.getSsl();
if (sslConfig != null) {
if (StringUtils.ok(sslConfig.getTrustStore())) {
truststore = new File(TranslatedConfigView.expandConfigValue(sslConfig.getTrustStore()));
truststorePassword = TranslatedConfigView.expandConfigValue(sslConfig.getTrustStorePassword()).toCharArray();
}
}
}
}
if (truststore == null) {
// Check if listener is an IIOP listener
List<IiopListener> listeners = iiopService.getIiopListener();
for (IiopListener listener : listeners) {
if (listener.getId().equals(listener)) {
Ssl sslConfig = listener.getSsl();
if (StringUtils.ok(sslConfig.getTrustStore())) {
truststore = new File(TranslatedConfigView.expandConfigValue(sslConfig.getTrustStore()));
truststorePassword = TranslatedConfigView.expandConfigValue(sslConfig.getTrustStorePassword()).toCharArray();
}
}
}
}
}
// Default to getting it from the JVM options if no non-default value found
if (truststore == null) {
List<String> jvmOptions = config.getJavaConfig().getJvmOptions();
for (String jvmOption : jvmOptions) {
if (jvmOption.startsWith("-Djavax.net.ssl.trustStore")) {
truststore = new File(TranslatedConfigView.expandConfigValue(jvmOption.substring(jvmOption.indexOf("=") + 1)));
}
}
}
// If it's STILL null, just go with default
if (truststore == null) {
truststore = serverEnvironment.getTrustStore();
}
// If the password hasn't been set, go with master
if (truststorePassword == null) {
MasterPasswordImpl masterPassword = serviceLocator.getService(MasterPasswordImpl.class);
truststorePassword = masterPassword.getMasterPassword();
}
}
use of org.glassfish.orb.admin.config.IiopListener in project Payara by payara.
the class CertificateManagementRestApiHandlers method getAllListenerNamesAndUrls.
/**
* Gets the names of all HTTP and IIOP listeners for the target instance and the links to them.
* @param contextPath The root context path
* @param config The config of the target instance
* @param serviceLocator The ServiceLocator to get additional HK2 services from
* @param listeners The list of listeners to populate
* @param usedByLinks The map of usedBy links to populate
*/
private static void getAllListenerNamesAndUrls(String contextPath, Config config, ServiceLocator serviceLocator, List<String> listeners, Map<String, String> usedByLinks) {
List<Protocol> protocols = config.getNetworkConfig().getProtocols().getProtocol();
String httpConfigUrl = contextPath + "/web/grizzly/networkListenerEdit.jsf?configName=" + config.getName() + "&cancelTo=web/grizzly/networkListeners.jsf";
for (Protocol protocol : protocols) {
listeners.add(protocol.getName());
usedByLinks.put(protocol.getName(), httpConfigUrl + "&name=" + protocol.getName());
}
IiopService iiopService = serviceLocator.getService(IiopService.class);
String iiopConfigUrl = contextPath + "/corba/sslEdit.jsf?configName=" + config.getName();
List<IiopListener> iiopListeners = iiopService.getIiopListener();
for (IiopListener listener : iiopListeners) {
listeners.add(listener.getId());
usedByLinks.put(listener.getId(), iiopConfigUrl + "&name=" + listener.getId());
}
}
use of org.glassfish.orb.admin.config.IiopListener in project Payara by payara.
the class PEORBConfigurator method configure.
public void configure(DataCollector dc, ORB orb) {
try {
// end temp fix for bug 6320008
if (threadpoolMgr != null) {
// This will be the case for the Server Side ORB created
// For client side threadpoolMgr will be null, so we will
// never come here
orb.setThreadPoolManager(threadpoolMgr);
}
// Do the stats for the threadpool
ThreadPoolManager tpool = orb.getThreadPoolManager();
// ORB creates its own threadpool if threadpoolMgr was null above
ThreadPool thpool = tpool.getDefaultThreadPool();
String ThreadPoolName = thpool.getName();
ThreadPoolStats tpStats = new ThreadPoolStatsImpl(thpool.getWorkQueue(0).getThreadPool());
StatsProviderManager.register("orb", PluginPoint.SERVER, "thread-pool/orb/threadpool/" + ThreadPoolName, tpStats);
configureCopiers(orb);
configureCallflowInvocationInterceptor(orb);
// In the server-case, iiop acceptors need to be set up after the
// initial part of the orb creation but before any
// portable interceptor initialization
IIOPUtils iiopUtils = IIOPUtils.getInstance();
if (iiopUtils.getProcessType().isServer()) {
List<IiopListener> iiop_listener_list = IIOPUtils.getInstance().getIiopService().getIiopListener();
IiopListener[] iiopListenerBeans = iiop_listener_list.toArray(new IiopListener[iiop_listener_list.size()]);
this.createORBListeners(iiopUtils, iiopListenerBeans, orb);
}
if (orb.getORBData().environmentIsGFServer()) {
// Start the transient name service, which publishes NameService
// in the ORB's local resolver.
new TransientNameService(orb);
}
// Publish the ORB reference back to GlassFishORBHelper, so that
// subsequent calls from interceptor ORBInitializers can call
// GlassFishORBHelper.getORB() without problems. This is
// especially important for code running in the service initializer
// thread.
getHelper().setORB(orb);
} catch (NoSuchWorkQueueException ex) {
Logger.getLogger(PEORBConfigurator.class.getName()).log(Level.SEVERE, null, ex);
}
}
use of org.glassfish.orb.admin.config.IiopListener in project Payara by payara.
the class CreateIiopListenerTest method tearDown.
@After
public void tearDown() throws TransactionFailure {
ConfigSupport.apply(new SingleConfigCode<IiopService>() {
public Object run(IiopService param) throws PropertyVetoException, TransactionFailure {
List<IiopListener> listenerList = param.getIiopListener();
for (IiopListener listener : listenerList) {
String currListenerId = listener.getId();
if (currListenerId != null && currListenerId.equals("iiop_1")) {
listenerList.remove(listener);
break;
}
}
return listenerList;
}
}, iiopService);
parameters = new ParameterMap();
}
Aggregations