|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.genesyslab.platform.applicationblocks.com.capacityrules.CapacityRuleHelper
public class CapacityRuleHelper
Helper class to retrieve CapacityRule data from CfgScript object.
Example of using helper-class:
ConfServerProtocol protocol = new ConfServerProtocol(new Endpoint(host, port)); protocol.setClientApplicationType(appType); protocol.setClientName("default"); protocol.setUserName(userName); protocol.setUserPassword(userPassword); IConfService service = (IConfService)ConfServiceFactory.createConfService(protocol); service.getProtocol().open(); CfgScriptQuery query = new CfgScriptQuery(service); CfgScript script = (CfgScript)service.retrieveObject(query); CapacityRuleHelper helper = CapacityRuleHelper.create(script); Document doc = helper.getXMLPresentation(); // edit xml document here helper.setXMLPresentation(doc); helper.getCfgScript().save(); service.getProtocol().close(); ConfServiceFactory.releaseConfService(service);
Method Summary | |
---|---|
static CapacityRuleHelper |
create(CfgScript script)
Creates instance of CapacityRuleHelper class. |
boolean |
equalsBinaries(byte[] capacityRulesBinary)
Compares current capacity rule binary presentation with another binaries presentation for equality (ignoring item order). |
static boolean |
equalsBinaries(byte[] capacityRulesBinary1,
byte[] capacityRulesBinary2)
Compares two capacity rules binary presentations for equality (ignoring item order). |
static byte[] |
getBinaryFromXML(org.w3c.dom.Document doc)
Gets optimized capacity rule binary representation according to passed xml presentation of capacity rule. |
static byte[] |
getBinaryFromXML(java.lang.String xml)
Gets optimized capacity rule binary representation according to passed xml presentation of capacity rule. |
byte[] |
getBinaryPresentation()
Gets binary presentation of CapacityRule in CfgScript object. |
CfgScript |
getCfgScript()
Gets COM AB CfgScript object instance. |
ValidationResult |
getValidationResult()
Gets a result of internal validation of capacity rule. |
org.w3c.dom.Document |
getXMLPresentation()
Gets XML presentation of CapacityRule in CfgScript object. |
java.lang.String |
getXMLStringData()
Gets XML data as string. |
boolean |
isEmpty()
Gets flag indicates that script does not have any data of capacity rule. |
boolean |
isEnabledValidation()
Gets flag that indicate if enabled or disabled internal validation of capacity rule. |
boolean |
matchBinaries(byte[] capacityRulesBinary)
Compares current capacity rule binary presentation with another binaries presentation for equivalence (ignoring item order). |
static boolean |
matchBinaries(byte[] capacityRulesBinary1,
byte[] capacityRulesBinary2)
Compares two capacity rules binary presentations for equivalence (ignoring item order) according to their's truth tables. |
void |
setEnabledValidation(boolean enabledValidation)
Set to true before assign new XML-presentation to validate results. |
void |
setXMLPresentation(org.w3c.dom.Document doc)
Sets XML presentation of CapacityRule in CfgScript object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean isEmpty()
public boolean isEnabledValidation()
public void setEnabledValidation(boolean enabledValidation)
enabledValidation
- flag that indicate if enabled or disabled internal validation of capacity rule.public ValidationResult getValidationResult()
public static boolean matchBinaries(byte[] capacityRulesBinary1, byte[] capacityRulesBinary2) throws CapacityRuleException
capacityRulesBinary1
- a binary presentation of 1st capacity rulecapacityRulesBinary2
- a binary presentation of 2nd capacity rule
CapacityRuleException
- if occurs some problem in the binaries parsing.
java.lang.IllegalArgumentException
- if any argument is null.public boolean matchBinaries(byte[] capacityRulesBinary) throws CapacityRuleException
capacityRulesBinary
- a binary presentation of other capacity rule
CapacityRuleException
- if occurs some problem in the binary parsing.
java.lang.IllegalArgumentException
- if the argument is null.
java.lang.IllegalStateException
- if the current binary presentation is is null.public static boolean equalsBinaries(byte[] capacityRulesBinary1, byte[] capacityRulesBinary2) throws CapacityRuleException
capacityRulesBinary1
- a binary presentation of 1st capacity rulecapacityRulesBinary2
- a binary presentation of 2nd capacity rule
CapacityRuleException
- if occurs some problem in the binaries parsing.
java.lang.IllegalArgumentException
- if any argument is null.public boolean equalsBinaries(byte[] capacityRulesBinary) throws CapacityRuleException
capacityRulesBinary
- a binary presentation of other capacity rule
CapacityRuleException
- if occurs some problem in the binary parsing.
java.lang.IllegalArgumentException
- if the argument is null.
java.lang.IllegalStateException
- if the current binary presentation is is null.public static byte[] getBinaryFromXML(org.w3c.dom.Document doc) throws CapacityRuleException
doc
- document presentation of capacity rule.
CapacityRuleException
- when occurs some problem in XML parsing.public static byte[] getBinaryFromXML(java.lang.String xml) throws CapacityRuleException
xml
- XML presentation of capacity rule.
CapacityRuleException
- when occurs some problem in XML parsing.public static CapacityRuleHelper create(CfgScript script) throws ConfigException
script
- instance of CfgScript object.
ConfigException
- if script has invalid format.
java.lang.IllegalArgumentException
- if script is null or script type isn't CFGCapacityRule.public org.w3c.dom.Document getXMLPresentation()
public void setXMLPresentation(org.w3c.dom.Document doc) throws CapacityRuleException
doc
- Document presentation of CapacityRule. Set null value to delete the rule data.
CapacityRuleException
- See exception message to identify of problem.public java.lang.String getXMLStringData()
public byte[] getBinaryPresentation()
public CfgScript getCfgScript()
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |