[jboss-dev-forums] [JBoss AS7 Development] - Detyped Representation of the AS 7 Management Model

Brian Stansberry do-not-reply at jboss.com
Wed Jan 12 09:36:24 EST 2011


Brian Stansberry [http://community.jboss.org/people/bstansberry%40jboss.com] modified the document:

"Detyped Representation of the AS 7 Management Model"

To view the document, visit: http://community.jboss.org/docs/DOC-16317

--------------------------------------------------------------
AS 7's management API will naturally include the ability for clients to query the management system to discover meta-information about the management model; i.e. what resources are available and what attributes and operations they expose. These details will be returned in a detyped form, either using the jboss-dmr library or JSON. (A JMX interface based on open mbeans will also be provided; most concepts in this article map naturally to JMX.) The purpose of this article is to describe the detyped representation of the API.

Readers are encouraged to look at the example detyped descriptions of parts of the management API at the bottom before reading the details.
h3. Description of addressable portions of the management model

All portions of the management model exposed by AS 7 are addressable via an ordered list of key/value pairs. For each addressable portion of the model, the following descriptive information will be available:

* description -- String -- text description of this portion of the model
* head-comment-allowed -- boolean -- indicates whether this portion of the model can store an XML comment that would be written in the persistent form of the model (e.g. domain.xml) before the start of the XML element that represents this portion of the model. This item is optional, and if not present defaults to true.
* tail-comment-allowed -- boolean -- similar to head-comment-allowed, but indicates whether a comment just before the close of the XML element is supported. A tail comment can only be supported if the element has child elements, in which case a comment can be inserted between the final child element and the element's closing tag. This item is optional, and if not present defaults to true.
* attributes -- Map of String (the attribute name) to complex structure -- the configuration attributes available in this portion of the model. See below for the representation of each attribute.
* operations -- Map of String (the operation name) to complex structure -- the operations that can be targetted at this address. See below for the representation of each operation.
* children -- Map of String (the type of child) to complex structure -- the relationship of this portion of the model to other addressable portions of the model. See below for the representation of each child relationship.


{
     "description => "A managable resource",
     "tail-comment-allowed" => false,
     "attributes" => {
          "foo" => {
               .... details of attribute foo
          }
      },
     "operations" => {
          "start" => {
               .... details of the start operation
          }
      },
     "children" => {
          "bar" => {
               .... details of the relationship with children of type "bar"
          }
      }
}

h4. Description of an Attribute

An attribute is a portion of the management model that is not directly addressable. Instead, it is conceptually a property of an addressable part of the model. For each attribute portion of the model, the following descriptive information will be available:

* description -- String -- text description of the attribute
* type -- org.jboss.dmr.ModelType -- the type of the attribute value. One of the enum values BIG_DECIMAL, BIG_INTEGER, BOOLEAN, BYTES, DOUBLE, INT, LIST, LONG, OBJECT, PROPERTY, STRING. Most of these are self-explanatory. An OBJECT will be represented in the detyped model as a map of string keys to values of some other legal type, conceptually similar to a javax.management.openmbean.CompositeData. A PROPERTY is a single key/value pair, where the key is a string, and the value is of some other legal type.
* value-type -- ModelType or complex structure -- Only present if type is LIST or OBJECT. If type is LIST or all the values of the OBJECT type are of the same type, this will be one of the ModelType enums  BIG_DECIMAL, BIG_INTEGER, BOOLEAN, BYTES, DOUBLE, INT, LIST, LONG, PROPERTY, STRING. Otherwise, value-type will detail the structure of the attribute value, enumerating the value's fields and the type of their value.
* required -- boolean -- true if the attribute will always exist in a representation of its portion of the model; false if it may not (implying a null value.) If not present, true is the default.
* head-comment-allowed -- boolean -- indicates whether the model can store an XML comment that would be written in the persistent form of the model (e.g. domain.xml) before the start of the XML element that represents this attribute. This item is optional, and if not present defaults to *false*. (This is a different default from is used for an addressable portion of the model, since model attributes often map to XML attributes, which don't allow comments.)
* tail-comment-allowed -- boolean -- similar to head-comment-allowed, but indicates whether a comment just before the close of the XML element is supported. A tail comment can only be supported if the element has child elements, in which case a comment can be inserted between the final child element and the element's closing tag. This item is optional, and if not present defaults to *false*. (This is a different default from is used for an addressable portion of the model, since model attributes often map to XML attributes, which don't allow comments.)
* arbitrary key/value pairs that further describe the attribute value, e.g. "max" => 2. See "Arbitrary Descriptors" below.  

"foo" => {
     "description" => "The foo",
     "type" => INT,
     "max" => 2
}


"bar" => {
     "description" => "The bar",
     "type" => OBJECT,
     "value-type" => {
          "size" => INT,
          "color" => STRING

     }
}

h3. Description of an Operation
An addressable portion of the model may have operations associated with it. The description of an operation will include the following information:

* operation-name -- String -- the name of the operation
* description -- String -- text description of the operation
* request-properties -- Map of String to complex structure -- description of the parameters of the operation. Keys are the names of the parameters, values are descriptions of the parameter value types. See below for details on the description of parameter value types.
* reply-properties -- complex structure, or empty -- description of the return value of the operation, with an empty node meaning void.
h4. Description of an Operation Parameter or Return value
* description -- String -- text description of the parameter or return value
* type -- org.jboss.dmr.ModelType -- the type of the parameter or return value. One of the enum values BIG_DECIMAL, BIG_INTEGER, BOOLEAN, BYTES, DOUBLE, INT, LIST, LONG, OBJECT, PROPERTY, STRING.
* value-type -- ModelType or complex structure -- Only present if type is LIST or OBJECT. If type is LIST or all the values of the OBJECT type are of the same type, this will be one of the ModelType enums  BIG_DECIMAL, BIG_INTEGER, BOOLEAN, BYTES, DOUBLE, INT, LIST, LONG, PROPERTY, STRING. Otherwise, value-type will detail the structure of the attribute value, enumerating the value's fields and the type of their value.
* required -- boolean -- Only relevant to parameters. true if the parameter must be present in the request object used to invoke the operation; false if it can omitted. If not present, true is the default.
* nillable -- boolean -- true if null is a valid value.  If not present, false is the default.
* arbitrary key/value pairs that further describe the attribute value, e.g. "max" =>2. See "Arbitrary Descriptors" below. 
h2. Arbitrary Descriptors
The description of an attribute, operation parameter or operation return value type can include arbitrary key/value pairs that provide extra information. Whether a particular key/value pair is present depends on the context, e.g. a pair with key "max" would probably only occur as part of the description of some numeric type.

Following are standard keys and their expected value type. If descriptor authors want to add an arbitrary key/value pair to some descriptor and the semantic matches the meaning of one of the following items, the standard key/value type should be used.

* min -- int -- the minimum value of some numeric type. The absence of this item implies there is no minimum value.
* max -- int -- the maximum value of some numeric type. The absence of this item implies there is no maximum value.
* min-length -- int -- the minimum length of some string, list or byte[] type. The absence of this item implies a minimum length of zero.
* max-length -- int -- the maximum length of some string, list or byte[]. The absence of this item implies there is no maximum value.
* nillable -- boolean -- whether null is a legal value. The absence of this item implies false; i.e. null is not a legal value.
* allowed -- List -- a list of legal values. The type of the elements in the list should match the type of the attribute.
h2. Example Representation of a Portion of the Domain Controller API

{
    "description" => "The root node of the domain-level management model.",
    "attributes" => {
        "namespaces" => {
            "type" => OBJECT,
            "value-type" => STRING,
            "description" => "Map of namespaces used in the configuration XML document, where keys are namespace prefixes and values are schema URIs.",
            "required" => false
        },
        "schema-locations" => {
            "type" => OBJECT,
            "value-type" => STRING,
            "description" => "Map of locations of XML schemas used in the configuration XML document, where keys are schema URIs and values are locations where the schema can be found.",
            "required" => false
        }
    },
    "operations" => "TODO",
    "children" => {
        "extension" => {
            "description" => "A list of extension modules.",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => "TODO"
        },
        "path" => {
            "description" => "A list of named filesystem paths. The paths may or may not be fully specified (i.e. include the actual paths.)",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => {
                "description" => "A named filesystem path, but without a requirement to specify the actual path. If no actual path is specified, acts as a placeholder in the model (e.g. at the domain level) until a fully specified path definition is applied at a lower level (e.g. at the host level, where available addresses are known.)",
                "tail-comment-allowed" => false,
                "attributes" => {
                    "name" => {
                        "type" => STRING,
                        "description" => "The name of the path. Cannot be one of the standard fixed paths provided by the system: <ul><li>jboss.home - the root directory of the JBoss AS distribution</li><li>user.home - user's home directory</li><li>user.dir - user's current working directory</li><li>java.home - java installation directory</li><li>jboss.server.base.dir - root directory for an individual server instance</li></ul> Note that the system provides other standard paths that can be overridden by declaring them in the configuration file. See the 'relative-to' attribute documentation for a complete list of standard paths.",
                        "required" => true
                    },
                    "path" => {
                        "type" => STRING,
                        "description" => "The actual filesystem path. Treated as an absolute path, unless the 'relative-to' attribute is specified, in which case the value is treated as relative to that path. <p>If treated as an absolute path, the actual runtime pathname specified by the value of this attribute will be determined as follows: </p>If this value is already absolute, then the value is directly used.  Otherwise the runtime pathname is resolved in a system-dependent way.  On UNIX systems, a relative pathname is made absolute by resolving it against the current user directory. On Microsoft Windows systems, a relative pathname is made absolute by resolving it against the current directory of the drive named by the pathname, if any; if not, it is resolved against the current user directory.",
                        "required" => false,
                        "min-length" => 1
                    },
                    "relative-to" => {
                        "type" => STRING,
                        "description" => "The name of another previously named path, or of one of the standard paths provided by the system. If 'relative-to' is provided, the value of the 'path' attribute is treated as relative to the path specified by this attribute. The standard paths provided by the system include:<ul><li>jboss.home - the root directory of the JBoss AS distribution</li><li>user.home - user's home directory</li><li>user.dir - user's current working directory</li><li>java.home - java installation directory</li><li>jboss.server.base.dir - root directory for an individual server instance</li><li>jboss.server.data.dir - directory the server will use for persistent data file storage</li><li>jboss.server.log.dir - directory the server will use for log file storage</li><li>jboss.server.tmp.dir - directory the server will use for temporary file storage</li><li>jboss.domain.servers.dir - directory under which a host controller will create the working area for individual server instances</li></ul>",
                        "required" => false
                    }
                },
                "operations" => {
                    "add" => {
                        "operation-name" => "add",
                        "description" => "Add a new 'path' child",
                        "request-properties" => {
                            "name" => {
                                "type" => STRING,
                                "description" => "The value of the path's 'name' attribute",
                                "required" => true,
                                "min-length" => 1,
                                "nillable" => false
                            },
                            "path" => {
                                "type" => STRING,
                                "description" => "The value of the path's 'path' attribute",
                                "required" => false,
                                "min-length" => 1,
                                "nillable" => true
                            },
                            "relative-to" => {
                                "type" => STRING,
                                "description" => "The value of the path's 'relative-to' attribute",
                                "required" => false,
                                "nillable" => true
                            }
                        },
                        "reply-properties" => {}
                    },
                    "remove" => {
                        "operation-name" => "remove",
                        "description" => "Remove a 'path' child",
                        "request-properties" => {"name" => {
                                "type" => STRING,
                                "description" => "The value of the path's 'name' attribute",
                                "required" => true,
                                "min-length" => 1,
                                "nillable" => false
                            }},
                        "reply-properties" => {}
                    },
                    "setPath" => {
                        "operation-name" => "setPath",
                        "description" => "Set the value of the 'path' attribute",
                        "request-properties" => {"path" => {
                                "type" => STRING,
                                "description" => "The new value of the 'path' attribute",
                                "required" => true,
                                "min-length" => 1,
                                "nillable" => true
                            }},
                        "reply-properties" => {}
                    },
                    "setRelativeTo" => {
                        "operation-name" => "setRelativeTo",
                        "description" => "Set the value of the 'relative-to' attribute",
                        "request-properties" => {"relative-to" => {
                                "type" => STRING,
                                "description" => "The new value of the 'relative-to' attribute",
                                "required" => true,
                                "nillable" => true
                            }},
                        "reply-properties" => {}
                    }
                }
            }
        },
        "profile" => {
            "description" => "A list of profiles available for use in the domain",
            "min-occurs" => 1,
            "max-occurs" => 2147483647,
            "model-description" => {
                "description" => "A named set of subsystem configurations.",
                "head-comment-allowed" => true,
                "tail-comment-allowed" => true,
                "attributes" => {"name" => {
                        "type" => STRING,
                        "description" => "The name of the profile",
                        "required" => true,
                        "min-length" => 1
                    }},
                "operations" => {},
                "children" => {
                    "subsystem" => {
                        "description" => "The subsystems that make up the profile.",
                        "min-occurs" => 1,
                        "max-occurs" => 2147483647,
                        "model-description" => {}
                    },
                    "include" => {"model-description" => {
                            "description" => "Specifies that a contents of a named profile are to be included in the profile whose definition includes this item.",
                            "head-comment-allowed" => true,
                            "tail-comment-allowed" => false,
                            "attributes" => {"profile" => {
                                    "type" => LIST,
                                    "description" => "The name of the included profile",
                                    "required" => true,
                                    "value-type" => STRING
                                }},
                            "operations" => "TODO"
                        }}
                }
            }
        },
        "interface" => {
            "description" => "A list of named network interfaces available for use in the domain. The interfaces may or may not be fully specified (i.e. include criteria on how to determine their IP address.",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => "TODO"
        },
        "socket-binding-group" => {
            "description" => "A list of socket binding groups available for use in the domain",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => "TODO"
        },
        "system-property" => {
            "description" => "A list of system properties to set on all servers in the domain.",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => "TODO"
        },
        "deployment" => {
            "description" => "A list of deployments available for use in the domain",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => "TODO"
        },
        "server-group" => {
            "description" => "A list of server groups available for use in the domain",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => "TODO"
        },
        "host" => {
            "description" => "Host controllers currently running in the domain",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => {}
        }
    }
}

h2. Example Representation of a Portion of the Host Controller API

{
    "description" => "The root node of the host-level management model.",
    "attributes" => {
        "namespaces" => {
            "type" => OBJECT,
            "value-type" => STRING,
            "description" => "Map of namespaces used in the configuration XML document, where keys are namespace prefixes and values are schema URIs.",
            "required" => false
        },
        "schema-locations" => {
            "type" => OBJECT,
            "value-type" => STRING,
            "description" => "Map of locations of XML schemas used in the configuration XML document, where keys are schema URIs and values are locations where the schema can be found.",
            "required" => false
        },
        "management" => {
            "description" => "Configuration of the host's management system.",
            "type" => OBJECT,
            "value-type" => {
                "interface" => {
                    "type" => STRING,
                    "description" => "Interface on which the host's socket for intra-domain management communication should be opened.",
                    "required" => false
                },
                "port" => {
                    "type" => STRING,
                    "description" => "Port on which the host's socket for intra-domain management communication should be opened.",
                    "required" => false
                }
            },
            "required" => true,
            "head-comment-allowed" => true
        },
        "domain-controller" => {
            "description" => "Configuration of how the host should interact with the Domain Controller",
            "type" => OBJECT,
            "value-type" => "TODO",
            "required" => true,
            "head-comment-allowed" => true,
            "tail-comment-allowed" => true
        }
    },
    "operations" => {
        "start-server" => {
            "operation-name" => "start-server",
            "description" => "Start a server.",
            "request-properties" => {"server" => {
                    "type" => STRING,
                    "description" => "The name of the server.",
                    "required" => true,
                    "min-length" => 1,
                    "nillable" => false
                }},
            "reply-properties" => {
                "type" => STRING,
                "description" => "The status of the server following execution of this operation."
            }
        },
        "restart-server" => {
            "operation-name" => "restart-server",
            "description" => "Restart a currently running server.",
            "request-properties" => {"server" => {
                    "type" => STRING,
                    "description" => "The name of the server.",
                    "required" => true,
                    "min-length" => 1,
                    "nillable" => false
                }},
            "reply-properties" => {
                "type" => STRING,
                "description" => "The status of the server following execution of this operation."
            }
        },
        "stop-server" => {
            "operation-name" => "stop-server",
            "description" => "Stop a currently running server.",
            "request-properties" => {"server" => {
                    "type" => STRING,
                    "description" => "The name of the server.",
                    "required" => true,
                    "min-length" => 1,
                    "nillable" => false
                }},
            "reply-properties" => {
                "type" => STRING,
                "description" => "The status of the server following execution of this operation."
            }
        }
    },
    "children" => {
        "extension" => {
            "description" => "A list of extension modules.",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => "TODO"
        },
        "path" => {
            "description" => "A list of named filesystem paths.",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => {
                "description" => "A named filesystem path, but without a requirement to specify the actual path. If no actual path is specified, acts as a placeholder in the model (e.g. at the domain level) until a fully specified path definition is applied at a lower level (e.g. at the host level, where available addresses are known.)",
                "tail-comment-allowed" => false,
                "attributes" => {
                    "name" => {
                        "type" => STRING,
                        "description" => "The name of the path. Cannot be one of the standard fixed paths provided by the system: <ul><li>jboss.home - the root directory of the JBoss AS distribution</li><li>user.home - user's home directory</li><li>user.dir - user's current working directory</li><li>java.home - java installation directory</li><li>jboss.server.base.dir - root directory for an individual server instance</li></ul> Note that the system provides other standard paths that can be overridden by declaring them in the configuration file. See the 'relative-to' attribute documentation for a complete list of standard paths.",
                        "required" => true
                    },
                    "path" => {
                        "type" => STRING,
                        "description" => "The actual filesystem path. Treated as an absolute path, unless the 'relative-to' attribute is specified, in which case the value is treated as relative to that path. <p>If treated as an absolute path, the actual runtime pathname specified by the value of this attribute will be determined as follows: </p>If this value is already absolute, then the value is directly used.  Otherwise the runtime pathname is resolved in a system-dependent way.  On UNIX systems, a relative pathname is made absolute by resolving it against the current user directory. On Microsoft Windows systems, a relative pathname is made absolute by resolving it against the current directory of the drive named by the pathname, if any; if not, it is resolved against the current user directory.",
                        "required" => true,
                        "min-length" => 1
                    },
                    "relative-to" => {
                        "type" => STRING,
                        "description" => "The name of another previously named path, or of one of the standard paths provided by the system. If 'relative-to' is provided, the value of the 'path' attribute is treated as relative to the path specified by this attribute. The standard paths provided by the system include:<ul><li>jboss.home - the root directory of the JBoss AS distribution</li><li>user.home - user's home directory</li><li>user.dir - user's current working directory</li><li>java.home - java installation directory</li><li>jboss.server.base.dir - root directory for an individual server instance</li><li>jboss.server.data.dir - directory the server will use for persistent data file storage</li><li>jboss.server.log.dir - directory the server will use for log file storage</li><li>jboss.server.tmp.dir - directory the server will use for temporary file storage</li><li>jboss.domain.servers.dir - directory under which a host controller will create the working area for individual server instances</li></ul>",
                        "required" => false
                    }
                },
                "operations" => {
                    "add" => {
                        "operation-name" => "add",
                        "description" => "Add a new 'path' child",
                        "request-properties" => {
                            "name" => {
                                "type" => STRING,
                                "description" => "The value of the path's 'name' attribute",
                                "required" => true,
                                "min-length" => 1,
                                "nillable" => false
                            },
                            "path" => {
                                "type" => STRING,
                                "description" => "The value of the path's 'path' attribute",
                                "required" => true,
                                "min-length" => 1,
                                "nillable" => false
                            },
                            "relative-to" => {
                                "type" => STRING,
                                "description" => "The value of the path's 'relative-to' attribute",
                                "required" => false,
                                "nillable" => true
                            }
                        },
                        "reply-properties" => {}
                    },
                    "remove" => {
                        "operation-name" => "remove",
                        "description" => "Remove a 'path' child",
                        "request-properties" => {"name" => {
                                "type" => STRING,
                                "description" => "The value of the path's 'name' attribute",
                                "required" => true,
                                "min-length" => 1,
                                "nillable" => false
                            }},
                        "reply-properties" => {}
                    },
                    "setPath" => {
                        "operation-name" => "setPath",
                        "description" => "Set the value of the 'path' attribute",
                        "request-properties" => {"path" => {
                                "type" => STRING,
                                "description" => "The new value of the 'path' attribute",
                                "required" => true,
                                "min-length" => 1,
                                "nillable" => false
                            }},
                        "reply-properties" => {}
                    },
                    "setRelativeTo" => {
                        "operation-name" => "setRelativeTo",
                        "description" => "Set the value of the 'relative-to' attribute",
                        "request-properties" => {"relative-to" => {
                                "type" => STRING,
                                "description" => "The new value of the 'relative-to' attribute",
                                "required" => true,
                                "nillable" => true
                            }},
                        "reply-properties" => {}
                    }
                }
            }
        },
        "system-property" => {
            "description" => "A list of system properties to set on all servers on the host.",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => "TODO"
        },
        "interface" => {
            "description" => "A list of fully specified named network interfaces available for use on the host.",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => "TODO"
        },
        "jvm" => {
            "description" => "A list of Java Virtual Machine configurations that can be applied ot servers on the host.",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => "TODO"
        },
        "server-config" => {
            "description" => "Host-level configurations for the servers that can run on this host.",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => {}
        },
        "server" => {
            "description" => "Servers currently running on the host",
            "min-occurs" => 0,
            "max-occurs" => 2147483647,
            "model-description" => "TODO"
        }
    }
}
--------------------------------------------------------------

Comment by going to Community
[http://community.jboss.org/docs/DOC-16317]

Create a new document in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2225]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20110112/2bdf494f/attachment.html 


More information about the jboss-dev-forums mailing list