Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package cl.alma.camel.acslog;
 
Represents a ACSLog endpoint.
 
 @UriEndpoint(scheme = "acslog")
 public class ACSLogEndpoint extends DefaultEndpoint {
 	
 	private String xml = null;
 	
 	private String audience = "Engineer";
 	
 	private String discard = "Trace";
 	
 	private String level = "Info";
 	
 	private String origin = "origin_not_defined";
 	
 	private int mode = 0;

Constructor
 
     public ACSLogEndpoint() { }

    
    

Parameters:
uri
component
See also:
org.apache.camel.impl.DefaultEndpoint
 
     public ACSLogEndpoint(String uriACSLogComponent component) {
         super(uricomponent);
     }

    
This endpoint implementation does not allow a producer, just a consumer.

 
     public Producer createProducer() throws Exception {
         //return new ACSLogProducer(this);
     	throw new RuntimeCamelException("Cannot produce to a ACSLog endpoint (one way only): " + getEndpointUri());
     }

    
Creates the consumer, if "xml" was specified in the endpoint options, it will create a ACSLogConsumerXML, otherwise it will use a ACSLogConsumerOnline

 
     public Consumer createConsumer(Processor processorthrows Exception {   	
     	ACSLogConsumer consumer = null;
     	
     	if(this.usingXMLFiles())
     		consumer = new ACSLogConsumerXML(thisprocessor);
     	else	
     		consumer = new ACSLogConsumerLC(thisprocessor);
     	
     	this.configureConsumer(consumer);
     	return consumer;
     }

    
 
     public boolean isSingleton() {
         return true;
    }
    
    

Returns:
if will use a XML directory
    public boolean usingXMLFiles() {
    	if(this.getXml() != null)
    		return !this.getXml().isEmpty();
    	return false;
    }

Returns:
the xml
	public String getXml() {
		return ;
	}

Parameters:
xml the xml to set
	public void setXml(String xml) {
		this. = xml;
	}

Returns:
the audience
	public String getAudience() {
		return ;
	}

Parameters:
audience the audience to set
	public void setAudience(String audience) {
		this. = audience;
	}

Returns:
the discard
	public String getDiscard() {
		return ;
	}

Parameters:
discard the discard to set
	public void setDiscard(String discard) {
		this. = discard;
	}

Returns:
the level
	public String getLevel() {
		return ;
	}

Parameters:
level the level to set
	public void setLevel(String level) {
		this. = level;
	}

Returns:
the location
	public String getOrigin() {
	}

Parameters:
location the location to set
	public void setOrigin(String origin) {
		this. = origin.toLowerCase();
	}

Returns:
the mode
	public int getMode() {
		return ;
	}

Parameters:
mode the mode to set
	public void setMode(int mode) {
		this. = mode;
	}
	public ACSLogMode getModeEnum() {
		return ACSLogMode.values()[this.getMode()];
	}
New to GrepCode? Check out our FAQ X