1008N/A ! The contents of this file are subject to the terms of the 1008N/A ! Common Development and Distribution License, Version 1.0 only 1008N/A ! (the "License"). You may not use this file except in compliance 1008N/A ! See the License for the specific language governing permissions 1008N/A ! and limitations under the License. 1008N/A ! When distributing Covered Code, include this CDDL HEADER in each 6983N/A ! If applicable, add the following below this CDDL HEADER, with the 6983N/A ! fields enclosed by brackets "[]" replaced with your own identifying 1008N/A ! Portions Copyright [yyyy] [name of copyright owner] 4129N/A ! Copyright 2008-2009 Sun Microsystems, Inc. 1008N/A <
xsl:
output method="text" encoding="us-ascii" />
1008N/A Template for generating the interface declaration. 1008N/A <
xsl:
template name="generate-interface-declaration">
1008N/A <
xsl:
value-
of select="'/**
'" />
1008N/A <
xsl:
call-
template name="add-java-comment">
1008N/A <
xsl:
with-
param name="indent-text" select="' *'" />
1008N/A <
xsl:
with-
param name="content" 1008N/A select="concat('A client-side interface for reading and modifying ', 1008N/A $this-ufn, ' settings.')" />
1008N/A <
xsl:
value-
of select="' * <p>
'" />
1008N/A <
xsl:
call-
template name="add-java-comment">
1008N/A <
xsl:
with-
param name="indent-text" select="' *'" />
1008N/A <
xsl:
value-
of select="' */
'" />
1008N/A select="concat('public interface ', 1008N/A <
xsl:
when test="boolean($this/@extends)">
1008N/A <
xsl:
value-
of select="concat($parent-java-class,'CfgClient ')" />
1008N/A <
xsl:
value-
of select="'ConfigurationClient '" />
1008N/A <
xsl:
text>{
</
xsl:
text>
1008N/A Template for generating the configuration definition getter. 1008N/A <
xsl:
template name="generate-configuration-definition-getter">
1008N/A select="concat(' /**
', 1008N/A ' * Get the configuration definition associated with this ', $this-ufn, '.
', 1008N/A ' * @return Returns the configuration definition associated with this ', $this-ufn, '.
', 1008N/A select="concat(' ManagedObjectDefinition<? extends ', $this-java-class,'CfgClient, ? extends ', $this-java-class,'Cfg> definition();
')" />
1008N/A Template for generating the relation getter declarations. 1008N/A <
xsl:
template name="generate-relation-declarations">
1008N/A <
xsl:
variable name="name" select="@name" />
1008N/A <
xsl:
call-
template name="name-to-ufn">
1008N/A <
xsl:
with-
param name="value" select="$name" />
1008N/A <
xsl:
variable name="java-relation-name">
1008N/A <
xsl:
call-
template name="name-to-java">
1008N/A <
xsl:
with-
param name="value" select="$name" />
1008N/A <
xsl:
variable name="java-class-name">
1008N/A <
xsl:
call-
template name="name-to-java">
1008N/A <
xsl:
with-
param name="value" select="@managed-object-name" />
1008N/A <
xsl:
when test="adm:one-to-one">
1389N/A <
xsl:
call-
template name="add-java-comment2">
1389N/A <
xsl:
with-
param name="indent" select="2" />
1389N/A <
xsl:
with-
param name="content" 1389N/A 'Gets the ', $ufn,'.
', 1389N/A '@return Returns the ', $ufn,'.
', 1389N/A '@throws DefinitionDecodingException
', 1389N/A ' If the ', $ufn, ' was found but its type could not be determined.
', 1389N/A '@throws ManagedObjectDecodingException
', 1389N/A ' If the ', $ufn, ' was found but one or more of its properties could not be decoded.
', 1389N/A '@throws ManagedObjectNotFoundException
', 1389N/A ' If the ', $ufn, ' could not be found on the server.
', 1389N/A '@throws ConcurrentModificationException
', 1389N/A ' If this ', $this-ufn, ' has been removed from the server by another client.
', 1389N/A '@throws AuthorizationException
', 1389N/A ' If the server refuses to retrieve the ', $ufn, ' because the client does not have the correct privileges.
', 1389N/A '@throws CommunicationException
', 1389N/A ' If the client cannot contact the server due to an underlying communication problem.')" />
1389N/A select="concat(' ', $java-class-name, 'CfgClient get', $java-relation-name, '()
', 1389N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,
', 1389N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,
', 1389N/A ' AuthorizationException, CommunicationException;
')" />
1008N/A <
xsl:
when test="adm:one-to-zero-or-one">
1389N/A <
xsl:
call-
template name="add-java-comment2">
1389N/A <
xsl:
with-
param name="indent" select="2" />
1389N/A <
xsl:
with-
param name="content" 1389N/A select="concat('Determines whether or not the ', $ufn,' exists.
', 1389N/A '@return Returns <true> if the ', $ufn,' exists.
', 1389N/A '@throws ConcurrentModificationException
', 1389N/A ' If this ', $this-ufn, ' has been removed from the server by another client.
', 1389N/A '@throws AuthorizationException
', 1389N/A ' If the server refuses to make the determination because the client does not have the correct privileges.
', 1389N/A '@throws CommunicationException
', 1389N/A ' If the client cannot contact the server due to an underlying communication problem.')" />
1008N/A select="concat(' boolean has', 1389N/A $java-relation-name, '() throws ConcurrentModificationException,
', 1389N/A ' AuthorizationException, CommunicationException;
')" />
1389N/A <
xsl:
call-
template name="add-java-comment2">
1389N/A <
xsl:
with-
param name="indent" select="2" />
1389N/A <
xsl:
with-
param name="content" 1389N/A 'Gets the ', $ufn,' if it is present.
', 1389N/A '@return Returns the ', $ufn, ' if it is present.
', 1389N/A '@throws DefinitionDecodingException
', 1389N/A ' If the ', $ufn, ' was found but its type could not be determined.
', 1389N/A '@throws ManagedObjectDecodingException
', 1389N/A ' If the ', $ufn, ' was found but one or more of its properties could not be decoded.
', 1389N/A '@throws ManagedObjectNotFoundException
', 1389N/A ' If the ', $ufn, ' is not present.
', 1389N/A '@throws ConcurrentModificationException
', 1389N/A ' If this ', $this-ufn, ' has been removed from the server by another client.
', 1389N/A '@throws AuthorizationException
', 1389N/A ' If the server refuses to retrieve the ', $ufn, ' because the client does not have the correct privileges.
', 1389N/A '@throws CommunicationException
', 1389N/A ' If the client cannot contact the server due to an underlying communication problem.')" />
1389N/A select="concat(' ', $java-class-name, 'CfgClient get', $java-relation-name, '()
', 1389N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,
', 1389N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,
', 1389N/A ' AuthorizationException, CommunicationException;
')" />
1389N/A <
xsl:
call-
template name="add-java-comment2">
1389N/A <
xsl:
with-
param name="indent" select="2" />
1389N/A <
xsl:
with-
param name="content" 1418N/A 'Creates a new ', $ufn,'. The new ', $ufn,' will initially ', 1418N/A 'not contain any property values (including mandatory ', 1418N/A 'properties). Once the ', $ufn,' has been configured it ', 1418N/A 'can be added to the server using the {@link #commit()} ', 1418N/A ' The type of the ', $ufn,' being created.
', 1389N/A ' The definition of the ', $ufn,' to be created.
', 1418N/A ' An optional collection in which to place any ', 1418N/A '{@link DefaultBehaviorException}s that occurred whilst ', 1418N/A 'attempting to determine the default values of the ', $ufn, 1418N/A '. This argument can be <code>null<code>.
', 1418N/A '@return Returns a new ', $ufn,' configuration instance.
')" />
1008N/A select="concat(' <C extends ', $java-class-name,'CfgClient> C create', $java-relation-name, '(
', 1929N/A ' ManagedObjectDefinition<C, ? extends ', $java-class-name,'Cfg> d, Collection<DefaultBehaviorException> exceptions);
')" />
1389N/A <
xsl:
call-
template name="add-java-comment2">
1389N/A <
xsl:
with-
param name="indent" select="2" />
1389N/A <
xsl:
with-
param name="content" 1389N/A 'Removes the ', $ufn,' if it exists.
', 1389N/A '@throws ManagedObjectNotFoundException
', 1389N/A ' If the ', $ufn, ' does not exist.
', 1389N/A '@throws OperationRejectedException
', 1389N/A ' If the server refuses to remove the ', $ufn, ' due to some server-side constraint which cannot be satisfied (for example, if it is referenced by another managed object).
', 1389N/A '@throws ConcurrentModificationException
', 1389N/A ' If this ', $this-ufn, ' has been removed from the server by another client.
', 1389N/A '@throws AuthorizationException
', 1389N/A ' If the server refuses to remove the ', $ufn, ' because the client does not have the correct privileges.
', 1389N/A '@throws CommunicationException
', 1389N/A ' If the client cannot contact the server due to an underlying communication problem.')" />
1389N/A select="concat(' void remove', $java-relation-name, '()
', 1389N/A ' throws ManagedObjectNotFoundException, OperationRejectedException,
', 1389N/A ' ConcurrentModificationException, AuthorizationException,
', 1389N/A ' CommunicationException;
')" />
1008N/A <
xsl:
when test="adm:one-to-many">
1008N/A <
xsl:
variable name="plural-name" 1008N/A select="adm:one-to-many/@plural-name" />
1008N/A <
xsl:
call-
template name="name-to-ufn">
1008N/A <
xsl:
with-
param name="value" select="$plural-name" />
1008N/A <
xsl:
variable name="java-relation-plural-name">
1008N/A <
xsl:
call-
template name="name-to-java">
1008N/A <
xsl:
with-
param name="value" select="$plural-name" />
1389N/A <
xsl:
call-
template name="add-java-comment2">
1389N/A <
xsl:
with-
param name="indent" select="2" />
1389N/A <
xsl:
with-
param name="content" 1389N/A select="concat('Lists the ', $ufpn,'.
', 1389N/A '@return Returns an array containing the names of the ', $ufpn,'.
', 1389N/A '@throws ConcurrentModificationException
', 1389N/A ' If this ', $this-ufn, ' has been removed from the server by another client.
', 1389N/A '@throws AuthorizationException
', 1389N/A ' If the server refuses to list the ', $ufpn, ' because the client does not have the correct privileges.
', 1389N/A '@throws CommunicationException
', 1389N/A ' If the client cannot contact the server due to an underlying communication problem.')" />
1008N/A select="concat(' String[] list', 1389N/A $java-relation-plural-name, '() throws ConcurrentModificationException,
', 1389N/A ' AuthorizationException, CommunicationException;
')" />
1389N/A <
xsl:
call-
template name="add-java-comment2">
1389N/A <
xsl:
with-
param name="indent" select="2" />
1389N/A <
xsl:
with-
param name="content" 1389N/A 'Gets the named ', $ufn, '.
', 1389N/A ' The name of the ', $ufn,' to retrieve.
', 1389N/A '@return Returns the named ', $ufn, '.
', 1389N/A '@throws DefinitionDecodingException
', 1389N/A ' If the named ', $ufn, ' was found but its type could not be determined.
', 1389N/A '@throws ManagedObjectDecodingException
', 1389N/A ' If the named ', $ufn, ' was found but one or more of its properties could not be decoded.
', 1389N/A '@throws ManagedObjectNotFoundException
', 1389N/A ' If the named ', $ufn, ' was not found on the server.
', 1389N/A '@throws ConcurrentModificationException
', 1389N/A ' If this ', $this-ufn, ' has been removed from the server by another client.
', 1389N/A '@throws AuthorizationException
', 1389N/A ' If the server refuses to retrieve the named ', $ufn, ' because the client does not have the correct privileges.
', 1389N/A '@throws CommunicationException
', 1389N/A ' If the client cannot contact the server due to an underlying communication problem.')" />
1389N/A select="concat(' ', $java-class-name, 'CfgClient get', $java-relation-name, '(String name)
', 1389N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,
', 1389N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,
', 1389N/A ' AuthorizationException, CommunicationException;
')" />
4129N/A <
xsl:
when test="string(adm:one-to-many/@unique) != 'true'">
4129N/A <
xsl:
call-
template name="add-java-comment2">
4129N/A <
xsl:
with-
param name="indent" select="2" />
4129N/A <
xsl:
with-
param name="content" 4129N/A 'Creates a new ', $ufn,'. The new ', $ufn,' will initially ', 4129N/A 'not contain any property values (including mandatory ', 4129N/A 'properties). Once the ', $ufn,' has been configured it ', 4129N/A 'can be added to the server using the {@link #commit()} ', 4129N/A ' The type of the ', $ufn,' being created.
', 4129N/A ' The definition of the ', $ufn,' to be created.
', 4129N/A ' The name of the new ', $ufn,'.
', 4129N/A ' An optional collection in which to place any ', 4129N/A '{@link DefaultBehaviorException}s that occurred whilst ', 4129N/A 'attempting to determine the default values of the ', $ufn, 4129N/A '. This argument can be <code>null<code>.
', 4129N/A '@return Returns a new ', $ufn,' configuration instance.
', 4129N/A '@throws IllegalManagedObjectNameException
', 4129N/A ' If the name of the new ', $ufn,' is invalid.
')" />
4129N/A select="concat(' <C extends ', $java-class-name,'CfgClient> C create', $java-relation-name, '(
', 4129N/A ' ManagedObjectDefinition<C, ? extends ', $java-class-name,'Cfg> d, String name, Collection<DefaultBehaviorException> exceptions) throws IllegalManagedObjectNameException;
')" />
4129N/A <
xsl:
when test="string(adm:one-to-many/@unique) = 'true'">
4129N/A <
xsl:
call-
template name="add-java-comment2">
4129N/A <
xsl:
with-
param name="indent" select="2" />
4129N/A <
xsl:
with-
param name="content" 4129N/A 'Creates a new ', $ufn,'. The new ', $ufn,' will initially ', 4129N/A 'not contain any property values (including mandatory ', 4129N/A 'properties). Once the ', $ufn,' has been configured it ', 4129N/A 'can be added to the server using the {@link #commit()} ', 4129N/A ' The type of the ', $ufn,' being created.
', 4129N/A ' The definition of the ', $ufn,' to be created.
', 4129N/A ' An optional collection in which to place any ', 4129N/A '{@link DefaultBehaviorException}s that occurred whilst ', 4129N/A 'attempting to determine the default values of the ', $ufn, 4129N/A '. This argument can be <code>null<code>.
', 4129N/A '@return Returns a new ', $ufn,' configuration instance.
')" />
4129N/A select="concat(' <C extends ', $java-class-name,'CfgClient> C create', $java-relation-name, '(
', 4129N/A ' ManagedObjectDefinition<C, ? extends ', $java-class-name,'Cfg> d, Collection<DefaultBehaviorException> exceptions);
')" />
1389N/A <
xsl:
call-
template name="add-java-comment2">
1389N/A <
xsl:
with-
param name="indent" select="2" />
1389N/A <
xsl:
with-
param name="content" 1389N/A 'Removes the named ', $ufn,'.
', 1389N/A ' The name of the ', $ufn,' to remove.
', 1389N/A '@throws ManagedObjectNotFoundException
', 1389N/A ' If the ', $ufn, ' does not exist.
', 1389N/A '@throws OperationRejectedException
', 1389N/A ' If the server refuses to remove the ', $ufn, ' due to some server-side constraint which cannot be satisfied (for example, if it is referenced by another managed object).
', 1389N/A '@throws ConcurrentModificationException
', 1389N/A ' If this ', $this-ufn, ' has been removed from the server by another client.
', 1389N/A '@throws AuthorizationException
', 1389N/A ' If the server refuses to remove the ', $ufn, ' because the client does not have the correct privileges.
', 1389N/A '@throws CommunicationException
', 1389N/A ' If the client cannot contact the server due to an underlying communication problem.')" />
1389N/A select="concat(' void remove', $java-relation-name, '(String name)
', 1389N/A ' throws ManagedObjectNotFoundException, OperationRejectedException,
', 1389N/A ' ConcurrentModificationException, AuthorizationException,
', 1389N/A ' CommunicationException;
')" />
1008N/A <
xsl:
message terminate="yes">
1008N/A select="concat('Unknown relation type "', local-name(*), '" in relation "', $name, '".')" />
1008N/A Main document parsing template. 1008N/A <
xsl:
call-
template name="copyright-notice" />
1008N/A select="concat('package ', $this-package, '.client;
')" />
1008N/A <
xsl:
call-
template name="generate-import-statements">
1008N/A <
xsl:
with-
param name="imports">
1008N/A <
xsl:
for-
each select="$this-local-properties">
2499N/A <
xsl:
call-
template name="get-property-java-imports">
2499N/A <
xsl:
with-
param name="interface" select="'client'" />
1008N/A <
xsl:
if test="$this-local-properties[@multi-valued='true']">
2499N/A test="$this-local-properties[not(@monitoring='true')]">
1418N/A <
xsl:
if test="$this-local-properties[@read-only='true']">
1008N/A <
xsl:
if test="$this-local-relations">
2499N/A select="$this-local-relations[adm:one-to-zero-or-one]|$this-local-relations[adm:one-to-many]">
1929N/A <
xsl:
variable name="java-class-name">
1929N/A <
xsl:
call-
template name="name-to-java">
1929N/A <
xsl:
with-
param name="value" 1929N/A select="@managed-object-name" />
1929N/A <
xsl:
element name="import">
1929N/A select="concat(@managed-object-package, '.server.', $java-class-name, 'Cfg')" />
1008N/A <
xsl:
when test="$this/@extends">
1008N/A <
xsl:
if test="$parent-package != $this-package">
1008N/A <
xsl:
element name="import">
1008N/A select="concat($parent-package, '.client.', $parent-java-class, 'CfgClient')" />
1008N/A <
xsl:
element name="import">
1008N/A select="concat($this-package, '.server.', $this-java-class, 'Cfg')" />
1008N/A <
xsl:
call-
template name="generate-interface-declaration" />
1008N/A <
xsl:
call-
template name="generate-configuration-definition-getter" />
1008N/A <
xsl:
for-
each select="$this-local-properties">
1008N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
call-
template name="generate-property-getter-declaration">
1008N/A <
xsl:
with-
param name="interface" select="'client'" />
1008N/A <
xsl:
call-
template name="generate-property-setter-declaration" />
1008N/A <
xsl:
for-
each select="$this-local-relations">
1008N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
call-
template name="generate-relation-declarations" />
1008N/A <
xsl:
text>}
</
xsl:
text>