Examples of MailResourceConfig


Examples of com.sun.appserv.management.config.MailResourceConfig

       
        if (domainRoot == null) {
            throw new IllegalStateException("domainRoot is uninitialised");
        }
       
        MailResourceConfig mailResourceConfig = findMailResourceConfig(
                jndiName);
        if (mailResourceConfig != null) {
            mailResourceConfig.setEnabled(enabled);
            return;
        }
       
        if (mailHost == null) {
            throw new IllegalArgumentException("mailHost parameter cannot be "
View Full Code Here

Examples of com.sun.appserv.management.config.MailResourceConfig

            getJavaMailDefaults(handlerCtx);
            handlerCtx.setOutputValue("Properties", new HashMap());
            return;
        }

        MailResourceConfig mailResource = AMXUtil.getDomainConfig().getMailResourceConfigMap().get(jndiName);
        if (mailResource == null){
            GuiUtil.handleError(handlerCtx, GuiUtil.getMessage("msg.NoSuchMailResource"));
            return;
        }

  if(AMXUtil.isEE())
            handlerCtx.setOutputValue("enabledString", TargetUtil.getEnabledStatus(mailResource, false));
        else
            handlerCtx.setOutputValue("enabled", TargetUtil.isResourceEnabled(mailResource, "server" ));
        handlerCtx.setOutputValue("host", mailResource.getHost());
        handlerCtx.setOutputValue("user", mailResource.getUser());
  handlerCtx.setOutputValue("from", mailResource.getFrom());
        handlerCtx.setOutputValue("description", mailResource.getDescription());
  handlerCtx.setOutputValue("storeProtocol", mailResource.getStoreProtocol());
  handlerCtx.setOutputValue("storeProtocolClass", mailResource.getStoreProtocolClass());
  handlerCtx.setOutputValue("transportProtocol", mailResource.getTransportProtocol());
  handlerCtx.setOutputValue("transportProtocolClass", mailResource.getTransportProtocolClass());
  handlerCtx.setOutputValue("debug", mailResource.getDebug());
       
        Map<String, String> props = mailResource.getProperties();
        handlerCtx.setOutputValue("Properties", props);
    }
View Full Code Here

Examples of com.sun.appserv.management.config.MailResourceConfig

            if(!edit){
                createJavaMail(handlerCtx);
                return;
            }
            String jndiName = (String) handlerCtx.getInputValue("jndiName");
            MailResourceConfig mailResource = AMXUtil.getDomainConfig().getMailResourceConfigMap().get(jndiName);
            if (mailResource == null){
                GuiUtil.handleError(handlerCtx, GuiUtil.getMessage("msg.NoSuchMailResource"));
                return;
            }
            mailResource.setHost((String)handlerCtx.getInputValue("host"));
            mailResource.setUser((String)handlerCtx.getInputValue("user"));
            mailResource.setFrom((String)handlerCtx.getInputValue("from"));
            mailResource.setDescription((String)handlerCtx.getInputValue("description"));
            if(! AMXUtil.isEE()){
                Boolean enabled = (Boolean) handlerCtx.getInputValue("enabled");
                TargetUtil.setResourceEnabled(mailResource, "server", enabled);
            }
            mailResource.setStoreProtocol((String)handlerCtx.getInputValue("storeProtocol"));
            mailResource.setStoreProtocolClass((String)handlerCtx.getInputValue("storeProtocolClass"));
            mailResource.setTransportProtocol((String)handlerCtx.getInputValue("transportProtocol"));
            mailResource.setTransportProtocolClass((String)handlerCtx.getInputValue("transportProtocolClass"));
            mailResource.setDebug((Boolean)handlerCtx.getInputValue("debug"));
            AMXUtil.editProperties(handlerCtx, mailResource);
        }catch (Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
    }
View Full Code Here

Examples of com.sun.appserv.management.config.MailResourceConfig

            }
            Map addProps = (Map)handlerCtx.getInputValue("AddProps");
            if (addProps != null)
                options = AMXUtil.convertToPropertiesOptionMap(addProps, options);
            if (options.isEmpty()) options = null;
            MailResourceConfig resource = AMXUtil.getDomainConfig().createMailResourceConfig(jndiName, host, user, from, options);
            resource.setDescription((String)handlerCtx.getInputValue("description"));
            createNewTargets(handlerCtx, jndiName);
           
        }catch (Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
View Full Code Here

Examples of com.sun.appserv.management.config.MailResourceConfig

    private static final String MAIL_RESOURCE_NAME  = "test/mail1";
   
        MailResourceConfig
    createMailResourceConfig()
    {
        final MailResourceConfig    mr  =
            getDomainConfig().createMailResourceConfig(
                MAIL_RESOURCE_NAME,
                "localhost",
                "mailuser@domain.com",
                "mailfrom@domain.com",
View Full Code Here

Examples of com.sun.appserv.management.config.MailResourceConfig

    ensureMailResourceConfig()
    {
        final Map<String,MailResourceConfig>  mails =
            getDomainConfig().getMailResourceConfigMap();
       
        MailResourceConfig mr   = mails.get( MAIL_RESOURCE_NAME );
        if ( mr == null )
        {
            mr  = createMailResourceConfig();
        }
        return mr;
View Full Code Here

Examples of com.sun.appserv.management.config.MailResourceConfig

    removeMailResourceConfig()
    {
        final Map<String,MailResourceConfig>  mails =
            getDomainConfig().getMailResourceConfigMap();
       
        MailResourceConfig mr   = mails.get( MAIL_RESOURCE_NAME );
        if ( mr != null )
        {
            getDomainConfig().removeMailResourceConfig( mr.getName() );
        }
    }
View Full Code Here

Examples of com.sun.appserv.management.config.MailResourceConfig

        this resource multiple times for some specific tests.
     */
      public static synchronized MailResourceConfig
  ensureDefaultInstance( final DomainConfig dc )
  {
      MailResourceConfig result = dc.getMailResourceConfigMap().get( getDefaultInstanceName() );
     
        /*
        if ( result != null )
        {
            System.out.println( "ensureDefaultInstance(): removing: " +
                JMXUtil.toString( Util.getExtra(result).getObjectName() ) );
            dc.removeMailResourceConfig( result.getName() );
            result  = null;
        }
        */
       
      if ( result == null )
      {
          result  = createInstance( dc, getDefaultInstanceName(),
              MAIL_RESOURCE_HOST, MAIL_RESOURCE_USER, MAIL_RESOURCE_FROM, OPTIONS);
            assert ! result.getEnabled();
           
            final StandaloneServerConfig serverConfig = dc.getStandaloneServerConfigMap().get( "server" );
           
            final Map<String,String> options = new HashMap<String,String>();
            options.put( ResourceConfigKeys.ENABLED_KEY, "false" );
            final ResourceRefConfig ref = serverConfig.createResourceRefConfig( result.getName(), options );
            assert ! ref.getEnabled();
           
            RefHelper.removeAllRefsTo( result, false );
      }
     
View Full Code Here

Examples of com.sun.appserv.management.config.MailResourceConfig

  }
   
    protected final AMXConfig
  createProgeny( final String name, final Map<String,String> options )
  {
      final MailResourceConfig  config  =
        getDomainConfig().createMailResourceConfig( name,
                                  MAIL_RESOURCE_HOST,
                                  MAIL_RESOURCE_USER,
                                  MAIL_RESOURCE_FROM,
                                  options);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.