1 /*2 * The contents of this file are subject to the terms 3 * of the Common Development and Distribution License 4 * (the License). You may not use this file except in5 * compliance with the License.6 * 7 * You can obtain a copy of the license at 8 * https://glassfish.dev.java.net/public/CDDLv1.0.html or9 * glassfish/bootstrap/legal/CDDLv1.0.txt.10 * See the License for the specific language governing 11 * permissions and limitations under the License.12 * 13 * When distributing Covered Code, include this CDDL 14 * Header Notice in each file and include the License file 15 * at glassfish/bootstrap/legal/CDDLv1.0.txt. 16 * If applicable, add the following below the CDDL Header, 17 * with the fields enclosed by brackets [] replaced by18 * you own identifying information: 19 * "Portions Copyrighted [year] [name of copyright owner]"20 * 21 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.22 */23 24 /*25 * $Header: /cvs/glassfish/admin/mbeanapi-impl/src/java/com/sun/enterprise/management/config/HTTPListenerConfigImpl.java,v 1.7 2005/12/25 03:39:14 tcfujii Exp $26 * $Revision: 1.7 $27 * $Date: 2005/12/25 03:39:14 $28 */29 package com.sun.enterprise.management.config;30 31 import java.util.Map ;32 33 import javax.management.ObjectName ;34 import javax.management.AttributeList ;35 36 37 import com.sun.appserv.management.util.misc.MapUtil;38 import com.sun.appserv.management.config.SSLConfigKeys;39 import com.sun.appserv.management.base.XTypes;40 import com.sun.enterprise.management.support.Delegate;41 import com.sun.enterprise.management.config.AMXConfigImplBase;42 import com.sun.enterprise.management.support.oldconfig.OldHTTPListenerMBean;43 44 45 import com.sun.enterprise.management.support.AMXAttributeNameMapper;46 /**47 Delegates Attributes to an existing MBean, but implements operations 48 in itself.49 */50 public final class HTTPListenerConfigImpl extends AMXConfigImplBase51 // implements HTTPListenerConfig52 implements /*SSLConfigFactory.CreateRemoveHook,*/ ConfigFactoryCallback53 {54 public55 HTTPListenerConfigImpl( final Delegate delegate )56 {57 super( delegate );58 }59 60 protected void61 addCustomMappings( final AMXAttributeNameMapper mapper )62 {63 super.addCustomMappings( mapper );64 65 mapper.matchName( "Name", "Id" );66 }67 68 /*69 private SSLConfigFactory70 getSSLConfigFactory()71 {72 return( new SSLConfigFactory( this, this ) );73 }74 75 76 public void77 removeSSLConfig()78 {79 getSSLConfigFactory().remove( );80 }81 82 public ObjectName83 getSSLConfigObjectName()84 {85 return( getContaineeObjectName( XTypes.SSL_CONFIG ) );86 } 87 88 ** SSLConfigFactory.CreateRemoveHook.removeOldSSLConfig *89 public ObjectName90 removeOldSSLConfig( )91 {92 final ObjectName objectName = getSSLConfigObjectName();93 94 getOldHTTPListenerMBean().removeSsl();95 96 return objectName;97 }98 99 100 private OldHTTPListenerMBean101 getOldHTTPListenerMBean()102 {103 return (OldHTTPListenerMBean)getDelegateProxy( OldHTTPListenerMBean.class );104 }105 106 ** SSLConfigFactory.CreateRemoveHook.createOldSSLConfig *107 public ObjectName108 createOldSSLConfig( AttributeList attrs )109 {110 return getOldHTTPListenerMBean().createSsl( attrs );111 }112 113 114 public ObjectName115 createSSLConfig(116 String certNickname,117 Map optional )118 {119 return getSSLConfigFactory().create( certNickname, optional );120 }121 122 ** SSLConfigFactory.CreateRemoveHook.removeOldSSLConfig *123 public ObjectName124 removeOldSSLConfig( )125 {126 final ObjectName objectName = getSSLConfigObjectName();127 128 getOldHTTPListenerMBean().removeSsl();129 130 return objectName;131 }132 */133 }134 135 136