Skip to content

Commit

Permalink
Revert "refactor RunModesProvider service"
Browse files Browse the repository at this point in the history
This reverts commit 4cdb723.
  • Loading branch information
dprzybyl committed Oct 28, 2024
1 parent 19a69ad commit 851ab24
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
package com.cognifide.apm.api.scripts;

import com.cognifide.apm.core.services.RunModesProvider;
import com.cognifide.apm.api.services.RunModesProvider;
import java.util.Arrays;
import java.util.Optional;
import org.apache.commons.lang3.StringUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*-
* ========================LICENSE_START=================================
* AEM Permission Management
* %%
* Copyright (C) 2013 Wunderman Thompson Technology
* %%
* Licensed 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.
* =========================LICENSE_END==================================
*/
package com.cognifide.apm.api.services;

import java.util.Set;

public interface RunModesProvider {

Set<String> getRunModes();

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

import com.cognifide.apm.api.scripts.LaunchEnvironment;
import com.cognifide.apm.api.scripts.Script;
import com.cognifide.apm.api.services.RunModesProvider;
import com.cognifide.apm.api.services.ScriptFinder;
import com.cognifide.apm.api.services.ScriptManager;
import com.cognifide.apm.core.Property;
import com.cognifide.apm.core.services.ModifiedScriptFinder;
import com.cognifide.apm.core.services.ResourceResolverProvider;
import com.cognifide.apm.core.services.RunModesProvider;
import com.cognifide.apm.core.utils.sling.SlingHelper;
import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.cognifide.apm.api.scripts.LaunchEnvironment;
import com.cognifide.apm.api.scripts.LaunchMode;
import com.cognifide.apm.api.scripts.Script;
import com.cognifide.apm.core.services.RunModesProvider;
import com.cognifide.apm.api.services.RunModesProvider;
import java.util.Date;
import java.util.Set;
import java.util.function.Predicate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import com.cognifide.apm.api.scripts.LaunchMode;
import com.cognifide.apm.api.scripts.Script;
import com.cognifide.apm.api.services.RunModesProvider;
import com.cognifide.apm.api.services.ScriptFinder;
import com.cognifide.apm.api.services.ScriptManager;
import com.cognifide.apm.core.Apm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
import com.cognifide.apm.api.scripts.Script;
import com.cognifide.apm.api.services.ExecutionMode;
import com.cognifide.apm.api.services.ExecutionResult;
import com.cognifide.apm.api.services.RunModesProvider;
import com.cognifide.apm.api.services.ScriptFinder;
import com.cognifide.apm.api.services.ScriptManager;
import com.cognifide.apm.api.status.Status;
import com.cognifide.apm.core.services.ModifiedScriptFinder;
import com.cognifide.apm.core.services.ResourceResolverProvider;
import com.cognifide.apm.core.services.RunModesProvider;
import com.cognifide.apm.core.services.event.ApmEvent;
import com.cognifide.apm.core.services.event.EventManager;
import com.cognifide.apm.core.utils.sling.SlingHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,23 @@
* limitations under the License.
* =========================LICENSE_END==================================
*/
package com.cognifide.apm.core.services;
package com.cognifide.apm.runmodes.services;

import com.cognifide.apm.core.Property;
import com.cognifide.apm.api.services.RunModesProvider;
import java.util.Set;
import org.apache.sling.settings.SlingSettingsService;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

@Component(
service = RunModesProvider.class,
property = {
Property.DESCRIPTION + "APM Service for providing run modes",
Property.VENDOR
}
)
public class RunModesProvider {
@Component
public class RunModesProviderService implements RunModesProvider {

@Reference
private SlingSettingsService slingSettings;

@Override
public Set<String> getRunModes() {
return slingSettings.getRunModes();
}

}

0 comments on commit 851ab24

Please sign in to comment.