Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sample code for creating groups from java
- Loading branch information
Showing
5 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
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
27 changes: 27 additions & 0 deletions
27
.../swis-client/src/main/java/com/solarwinds/orionsdk/swis_client/GroupMemberDefinition.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,27 @@ | ||
package com.solarwinds.orionsdk.swis_client; | ||
|
||
public class GroupMemberDefinition { | ||
private String name; | ||
private String definition; | ||
|
||
public GroupMemberDefinition(String name, String definition) { | ||
setName(name); | ||
setDefinition(definition); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getDefinition() { | ||
return definition; | ||
} | ||
|
||
public void setDefinition(String definition) { | ||
this.definition = definition; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...s/Java/swis-client/src/main/java/com/solarwinds/orionsdk/swis_client/GroupRollupMode.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,15 @@ | ||
package com.solarwinds.orionsdk.swis_client; | ||
|
||
public enum GroupRollupMode { | ||
Mixed(0), Worst(1), Best(2); | ||
|
||
private final int value; | ||
|
||
private GroupRollupMode(int value) { | ||
this.value = value; | ||
} | ||
|
||
public int getValue() { | ||
return value; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...Java/swis-client/src/main/java/com/solarwinds/orionsdk/swis_client/OrionGroupManager.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,15 @@ | ||
package com.solarwinds.orionsdk.swis_client; | ||
|
||
public class OrionGroupManager { | ||
private ISwisClient swis; | ||
|
||
public OrionGroupManager(ISwisClient swis) { | ||
this.swis = swis; | ||
} | ||
|
||
public void createGroup(String name, int refreshIntervalSeconds, GroupRollupMode rollupMode, String description, | ||
boolean pollingEnabled, Iterable<GroupMemberDefinition> members) { | ||
swis.invoke("Orion.Container", "CreateContainer", name, "Core", refreshIntervalSeconds, rollupMode.getValue(), | ||
description, pollingEnabled, members); | ||
} | ||
} |