Skip to content

Commit

Permalink
Add component documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus committed Apr 15, 2015
1 parent a9f1338 commit a0ae974
Show file tree
Hide file tree
Showing 13 changed files with 134 additions and 70 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -45,25 +45,26 @@ public class ValidatorEndpoint extends DefaultEndpoint {


private static final Logger LOG = LoggerFactory.getLogger(ValidatorEndpoint.class); private static final Logger LOG = LoggerFactory.getLogger(ValidatorEndpoint.class);


@UriPath @Metadata(required = "true") @UriPath(description = "URL to a local resource on the classpath or a full URL to a remote resource or resource on the file system which contains the XSD to validate against.")
@Metadata(required = "true")
private String resourceUri; private String resourceUri;
@UriParam(defaultValue = XMLConstants.W3C_XML_SCHEMA_NS_URI) @UriParam(defaultValue = XMLConstants.W3C_XML_SCHEMA_NS_URI, description = "Configures the W3C XML Schema Namespace URI.")
private String schemaLanguage = XMLConstants.W3C_XML_SCHEMA_NS_URI; private String schemaLanguage = XMLConstants.W3C_XML_SCHEMA_NS_URI;
@UriParam @UriParam(description = "To use a custom javax.xml.validation.SchemaFactory")
private SchemaFactory schemaFactory; private SchemaFactory schemaFactory;
@UriParam @UriParam(description = "To use a custom org.apache.camel.processor.validation.ValidatorErrorHandler. The default error handler captures the errors and throws an exception.")
private ValidatorErrorHandler errorHandler = new DefaultValidationErrorHandler(); private ValidatorErrorHandler errorHandler = new DefaultValidationErrorHandler();
@UriParam @UriParam(description = "Whether DOMSource/DOMResult or SaxSource/SaxResult should be used by the validator.")
private boolean useDom; private boolean useDom;
@UriParam(defaultValue = "true") @UriParam(defaultValue = "true", description = "Whether the Schema instance should be shared or not. This option is introduced to work around a JDK 1.6.x bug. Xerces should not have this issue.")
private boolean useSharedSchema = true; private boolean useSharedSchema = true;
@UriParam @UriParam(description = "To use a custom LSResourceResolver")
private LSResourceResolver resourceResolver; private LSResourceResolver resourceResolver;
@UriParam(defaultValue = "true") @UriParam(defaultValue = "true", description = "Whether to fail if no body exists.")
private boolean failOnNullBody = true; private boolean failOnNullBody = true;
@UriParam(defaultValue = "true") @UriParam(defaultValue = "true", description = "Whether to fail if no header exists when validating against a header.")
private boolean failOnNullHeader = true; private boolean failOnNullHeader = true;
@UriParam @UriParam(description = "To validate against a header instead of the message body.")
private String headerName; private String headerName;


public ValidatorEndpoint() { public ValidatorEndpoint() {
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ public SqlMapClient getSqlMapClient() {
return sqlMapClient; return sqlMapClient;
} }


/**
* To use the given {@link com.ibatis.sqlmap.client.SqlMapClient}
*/
public void setSqlMapClient(SqlMapClient sqlMapClient) { public void setSqlMapClient(SqlMapClient sqlMapClient) {
this.sqlMapClient = sqlMapClient; this.sqlMapClient = sqlMapClient;
} }
Expand All @@ -100,14 +103,24 @@ public String getSqlMapConfig() {
return sqlMapConfig; return sqlMapConfig;
} }


/**
* Location of iBatis xml configuration file.
* <p/>
* The default value is: SqlMapConfig.xml loaded from the classpath
*/
public void setSqlMapConfig(String sqlMapConfig) { public void setSqlMapConfig(String sqlMapConfig) {
this.sqlMapConfig = sqlMapConfig; this.sqlMapConfig = sqlMapConfig;
} }


public boolean isUseTransactions() { public boolean isUseTransactions() {
return useTransactions; return useTransactions;
} }


/**
* Whether to use transactions.
* <p/>
* This option is by default true.
*/
public void setUseTransactions(boolean useTransactions) { public void setUseTransactions(boolean useTransactions) {
this.useTransactions = useTransactions; this.useTransactions = useTransactions;
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@
public class IBatisEndpoint extends DefaultPollingEndpoint { public class IBatisEndpoint extends DefaultPollingEndpoint {
@UriPath @Metadata(required = "true") @UriPath @Metadata(required = "true")
private String statement; private String statement;
@UriParam @UriParam(defaultValue = "true")
private boolean useTransactions; private boolean useTransactions = true;
@UriParam @UriParam(label = "producer")
private StatementType statementType; private StatementType statementType;
@UriParam @UriParam(label = "consumer", defaultValue = "0")
private int maxMessagesPerPoll; private int maxMessagesPerPoll;
@UriParam @UriParam(label = "consumer")
private IBatisProcessingStrategy strategy; private IBatisProcessingStrategy strategy;
@UriParam @UriParam(defaultValue = "TRANSACTION_REPEATABLE_READ",
enums = "TRANSACTION_NONE,TRANSACTION_READ_UNCOMMITTED,TRANSACTION_READ_COMMITTED,TRANSACTION_REPEATABLE_READ,TRANSACTION_SERIALIZABLE")
private String isolation; private String isolation;


public IBatisEndpoint() { public IBatisEndpoint() {
Expand Down Expand Up @@ -81,48 +82,40 @@ public IBatisConsumer createConsumer(Processor processor) throws Exception {
return consumer; return consumer;
} }


/**
* Gets the iBatis SqlMapClient
*/
public SqlMapClient getSqlMapClient() throws IOException { public SqlMapClient getSqlMapClient() throws IOException {
return getComponent().getSqlMapClient(); return getComponent().getSqlMapClient();
} }


/**
* Gets the IbatisProcessingStrategy to to use when consuming messages from the database
*/
public IBatisProcessingStrategy getProcessingStrategy() throws Exception { public IBatisProcessingStrategy getProcessingStrategy() throws Exception {
return strategy; return strategy;
} }


/**
* Allows to plugin a custom {@link IBatisProcessingStrategy} to use by the consumer.
*/
public void setStrategy(IBatisProcessingStrategy strategy) { public void setStrategy(IBatisProcessingStrategy strategy) {
this.strategy = strategy; this.strategy = strategy;
} }


/**
* Statement to run when polling or processing
*/
public String getStatement() { public String getStatement() {
return statement; return statement;
} }


/** /**
* Statement to run when polling or processing * The statement name in the iBatis XML mapping file which maps to the query, insert, update or delete operation you wish to evaluate.
*/ */
public void setStatement(String statement) { public void setStatement(String statement) {
this.statement = statement; this.statement = statement;
} }


/**
* Indicates if transactions should be used when calling statements. Useful if using a comma separated list when
* consuming records.
*/
public boolean isUseTransactions() { public boolean isUseTransactions() {
return useTransactions; return useTransactions;
} }


/** /**
* Sets indicator to use transactions for consuming and error handling statements. * Whether to use transactions.
* <p/>
* This option is by default true.
*/ */
public void setUseTransactions(boolean useTransactions) { public void setUseTransactions(boolean useTransactions) {
this.useTransactions = useTransactions; this.useTransactions = useTransactions;
Expand All @@ -132,6 +125,9 @@ public StatementType getStatementType() {
return statementType; return statementType;
} }


/**
* Mandatory to specify for the producer to control which kind of operation to invoke.
*/
public void setStatementType(StatementType statementType) { public void setStatementType(StatementType statementType) {
this.statementType = statementType; this.statementType = statementType;
} }
Expand All @@ -140,6 +136,12 @@ public int getMaxMessagesPerPoll() {
return maxMessagesPerPoll; return maxMessagesPerPoll;
} }


/**
* This option is intended to split results returned by the database pool into the batches and deliver them in multiple exchanges.
* This integer defines the maximum messages to deliver in single exchange. By default, no maximum is set.
* Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files.
* Set a value of 0 or negative to disable it.
*/
public void setMaxMessagesPerPoll(int maxMessagesPerPoll) { public void setMaxMessagesPerPoll(int maxMessagesPerPoll) {
this.maxMessagesPerPoll = maxMessagesPerPoll; this.maxMessagesPerPoll = maxMessagesPerPoll;
} }
Expand All @@ -148,6 +150,9 @@ public String getIsolation() throws Exception {
return isolation; return isolation;
} }


/**
* Transaction isolation level
*/
public void setIsolation(String isolation) throws Exception { public void setIsolation(String isolation) throws Exception {
this.isolation = isolation; this.isolation = isolation;
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ public SchemaFactory getSchemaFactory() {
return schemaFactory; return schemaFactory;
} }


/**
* To use the {@link javax.xml.validation.SchemaFactory}.
*/
public void setSchemaFactory(SchemaFactory schemaFactory) { public void setSchemaFactory(SchemaFactory schemaFactory) {
this.schemaFactory = schemaFactory; this.schemaFactory = schemaFactory;
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public NagiosConfiguration getConfiguration() {
return configuration; return configuration;
} }


/**
* To use a shared {@link NagiosConfiguration}
*/
public void setConfiguration(NagiosConfiguration configuration) { public void setConfiguration(NagiosConfiguration configuration) {
this.configuration = configuration; this.configuration = configuration;
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ public String getHost() {
return host; return host;
} }


/**
* This is the address of the Nagios host where checks should be send.
*/
public void setHost(String host) { public void setHost(String host) {
this.host = host; this.host = host;
} }
Expand All @@ -120,6 +123,9 @@ public int getPort() {
return port; return port;
} }


/**
* The port number of the host.
*/
public void setPort(int port) { public void setPort(int port) {
this.port = port; this.port = port;
} }
Expand All @@ -128,6 +134,9 @@ public int getConnectionTimeout() {
return connectionTimeout; return connectionTimeout;
} }


/**
* Connection timeout in millis.
*/
public void setConnectionTimeout(int connectionTimeout) { public void setConnectionTimeout(int connectionTimeout) {
this.connectionTimeout = connectionTimeout; this.connectionTimeout = connectionTimeout;
} }
Expand All @@ -136,6 +145,9 @@ public int getTimeout() {
return timeout; return timeout;
} }


/**
* Sending timeout in millis.
*/
public void setTimeout(int timeout) { public void setTimeout(int timeout) {
this.timeout = timeout; this.timeout = timeout;
} }
Expand All @@ -144,6 +156,9 @@ public String getPassword() {
return password; return password;
} }


/**
* Password to be authenticated when sending checks to Nagios.
*/
public void setPassword(String password) { public void setPassword(String password) {
this.password = password; this.password = password;
} }
Expand All @@ -152,6 +167,9 @@ public NagiosEncryptionMethod getEncryptionMethod() {
return encryptionMethod; return encryptionMethod;
} }


/**
* To specify an encryption method.
*/
public void setEncryptionMethod(NagiosEncryptionMethod encryptionMethod) { public void setEncryptionMethod(NagiosEncryptionMethod encryptionMethod) {
this.encryptionMethod = encryptionMethod; this.encryptionMethod = encryptionMethod;
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ public boolean isSendSync() {
return sendSync; return sendSync;
} }


/**
* Whether or not to use synchronous when sending a passive check.
* Setting it to false will allow Camel to continue routing the message and the passive check message will be send asynchronously.
*/
public void setSendSync(boolean sendSync) { public void setSendSync(boolean sendSync) {
this.sendSync = sendSync; this.sendSync = sendSync;
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public ApplicationContext getApplicationContext() {
return applicationContext; return applicationContext;
} }


/**
* The Spring ApplicationContext
*/
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext; this.applicationContext = applicationContext;
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public ZooKeeperConfiguration getConfiguration() {
return configuration; return configuration;
} }


/**
* To use a shared {@link ZooKeeperConfiguration}
*/
public void setConfiguration(ZooKeeperConfiguration configuration) { public void setConfiguration(ZooKeeperConfiguration configuration) {
this.configuration = configuration; this.configuration = configuration;
} }
Expand Down
Loading

0 comments on commit a0ae974

Please sign in to comment.