-
Notifications
You must be signed in to change notification settings - Fork 575
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NMS-16358: Fixed meta-data retrieval in Collectd
- Loading branch information
1 parent
1ccbc71
commit a12d06e
Showing
14 changed files
with
224 additions
and
12 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
core/mate/api/src/main/java/org/opennms/core/mate/api/EmptyScopeProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Licensed to The OpenNMS Group, Inc (TOG) under one or more | ||
* contributor license agreements. See the LICENSE.md file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. | ||
* | ||
* TOG licenses this file to You under the GNU Affero General | ||
* Public License Version 3 (the "License") or (at your option) | ||
* any later version. You may not use this file except in | ||
* compliance with the License. You may obtain a copy of the | ||
* License at: | ||
* | ||
* https://www.gnu.org/licenses/agpl-3.0.txt | ||
* | ||
* 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.opennms.core.mate.api; | ||
|
||
public class EmptyScopeProvider implements ScopeProvider { | ||
public final static EmptyScopeProvider EMPTY = new EmptyScopeProvider(); | ||
|
||
private EmptyScopeProvider() { | ||
} | ||
|
||
@Override | ||
public Scope getScope() { | ||
return EmptyScope.EMPTY; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
core/mate/api/src/main/java/org/opennms/core/mate/api/FallBackScopeProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Licensed to The OpenNMS Group, Inc (TOG) under one or more | ||
* contributor license agreements. See the LICENSE.md file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. | ||
* | ||
* TOG licenses this file to You under the GNU Affero General | ||
* Public License Version 3 (the "License") or (at your option) | ||
* any later version. You may not use this file except in | ||
* compliance with the License. You may obtain a copy of the | ||
* License at: | ||
* | ||
* https://www.gnu.org/licenses/agpl-3.0.txt | ||
* | ||
* 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.opennms.core.mate.api; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
|
||
public class FallBackScopeProvider implements ScopeProvider { | ||
private final List<ScopeProvider> scopeProviders; | ||
|
||
public FallBackScopeProvider(final List<ScopeProvider> scopeProviders) { | ||
this.scopeProviders = ImmutableList.copyOf(scopeProviders); | ||
} | ||
|
||
public FallBackScopeProvider(final ScopeProvider... scopeProviders) { | ||
this.scopeProviders = ImmutableList.copyOf(scopeProviders); | ||
} | ||
|
||
|
||
@Override | ||
public Scope getScope() { | ||
return new FallbackScope(scopeProviders.stream().map(ScopeProvider::getScope).collect(Collectors.toList())); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
core/mate/api/src/main/java/org/opennms/core/mate/api/ScopeProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Licensed to The OpenNMS Group, Inc (TOG) under one or more | ||
* contributor license agreements. See the LICENSE.md file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. | ||
* | ||
* TOG licenses this file to You under the GNU Affero General | ||
* Public License Version 3 (the "License") or (at your option) | ||
* any later version. You may not use this file except in | ||
* compliance with the License. You may obtain a copy of the | ||
* License at: | ||
* | ||
* https://www.gnu.org/licenses/agpl-3.0.txt | ||
* | ||
* 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.opennms.core.mate.api; | ||
|
||
public interface ScopeProvider { | ||
Scope getScope(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.