@Test public void testParseJettyOption_Acceptors() throws KettleXMLException { Node configNode = getConfigNode( getConfigWithAcceptorsOnlyOption() ); Map<String, String> parseJettyOptions = slServerConfig.parseJettyOptions( configNode ); assertNotNull( parseJettyOptions ); assertEquals( 1, parseJettyOptions.size() ); assertTrue( "Expected containing key=" + EXPECTED_ACCEPTORS_KEY, parseJettyOptions .containsKey( EXPECTED_ACCEPTORS_KEY ) ); assertEquals( EXPECTED_ACCEPTORS_VALUE, parseJettyOptions.get( EXPECTED_ACCEPTORS_KEY ) ); }
protected Map<String, String> parseJettyOptions( Node node ) { Map<String, String> jettyOptions = null; Node jettyOptionsNode = XMLHandler.getSubNode( node, XML_TAG_JETTY_OPTIONS ); if ( jettyOptionsNode != null ) { jettyOptions = new HashMap<String, String>(); if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPTORS ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_ACCEPTORS, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPTORS ) ); } if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPT_QUEUE_SIZE ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPT_QUEUE_SIZE ) ); } if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_LOW_RES_MAX_IDLE_TIME ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_LOW_RES_MAX_IDLE_TIME ) ); } } return jettyOptions; }
SlaveServerConfig { protected Map<String, String> parseJettyOptions( Node node ) { Map<String, String> jettyOptions = null; Node jettyOptionsNode = XMLHandler.getSubNode( node, XML_TAG_JETTY_OPTIONS ); if ( jettyOptionsNode != null ) { jettyOptions = new HashMap<String, String>(); if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPTORS ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_ACCEPTORS, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPTORS ) ); } if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPT_QUEUE_SIZE ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPT_QUEUE_SIZE ) ); } if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_LOW_RES_MAX_IDLE_TIME ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_LOW_RES_MAX_IDLE_TIME ) ); } } return jettyOptions; } }
SlaveServerConfig { protected Map<String, String> parseJettyOptions( Node node ) { Map<String, String> jettyOptions = null; Node jettyOptionsNode = XMLHandler.getSubNode( node, XML_TAG_JETTY_OPTIONS ); if ( jettyOptionsNode != null ) { jettyOptions = new HashMap<String, String>(); if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPTORS ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_ACCEPTORS, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPTORS ) ); } if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPT_QUEUE_SIZE ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPT_QUEUE_SIZE ) ); } if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_LOW_RES_MAX_IDLE_TIME ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_LOW_RES_MAX_IDLE_TIME ) ); } } return jettyOptions; } SlaveServerConfig();  SlaveServerConfig( SlaveServer slaveServer );  SlaveServerConfig( List<SlaveServer> masters, boolean reportingToMasters, SlaveServer slaveServer );  SlaveServerConfig( LogChannelInterface log, Node node );  SlaveServerConfig( String hostname, int port, boolean joining ); }
SlaveServerConfig { protected Map<String, String> parseJettyOptions( Node node ) { Map<String, String> jettyOptions = null; Node jettyOptionsNode = XMLHandler.getSubNode( node, XML_TAG_JETTY_OPTIONS ); if ( jettyOptionsNode != null ) { jettyOptions = new HashMap<String, String>(); if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPTORS ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_ACCEPTORS, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPTORS ) ); } if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPT_QUEUE_SIZE ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPT_QUEUE_SIZE ) ); } if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_LOW_RES_MAX_IDLE_TIME ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_LOW_RES_MAX_IDLE_TIME ) ); } } return jettyOptions; } SlaveServerConfig();  SlaveServerConfig( SlaveServer slaveServer );  SlaveServerConfig( List<SlaveServer> masters, boolean reportingToMasters, SlaveServer slaveServer );  SlaveServerConfig( LogChannelInterface log, Node node );  SlaveServerConfig( String hostname, int port, boolean joining ); String getXML(); void readAutoSequences(); List<SlaveServer> getMasters(); void setMasters( List<SlaveServer> masters ); SlaveServer getSlaveServer(); void setSlaveServer( SlaveServer slaveServer ); boolean isReportingToMasters(); void setReportingToMasters( boolean reportingToMaster ); boolean isJoining(); void setJoining( boolean joining ); int getMaxLogLines(); void setMaxLogLines( int maxLogLines ); int getMaxLogTimeoutMinutes(); void setMaxLogTimeoutMinutes( int maxLogTimeoutMinutes ); int getObjectTimeoutMinutes(); void setObjectTimeoutMinutes( int objectTimeoutMinutes ); String getFilename(); void setFilename( String filename ); List<DatabaseMeta> getDatabases(); void setDatabases( List<DatabaseMeta> databases ); List<SlaveSequence> getSlaveSequences(); void setSlaveSequences( List<SlaveSequence> slaveSequences ); SlaveSequence getAutoSequence(); void setAutoSequence( SlaveSequence autoSequence ); boolean isAutomaticCreationAllowed(); void setAutomaticCreationAllowed( boolean automaticCreationAllowed ); Repository getRepository(); void setRepository( Repository repository ); String getRepositoryUsername(); void setRepositoryUsername( String repositoryUsername ); String getRepositoryPassword(); void setRepositoryPassword( String repositoryPassword ); DelegatingMetaStore getMetaStore(); void setMetaStore( DelegatingMetaStore metaStore ); String getPasswordFile(); void setPasswordFile( String passwordFile ); String getRepositoryId(); void setRepositoryId( String repositoryId ); }
SlaveServerConfig { protected Map<String, String> parseJettyOptions( Node node ) { Map<String, String> jettyOptions = null; Node jettyOptionsNode = XMLHandler.getSubNode( node, XML_TAG_JETTY_OPTIONS ); if ( jettyOptionsNode != null ) { jettyOptions = new HashMap<String, String>(); if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPTORS ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_ACCEPTORS, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPTORS ) ); } if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPT_QUEUE_SIZE ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_ACCEPT_QUEUE_SIZE, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_ACCEPT_QUEUE_SIZE ) ); } if ( XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_LOW_RES_MAX_IDLE_TIME ) != null ) { jettyOptions.put( Const.KETTLE_CARTE_JETTY_RES_MAX_IDLE_TIME, XMLHandler.getTagValue( jettyOptionsNode, XML_TAG_LOW_RES_MAX_IDLE_TIME ) ); } } return jettyOptions; } SlaveServerConfig();  SlaveServerConfig( SlaveServer slaveServer );  SlaveServerConfig( List<SlaveServer> masters, boolean reportingToMasters, SlaveServer slaveServer );  SlaveServerConfig( LogChannelInterface log, Node node );  SlaveServerConfig( String hostname, int port, boolean joining ); String getXML(); void readAutoSequences(); List<SlaveServer> getMasters(); void setMasters( List<SlaveServer> masters ); SlaveServer getSlaveServer(); void setSlaveServer( SlaveServer slaveServer ); boolean isReportingToMasters(); void setReportingToMasters( boolean reportingToMaster ); boolean isJoining(); void setJoining( boolean joining ); int getMaxLogLines(); void setMaxLogLines( int maxLogLines ); int getMaxLogTimeoutMinutes(); void setMaxLogTimeoutMinutes( int maxLogTimeoutMinutes ); int getObjectTimeoutMinutes(); void setObjectTimeoutMinutes( int objectTimeoutMinutes ); String getFilename(); void setFilename( String filename ); List<DatabaseMeta> getDatabases(); void setDatabases( List<DatabaseMeta> databases ); List<SlaveSequence> getSlaveSequences(); void setSlaveSequences( List<SlaveSequence> slaveSequences ); SlaveSequence getAutoSequence(); void setAutoSequence( SlaveSequence autoSequence ); boolean isAutomaticCreationAllowed(); void setAutomaticCreationAllowed( boolean automaticCreationAllowed ); Repository getRepository(); void setRepository( Repository repository ); String getRepositoryUsername(); void setRepositoryUsername( String repositoryUsername ); String getRepositoryPassword(); void setRepositoryPassword( String repositoryPassword ); DelegatingMetaStore getMetaStore(); void setMetaStore( DelegatingMetaStore metaStore ); String getPasswordFile(); void setPasswordFile( String passwordFile ); String getRepositoryId(); void setRepositoryId( String repositoryId ); static final String XML_TAG; static final String XML_TAG_MASTERS; static final String XML_TAG_REPOSITORY; static final String XML_TAG_SEQUENCES; static final String XML_TAG_AUTOSEQUENCE; static final String XML_TAG_AUTO_CREATE; static final String XML_TAG_JETTY_OPTIONS; static final String XML_TAG_ACCEPTORS; static final String XML_TAG_ACCEPT_QUEUE_SIZE; static final String XML_TAG_LOW_RES_MAX_IDLE_TIME; }