001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017 package org.apache.servicemix.jbi.management.task;
018
019 import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
020 import org.apache.tools.ant.Project;
021
022 /**
023 * ListBindingComponentsTask
024 *
025 * @version $Revision:
026 */
027 public class ListBindingComponentsTask extends JbiTask {
028
029 private String sharedLibraryName;
030
031 private String serviceAssemblyName;
032
033 private String bindingComponentName;
034
035 private String state;
036
037 private String xmlOutput;
038
039 /**
040 * @return the xmlOutput
041 */
042 public String isXmlOutput() {
043 return xmlOutput;
044 }
045
046 /**
047 * @param xmlOutput
048 * the xmlOutput to set
049 */
050 public void setXmlOutput(String xmlOutput) {
051 this.xmlOutput = xmlOutput;
052 }
053
054 /**
055 *
056 * @return shared library name
057 */
058 public String getSharedLibraryName() {
059 return sharedLibraryName;
060 }
061
062 /**
063 *
064 * @param sharedLibraryName
065 */
066 public void setSharedLibraryName(String sharedLibraryName) {
067 this.sharedLibraryName = sharedLibraryName;
068 }
069
070 /**
071 *
072 * @return service assembly name
073 */
074 public String getServiceAssemblyName() {
075 return serviceAssemblyName;
076 }
077
078 /**
079 *
080 * @param serviceAssemblyName
081 */
082 public void setServiceAssemblyName(String serviceAssemblyName) {
083 this.serviceAssemblyName = serviceAssemblyName;
084 }
085
086 /**
087 *
088 * @return binding component name
089 */
090 public String getBindingComponentName() {
091 return bindingComponentName;
092 }
093
094 /**
095 *
096 * @param bindingComponentName
097 */
098 public void setBindingComponentName(String bindingComponentName) {
099 this.bindingComponentName = bindingComponentName;
100 }
101
102 /**
103 *
104 * @return component state
105 */
106 public String getState() {
107 return state;
108 }
109
110 /**
111 *
112 * @param state
113 * Sets the component state
114 */
115 public void setState(String state) {
116 this.state = state;
117 }
118
119 /**
120 * execute the task
121 *
122 * @throws BuildException
123 */
124 public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
125 String result = acs.listComponents(true, false, true, getState(), getSharedLibraryName(), getServiceAssemblyName());
126 if (xmlOutput != null) {
127 getProject().setProperty(xmlOutput, result);
128 }
129 log(result, Project.MSG_WARN);
130 }
131
132 }