Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<!--

     Copyright 2005-2014 Red Hat, Inc.

     Red Hat 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.

-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:bp="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0">

    <reference id="featuresService" interface="org.apache.karaf.features.FeaturesService"/>
    <reference id="fabricService" interface="io.fabric8.api.FabricService"/>
    <reference id="curator" interface="org.apache.curator.framework.CuratorFramework"/>
    <reference id="configurationAdmin" interface="org.osgi.service.cm.ConfigurationAdmin" availability="optional"/>
    <reference id="editorFactory" interface="org.jledit.EditorFactory"/>

  <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">

        <command name="fabric/profile-edit">
            <action class="io.fabric8.commands.ProfileEdit">
                <property name="fabricService" ref="fabricService"/>
                <property name="curator" ref="curator"/>
                <property name="configurationAdmin" ref="configurationAdmin"/>
                <property name="editorFactory" ref="editorFactory"/>
            </action>
            <completers>
                <ref component-id="profileCompleter"/>
                <ref component-id="versionCompleter"/>
                <null/>
            </completers>
            <optional-completers>
                <entry key="-f" value-ref="allFeatureCompleter"/>
                <entry key="-r" value-ref="featureUrlCompleter"/>
                <entry key="-b" value-ref="bundleCompleter"/>
                <entry key="-p" value-ref="delimitedConfigWithKeysCompleter"/>
            </optional-completers>
        </command>

        <command name="fabric/container-connect">
            <action class="io.fabric8.commands.ContainerConnect">
                <property name="fabricService" ref="fabricService"/>
                <property name="curator" ref="curator"/>
                <property name="sshClientId">
                    <bp:idref component-id="sshClient"/>
                </property>
            </action>
            <completers>
                <ref component-id="containerCompleter"/>
                <null/>
            </completers>
        </command>
    </command-bundle>

    <bean id="containerCompleter" class="io.fabric8.boot.commands.support.ContainerCompleter">
        <property name="fabricService" ref="fabricService"/>
    </bean>

    <bean id="profileCompleter" class="io.fabric8.boot.commands.support.ProfileCompleter">
        <property name="fabricService" ref="fabricService"/>
    </bean>

    <bean id="versionCompleter" class="io.fabric8.boot.commands.support.VersionCompleter">
        <property name="fabricService" ref="fabricService"/>
    </bean>

    <bean id="allFeatureCompleter" class="io.fabric8.commands.support.DelimitedListCompleter">
        <argument index="0">
            <ref component-id="karafAllFeatureCompleter"/>
        </argument>
    </bean>

    <bean id="featureUrlCompleter" class="io.fabric8.commands.support.DelimitedListCompleter">
        <argument index="0">
            <ref component-id="karafFeatureUrlCompleter"/>
        </argument>
    </bean>

    <bean id="bundleCompleter" class="io.fabric8.commands.support.DelimitedListCompleter">
        <argument index="0">
            <ref component-id="bundleLocationCompleter"/>
        </argument>
    </bean>

    <bean id="delimitedConfigWithKeysCompleter" class="io.fabric8.commands.support.DelimitedListCompleter">
        <argument index="0">
            <bean class="io.fabric8.commands.support.ConfigWithKeyCompleter" init-method="init">
                <property name="admin" ref="configurationAdmin"/>
            </bean>
        </argument>
    </bean>

    <bean id="bundleLocationCompleter" class="io.fabric8.commands.support.BundleLocationCompleter">
        <property name="featuresService" ref="featuresService" />
    </bean>

     <!-- Karaf Completers -->
    <bean id="karafAllFeatureCompleter" class="org.apache.karaf.features.command.completers.AllFeatureCompleter">
        <property name="featuresService" ref="featuresService" />
    </bean>

    <bean id="karafFeatureUrlCompleter" class="org.apache.karaf.features.command.completers.FeatureRepositoryCompleter">
        <property name="featuresService" ref="featuresService" />
    </bean>

    <!-- Container Connect -->
    <bean id="agentFactory" class="org.apache.karaf.shell.ssh.KarafAgentFactory">
        <property name="bundleContext" ref="blueprintBundleContext"/>
    </bean>

    <bean id="sshClient" class="org.apache.sshd.SshClient" factory-method="setUpDefaultClient" scope="prototype">
        <property name="agentFactory" ref="agentFactory" />
    </bean>

</blueprint>
New to GrepCode? Check out our FAQ X