-
-
Save ekohl/838610 to your computer and use it in GitHub Desktop.
Revisions
-
ekohl revised this gist
Feb 22, 2011 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,20 +5,20 @@ enum Method { GET, ADD }; enum Detail { DISKS("$_.getmemorystatistics(); $_.getcpustatistics(); "), STATISTICS("$_.getdiskimages(); "); public final String powershell; Detail(String powershell) { this.powershell = powershell; } } static String getProcess(Method method, Set<Detail> details) { StringBuilder buf = new StringBuilder(); if (details != null) { for (Detail detail : details) { buf.append(detail.powershell); } } return MessageFormat.format(PROCESS_VMS, method == Method.ADD ? " " : "$_; ", buf); } @@ -28,12 +28,12 @@ private String getProcess(Method method) { } private Set<Detail> getDetails() { Set<Detail> details = new EnumSet<Detail>(); for (Detail detail : Detail.class.getEnumConstants()) { if (include(getHttpHeaders(), detail.name().toLowerCase())) { details.add(detail); } } return details; } } -
ekohl revised this gist
Feb 22, 2011 . 1 changed file with 17 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,27 +1,34 @@ class PowerShellVmsResource { enum Method { GET, ADD }; enum Detail { DISKS("$_.getmemorystatistics(); $_.getcpustatistics(); "), STATISTICS("$_.getdiskimages(); "); public final String powershell; Detail(String powershell) { this.powershell = powershell; } } static String getProcess(Method method, Set<Detail> details) { StringBuilder buf = new StringBuilder(); if (details != null) { for (Detail detail : details) { buf.append(detail.powershell); } } return MessageFormat.format(PROCESS_VMS, method == Method.ADD ? " " : "$_; ", buf); } private String getProcess(Method method) { return getProcess(method, getDetails()); } private Set<Detail> getDetails() { Set<Detail> details = new EnumSet<Detail>; for (Detail detail : Detail.class.getEnumConstants()) { if (include(getHttpHeaders(), detail.name().toLowerCase())) { details.add(detail); -
markmc revised this gist
Feb 22, 2011 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -17,12 +17,16 @@ static String getProcess(Method method, Set<Detail> details) { } private String getProcess(Method method) { return getProcess(method, getDetails()); } private Set<Details> getDetails() { Set<Detail> details = new EnumSet<Detail>(); for (Detail detail : Detail.class.getEnumConstants()) { if (include(getHttpHeaders(), detail.name().toLowerCase())) { details.add(detail); } } return details; } } -
markmc created this gist
Feb 22, 2011 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ class PowerShellVmsResource { enum Method { GET, ADD }; enum Detail { DISKS, STATISTICS }; static String getProcess(Method method, Set<Detail> details) { StringBuilder buf = new StringBuilder(); if (details != null) { if (details.contains(Detail.DISKS)) { buf.append(GET_STATS); } if (details.contains(Detail.STATISTICS)) { buf.append(GET_DISKS); } } return MessageFormat.format(PROCESS_VMS, method == Method.ADD ? " " : "$_; ", buf); } private String getProcess(Method method) { Set<Detail> details = new EnumSet<Detail>(); for (Detail detail : Detail.class.getEnumConstants()) { if (include(getHttpHeaders(), detail.name().toLowerCase())) { details.add(detail); } } return getProcess(method, details); } }