ilog.rules.archive

Class IlrRulesetArchive

  • java.lang.Object
    • ilog.rules.archive.IlrRulesetArchive
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int B2X
      A constant used to type an archive element as an element that contains a mapping between a business object model and an executable object model.
      static int BOM
      A constant used to type an archive element as an element that contains a business object model.
      static int ENGINE_CONF
      A constant used to type an archive element as an element that contains an engine configuration file.
      static int GENERATED
      A constant used to type an archive element as an element whose content has been generated by the archive builder.
      static int IRL
      A constant used to type an archive element as an element that contains IRL code.
      static int MISC
      A constant used to type an archive element as an element that contains miscellaneous data.
      static int USER_DATA
      A constant used to type an archive element as an element that contains user data.
      static java.lang.String VARIABLES
      The base name of the IRL element that contains the variables declaration for a given package.
      static int WSDL
      A constant used to type an archive element as an element that contains a WSDL.
      static int XOM
      A constant used to type an archive element as an element that contains an executable object model.
      static int XSD
      A constant used to type an archive element as an element that contains an XSD.
    • Constructor Summary

      Constructors 
      Constructor and Description
      IlrRulesetArchive()
      Creates an empty ruleset archive based on UTF-8 encoding.
      IlrRulesetArchive(java.lang.String encoding)
      Creates an empty ruleset archive based on the given encoding.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      boolean compare(IlrRulesetArchive archive)
      Compares two ruleset archives to determine if they have the same content.
      static IlrRulesetArchive extractArchive(IlrRulesetArchiveLoader loader)
      Obtains a ruleset archive object filled from the archive given through the archive loader.
      java.lang.String getContent(java.lang.String entryName)
      Returns the contents of an archive element as a string.
      IlrRulesetArchive.Element getElement(java.lang.String key)
      Returns the element in the archive whose name is specified by the parameter.
      java.util.Collection getElements()
      Returns the elements that compose the archive.
      java.util.Collection getElements(int kind)
      Returns the elements of a given type contained in the archive.
      java.lang.String getEncoding()
      Returns the encoding used in the archive.
      java.lang.String getIRL(java.lang.String pkgName, java.lang.String artifactName)
      Returns the IRL code stored in the archive for the specified artifact name and package.
      java.lang.String getRulesetSignature()
      Returns the part of the descriptor that contains the ruleset signature, in XML.
      java.lang.Object getSchema(java.lang.String namespace, java.lang.String name)
      Returns a schema as an input stream or a URL depending on what is present inside the archive.
      java.util.Map getSchemaNames(boolean onlyContained)
      Returns a map that associates to a namespace all the schema's file names declared or contained inside this archive.
      java.lang.String getXmlEncoding()
      Returns the encoding used for the XML parts in the archive.
      boolean isBusiness()
      Indicates whether the archive is a business archive or not.
      boolean isBusinessDataXmlServiceEnable()
      Allows you to determine if this ruleset archive parsed will produce a ruleset that could have parameters set with XML BOM objects.
      void reset()
      Resets the archive.
      void setBusinessDataXmlServiceEnable(boolean businessDataXmlServiceEnable)
      Enables the use of XML BOM objects as parameters on the ruleset resulting from the parsing of this ruleset archive.
      void write(java.util.jar.JarOutputStream jarOutputStream)
      Writes the ruleset archive contents in the given jar stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • VARIABLES

        public static final java.lang.String VARIABLES
        The base name of the IRL element that contains the variables declaration for a given package.
        See Also:
        Constant Field Values
      • IRL

        public static final int IRL
        A constant used to type an archive element as an element that contains IRL code. Its value is 0.
        See Also:
        Constant Field Values
      • BOM

        public static final int BOM
        A constant used to type an archive element as an element that contains a business object model. Its value is 1.
        See Also:
        Constant Field Values
      • B2X

        public static final int B2X
        A constant used to type an archive element as an element that contains a mapping between a business object model and an executable object model. Its value is 2.
        See Also:
        Constant Field Values
      • XOM

        public static final int XOM
        A constant used to type an archive element as an element that contains an executable object model. Its value is 3.
        See Also:
        Constant Field Values
      • ENGINE_CONF

        public static final int ENGINE_CONF
        A constant used to type an archive element as an element that contains an engine configuration file. Its value is 4.
        See Also:
        Constant Field Values
      • USER_DATA

        public static final int USER_DATA
        A constant used to type an archive element as an element that contains user data. Its value is 5.
        See Also:
        Constant Field Values
      • XSD

        public static final int XSD
        A constant used to type an archive element as an element that contains an XSD. Its value is 6.
        See Also:
        Constant Field Values
      • WSDL

        public static final int WSDL
        A constant used to type an archive element as an element that contains a WSDL. Its value is 7.
        See Also:
        Constant Field Values
      • MISC

        public static final int MISC
        A constant used to type an archive element as an element that contains miscellaneous data. Its value is 8.
        See Also:
        Constant Field Values
      • GENERATED

        public static final int GENERATED
        A constant used to type an archive element as an element whose content has been generated by the archive builder. Its value is 20.
        See Also:
        Constant Field Values
    • Constructor Detail

      • IlrRulesetArchive

        public IlrRulesetArchive(java.lang.String encoding)
        Creates an empty ruleset archive based on the given encoding. The archive contents are stored in memory.
        Parameters:
        encoding - The encoding used to store the archive contents.
      • IlrRulesetArchive

        public IlrRulesetArchive()
        Creates an empty ruleset archive based on UTF-8 encoding. The archive contents are stored in memory.
    • Method Detail

      • getElements

        public java.util.Collection getElements()
        Returns the elements that compose the archive.
        Returns:
        A collection of archive elements.
      • reset

        public void reset()
        Resets the archive.
      • getEncoding

        public java.lang.String getEncoding()
        Returns the encoding used in the archive.
        Returns:
        The archive encoding.
      • getXmlEncoding

        public java.lang.String getXmlEncoding()
        Returns the encoding used for the XML parts in the archive.
        Returns:
        The XML encoding.
      • getElements

        public java.util.Collection getElements(int kind)
        Returns the elements of a given type contained in the archive. The possible values for the kind are: IRL, BOM, B2X, XOM, XSD, WSDL, USER_DATA, ENGINE_CONF, MISC
        Parameters:
        kind - The type of the required elements.
        Returns:
        A collection that contains the archive elements of a certain type.
      • getRulesetSignature

        public java.lang.String getRulesetSignature()
        Returns the part of the descriptor that contains the ruleset signature, in XML.
        Returns:
        A string that represents the ruleset signature in XML format.
      • getElement

        public IlrRulesetArchive.Element getElement(java.lang.String key)
        Returns the element in the archive whose name is specified by the parameter.
        Parameters:
        key - The name of the element we are looking for.
        Returns:
        The element in the archive whose name is equal to the parameter, or null if there is no such element in the archive.
      • isBusiness

        public boolean isBusiness()
        Indicates whether the archive is a business archive or not.

        A business archive contains business object models, with the IRL based on these models. Translations can be provided to move from the business model to the execution model. If no translation is given, an implicit one-to-one mapping is applied.

        Returns:
        true if the archive is a business archive, else it returns false.
      • write

        public void write(java.util.jar.JarOutputStream jarOutputStream)
                   throws java.io.IOException
        Writes the ruleset archive contents in the given jar stream. The XML-generated parts of the archive are stored with the UTF-8 encoding. The archive contents given by the user are stored with the encoding specified for the archive. By default, the encoding is UTF-8. It is the responsibility of the user to close the given stream.
        Throws:
        java.io.IOException
        Parameters:
        jarOutputStream - The stream in which the archive is persisted.
      • compare

        public boolean compare(IlrRulesetArchive archive)
        Compares two ruleset archives to determine if they have the same content.
        Parameters:
        archive - The archive to compare with this.
        Returns:
        true if the archives have the same content, else it returns false.
      • extractArchive

        public static IlrRulesetArchive extractArchive(IlrRulesetArchiveLoader loader)
        Obtains a ruleset archive object filled from the archive given through the archive loader. The archive contents are stored in memory.
        Parameters:
        loader - The loader in charge of archive loading.
        Returns:
        The ruleset archive object filled from the source archive managed by the loader.
      • getIRL

        public java.lang.String getIRL(java.lang.String pkgName,
                              java.lang.String artifactName)
        Returns the IRL code stored in the archive for the specified artifact name and package. To get the package variables declaration, use the artifact name of IlrRulesetArchive.VARIABLES.
        Parameters:
        pkgName - The name of the package given when the artifact was inserted in the archive.
        artifactName - The name of the artifact given when the artifact was inserted in the archive.
        Returns:
        The IRL code of the specified artifact.
      • getContent

        public java.lang.String getContent(java.lang.String entryName)
        Returns the contents of an archive element as a string.
        Parameters:
        entryName - The name of the element whose contents are to be returned.
        Returns:
        The contents of the element whose name is given. It returns null if no such element is found in the archive.
      • isBusinessDataXmlServiceEnable

        public boolean isBusinessDataXmlServiceEnable()
        Allows you to determine if this ruleset archive parsed will produce a ruleset that could have parameters set with XML BOM objects.
        Returns:
        true if XML BOM objects could be passed to the parsed ruleset.
      • setBusinessDataXmlServiceEnable

        public void setBusinessDataXmlServiceEnable(boolean businessDataXmlServiceEnable)
        Enables the use of XML BOM objects as parameters on the ruleset resulting from the parsing of this ruleset archive.
        Parameters:
        businessDataXmlServiceEnable -

© Copyright IBM Corp. 1987, 2017