Package org.tubo.item

Examples of org.tubo.item.Item


        //
        // setup event (hook)
        initializeEvent(event);
        //
        // create new item
        Item item = createItem();
        //
        // set raw data consumed
        item.setConsumedRawData(consumedRawData);
        //
        // setup item (hook)
        initializeItem(item);
        //
        // dispatch event
View Full Code Here


    /**
     * Create a new Item instance using ResourceManager
     * @return a Item instance
     */
    protected Item createItem() {
        Item item = getResourceManager().getNewItem();
        return item;
    }
View Full Code Here


    public void execute(FlowContext flowContext) throws TuboException {
        //
        // get item
        Item item = flowContext.getItem();
        //
        //
        int i=0;
        String transform = null;
        do {
            //
            // get i-esima transformation
            String ti = "t"+i;
            transform = (String)item.getProperty(ti);
            //
            // if i-esima transformation is null then is cut condition
            if (transform!=null) {
                //
                // parse transformation
                int inx = transform.indexOf("->");
                String from = transform.substring(0,inx).trim();
                String to = transform.substring(inx+"->".length(),transform.length()).trim();
                //
                // transform
                Object value = item.getProperties().remove(from);
                item.setProperty(to,value);
                //
                // increment i
                i++;
            }
        //
View Full Code Here

    }

    public void execute(FlowContext flowContext) throws TuboException {
        //
        // get item
        Item item = flowContext.getItem();
        //
        // get input
        String input = (String)item.getProperty(ECHO_INPUT_PROPERTY);
        //
        // put input in output
        item.setProperty(ECHO_OUTPUT_PROPERTY,input);
    }
View Full Code Here

    }

    public void execute(FlowContext flowContext) throws TuboException {
        //
        // get item
        Item item = flowContext.getItem();
        //
        // get input
        String input = (String)item.getProperty(ECHO_INPUT_PROPERTY);
        //
        // trim input
        input = input.trim();
        //
        // check command
        if (HELP_CMD.equals(input))
            item.setProperty(ECHO_OUTPUT_PROPERTY, HELP_MSG);
        else if (SHUTDOWN_CMD.equals(input)) {
            getResourceManager().getKernel().shutdown();
            item.setProperty(ECHO_OUTPUT_PROPERTY, "");
        }
        else
            if ("".equals(input) || "\n".equals(input) || "\r".equals(input))
                item.setProperty(ECHO_OUTPUT_PROPERTY, null);
            else
                item.setProperty(ECHO_OUTPUT_PROPERTY, CMDNOTFOUND_MSG);
    }
View Full Code Here

     * </p>
     * @return new Item instance
     * @throws TuboException
     */
    public Item getNewItem() throws TuboException {
        Item item = null;
        try {
            //
            // get Item via Spring
            item = (Item)beanFactory.getBean(SPRING_ITEM_BEAN_ID);
        } catch (BeansException e) {
View Full Code Here

    public void sayHelloWithName(FlowContext flowContext) throws TuboException {
        flowContext.getItem().setProperty(HELLO_OUTPUT_PROPERTY,"Hello World!!");
        //
        // get item
        Item item = flowContext.getItem();
        //
        // get name
        String name = (String)item.getProperty(HELLO_NAME_PROPERTY);
        //
        // put input in output
        item.setProperty(HELLO_OUTPUT_PROPERTY,"Hello World "+name+"!!");
    }
View Full Code Here

    private static Log log = LogFactory.getLog(LoggerComponent.class);

    public void execute(FlowContext flowContext) throws TuboException {
        //
        // get item
        Item item = flowContext.getItem();
        //
        // get consumed Log Event
        LoggingEvent event = (LoggingEvent) item.getConsumedRawData();
        //
        // get a logger from the hierarchy. The name of the logger is taken to be the name contained in the event.
        Logger remoteLogger = LogManager.getLoggerRepository().getLogger(event.getLoggerName());
        //
        // apply the logger-level filter
View Full Code Here

TOP

Related Classes of org.tubo.item.Item

Copyright © 2018 www.massapicom. 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.