http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/716e03b5/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/ReportingTaskNode.java ---------------------------------------------------------------------- diff --cc nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/ReportingTaskNode.java index 0000000,6b8ede0..fa48cb3 mode 000000,100644..100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/ReportingTaskNode.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/ReportingTaskNode.java @@@ -1,0 -1,56 +1,77 @@@ + /* + * 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 org.apache.nifi.controller; + + import java.util.concurrent.TimeUnit; + + import org.apache.nifi.reporting.ReportingContext; + import org.apache.nifi.reporting.ReportingTask; + import org.apache.nifi.scheduling.SchedulingStrategy; + + public interface ReportingTaskNode extends ConfiguredComponent { + + Availability getAvailability(); + + void setAvailability(Availability availability); + + void setSchedulingStrategy(SchedulingStrategy schedulingStrategy); + + SchedulingStrategy getSchedulingStrategy(); + + /** + * @return a string representation of the time between each scheduling + * period + */ + String getSchedulingPeriod(); + + long getSchedulingPeriod(TimeUnit timeUnit); + + /** + * Updates how often the ReportingTask should be triggered to run + * @param schedulingPeriod + */ + void setScheduldingPeriod(String schedulingPeriod); + + ReportingTask getReportingTask(); + + ReportingContext getReportingContext(); + + ConfigurationContext getConfigurationContext(); + + boolean isRunning(); ++ ++ /** ++ * Indicates the {@link ScheduledState} of this <code>ReportingTask</code>. A ++ * value of stopped does NOT indicate that the <code>ReportingTask</code> has ++ * no active threads, only that it is not currently scheduled to be given ++ * any more threads. To determine whether or not the ++ * <code>ReportingTask</code> has any active threads, see ++ * {@link ProcessScheduler#getActiveThreadCount(ReportingTask)}. ++ * ++ * @return ++ */ ++ ScheduledState getScheduledState(); ++ ++ void setScheduledState(ScheduledState state); ++ ++ void verifyCanStart(); ++ void verifyCanStop(); ++ void verifyCanDisable(); ++ void verifyCanEnable(); ++ void verifyCanDelete(); ++ void verifyCanUpdate(); + }
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/716e03b5/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/service/ControllerServiceNode.java ---------------------------------------------------------------------- diff --cc nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/service/ControllerServiceNode.java index 0000000,6f9c237..66bad39 mode 000000,100644..100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/service/ControllerServiceNode.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/service/ControllerServiceNode.java @@@ -1,0 -1,40 +1,47 @@@ + /* + * 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 org.apache.nifi.controller.service; + + import org.apache.nifi.controller.Availability; + import org.apache.nifi.controller.ConfiguredComponent; + import org.apache.nifi.controller.ControllerService; + + public interface ControllerServiceNode extends ConfiguredComponent { + - ControllerService getControllerService(); ++ ControllerService getProxiedControllerService(); ++ ++ ControllerService getControllerServiceImplementation(); + + Availability getAvailability(); + + void setAvailability(Availability availability); + + boolean isDisabled(); + + void setDisabled(boolean disabled); + + ControllerServiceReference getReferences(); + + void addReference(ConfiguredComponent referringComponent); + + void removeReference(ConfiguredComponent referringComponent); ++ ++ void verifyCanEnable(); ++ void verifyCanDisable(); ++ void verifyCanDelete(); ++ void verifyCanUpdate(); + } http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/716e03b5/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/service/ControllerServiceProvider.java ---------------------------------------------------------------------- diff --cc nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/service/ControllerServiceProvider.java index 0000000,35a255d..03ed779 mode 000000,100644..100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/service/ControllerServiceProvider.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/service/ControllerServiceProvider.java @@@ -1,0 -1,47 +1,56 @@@ + /* + * 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 org.apache.nifi.controller.service; + -import java.util.Map; - ++import org.apache.nifi.annotation.lifecycle.OnAdded; + import org.apache.nifi.controller.ControllerServiceLookup; + + /** + * + */ + public interface ControllerServiceProvider extends ControllerServiceLookup { + + /** - * Gets the controller service for the specified identifier. Returns null if - * the identifier does not match a known service. ++ * Creates a new Controller Service of the given type and assigns it the given id. If <code>firstTimeadded</code> ++ * is true, calls any methods that are annotated with {@link OnAdded} + * + * @param type + * @param id - * @param properties ++ * @param firstTimeAdded + * @return + */ - ControllerServiceNode createControllerService(String type, String id, Map<String, String> properties); ++ ControllerServiceNode createControllerService(String type, String id, boolean firstTimeAdded); + + /** + * Gets the controller service node for the specified identifier. Returns + * <code>null</code> if the identifier does not match a known service + * + * @param id + * @return + */ + ControllerServiceNode getControllerServiceNode(String id); ++ ++ /** ++ * Removes the given Controller Service from the flow. This will call all appropriate methods ++ * that have the @OnRemoved annotation. ++ * ++ * @param serviceNode the controller service to remove ++ * ++ * @throws IllegalStateException if the controller service is not disabled or is not a part of this flow ++ */ ++ void removeControllerService(ControllerServiceNode serviceNode); + }
