Package smilehouse.opensyncro.pipes.component

Examples of smilehouse.opensyncro.pipes.component.PipeComponentData


        return getInstance(id);
    }
    */
   
    public PipeComponentIF loadPipeComponent(String id, Long PipeComponentDataId) {
        PipeComponentData pcdata = (PipeComponentData) load(PipeComponentData.class, PipeComponentDataId);
        return getInstance(id, pcdata);
       
    }
View Full Code Here


                                Persister pers,
                                LabelResource labels,
                                int requestType) {

        PipeComponentIF component = null;
        PipeComponentData componentData = null;
       
        //component = pers.loadPipeComponent(new Long(parameters.getLong(COMPONENT_ID)));
        String componentId = parameters.getString(COMPONENT_ID);
        Long dataId = new Long(parameters.getLong(DATA_ID));
View Full Code Here

                        PipeComponentIF impl = Persister.getInstance(className);
                        if(impl != null) {
                            //PipeComponentIF newComponent = impl.getInstance();
                            PipeComponentIF newComponent = Persister.getInstance(className);
                            PipeComponentData pcdata;
                            pcdata = new PipeComponentData();
                            pcdata.setAttributes(new HashMap());
                            //Long dataId;

                            switch(componentType) {
                            case PipeComponentIF.TYPE_SOURCE:
                                pipe.setSource((SourceIF) newComponent);
                                pipe.setSourceID(newComponent.getID());

                                pcdata = new PipeComponentData();
                                pipe.setSourceData(pcdata);
                                newComponent.setData(pcdata);

                                pers.save(pcdata);

                                //dataId = pcdata.getId();
                                break;
                            case PipeComponentIF.TYPE_DESTINATION:
                                pipe.setDestination((DestinationIF) newComponent);
                                pipe.setDestinationID(newComponent.getID());

                                pcdata = new PipeComponentData();
                                pipe.setDestinationData(pcdata);
                                newComponent.setData(pcdata);

                                pers.save(pcdata);

                                //dataId = pcdata.getId();
                                break;
                            case PipeComponentIF.TYPE_CONVERTER:
                                pcdata = new PipeComponentData();
                                ConverterListItem cl = pipe.addConverter(
                                    (ConverterIF) newComponent,
                                    pcdata);
                                pers.save(cl);

                                pers.save(pipe);

                                //dataId = pcdata.getId();

                                /*System.out.println("Created new Converter (" + newComponent.getID() + ", " +
                                 className + "), dataId: " + dataId);*/

                                converterField = converterFieldInfo.getField(pipe, labels, req);
                                break;
                            }
                        }
                    }
                }

                // ------
                // Delete
                // ------
                if(parameters.wasGiven(DELETE_COMPONENT_OF_TYPE)
                        && parameters.getInt(DELETE_COMPONENT_OF_TYPE) != -1) {
                    switch(parameters.getInt(DELETE_COMPONENT_OF_TYPE)) {
                    case PipeComponentIF.TYPE_SOURCE:
                        PipeComponentIF source = pipe.getCurrentSource();
                        String sourceID = pipe.getSourceID();
                        if(sourceID != null) {
                            PipeComponentData sourceData = this.pipe.getSourceData();

                            // We need to remove references to Source component's PipeComponentData before deleting it
                            if(source != null) {
                                source.setData(null);
                            }
                            pipe.setSourceData(null);

                            // Delete the Source component's PipeComponentData
                            pers.delete(sourceData);

                            // Clear Source component instance and ID
                            pipe.setSource(null);
                            pipe.setSourceID(null);

                        }
                        break;
                    case PipeComponentIF.TYPE_DESTINATION:
                        PipeComponentIF destination = pipe.getCurrentDestination();
                        String destinationID = pipe.getDestinationID();
                        if(destinationID != null) {
                            PipeComponentData destinationData = this.pipe.getDestinationData();

                            // We need to remove references to Destination component's PipeComponentData before deleting it
                            if(destination != null) {
                               destination.setData(null);   
                            }
View Full Code Here

    while(it.hasNext()){
      ConverterListItem cvi=(ConverterListItem)it.next();
      ConverterListItem ci=new ConverterListItem();
      ci.setConverter(cvi.getConverter());
      HashMap cmap=new HashMap(cvi.getConverterData().getAttributes());
      ci.setConverterData(new PipeComponentData(cmap));
      ci.setConverterID(cvi.getConverterID());
      ci.setParent(this);
      newClist.add(ci);
    }
    pipe.setConverterList(newClist);
   
    HashMap dmap=new HashMap();
    if(this.getDestinationData()!=null){
      dmap.putAll(this.getDestinationData().getAttributes());
    }
    pipe.setDestinationData(new PipeComponentData(dmap));
    pipe.setDestinationID(this.getDestinationID());
   
    pipe.setHttpStartEnabled(this.isHttpStartEnabled());
    pipe.setMailHost(this.getMailHost());
    pipe.setName("Copy of "+this.getName());
    pipe.setRecipientAddress(this.getRecipientAddress());
   
    HashMap smap=new HashMap();
    if(this.getSourceData()!=null){
      smap.putAll(this.getSourceData().getAttributes());
    }
    pipe.setSourceData(new PipeComponentData(smap));
    pipe.setSourceID(this.getSourceID());
   
    pipe.setStartPassword(this.getStartPassword());
    pipe.setTransferLogNotificationLevel(this.getTransferLogNotificationLevel());
    pipe.setLoggingVerbosityLevel(this.getLoggingVerbosityLevel());
View Full Code Here

                return null;
            }

            // Initialize a new PipeComponentData if needed
            if(data == null) {
                data = new PipeComponentData();
                data.setAttributes(new HashMap());
            }

            // Get the constructor every component should implement
            Class implClass = getImplementationClass(componentID);
View Full Code Here

TOP

Related Classes of smilehouse.opensyncro.pipes.component.PipeComponentData

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.