📄 alsbconfigurationmbean.html
字号:
</pre> <h2>Changing environment values</h2> The following code shows two ways of changing environment values. Environment values can be changed either via the find-and-replace feature, or individually. While the former is more convenient the latter provides more control. <p> <pre> // change environment values that differ between domains. // we simply change the string "localhost" to "productionhost" // in all the URIs EnvValueQuery evquery = new EnvValueQuery( null, // search across all resource types Collections.singleton(EnvValueTypes.SERVICE_URI), // search only the URIs null, // search across all projects and folders. true, // only search across resources that are // actually modified/imported in this session "localhost", // the string we want to replace false // not a complete match of URI. any URI // that has "localhost" as substring will match ); //create a customization object for finding and replacing an environment value FindAndReplaceCustomization replaceCust = new FindAndReplaceCustomization("Find and Replace service uri",evquery, "productionhost"); List<Customization> custList = new ArrayList<Customization>(); custList.add(replaceCust); //customize now alsbSession.customize(custList); // perform an even finer grained environment value replacement. // replace all file paths/URLs that start with "file:///c:/" and // replace with "file:///c:/{project/folder of the resource}, // essentially making the file structure confirm to the project // structure // find all env values in all resources that have been modified in // the sessionevquery = new EnvValueQuery(null, null, null, true, null, false);ArrayList<QualifiedEnvValue> envValuesToChange = new ArrayList<QualifiedEnvValue>();String prefix = "file:///c:/";for (QualifiedEnvValue qev : alsbSession.findEnvValues(evquery)) { if (qev.getValue() instanceof String && qev.getValue().toString().startsWith(prefix)) { Ref ref = qev.getOwner(); String oldValue = (String) qev.getValue(); String newValue = oldValue.substring(0, prefix.length()) + ref.getFullName() + // insert "/" separated path for the resource "/" + oldValue.substring(prefix.length()); QualifiedEnvValue newEnvValue = new QualifiedEnvValue(qev.getOwner(), qev.getEnvValueType(), qev.getLocation(), newValue); envValuesToChange.add(newEnvValue); System.out.println("Env value " + qev.getOwner() + " : " + qev.getEnvValueType() + " : " + qev.getLocation() + " : " + qev.getValue() + " will be changed to " + newValue); }}//Create a customization to assign a new set of env valuesEnvValueCustomization envCust = new EnvValueCustomization("Assign env values", envValuesToChange);custList.clear();custList.add(envCust);// customize nowalsbSession.customize(custList); </pre> <h2>Querying resources</h2> This mbean also allows querying resources based on certain criteria. The queries can be performed over the core (activated) data, or in a session, in which case the session view of the configuration will be used to return the query result. The following code shows a simple query that returns all WSDL based "http" services.<p> <pre> ALSBConfigurationMBean alsbCore = getConfigMBean(null); ProxyServiceQuery query = new ProxyServiceQuery(); // find all proxy services using http transport and WSDL based query.setTransportScheme("http"); query.setWSDLBasedService(true); Set<Ref> refs = alsbCore.getRefs(query); System.out.println("Resources that satisfy the search criteria are:"); for (Ref ref : refs) { System.out.println(ref); } </pre>
<P>
<P>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#NAME">NAME</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#TYPE">TYPE</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#clone(com.bea.wli.config.Ref, com.bea.wli.config.Ref)">clone</A></B>(<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A> sourceRef,
<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A> targetRef)</CODE>
<BR>
Clones a given source project, folder or resource with a new identity.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#createFolder(com.bea.wli.config.Ref, java.lang.String)">createFolder</A></B>(<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A> folderRef,
<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> description)</CODE>
<BR>
Creates a folder with the given reference and description.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#createProject(com.bea.wli.config.Ref, java.lang.String)">createProject</A></B>(<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A> projectRef,
<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> description)</CODE>
<BR>
Creates a project with the given reference, and project description.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#customize(java.util.List)">customize</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/List.html" title="class or interface in java.util">List</A><<A HREF="../../../../../../com/bea/wli/config/customization/Customization.html" title="class in com.bea.wli.config.customization">Customization</A>> customizations)</CODE>
<BR>
This API supports multiple customizations at one place.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#delete(java.util.Collection)">delete</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A><<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A>> refs)</CODE>
<BR>
Deletes the given collection of references.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#exists(com.bea.wli.config.Ref)">exists</A></B>(<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A> ref)</CODE>
<BR>
Returns true if an entity exists in the domain.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#export(java.util.Collection, boolean, java.lang.String)">export</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A><<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A>> refsToExport,
boolean includeDependencies,
<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> passphrase)</CODE>
<BR>
Exports the given collection of references and returns bytes that make up the export data.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#exportProjects(java.util.Collection, java.lang.String)">exportProjects</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A><<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A>> projectrefs,
<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> passphrase)</CODE>
<BR>
Export resources at the project level.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A><<A HREF="../../../../../../com/bea/wli/config/env/QualifiedEnvValue.html" title="class in com.bea.wli.config.env">QualifiedEnvValue</A>></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#findEnvValues(com.bea.wli.config.env.EnvValueQuery)">findEnvValues</A></B>(<A HREF="../../../../../../com/bea/wli/config/env/EnvValueQuery.html" title="class in com.bea.wli.config.env">EnvValueQuery</A> query)</CODE>
<BR>
Searches environment specific values based on the given query</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -