You can subscribe to this list here.
2005 |
Jan
|
Feb
(1) |
Mar
(45) |
Apr
(150) |
May
(145) |
Jun
(150) |
Jul
(79) |
Aug
(313) |
Sep
(160) |
Oct
(309) |
Nov
(115) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(160) |
Feb
(144) |
Mar
(127) |
Apr
(48) |
May
(102) |
Jun
(54) |
Jul
(245) |
Aug
(94) |
Sep
(152) |
Oct
(162) |
Nov
(166) |
Dec
(740) |
2007 |
Jan
(752) |
Feb
(437) |
Mar
(328) |
Apr
(373) |
May
(569) |
Jun
(399) |
Jul
(369) |
Aug
(627) |
Sep
(100) |
Oct
(306) |
Nov
(166) |
Dec
(282) |
2008 |
Jan
(68) |
Feb
(145) |
Mar
(180) |
Apr
(160) |
May
(277) |
Jun
(229) |
Jul
(1188) |
Aug
(51) |
Sep
(97) |
Oct
(99) |
Nov
(95) |
Dec
(170) |
2009 |
Jan
(39) |
Feb
(73) |
Mar
(120) |
Apr
(121) |
May
(104) |
Jun
(262) |
Jul
(57) |
Aug
(171) |
Sep
(131) |
Oct
(88) |
Nov
(64) |
Dec
(83) |
2010 |
Jan
(55) |
Feb
(67) |
Mar
(124) |
Apr
(64) |
May
(130) |
Jun
(75) |
Jul
(164) |
Aug
(64) |
Sep
(44) |
Oct
(17) |
Nov
(43) |
Dec
(31) |
2011 |
Jan
(21) |
Feb
(10) |
Mar
(43) |
Apr
(46) |
May
(52) |
Jun
(71) |
Jul
(7) |
Aug
(16) |
Sep
(51) |
Oct
(14) |
Nov
(33) |
Dec
(15) |
2012 |
Jan
(12) |
Feb
(61) |
Mar
(129) |
Apr
(76) |
May
(70) |
Jun
(52) |
Jul
(29) |
Aug
(41) |
Sep
(32) |
Oct
(23) |
Nov
(38) |
Dec
(26) |
2013 |
Jan
(35) |
Feb
(37) |
Mar
(51) |
Apr
(15) |
May
(52) |
Jun
(15) |
Jul
(23) |
Aug
(21) |
Sep
(46) |
Oct
(69) |
Nov
(57) |
Dec
(26) |
2014 |
Jan
(5) |
Feb
(13) |
Mar
(17) |
Apr
(1) |
May
(5) |
Jun
|
Jul
(2) |
Aug
(2) |
Sep
(1) |
Oct
(16) |
Nov
(8) |
Dec
(4) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
(4) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:37:40
|
Update of /cvsroot/sblim/wbemsmt-dns-eui/jswing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15133/jswing Log Message: Directory /cvsroot/sblim/wbemsmt-dns-eui/jswing added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:37:03
|
Update of /cvsroot/sblim/wbemsmt-dns-eui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15016/wbemsmt-dns-eui Log Message: Directory /cvsroot/sblim/wbemsmt-dns-eui added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:32:18
|
Update of /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/exception In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14080/java/org/sblim/wbemsmt/exception Added Files: CimClassNotFoundException.java PropertyNotFoundException.java InvalidCimClassException.java InvalidParameterException.java NotConnectedException.java InvalidPropertyValueException.java CimConnectionException.java ObjectCreationException.java Log Message: WBEM-SMT DNS BusinessLogic component. First initial upload. --- NEW FILE: InvalidCimClassException.java --- /** * InvalidCimClassesException.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Wolfgang Taphorn <ta...@de...> * * Contributors: * **/ /* * Created on Mar 7, 2005 * */ package org.sblim.wbemsmt.exception; /** * Author taphorn * */ public class InvalidCimClassException extends Exception { /** * */ public InvalidCimClassException() { super(); // TODO Auto-generated constructor stub } public InvalidCimClassException(String message) { super(message); } } --- NEW FILE: NotConnectedException.java --- /** * NotConnectedException.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Wolfgang Taphorn <ta...@de...> * * Contributors: * **/ /* * Created on Mar 14, 2005 * */ package org.sblim.wbemsmt.exception; /** * Author taphorn * */ public class NotConnectedException extends Exception { public NotConnectedException() { super(); } public NotConnectedException(String message) { super(message); } } --- NEW FILE: PropertyNotFoundException.java --- /** * PropertyNotFoundException.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Wolfgang Taphorn <ta...@de...> * * Contributors: * **/ /* * Created on Mar 7, 2005 * */ package org.sblim.wbemsmt.exception; /** * Author taphorn * */ public class PropertyNotFoundException extends Exception { /** * */ public PropertyNotFoundException() { super(); // TODO Auto-generated constructor stub } public PropertyNotFoundException(String message) { super(message); } } --- NEW FILE: CimConnectionException.java --- /** * CimConnectionException.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Wolfgang Taphorn <ta...@de...> * * Contributors: * **/ /* * Created on Mar 21, 2005 * */ package org.sblim.wbemsmt.exception; /** * Author taphorn * */ public class CimConnectionException extends Exception { public CimConnectionException() { super(); } public CimConnectionException(String message) { super(message); } } --- NEW FILE: InvalidPropertyValueException.java --- /** * InvalidPropertyValueException.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Wolfgang Taphorn <ta...@de...> * * Contributors: * **/ /* * Created on Mar 7, 2005 * */ package org.sblim.wbemsmt.exception; /** * Author taphorn * */ public class InvalidPropertyValueException extends Exception { /** * */ public InvalidPropertyValueException() { super(); // TODO Auto-generated constructor stub } public InvalidPropertyValueException(String message) { super(message); } } --- NEW FILE: CimClassNotFoundException.java --- /** * CimClassNotFoundException.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Wolfgang Taphorn <ta...@de...> * * Contributors: * **/ package org.sblim.wbemsmt.exception; /** * Author taphorn * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class CimClassNotFoundException extends Exception { public CimClassNotFoundException() { super (); } public CimClassNotFoundException(String message) { super (message); } } --- NEW FILE: ObjectCreationException.java --- /** * ObjectCreationException.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Wolfgang Taphorn <ta...@de...> * * Contributors: * **/ /* * Created on Mar 14, 2005 * */ package org.sblim.wbemsmt.exception; /** * Author taphorn * */ public class ObjectCreationException extends Exception { public ObjectCreationException() { super (); } public ObjectCreationException(String message) { super(message); } } --- NEW FILE: InvalidParameterException.java --- /** * InvalidParameterException.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Wolfgang Taphorn <ta...@de...> * * Contributors: * **/ /* * Created on Mar 22, 2005 * */ package org.sblim.wbemsmt.exception; /** * Author taphorn * */ public class InvalidParameterException extends Exception { public InvalidParameterException() { super (); } public InvalidParameterException(String message) { super(message); } } |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:32:18
|
Update of /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/dns/bl/adapter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14080/java/org/sblim/wbemsmt/dns/bl/adapter Added Files: Network.java ReverseZoneAdapter.java ReverseZone.java Log Message: WBEM-SMT DNS BusinessLogic component. First initial upload. --- NEW FILE: Network.java --- /** * Network.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: **/ /* * Created on Jun 30, 2005, ceron */ package org.sblim.wbemsmt.dns.bl.adapter; import java.util.ArrayList; import org.sblim.wbemsmt.dns.bl.fco.DNSResourceRecord; /** * @author ceron * */ public class Network { private String name4ReverseZone = null; private ArrayList records = null; public Network(String reverseName){ this.name4ReverseZone = reverseName; this.records = new ArrayList(); } public void addRecord(DNSResourceRecord r){ if(!this.records.contains(r)) this.records.add(r); } public ArrayList getRecords(){ return this.records; } public String getNameForReverseZone(){ return this.name4ReverseZone; } public boolean equals(Object o){ Network t = (Network) o; try{ if (this.name4ReverseZone.equalsIgnoreCase(t.getNameForReverseZone())) return true; else return false; }catch (Exception e){ return false; } } } --- NEW FILE: ReverseZone.java --- /** * ReverseZone.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: **/ /* * Created on Aug 13, 2005, ceron */ package org.sblim.wbemsmt.dns.bl.adapter; import java.util.ArrayList; import org.sblim.wbemsmt.dns.bl.fco.DNSMasterZone; /** * @author ceron * */ public class ReverseZone { private DNSMasterZone zone = null; private ArrayList rrs = null; public ReverseZone(DNSMasterZone z, ArrayList a){ this.zone = z; this.rrs = a; } public DNSMasterZone getZone(){ return this.zone; } public ArrayList getZoneResourceRecords(){ return this.rrs; } } --- NEW FILE: ReverseZoneAdapter.java --- /** * ReverseZoneAdapter.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: **/ /* * Created on Aug 13, 2005, ceron */ package org.sblim.wbemsmt.dns.bl.adapter; import java.util.ArrayList; import org.sblim.wbem.client.CIMClient; import org.sblim.wbemsmt.dns.bl.fco.DNSMasterZone; import org.sblim.wbemsmt.dns.bl.fco.DNSResourceRecord; import org.sblim.wbemsmt.dns.bl.fco.DNSZone; import org.sblim.wbemsmt.dns.bl.adapter.Network; /** * @author ceron * */ public class ReverseZoneAdapter{ private ArrayList zoneAL = null; private ArrayList rrsAL = null; private CIMClient cimClient = null; private ArrayList nets = null; private Network net = null; private ArrayList reverseZones = new ArrayList(); /** Creates a ReverseZoneAdapter object with information * for creating a reverse zone for every master zone * @param cimClient */ public ReverseZoneAdapter(CIMClient cimClient){ this.cimClient = cimClient; this.zoneAL = DNSMasterZone.enumerateInstances(cimClient); } /** Creates a ReverseZoneAdapter object with information * for creating a reverse zone for the given master zone * @param cimClient * @param zone */ public ReverseZoneAdapter(CIMClient cimClient, DNSMasterZone zone){ this.cimClient = cimClient; this.zoneAL = new ArrayList(); this.zoneAL.add(zone); } /**Creates a ReverseZoneAdapter object with information for creating * reverse zones for the given array list of resource records * @param cimClient * @param rrs */ public ReverseZoneAdapter(CIMClient cimClient, ArrayList rrs){ this.cimClient = cimClient; this.rrsAL = rrs; } public String[] getReverseZoneNames(){ String [] s = new String[nets.size()]; try{ for(int i=0; i<nets.size();i++){ s[i] = ((Network)nets.get(i)).getNameForReverseZone(); } }catch(Exception e){ System.err.println("Error while retrieving reverse zones names"); } return s; } /**Gets the networks info. This is only the information of which * resource records would belong to each reverse zone * @return ArrayList of Network objects */ public ArrayList getNetworks(){ return this.nets; } /**Builds network information based upon the zones or resource records * given to the adapter * @return true or false */ public boolean builReverseInfo(){ ArrayList reverseZones = new ArrayList(); ArrayList reverseRRs = new ArrayList(); DNSMasterZone zone = null; DNSMasterZone revZone = null; DNSResourceRecord rr = null; DNSResourceRecord revRR = null; //get rrs from zones we want to create resource records from if(this.zoneAL != null){ //Want to create reverse of (a specific | all) zone(s) this.rrsAL = new ArrayList(); for(int i=0; i<zoneAL.size();i++){ zone = (DNSMasterZone) zoneAL.get(i); try{ if(!"localhost".equalsIgnoreCase(zone.getName()) && !"0.0.127.in-addr.arpa".equalsIgnoreCase(zone.getName()) && zone.getName().toLowerCase().indexOf("in-addr.arpa")==-1) this.rrsAL.addAll(zone.getAssociatedResourceRecords(this.cimClient)); }catch(Exception ex){ System.err.println("System inernal error while getting zone name"); } } } //put resource records into networks try{ this.nets = this.createNetworks(this.rrsAL); }catch(Exception e){ System.err.println("Unable to create reverse zone(s)"); e.printStackTrace(); return false; } return true; } /**Creates an array list of ReverseZone * @return Arraylist of ReverseZone */ public ArrayList createReverseZones(){ ReverseZone r = null; Network net = null; DNSMasterZone zone = null; DNSResourceRecord rr = null; ArrayList rrList = null; ArrayList newRRList = null; try{ for(int i=0; i<this.nets.size();i++){ net = (Network) nets.get(i); rrList = net.getRecords(); zone = new DNSMasterZone(this.cimClient); zone.setName(net.getNameForReverseZone()); zone.setType(new Short(DNSZone.TYPE_MASTER)); newRRList = new ArrayList(); for(int j=0;j<rrList.size();j++){ rr = (DNSResourceRecord) rrList.get(j); rr = rr.createReverse(this.cimClient); newRRList.add(rr); } r = new ReverseZone(zone,newRRList); this.reverseZones.add(r); } }catch(Exception e){ System.err.println("Error while creating reverse zone data"); } return this.reverseZones; } private ArrayList createNetworks(ArrayList rrs) throws Exception { ArrayList nets = new ArrayList(); DNSResourceRecord r = null; String value = null; String revName = null; String[] octets = null; Network net = null; if(rrs==null) return nets; for(int i=0;i<rrs.size();i++){ try{ r = (DNSResourceRecord) rrs.get(i); if(!("A".equalsIgnoreCase(r.getTypeString()))) continue; value = r.getValue(); octets = value.split("\\."); revName = new String(); for(int j=octets.length-2; j>=0; j--) revName = revName.concat(octets[j]+"."); revName = revName.concat("in-addr.arpa"); net = new Network(revName); if(!nets.contains(net)){ net.addRecord(r); nets.add(net); }else{ net = (Network) nets.get(nets.indexOf(net)); net.addRecord(r); } }catch (ArrayIndexOutOfBoundsException e){ try{ System.out.println("Invalid value in resource record " + r.getName()); }catch(Exception d){ } throw e; }catch (Exception e){ throw e; } } return nets; } } |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:32:18
|
Update of /cvsroot/sblim/wbemsmt-dns-bl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14080 Added Files: build.xml .classpath .cvsignore .project license.txt Log Message: WBEM-SMT DNS BusinessLogic component. First initial upload. --- NEW FILE: .cvsignore --- bin compile wbemsmt-dns-bl.jar --- NEW FILE: build.xml --- <!-- * build.xml * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Wolfgang Taphorn <ta...@de...> * * Contributors: --> <project name="wbemsmt-dns-bl" default="package" basedir="." > <description> Build file of sblim wbemsmt-dns-bl project. </description> <property environment="env"/> <property name="project.packagepath" location="org/sblim/wbemsmt/dns"/> <property name="project.packagepath.additional" location="org/sblim/wbemsmt/exceptions"/> <property name="cimClientPath" location="${env.CIMCLIENTPATH}"/> <target name="build"> <mkdir dir="${basedir}/compile"/> <javac destdir="${basedir}/compile" debug="true" listfiles="true" compiler="modern" srcdir="${basedir}"> <exclude name="**/dns/test/**"/> <classpath> <path> <fileset dir="${cimClientPath}"> <include name="sblimCIMClient.jar"/> </fileset> </path> </classpath> </javac> </target> <target name="package" depends="clean, build"> <jar index="true" destfile="${basedir}/${ant.project.name}.jar" basedir="${basedir}/compile/" includes="**/*.class" /> </target> <target name="clean"> <delete dir="${basedir}/compile/" verbose="true"/> <delete file="${basedir}/${ant.project.name}.jar" verbose="true"/> </target> </project> --- NEW FILE: .classpath --- <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="java"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry combineaccessrules="false" kind="src" path="/cim-client"/> <classpathentry sourcepath="ECLIPSE_HOME/plugins/org.eclipse.jdt.source_3.1.0/src/org.junit_3.8.1/junitsrc.zip" kind="var" path="JUNIT_HOME/junit.jar"/> <classpathentry kind="output" path="java"/> </classpath> --- NEW FILE: license.txt --- Common Public License Version 1.0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 1. DEFINITIONS "Contribution" means: a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and b) in the case of each subsequent Contributor: i) changes to the Program, and ii) additions to the Program; where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. "Contributor" means any person or entity that distributes the Program. "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. "Program" means the Contributions distributed in accordance with this Agreement. "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. 2. GRANT OF RIGHTS a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. 3. REQUIREMENTS A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: a) it complies with the terms and conditions of this Agreement; and b) its license agreement: i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. When the Program is made available in source code form: a) it must be made available under this Agreement; and b) a copy of this Agreement must be included with each copy of the Program. Contributors may not remove or alter any copyright notices contained within the Program. Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. 4. COMMERCIAL DISTRIBUTION Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. 5. NO WARRANTY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. 6. DISCLAIMER OF LIABILITY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 7. GENERAL If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>wbemsmt-dns-bl</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription> |
Update of /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/dns/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14080/java/org/sblim/wbemsmt/dns/test Added Files: DNSTest_DnsConfiguration_getall.java DNSTest_DnsHintZone_print.java DNSTest_DnsSetting_associations.java DNSTest_DnsSetting_print.java DNSTest_DnsIPAddress_modify.java DNSTest_DnsZone_associations.java DNSTest_DnsAML_getall.java DNSTest_DnsHintZone_modify.java DNSTest_DnsSetting_delete.java DNSTest_DnsMasterZone_reverse.java DNSTest_DnsZone_list.java DNSTest_DnsZone_getall.java DNSTest_DnsService_associations.java DNSTest_DnsMasterZone_create.java DNSTest_DnsService_print.java DNSTest_DnsIPAddress_print.java DNSTest_DnsHintZone_delete.java DNSTest_DnsSlaveZone_list.java DNSTest_DnsHintZone_list.java DNSTest_DnsSlaveZone_print.java DNSTest_DnsMasterZone_associations.java DNSTest_ResourceRecord_print.java DNSTest_DnsConfiguration_print.java DNSTest_DnsSlaveZone_associations.java DNSTest_DnsSlaveZone_create.java DNSTest_DnsForwardZone_create.java DNSTest_DnsIPAddress_list.java DNSTest_DnsSetting_list.java DNSTest_DnsSlaveZone_modify.java DNSTestSuite.java DNSTest_DnsForwardZone_delete.java DNSTest_DnsHintZone_create.java DNSTest_DnsSetting_modify.java DNSTest_DnsAML_list.java DNSTest_DnsHintZone_getall.java DNSTest_DnsSlaveZone_getall.java DNSTest_DnsZone_print.java DNSTest_DnsAML_delete.java DNSTest_DnsSetting_getall.java DNSTest_DnsForwardZone_list.java DNSTest_ResourceRecord_list.java DNSTest_ResourceRecord_getall.java DNSTest_DnsAML_associations.java DNSTest_DnsConfiguration_associations.java DNSTest_DnsAclInService.java DNSTest_DnsIPAddress_delete.java DNSTest_DnsService_list.java DNSTest_DnsMasterZone_list.java DNSTest_DnsMasterZone_modify.java DNSTest_DnsAML_create.java DNSTest_DnsIPAddress_getall.java DNSTest_BaseClass.java DNSTest_DnsMasterZone_print.java DNSTest_DnsForwardZone_getall.java DNSTest_DnsHintZone_associations.java DNSTest_DnsAML_print.java DNSTest_DnsMasterZone_delete.java DNSTest_DnsConfiguration_list.java DNSTest_DnsService_getall.java DNSTest_DnsSlaveZone_delete.java DNSTest_DnsMasterZone_getall.java DNSTest_DnsForwardZone_print.java DNSTest_DnsForwardZone_associations.java DNSTest_DnsAclInZone.java DNSTest_DnsAML_modify.java DNSTest_DnsIPAddress_associations.java DNSTest_DnsForwardZone_modify.java DNSTest_DnsIPAddress_create.java Log Message: WBEM-SMT DNS BusinessLogic component. First initial upload. --- NEW FILE: DNSTest_DnsMasterZone_delete.java --- /** * DNSTest_DnsMasterZone_delete.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: * **/ /* * Created on Jun 14, 2005, ceron */ package org.sblim.wbemsmt.dns.test; import java.util.ArrayList; import java.util.Iterator; import junit.framework.Assert; import org.sblim.wbem.cim.CIMObjectPath; import org.sblim.wbemsmt.dns.bl.fco.DNSMasterZone; import org.sblim.wbemsmt.exception.InvalidParameterException; /** * Author ceron * */ public class DNSTest_DnsMasterZone_delete extends DNSTest_BaseClass { public DNSTest_DnsMasterZone_delete(String arg0){ super(arg0); } public void testDeleteDnsMasterZone01(){ DNSMasterZone zone = null; ArrayList a = DNSMasterZone.enumerateInstanceNames(this.cimClient); Iterator i = a.iterator(); CIMObjectPath op = null; try{ while(i.hasNext()){ op = (CIMObjectPath) i.next(); zone = (DNSMasterZone) DNSMasterZone.getInstance(this.cimClient,op); if("GhostMasterZone".equals(zone.getName())){ DNSMasterZone.deleteInstance(this.cimClient,zone); } } }catch (Exception e){ e.printStackTrace(); Assert.fail("testDeleteDnsMasterZone01 failed: " + e.getMessage()); } System.out.println("testDeleteDnsMasterZone01: completed"); } public void testDeleteDnsMasterZone02(){ DNSMasterZone zone = null; try{ DNSMasterZone.deleteInstance(this.cimClient,zone); }catch (InvalidParameterException e){ System.out.println("testDeleteDnsMasterZone02: Got InvalidParameterException as expected"); }catch (Exception e){ e.printStackTrace(); Assert.fail("testDeleteDnsMaster02 failed: " + e.getMessage()); } } } --- NEW FILE: DNSTest_DnsAML_print.java --- /** * DNSTest_DnsAML_print.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: * **/ /* * Created on May 26, 2005, ceron */ package org.sblim.wbemsmt.dns.test; import java.util.ArrayList; import junit.framework.Assert; import org.sblim.wbemsmt.dns.bl.fco.DNSAddressMatchList; /** * Author ceron * */ public class DNSTest_DnsAML_print extends DNSTest_BaseClass { /** * Constructor for DNSTest. * @param arg0 */ public DNSTest_DnsAML_print(String arg0) { super(arg0); } public void testPrintDnsAML01() { try { ArrayList amlList = DNSAddressMatchList.enumerateInstanceNames(cimClient); System.out.println("______________________________"); for (int i=0; amlList != null && i < amlList.size(); i++) { System.out.println(amlList.get(i)); } System.out.println("_______________________________"); System.out.println("testPrintDnsAML01 completed. Printed " + amlList.size() + " address match list ObjectPath entries."); } catch (Exception e) { e.printStackTrace(); Assert.fail("testPrintDnsAML01 failed: " + e.getMessage()); } } public void testPrintDnsAML02() { try { ArrayList amlList = DNSAddressMatchList.enumerateInstances(this.cimClient); for (int i=0; amlList != null && i < amlList.size(); i++) { System.out.println("_____________________________"); System.out.println(amlList.get(i)); } System.out.println("testPrintDnsAML02 completed. Printed " + amlList.size() + " Instances."); } catch (Exception e) { e.printStackTrace(); Assert.fail("testPrintDnsAML02 failed: " + e.getMessage()); } } } --- NEW FILE: DNSTest_DnsAML_getall.java --- /** * DNSTest_DnsAML_getall.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: * **/ /* * Created on May 26, 2005, ceron */ package org.sblim.wbemsmt.dns.test; import java.util.ArrayList; import java.util.Iterator; import junit.framework.Assert; import org.sblim.wbem.cim.CIMObjectPath; import org.sblim.wbemsmt.dns.bl.fco.DNSAddressMatchList; /** * Author ceron * */ public class DNSTest_DnsAML_getall extends DNSTest_BaseClass { /**The objective of this test is to test the get* methods from * DNSAddressMatchList * @param arg0 */ public DNSTest_DnsAML_getall(String arg0){ super(arg0); } public void testSingleDnsAML01(){ ArrayList arraylist = null; Iterator rri = null; DNSAddressMatchList aml = null; CIMObjectPath op = null; String name = null; String serviceName = null; Short addressListType = null; String addressListTypeString = null; Object addressList[] = null; try{ arraylist = DNSAddressMatchList.enumerateInstanceNames(this.cimClient); } catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsAML01 failed: " + e.getMessage()); } rri = arraylist.iterator(); while(rri.hasNext()){ op = (CIMObjectPath)rri.next(); try{ aml = (DNSAddressMatchList) DNSAddressMatchList.getInstance(this.cimClient,op); }catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsAML01 failed: " + e.getMessage()); } try{ serviceName = aml.getServiceName(); name = aml.getName(); addressListType = aml.getAddressListType(); addressListTypeString = aml.getAddressListTypeString(); addressList = aml.getAddressList(); } catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsAML01 failed: " + e.getMessage()); } System.out.println("_________________________"); System.out.println("Name: " + name); System.out.println("ServiceName: " + serviceName); System.out.println("AddressListType: " + addressListType + " -> " + addressListTypeString); System.out.println("AddressList:"); for(int i=0; i < addressList.length; i++) System.out.println(" "+ addressList[i]); } System.out.println("_________________________"); System.out.println("testSingleDnsAML01 completed. Got " + arraylist.size()+ " address match list instances"); } } --- NEW FILE: DNSTest_DnsZone_print.java --- /** * DNSTest_DnsZone_print.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: * **/ /* * Created on May 20, 2005, ceron */ package org.sblim.wbemsmt.dns.test; import java.util.ArrayList; import junit.framework.Assert; import org.sblim.wbemsmt.dns.bl.fco.DNSZone; /** * Author ceron * */ public class DNSTest_DnsZone_print extends DNSTest_BaseClass{ /** * Constructor for DNSTest. * @param arg0 */ public DNSTest_DnsZone_print(String arg0) { super(arg0); } public void testPrintDnsZone01() { try { ArrayList dnsZoneList = DNSZone.enumerateInstanceNames(cimClient); System.out.println("______________________________"); for (int i=0; dnsZoneList != null && i < dnsZoneList.size(); i++) { System.out.println(dnsZoneList.get(i)); } System.out.println("_______________________________"); System.out.println("testPrintDnsZone01 completed. Printed " + dnsZoneList.size() + " DnsZone ObjectPath entries."); } catch (Exception e) { e.printStackTrace(); Assert.fail("testPrintDnsZone01 failed: " + e.getMessage()); } } public void testPrintDnsZone02() { try { ArrayList dnsZoneList = DNSZone.enumerateInstances(this.cimClient); for (int i=0; dnsZoneList != null && i < dnsZoneList.size(); i++) { System.out.println("_____________________________"); System.out.println(dnsZoneList.get(i)); } System.out.println("testPrintDnsZone02 completed. Printed " + dnsZoneList.size() + " DnsZone Instances."); } catch (Exception e) { e.printStackTrace(); Assert.fail("testPrintDnsZone02 failed: " + e.getMessage()); } } } --- NEW FILE: DNSTestSuite.java --- /** * DNSTestSuite.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Wolfgang Taphorn <ta...@de...> * * Contributors: * Rodrigo Ceron <rc...@br...> **/ /* * Created on Mar 16, 2005 * */ package org.sblim.wbemsmt.dns.test; import junit.framework.Test; import junit.framework.TestSuite; /** * Author taphorn * */ public class DNSTestSuite extends TestSuite { public static void main(String[] args) { junit.swingui.TestRunner.run(DNSTestSuite.class); } public static Test suite() { TestSuite suite= new TestSuite(); //========== //List Resource Records suite.addTest(new DNSTest_ResourceRecord_list("testListDnsResourceRecord01")); suite.addTest(new DNSTest_ResourceRecord_list("testListDnsResourceRecord02")); suite.addTest(new DNSTest_ResourceRecord_list("testListDnsResourceRecord03")); suite.addTest(new DNSTest_ResourceRecord_list("testListDnsResourceRecord04")); //Print Resource Records suite.addTest(new DNSTest_ResourceRecord_print("testPrintDnsResourceRecord01")); suite.addTest(new DNSTest_ResourceRecord_print("testPrintDnsResourceRecord02")); //Get a specific RR and print its data suite.addTest(new DNSTest_ResourceRecord_getall("testSingleDnsResourceRecord01")); //=========== //List Dns Master Zones only suite.addTest(new DNSTest_DnsMasterZone_list("testListDnsMasterZone01")); suite.addTest(new DNSTest_DnsMasterZone_list("testListDnsMasterZone02")); suite.addTest(new DNSTest_DnsMasterZone_list("testListDnsMasterZone03")); suite.addTest(new DNSTest_DnsMasterZone_list("testListDnsMasterZone04")); //Print Dns Master Zones only suite.addTest(new DNSTest_DnsMasterZone_print("testPrintDnsMasterZone01")); suite.addTest(new DNSTest_DnsMasterZone_print("testPrintDnsMasterZone02")); //Get a specific DnsMasterZone and print its data suite.addTest(new DNSTest_DnsMasterZone_getall("testSingleDnsMasterZone01")); //Modify the data of a master Zone suite.addTest(new DNSTest_DnsMasterZone_modify("testModifyDnsMasterZone01")); suite.addTest(new DNSTest_DnsMasterZone_modify("testModifyDnsMasterZone02")); suite.addTest(new DNSTest_DnsMasterZone_modify("testModifyDnsMasterZone03")); //Get the associations of a master Zone suite.addTest(new DNSTest_DnsMasterZone_associations("testAssociationsDnsMasterZone01")); suite.addTest(new DNSTest_DnsMasterZone_associations("testAssociationsDnsMasterZone02")); suite.addTest(new DNSTest_DnsMasterZone_associations("testAssociationsDnsMasterZone03")); suite.addTest(new DNSTest_DnsMasterZone_associations("testAssociationsDnsMasterZone04")); suite.addTest(new DNSTest_DnsMasterZone_associations("testAssociationsDnsMasterZone05")); suite.addTest(new DNSTest_DnsMasterZone_associations("testAssociationsDnsMasterZone06")); //Create a master zone match list suite.addTest(new DNSTest_DnsMasterZone_create("testCreateDnsMasterZone01")); suite.addTest(new DNSTest_DnsMasterZone_create("testCreateDnsMasterZone02")); //Delete previous master zone match list suite.addTest(new DNSTest_DnsMasterZone_delete("testDeleteDnsMasterZone01")); suite.addTest(new DNSTest_DnsMasterZone_delete("testDeleteDnsMasterZone02")); //Reverse of Master zone networks suite.addTest(new DNSTest_DnsMasterZone_reverse("testReverseDnsMasterZone01")); suite.addTest(new DNSTest_DnsMasterZone_reverse("testReverseDnsMasterZone02")); suite.addTest(new DNSTest_DnsMasterZone_reverse("testReverseDnsMasterZone03")); //=========== //List Dns Slave Zones only suite.addTest(new DNSTest_DnsSlaveZone_list("testListDnsSlaveZone01")); suite.addTest(new DNSTest_DnsSlaveZone_list("testListDnsSlaveZone02")); suite.addTest(new DNSTest_DnsSlaveZone_list("testListDnsSlaveZone03")); suite.addTest(new DNSTest_DnsSlaveZone_list("testListDnsSlaveZone04")); //Print Dns Slave Zones only suite.addTest(new DNSTest_DnsSlaveZone_print("testPrintDnsSlaveZone01")); suite.addTest(new DNSTest_DnsSlaveZone_print("testPrintDnsSlaveZone02")); //Get a specific DnsSlaveZone and print its data suite.addTest(new DNSTest_DnsSlaveZone_getall("testSingleDnsSlaveZone01")); //Modify the data of a slave Zone suite.addTest(new DNSTest_DnsSlaveZone_modify("testModifyDnsSlaveZone01")); suite.addTest(new DNSTest_DnsSlaveZone_modify("testModifyDnsSlaveZone02")); suite.addTest(new DNSTest_DnsSlaveZone_modify("testModifyDnsSlaveZone03")); //Get the associations of a slave Zone suite.addTest(new DNSTest_DnsSlaveZone_associations("testAssociationsDnsSlaveZone01")); suite.addTest(new DNSTest_DnsSlaveZone_associations("testAssociationsDnsSlaveZone02")); suite.addTest(new DNSTest_DnsSlaveZone_associations("testAssociationsDnsSlaveZone03")); suite.addTest(new DNSTest_DnsSlaveZone_associations("testAssociationsDnsSlaveZone04")); suite.addTest(new DNSTest_DnsSlaveZone_associations("testAssociationsDnsSlaveZone05")); suite.addTest(new DNSTest_DnsSlaveZone_associations("testAssociationsDnsSlaveZone06")); suite.addTest(new DNSTest_DnsSlaveZone_associations("testAssociationsDnsSlaveZone09")); suite.addTest(new DNSTest_DnsSlaveZone_associations("testAssociationsDnsSlaveZone10")); //Create a slave zone match list suite.addTest(new DNSTest_DnsSlaveZone_create("testCreateDnsSlaveZone01")); suite.addTest(new DNSTest_DnsSlaveZone_create("testCreateDnsSlaveZone02")); //Delete previous slave zone match list suite.addTest(new DNSTest_DnsSlaveZone_delete("testDeleteDnsSlaveZone01")); suite.addTest(new DNSTest_DnsSlaveZone_delete("testDeleteDnsSlaveZone02")); //=========== //List Dns Hint Zones only suite.addTest(new DNSTest_DnsHintZone_list("testListDnsHintZone01")); suite.addTest(new DNSTest_DnsHintZone_list("testListDnsHintZone02")); suite.addTest(new DNSTest_DnsHintZone_list("testListDnsHintZone03")); suite.addTest(new DNSTest_DnsHintZone_list("testListDnsHintZone04")); //Print Dns Hint Zones only suite.addTest(new DNSTest_DnsHintZone_print("testPrintDnsHintZone01")); suite.addTest(new DNSTest_DnsHintZone_print("testPrintDnsHintZone02")); //Get a specific DnsHintZone and print its data suite.addTest(new DNSTest_DnsHintZone_getall("testSingleDnsHintZone01")); //Modify the data of a hint Zone suite.addTest(new DNSTest_DnsHintZone_modify("testModifyDnsHintZone01")); suite.addTest(new DNSTest_DnsHintZone_modify("testModifyDnsHintZone02")); suite.addTest(new DNSTest_DnsHintZone_modify("testModifyDnsHintZone03")); //Create a hint zone match list suite.addTest(new DNSTest_DnsHintZone_create("testCreateDnsHintZone01")); suite.addTest(new DNSTest_DnsHintZone_create("testCreateDnsHintZone02")); //Delete previous hint zone match list suite.addTest(new DNSTest_DnsHintZone_delete("testDeleteDnsHintZone01")); suite.addTest(new DNSTest_DnsHintZone_delete("testDeleteDnsHintZone02")); //Get the associations of a hint Zone suite.addTest(new DNSTest_DnsHintZone_associations("testAssociationsDnsHintZone01")); suite.addTest(new DNSTest_DnsHintZone_associations("testAssociationsDnsHintZone02")); //=========== //List Dns Forward Zones only suite.addTest(new DNSTest_DnsForwardZone_list("testListDnsForwardZone01")); suite.addTest(new DNSTest_DnsForwardZone_list("testListDnsForwardZone02")); suite.addTest(new DNSTest_DnsForwardZone_list("testListDnsForwardZone03")); suite.addTest(new DNSTest_DnsForwardZone_list("testListDnsForwardZone04")); //Print Dns Forward Zones only suite.addTest(new DNSTest_DnsForwardZone_print("testPrintDnsForwardZone01")); suite.addTest(new DNSTest_DnsForwardZone_print("testPrintDnsForwardZone02")); //Get a specific DnsForwardZone and print its data suite.addTest(new DNSTest_DnsForwardZone_getall("testSingleDnsForwardZone01")); //Modify the data of a forward Zone suite.addTest(new DNSTest_DnsForwardZone_modify("testModifyDnsForwardZone01")); suite.addTest(new DNSTest_DnsForwardZone_modify("testModifyDnsForwardZone02")); suite.addTest(new DNSTest_DnsForwardZone_modify("testModifyDnsForwardZone03")); //Create a forward zone match list suite.addTest(new DNSTest_DnsForwardZone_create("testCreateDnsForwardZone01")); suite.addTest(new DNSTest_DnsForwardZone_create("testCreateDnsForwardZone02")); //Delete previous forward zone match list suite.addTest(new DNSTest_DnsForwardZone_delete("testDeleteDnsForwardZone01")); suite.addTest(new DNSTest_DnsForwardZone_delete("testDeleteDnsForwardZone02")); //Get the associations of a forward Zone suite.addTest(new DNSTest_DnsForwardZone_associations("testAssociationsDnsForwardZone01")); suite.addTest(new DNSTest_DnsForwardZone_associations("testAssociationsDnsForwardZone02")); //========== // List Adress Match Lists suite.addTest(new DNSTest_DnsAML_list("testListDnsAML01")); suite.addTest(new DNSTest_DnsAML_list("testListDnsAML02")); suite.addTest(new DNSTest_DnsAML_list("testListDnsAML03")); suite.addTest(new DNSTest_DnsAML_list("testListDnsAML04")); //Print Address Match Lists suite.addTest(new DNSTest_DnsAML_print("testPrintDnsAML01")); suite.addTest(new DNSTest_DnsAML_print("testPrintDnsAML02")); //Get a specific Address Match List and print its data suite.addTest(new DNSTest_DnsAML_getall("testSingleDnsAML01")); //Modify the data of an Address Match List suite.addTest(new DNSTest_DnsAML_modify("testModifyDnsAML01")); suite.addTest(new DNSTest_DnsAML_modify("testModifyDnsAML02")); suite.addTest(new DNSTest_DnsAML_modify("testModifyDnsAML03")); //Get the associations of an Address Match List suite.addTest(new DNSTest_DnsAML_associations("testAssociationsDnsAML01")); suite.addTest(new DNSTest_DnsAML_associations("testAssociationsDnsAML02")); suite.addTest(new DNSTest_DnsAML_associations("testAssociationsDnsAML03")); suite.addTest(new DNSTest_DnsAML_associations("testAssociationsDnsAML04")); //Create an address match list suite.addTest(new DNSTest_DnsAML_create("testCreateDnsAML01")); suite.addTest(new DNSTest_DnsAML_create("testCreateDnsAML02")); //Delete previous address match list suite.addTest(new DNSTest_DnsAML_delete("testDeleteDnsAML01")); suite.addTest(new DNSTest_DnsAML_delete("testDeleteDnsAML02")); //========== // List ip addresses suite.addTest(new DNSTest_DnsIPAddress_list("testListDnsIPAddress01")); suite.addTest(new DNSTest_DnsIPAddress_list("testListDnsIPAddress02")); suite.addTest(new DNSTest_DnsIPAddress_list("testListDnsIPAddress03")); suite.addTest(new DNSTest_DnsIPAddress_list("testListDnsIPAddress04")); //Print ip addresses suite.addTest(new DNSTest_DnsIPAddress_print("testPrintDnsIPAddress01")); suite.addTest(new DNSTest_DnsIPAddress_print("testPrintDnsIPAddress02")); //Get a specific ip Address and print its data suite.addTest(new DNSTest_DnsIPAddress_getall("testSingleDnsIPAddress01")); //Modify the data of an ip Address suite.addTest(new DNSTest_DnsIPAddress_modify("testModifyDnsIPAddress01")); suite.addTest(new DNSTest_DnsIPAddress_modify("testModifyDnsIPAddress02")); suite.addTest(new DNSTest_DnsIPAddress_modify("testModifyDnsIPAddress03")); //Get the associations of an ip Address suite.addTest(new DNSTest_DnsIPAddress_associations("testAssociationsDnsIPAddress01")); suite.addTest(new DNSTest_DnsIPAddress_associations("testAssociationsDnsIPAddress02")); //Create an ip address suite.addTest(new DNSTest_DnsIPAddress_create("testCreateDnsIPAddress01")); suite.addTest(new DNSTest_DnsIPAddress_create("testCreateDnsIPAddress02")); //Delete previous ip address suite.addTest(new DNSTest_DnsIPAddress_delete("testDeleteDnsIPAddress01")); suite.addTest(new DNSTest_DnsIPAddress_delete("testDeleteDnsIPAddress02")); //========== // List dns services suite.addTest(new DNSTest_DnsService_list("testListDnsService01")); suite.addTest(new DNSTest_DnsService_list("testListDnsService02")); suite.addTest(new DNSTest_DnsService_list("testListDnsService03")); suite.addTest(new DNSTest_DnsService_list("testListDnsService04")); //Print dns services suite.addTest(new DNSTest_DnsService_print("testPrintDnsService01")); suite.addTest(new DNSTest_DnsService_print("testPrintDnsService02")); //Get a specific dns service and print its data suite.addTest(new DNSTest_DnsService_getall("testSingleDnsService01")); //Get the associations of a dns service suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService01")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService02")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService03")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService04")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService05")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService06")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService07")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService08")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService09")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService10")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService11")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService12")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService13")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService14")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService15")); suite.addTest(new DNSTest_DnsService_associations("testAssociationsDnsService16")); //========== // List dns configuration suite.addTest(new DNSTest_DnsConfiguration_list("testListDnsConfiguration01")); suite.addTest(new DNSTest_DnsConfiguration_list("testListDnsConfiguration02")); suite.addTest(new DNSTest_DnsConfiguration_list("testListDnsConfiguration03")); suite.addTest(new DNSTest_DnsConfiguration_list("testListDnsConfiguration04")); //Print dns configuration suite.addTest(new DNSTest_DnsConfiguration_print("testPrintDnsConfiguration01")); suite.addTest(new DNSTest_DnsConfiguration_print("testPrintDnsConfiguration02")); //Get a specific dns configuration and print its data suite.addTest(new DNSTest_DnsConfiguration_getall("testSingleDnsConfiguration01")); //Get the associations of a dns configuration suite.addTest(new DNSTest_DnsConfiguration_associations("testAssociationsDnsConfiguration01")); suite.addTest(new DNSTest_DnsConfiguration_associations("testAssociationsDnsConfiguration02")); suite.addTest(new DNSTest_DnsConfiguration_associations("testAssociationsDnsConfiguration03")); suite.addTest(new DNSTest_DnsConfiguration_associations("testAssociationsDnsConfiguration04")); //========== // List dns settings suite.addTest(new DNSTest_DnsSetting_list("testListDnsSetting01")); suite.addTest(new DNSTest_DnsSetting_list("testListDnsSetting02")); suite.addTest(new DNSTest_DnsSetting_list("testListDnsSetting03")); suite.addTest(new DNSTest_DnsSetting_list("testListDnsSetting04")); //Print dns settings suite.addTest(new DNSTest_DnsSetting_print("testPrintDnsSetting01")); suite.addTest(new DNSTest_DnsSetting_print("testPrintDnsSetting02")); //Get a specific dns setting and print its data suite.addTest(new DNSTest_DnsSetting_getall("testSingleDnsSetting01")); //Modify the data of a dns setting suite.addTest(new DNSTest_DnsSetting_modify("testModifyDnsSetting01")); suite.addTest(new DNSTest_DnsSetting_modify("testModifyDnsSetting02")); suite.addTest(new DNSTest_DnsSetting_modify("testModifyDnsSetting03")); //Get the associations of a dns setting suite.addTest(new DNSTest_DnsSetting_associations("testAssociationsDnsSetting01")); suite.addTest(new DNSTest_DnsSetting_associations("testAssociationsDnsSetting02")); suite.addTest(new DNSTest_DnsSetting_associations("testAssociationsDnsSetting03")); suite.addTest(new DNSTest_DnsSetting_associations("testAssociationsDnsSetting04")); //======== //Create association between Zone and ACL // suite.addTest(new DNSTest_DnsAclInZone("testDnsAclInZone01")); //delete it // suite.addTest(new DNSTest_DnsAclInZone("testDnsAclInZone01delete")); // suite.addTest(new DNSTest_DnsAclInZone("testDnsAclInZone02")); // suite.addTest(new DNSTest_DnsAclInZone("testDnsAclInZone03")); //delete it // suite.addTest(new DNSTest_DnsAclInZone("testDnsAclInZone03delete")); //======== //Create association between Zone and ACL // suite.addTest(new DNSTest_DnsAclInService("testDnsAclInService01")); //delete it // suite.addTest(new DNSTest_DnsAclInService("testDnsAclInService01delete")); //suite.addTest(new DNSTest_DnsAclInService("testDnsAclInService02")); //delete it //suite.addTest(new DNSTest_DnsAclInService("testDnsAclInService02delete")); return suite; } } --- NEW FILE: DNSTest_DnsHintZone_getall.java --- /** * DNSTest_DnsHintZone_getall.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: * **/ /* * Created on May 21, 2005, ceron */ package org.sblim.wbemsmt.dns.test; import java.util.ArrayList; import java.util.Iterator; import junit.framework.Assert; import org.sblim.wbem.cim.CIMObjectPath; import org.sblim.wbemsmt.dns.bl.fco.DNSHintZone; /** * Author ceron * */ public class DNSTest_DnsHintZone_getall extends DNSTest_BaseClass { /**The objective of this test is to test the get* methods from * DNSHintZone * @param arg0 */ public DNSTest_DnsHintZone_getall(String arg0){ super(arg0); } public void testSingleDnsHintZone01(){ ArrayList arraylist = null; Iterator rri = null; DNSHintZone dnsHintZone = null; CIMObjectPath op = null; String name = null; Short type = null; String typestr = null; String rr = null; try{ arraylist = DNSHintZone.enumerateInstanceNames(this.cimClient); } catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsHintZone01 failed: " + e.getMessage()); } rri = arraylist.iterator(); while(rri.hasNext()){ op = (CIMObjectPath)rri.next(); try{ dnsHintZone = (DNSHintZone) DNSHintZone.getInstance(this.cimClient,op); }catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsHintZone01 failed: " + e.getMessage()); } try{ name = dnsHintZone.getName(); type = dnsHintZone.getType(); typestr = dnsHintZone.getTypeString(); rr = dnsHintZone.getResourceRecordFile(); } catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsHintZone01 failed: " + e.getMessage()); } System.out.println("_________________________"); System.out.println("Name: " + name); System.out.println("Type: " + type + " -> " + typestr); System.out.println("ResourceRecord: " + rr); } System.out.println("_________________________"); System.out.println("testSingleDnsHintZone01 completed. Got " + arraylist.size()+ " DnsHintZones instances"); } } --- NEW FILE: DNSTest_DnsSetting_associations.java --- /** * DNSTest_DnsSetting_associations.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: * **/ /* * Created on Jun 18, 2005, ceron */ package org.sblim.wbemsmt.dns.test; import java.util.ArrayList; import java.util.Iterator; import junit.framework.Assert; import org.sblim.wbem.cim.CIMException; import org.sblim.wbem.cim.CIMObjectPath; import org.sblim.wbemsmt.dns.bl.fco.DNSConfiguration; import org.sblim.wbemsmt.dns.bl.fco.DNSService; import org.sblim.wbemsmt.dns.bl.fco.DNSSetting; /** * Author ceron * */ public class DNSTest_DnsSetting_associations extends DNSTest_BaseClass { public DNSTest_DnsSetting_associations(String arg0){ super(arg0); } public void testAssociationsDnsSetting01(){ ArrayList arraylist = null; ArrayList arraylist2 = null; Iterator settingI = null; Iterator serviceI = null; DNSSetting setting = null; CIMObjectPath op = null; CIMObjectPath service = null; System.out.println("TEST: get dns service from setting association"); try{ arraylist = DNSSetting.enumerateInstanceNames(this.cimClient); } catch (Exception e){ e.printStackTrace(); Assert.fail("testAssociationsDnsSetting01 failed: " + e.getMessage()); } settingI = arraylist.iterator(); while(settingI.hasNext()){ op = (CIMObjectPath) settingI.next(); System.out.println("Dns Setting object path: " + op); try{ setting = (DNSSetting) DNSSetting.getInstance(this.cimClient,op); }catch (Exception e){ e.printStackTrace(); Assert.fail("testAssociationsDnsSetting01 failed: " + e.getMessage()); } try{ arraylist2 = setting.getAssociatedDnsServiceNames(this.cimClient); } catch (CIMException e){ e.printStackTrace(); Assert.fail("testAssociationsDnsSetting01 failed: " + e.getMessage()); } serviceI = arraylist2.iterator(); while(serviceI.hasNext()){ service = (CIMObjectPath) serviceI.next(); System.out.println("Associated Dns Service: " + service); } System.out.println(); } System.out.println("testAssociationsDnsSetting01 completed."); } public void testAssociationsDnsSetting02(){ ArrayList arraylist = null; ArrayList arraylist2 = null; Iterator settingI = null; Iterator serviceI = null; DNSSetting setting = null; CIMObjectPath op = null; DNSService service = null; System.out.println("TEST: get Dns service instance from setting association"); try{ arraylist = DNSSetting.enumerateInstanceNames(this.cimClient); } catch (Exception e){ e.printStackTrace(); Assert.fail("testAssociationsDnsSetting02 failed: " + e.getMessage()); } settingI = arraylist.iterator(); while(settingI.hasNext()){ op = (CIMObjectPath) settingI.next(); System.out.println("Dns Setting object path: " + op); try{ setting = (DNSSetting) DNSSetting.getInstance(this.cimClient,op); }catch (Exception e){ e.printStackTrace(); Assert.fail("testAssociationsDnsSetting02 failed: " + e.getMessage()); } try{ arraylist2 = setting.getAssociatedDnsServices(this.cimClient); } catch (CIMException e){ e.printStackTrace(); Assert.fail("testAssociationsDnsSetting02 failed: " + e.getMessage()); } serviceI = arraylist2.iterator(); while(serviceI.hasNext()){ service = (DNSService) serviceI.next(); System.out.println("Associated Dns Service:\n" + service +"\n________"); } System.out.println(); } System.out.println("testAssociationsDnsSetting02 completed."); } public void testAssociationsDnsSetting03(){ ArrayList arraylist = null; ArrayList arraylist2 = null; Iterator settingI = null; Iterator confI = null; DNSSetting setting = null; CIMObjectPath op = null; CIMObjectPath conf = null; System.out.println("TEST: get dns configuration from setting association"); try{ arraylist = DNSSetting.enumerateInstanceNames(this.cimClient); } catch (Exception e){ e.printStackTrace(); Assert.fail("testAssociationsDnsSetting03 failed: " + e.getMessage()); } settingI = arraylist.iterator(); while(settingI.hasNext()){ op = (CIMObjectPath) settingI.next(); System.out.println("Dns Setting object path: " + op); try{ setting = (DNSSetting) DNSSetting.getInstance(this.cimClient,op); }catch (Exception e){ e.printStackTrace(); Assert.fail("testAssociationsDnsSetting03 failed: " + e.getMessage()); } try{ arraylist2 = setting.getAssociatedDnsConfigurationNames(this.cimClient); } catch (CIMException e){ e.printStackTrace(); Assert.fail("testAssociationsDnsSetting03 failed: " + e.getMessage()); } confI = arraylist2.iterator(); while(confI.hasNext()){ conf = (CIMObjectPath) confI.next(); System.out.println("Associated Dns Configuration: " + conf); } System.out.println(); } System.out.println("testAssociationsDnsSetting03 completed."); } public void testAssociationsDnsSetting04(){ ArrayList arraylist = null; ArrayList arraylist2 = null; Iterator settingI = null; Iterator confI = null; DNSSetting setting = null; CIMObjectPath op = null; DNSConfiguration conf = null; System.out.println("TEST: get Dns configuration instance from setting association"); try{ arraylist = DNSSetting.enumerateInstanceNames(this.cimClient); } catch (Exception e){ e.printStackTrace(); Assert.fail("testAssociationsDnsSetting04 failed: " + e.getMessage()); } settingI = arraylist.iterator(); while(settingI.hasNext()){ op = (CIMObjectPath) settingI.next(); System.out.println("Dns Setting object path: " + op); try{ setting = (DNSSetting) DNSSetting.getInstance(this.cimClient,op); }catch (Exception e){ e.printStackTrace(); Assert.fail("testAssociationsDnsSetting04 failed: " + e.getMessage()); } try{ arraylist2 = setting.getAssociatedDnsConfigurations(this.cimClient); } catch (CIMException e){ e.printStackTrace(); Assert.fail("testAssociationsDnsSetting04 failed: " + e.getMessage()); } confI = arraylist2.iterator(); while(confI.hasNext()){ conf = (DNSConfiguration) confI.next(); System.out.println("Associated Dns Configuration:\n" + conf +"\n________"); } System.out.println(); } System.out.println("testAssociationsDnsSetting04 completed."); } } --- NEW FILE: DNSTest_DnsConfiguration_getall.java --- /** * DNSTest_DnsConfiguration_getall.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: * **/ /* * Created on Jun 18, 2005, ceron */ package org.sblim.wbemsmt.dns.test; import java.util.ArrayList; import java.util.Iterator; import junit.framework.Assert; import org.sblim.wbem.cim.CIMObjectPath; import org.sblim.wbemsmt.dns.bl.fco.DNSConfiguration; ; /** * Author ceron * */ public class DNSTest_DnsConfiguration_getall extends DNSTest_BaseClass { /**The objective of this test is to test the get* methods from * DNSConfiguration * @param arg0 */ public DNSTest_DnsConfiguration_getall(String arg0){ super(arg0); } public void testSingleDnsConfiguration01(){ ArrayList arraylist = null; Iterator rri = null; DNSConfiguration conf = null; CIMObjectPath op = null; String name = null; String confFile = null; try{ arraylist = DNSConfiguration.enumerateInstanceNames(this.cimClient); } catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsConfiguration01 failed: " + e.getMessage()); } rri = arraylist.iterator(); while(rri.hasNext()){ op = (CIMObjectPath)rri.next(); try{ conf = (DNSConfiguration) DNSConfiguration.getInstance(this.cimClient,op); }catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsConfiguration01 failed: " + e.getMessage()); } try{ name = conf.getName(); confFile = conf.getConfFile(); } catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsConfiguration01 failed: " + e.getMessage()); } System.out.println("_________________________"); System.out.println("Name: " + name); System.out.println("Config file: " + confFile); } System.out.println("_________________________"); System.out.println("testSingleDnsConfiguration01 completed. Got " + arraylist.size()+ " dns configuration instances"); } } --- NEW FILE: DNSTest_DnsMasterZone_print.java --- /** * DNSTest_DnsMasterZone_print.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: * **/ /* * Created on May 21, 2005, ceron */ package org.sblim.wbemsmt.dns.test; import java.util.ArrayList; import junit.framework.Assert; import org.sblim.wbemsmt.dns.bl.fco.DNSMasterZone; /** * Author ceron * */ public class DNSTest_DnsMasterZone_print extends DNSTest_BaseClass{ /** * Constructor for DNSTest. * @param arg0 */ public DNSTest_DnsMasterZone_print(String arg0) { super(arg0); } public void testPrintDnsMasterZone01() { try { ArrayList dnsMasterZoneList = DNSMasterZone.enumerateInstanceNames(cimClient); System.out.println("______________________________"); for (int i=0; dnsMasterZoneList != null && i < dnsMasterZoneList.size(); i++) { System.out.println(dnsMasterZoneList.get(i)); } System.out.println("_______________________________"); System.out.println("testPrintDnsMasterZone01 completed. Printed " + dnsMasterZoneList.size() + " DnsMasterZone ObjectPath entries."); } catch (Exception e) { e.printStackTrace(); Assert.fail("testPrintDnsMasterZone01 failed: " + e.getMessage()); } } public void testPrintDnsMasterZone02() { try { ArrayList dnsMasterZoneList = DNSMasterZone.enumerateInstances(this.cimClient); for (int i=0; dnsMasterZoneList != null && i < dnsMasterZoneList.size(); i++) { System.out.println("_____________________________"); System.out.println(dnsMasterZoneList.get(i)); } System.out.println("testPrintDnsMasterZone02 completed. Printed " + dnsMasterZoneList.size() + " DnsMasterZone Instances."); } catch (Exception e) { e.printStackTrace(); Assert.fail("testPrintDnsMasterZone02 failed: " + e.getMessage()); } } } --- NEW FILE: DNSTest_DnsAML_list.java --- /** * DNSTest_DnsAML_list.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: * **/ /* * Created on May 26, 2005, ceron */ package org.sblim.wbemsmt.dns.test; import java.util.ArrayList; import junit.framework.Assert; import org.sblim.wbemsmt.dns.bl.fco.DNSAddressMatchList; /** * Author ceron * */ public class DNSTest_DnsAML_list extends DNSTest_BaseClass { /** * Constructor for DNSTest. * @param arg0 */ public DNSTest_DnsAML_list(String arg0) { super(arg0); } public void testListDnsAML01() { try { ArrayList amlList = DNSAddressMatchList.enumerateInstanceNames(cimClient); System.out.println("testListDnsAML01 completed. Got " + amlList.size() + " address match list ObjectPath entries."); } catch (Exception e) { e.printStackTrace(); Assert.fail("testListDnsAML01 failed: " + e.getMessage()); } } public void testListDnsAML02() { try { DNSAddressMatchList.enumerateInstanceNames(null); Assert.fail("testListDnsAML02 failed"); } catch (NullPointerException e) { System.out.println("testListDnsAML02 completed. Got NullPointerException as expected."); } catch (Exception e) { e.printStackTrace(); Assert.fail("testListDnsAML02 failed: " + e.getMessage()); } } public void testListDnsAML03() { try { ArrayList amlList = DNSAddressMatchList.enumerateInstances(this.cimClient); System.out.println("testListDnsAML03 completed. Got " + amlList.size() + " address match list Instances."); } catch (Exception e) { e.printStackTrace(); Assert.fail("testListDnsAML03 failed: " + e.getMessage()); } } public void testListDnsAML04() { try { DNSAddressMatchList.enumerateInstances(null); Assert.fail("testListDnsAML04 failed"); } catch (NullPointerException e) { System.out.println("testListDnsAML04 completed. Got NullPointerException as expected."); } catch (Exception e) { e.printStackTrace(); Assert.fail("testListDnsAML04 failed: " + e.getMessage()); } } } --- NEW FILE: DNSTest_DnsSlaveZone_getall.java --- /** * DNSTest_DnsSlaveZone_getall.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: * **/ /* * Created on May 21, 2005, ceron */ package org.sblim.wbemsmt.dns.test; import java.util.ArrayList; import java.util.Iterator; import junit.framework.Assert; import org.sblim.wbem.cim.CIMObjectPath; import org.sblim.wbemsmt.dns.bl.fco.DNSSlaveZone; /**he objective of this test is to test the get* methods from * DNSSlaveZone * Author ceron * */ public class DNSTest_DnsSlaveZone_getall extends DNSTest_BaseClass { /**The objective of this test is to test the get* methods from * DNSSlaveZone * @param arg0 */ public DNSTest_DnsSlaveZone_getall(String arg0){ super(arg0); } public void testSingleDnsSlaveZone01(){ ArrayList arraylist = null; Iterator rri = null; DNSSlaveZone dnsSlaveZone = null; CIMObjectPath op = null; String name = null; Short type = null; String typestr = null; String rr = null; String forwardString = null; Short forward = null; Object forwarders[] = null; try{ arraylist = DNSSlaveZone.enumerateInstanceNames(this.cimClient); } catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsSlaveZone01 failed: " + e.getMessage()); } rri = arraylist.iterator(); while(rri.hasNext()){ op = (CIMObjectPath)rri.next(); try{ dnsSlaveZone = (DNSSlaveZone) DNSSlaveZone.getInstance(this.cimClient,op); }catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsSlaveZone01 failed: " + e.getMessage()); } try{ name = dnsSlaveZone.getName(); type = dnsSlaveZone.getType(); typestr = dnsSlaveZone.getTypeString(); rr = dnsSlaveZone.getResourceRecordFile(); forwardString = dnsSlaveZone.getForwardString(); forward = dnsSlaveZone.getForward(); forwarders = dnsSlaveZone.getForwarders(); } catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsSlaveZone01 failed: " + e.getMessage()); } System.out.println("_________________________"); System.out.println("Name: " + name); System.out.println("Type: " + type + " -> " + typestr); System.out.println("ResourceRecord: " + rr); System.out.println("Forward: " + forward + " -> " + forwardString); System.out.println("Forwarders:"); for(int i=0; i < forwarders.length; i++) System.out.println(" "+ forwarders[i]); } System.out.println("_________________________"); System.out.println("testSingleDnsSlaveZone01 completed. Got " + arraylist.size()+ " DnsSlaveZones instances"); } } --- NEW FILE: DNSTest_DnsHintZone_print.java --- /** * DNSTest_DnsHintZone_print.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: * **/ /* * Created on May 21, 2005, ceron */ package org.sblim.wbemsmt.dns.test; import java.util.ArrayList; import junit.framework.Assert; import org.sblim.wbemsmt.dns.bl.fco.DNSHintZone; /** * Author ceron * */ public class DNSTest_DnsHintZone_print extends DNSTest_BaseClass { /** * Constructor for DNSTest. * @param arg0 */ public DNSTest_DnsHintZone_print(String arg0) { super(arg0); } public void testPrintDnsHintZone01() { try { ArrayList dnsHintZoneList = DNSHintZone.enumerateInstanceNames(cimClient); System.out.println("______________________________"); for (int i=0; dnsHintZoneList != null && i < dnsHintZoneList.size(); i++) { System.out.println(dnsHintZoneList.get(i)); } System.out.println("_______________________________"); System.out.println("testPrintDnsHintZone01 completed. Printed " + dnsHintZoneList.size() + " DnsHintZone ObjectPath entries."); } catch (Exception e) { e.printStackTrace(); Assert.fail("testPrintDnsHintZone01 failed: " + e.getMessage()); } } public void testPrintDnsHintZone02() { try { ArrayList dnsHintZoneList = DNSHintZone.enumerateInstances(this.cimClient); for (int i=0; dnsHintZoneList != null && i < dnsHintZoneList.size(); i++) { System.out.println("_____________________________"); System.out.println(dnsHintZoneList.get(i)); } System.out.println("testPrintDnsHintZone02 completed. Printed " + dnsHintZoneList.size() + " DnsHintZone Instances."); } catch (Exception e) { e.printStackTrace(); Assert.fail("testPrintDnsHintZone02 failed: " + e.getMessage()); } } } --- NEW FILE: DNSTest_DnsForwardZone_delete.java --- /** * DNSTest_DnsForwardZone_delete.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: * **/ /* * Created on Jun 14, 2005, ceron */ package org.sblim.wbemsmt.dns.test; import java.util.ArrayList; import java.util.Iterator; import junit.framework.Assert; import org.sblim.wbem.cim.CIMObjectPath; import org.sblim.wbemsmt.dns.bl.fco.DNSForwardZone; import org.sblim.wbemsmt.exception.InvalidParameterException; /** * Author ceron * */ public class DNSTest_DnsForwardZone_delete extends DNSTest_BaseClass { public DNSTest_DnsForwardZone_delete(String arg0){ super(arg0); } public void testDeleteDnsForwardZone01(){ DNSForwardZone zone = null; ArrayList a = DNSForwardZone.enumerateInstanceNames(this.cimClient); Iterator i = a.iterator(); CIMObjectPath op = null; try{ while(i.hasNext()){ op = (CIMObjectPath) i.next(); zone = (DNSForwardZone) DNSForwardZone.getInstance(this.cimClient,op); if("GhostFwZone".equals(zone.getName())){ DNSForwardZone.deleteInstance(this.cimClient,zone); } } }catch (Exception e){ e.printStackTrace(); Assert.fail("testDeleteDnsForwardZone01 failed: " + e.getMessage()); } System.out.println("testDeleteDnsForwardZone01: completed"); } public void testDeleteDnsForwardZone02(){ DNSForwardZone zone = null; try{ DNSForwardZone.deleteInstance(this.cimClient,zone); }catch (InvalidParameterException e){ System.out.println("testDeleteDnsForwardZone02: Got InvalidParameterException as expected"); }catch (Exception e){ e.printStackTrace(); Assert.fail("testDeleteDnsForward02 failed: " + e.getMessage()); } } } --- NEW FILE: DNSTest_DnsService_getall.java --- /** * DNSTest_DnsService_getall.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: * **/ /* * Created on Jun 17, 2005, ceron */ package org.sblim.wbemsmt.dns.test; import java.util.ArrayList; import java.util.Iterator; import junit.framework.Assert; import org.sblim.wbem.cim.CIMObjectPath; import org.sblim.wbemsmt.dns.bl.fco.DNSService; /** * Author ceron * */ public class DNSTest_DnsService_getall extends DNSTest_BaseClass { /**The objective of this test is to test the get* methods from * DNSService * @param arg0 */ public DNSTest_DnsService_getall(String arg0){ super(arg0); } public void testSingleDnsService01(){ ArrayList arraylist = null; Iterator rri = null; DNSService service = null; CIMObjectPath op = null; String name = null; try{ arraylist = DNSService.enumerateInstanceNames(this.cimClient); } catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsService01 failed: " + e.getMessage()); } rri = arraylist.iterator(); while(rri.hasNext()){ op = (CIMObjectPath)rri.next(); try{ service = (DNSService) DNSService.getInstance(this.cimClient,op); }catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsService01 failed: " + e.getMessage()); } try{ name = service.getName(); } catch (Exception e){ e.printStackTrace(); Assert.fail("testSingleDnsService01 failed: " + e.getMessage()); } System.out.println("_________________________"); System.out.println("Name: " + name); } System.out.println("_________________________"); System.out.println("testSingleDnsService01 completed. Got " + arraylist.size()+ " dns service instances"); } } --- NEW FILE: DNSTest_DnsConfiguration_list.java --- /** * DNSTest_DnsConfiguration_list.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: * **/ /* * Created on Jun 18, 2005, ceron */ package org.sblim.wbemsmt.dns.test; import java.util.ArrayList; import junit.framework.Assert; import org.sblim.wbemsmt.dns.bl.fco.DNSConfiguration; /** * Author ceron * */ public class DNSTest_DnsConfiguration_list extends DNSTest_BaseClass { /** * Constructor for DNSTest. * @param arg0 */ public DNSTest_DnsConfiguration_list(String arg0) { super(arg0); } public void testListDnsConfiguration01() { try { ArrayList confList = DNSConfiguration.enumerateInstanceNames(cimClient); System.out.println("testListDnsService01 completed. Got ... [truncated message content] |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:32:17
|
Update of /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/dns/bl/fco In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14080/java/org/sblim/wbemsmt/dns/bl/fco Added Files: DNSAddressMatchList.java DNSResourceRecord.java DNSIPAddress.java DNSSetting.java DNSConfiguration.java DNSForwardZone.java DNSMasterZone.java DNSAclForService.java DNSHintZone.java DNSAclForZone.java DNSService.java DNSZone.java DNSSlaveZone.java DNSCommonBase.java Log Message: WBEM-SMT DNS BusinessLogic component. First initial upload. --- NEW FILE: DNSMasterZone.java --- /** * DNSMasterZone.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: **/ package org.sblim.wbemsmt.dns.bl.fco; import java.util.ArrayList; import java.util.Enumeration; import java.util.Vector; import org.sblim.wbem.cim.CIMClass; import org.sblim.wbem.cim.CIMDataType; import org.sblim.wbem.cim.CIMException; import org.sblim.wbem.cim.CIMInstance; import org.sblim.wbem.cim.CIMObjectPath; import org.sblim.wbem.cim.CIMProperty; import org.sblim.wbem.cim.CIMValue; import org.sblim.wbem.cim.UnsignedInt16; import org.sblim.wbem.cim.UnsignedInt32; import org.sblim.wbem.client.CIMClient; import org.sblim.wbemsmt.exception.InvalidCimClassException; import org.sblim.wbemsmt.exception.InvalidParameterException; import org.sblim.wbemsmt.exception.InvalidPropertyValueException; import org.sblim.wbemsmt.exception.ObjectCreationException; import org.sblim.wbemsmt.exception.PropertyNotFoundException; public class DNSMasterZone extends DNSZone{ public final static String CIM_CLASS_NAME = "Linux_DnsMasterZone"; public final static String CIM_PROPERTY_CONTACT = "Contact"; public final static String CIM_PROPERTY_SN = "SerialNumber"; public final static String CIM_PROPERTY_REFRESH = "Refresh"; public final static String CIM_PROPERTY_RETRY = "Retry"; public final static String CIM_PROPERTY_EXPIRE = "Expire"; public final static String CIM_PROPERTY_NCTTL = "NegativeCachingTTL"; public final static String CIM_PROPERTY_SERVER = "Server"; public final static String CIM_PROPERTY_FORWARD = "Forward"; public final static String CIM_PROPERTY_FORWARDERS = "Forwarders"; public final static String[] CIM_VALUEMAP_FORWARD = {"Unknown","Only","First"}; public final static short FORWARD_UNKNOWN = 0; public final static short FORWARD_ONLY = 1; public final static short FORWARD_FIRST = 2; public final static String CIM_ASSOCIATOR_CLASS_ALLOW_UPDATE_ACL_FOR_ZONE = "Linux_DnsAllowUpdateACLForZone"; public final static String CIM_ASSOCIATOR_CLASS_ALLOW_QUERY_ACL_FOR_ZONE = "Linux_DnsAllowQueryACLForZone"; public final static String CIM_ASSOCIATOR_CLASS_ALLOW_TRANSFER_ACL_FOR_ZONE = "Linux_DnsAllowTransferACLForZone"; public final static String CIM_ASSOCIATOR_CLASS_ALLOW_NOTIFY_ACL_FOR_ZONE = "Linux_DnsAllowNotifyACLForZone"; public final static String CIM_ASSOCIATOR_CLASS_BLACKHOLE_ACL_FOR_ZONE = "Linux_DnsBlackholeACLForZone"; /**Creates a DNSMasterZone Object from a cim instance * @param cimInstance * @param cimObjectPath * @throws ObjectCreationException * @throws InvalidCimClassException */ public DNSMasterZone(CIMInstance cimInstance, CIMObjectPath cimObjectPath) throws ObjectCreationException, InvalidCimClassException { super(cimInstance,cimObjectPath); this.className = CIM_CLASS_NAME; } /**Creates a new DNSMasterZone instance. This is not reflected into the * cim server yet, call createInstance later * @param cimClient * @throws CIMException */ public DNSMasterZone(CIMClient cimClient) throws CIMException { super(cimClient); this.className = CIM_CLASS_NAME; try{ this.cimObjectPath = new CIMObjectPath(this.className); CIMClass cimClass = cimClient.getClass(this.cimObjectPath, false, true, true); this.cimInstance = cimClass.newInstance(); this.original_cimInstance = (CIMInstance)cimInstance.clone(); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } } /* (non-Javadoc) * @see com.ibm.wbem.smt.dns.DNSZone#enumerateInstanceNames(com.ibm.wbem.smt.CimClient) */ public static ArrayList enumerateInstanceNames(CIMClient cimClient) throws CIMException { ArrayList cimInstanceNamesList = new ArrayList(); Enumeration enum = null; CIMObjectPath cimObjectPath = null; try{ enum = cimClient.enumerateInstanceNames(new CIMObjectPath(CIM_CLASS_NAME)); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } while (enum.hasMoreElements()) { cimObjectPath = (CIMObjectPath) enum.nextElement(); cimInstanceNamesList.add(cimObjectPath); } return cimInstanceNamesList; } /* (non-Javadoc) * @see com.ibm.wbem.smt.dns.DNSZone#enumerateInstances(com.ibm.wbem.smt.CimClient) */ public static ArrayList enumerateInstances(CIMClient cimClient) throws CIMException { ArrayList cimInstanceList = new ArrayList(); Enumeration enum = null; try{ enum = cimClient.enumerateInstances(new CIMObjectPath(CIM_CLASS_NAME)); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } CIMInstance cimInstance = null; while (enum.hasMoreElements()) { cimInstance = (CIMInstance) enum.nextElement(); try { cimInstanceList.add(new DNSMasterZone(cimInstance, cimInstance.getObjectPath())); } catch(ObjectCreationException e) { System.out.println("Null Cim Instance passed!"); } catch(InvalidCimClassException e){ System.out.println("Cim Instance's class must be "+CIM_CLASS_NAME); } } return cimInstanceList; } /* (non-Javadoc) * @see com.ibm.wbem.smt.dns.DNSZone#getInstance(com.ibm.wbem.smt.CimClient, javax.wbem.cim.CIMObjectPath) */ public static DNSZone getInstance(CIMClient cimClient, CIMObjectPath cimObjectPath) throws CIMException, InvalidParameterException { CIMInstance cimInstance = null; DNSMasterZone zone = null; if (cimObjectPath == null) { throw new InvalidParameterException("Null ObjectPath passed!"); } try{ cimInstance = cimClient.getInstance(cimObjectPath); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } try { zone = new DNSMasterZone(cimInstance, cimObjectPath); } catch (ObjectCreationException e) { System.out.println("Returned Cim Instance was null"); return null; } catch (InvalidCimClassException e){ System.out.println("ObjectPath is not a path to " + CIM_CLASS_NAME); return null; } return zone; } public static DNSMasterZone createInstance(CIMClient cimClient, DNSMasterZone dnsMasterZone) throws CIMException, InvalidParameterException { DNSMasterZone masterZone = null; CIMObjectPath cimObjectPath = null; if (dnsMasterZone == null || dnsMasterZone.getCimInstance() == null) { throw new InvalidParameterException("Invalid Zone passed for creation"); } try{ cimObjectPath = cimClient.createInstance(dnsMasterZone.getCimObjectPath(), dnsMasterZone.getCimInstance()); }catch (CIMException e){ System.out.println(e.getMessage()); throw e; } try { masterZone = (DNSMasterZone) getInstance(cimClient,cimObjectPath); } catch(Exception e){ System.out.println("Problem to retrive created master zone!"); } return masterZone; } /**Gets the associated Update ACL names * @param cimClient * @return An ArrayList of ACL ObjectPaths * @throws CIMException */ public ArrayList getAssociatedAllowUpdateACLNames(CIMClient cimClient) throws CIMException { Enumeration enum = null; try{ enum = cimClient.associatorNames(this.cimObjectPath, CIM_ASSOCIATOR_CLASS_ALLOW_UPDATE_ACL_FOR_ZONE, DNSAddressMatchList.CIM_CLASS_NAME, "Element","Setting"); } catch (CIMException e){ System.out.println("Error within cim client"); throw e; } ArrayList aclNamesList = new ArrayList(); while (enum.hasMoreElements()) { aclNamesList.add(enum.nextElement()); } return aclNamesList; } /**Gets the associated Update ACLs * @param cimClient * @return An ArrayList of DNSAddressMatchList objects * @throws CIMException */ public ArrayList getAssociatedAllowUpdateACL(CIMClient cimClient) throws CIMException { Enumeration enum = null; try{ enum = cimClient.associators(this.cimObjectPath, CIM_ASSOCIATOR_CLASS_ALLOW_UPDATE_ACL_FOR_ZONE, DNSAddressMatchList.CIM_CLASS_NAME, "Element","Setting",false,false,null); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } ArrayList aclList = new ArrayList(); while (enum.hasMoreElements()) { CIMInstance dummyInstance = (CIMInstance) enum.nextElement(); try { aclList.add(new DNSAddressMatchList(dummyInstance, dummyInstance.getObjectPath())); } catch (ObjectCreationException e){ System.out.println("Tried to create an ACL from null value"); } catch (InvalidCimClassException e){ System.out.println("Cim Instance is not of type "+DNSAddressMatchList.CIM_CLASS_NAME); } } return aclList; } /**Gets the associated Query ACL names * @param cimClient * @return An ArrayList of ObjectPaths * @throws CIMException */ public ArrayList getAssociatedAllowQueryACLNames(CIMClient cimClient) throws CIMException { Enumeration enum = null; try{ enum = cimClient.associatorNames(this.cimObjectPath, CIM_ASSOCIATOR_CLASS_ALLOW_QUERY_ACL_FOR_ZONE, DNSAddressMatchList.CIM_CLASS_NAME, "Element","Setting"); } catch (CIMException e){ System.out.println(e.getMessage()); throw e; } ArrayList aclNamesList = new ArrayList(); while (enum.hasMoreElements()) { aclNamesList.add(enum.nextElement()); } return aclNamesList; } /**Gets the associated Query ACLs * @param cimClient * @return An ArrayList of DNSAddressMatchList objects * @throws CIMException */ public ArrayList getAssociatedAllowQueryACL(CIMClient cimClient) throws CIMException { Enumeration enum = null; try{ enum = cimClient.associators(this.cimObjectPath, CIM_ASSOCIATOR_CLASS_ALLOW_QUERY_ACL_FOR_ZONE, DNSAddressMatchList.CIM_CLASS_NAME, "Element","Setting",false,false,null); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } ArrayList aclList = new ArrayList(); while (enum.hasMoreElements()) { CIMInstance dummyInstance = (CIMInstance) enum.nextElement(); try { aclList.add(new DNSAddressMatchList(dummyInstance, dummyInstance.getObjectPath())); } catch (ObjectCreationException e){ System.out.println("Tried to create an ACL from null value"); } catch (InvalidCimClassException e){ System.out.println("Cim Instance is not of type "+DNSAddressMatchList.CIM_CLASS_NAME); } } return aclList; } /**Gets the associated Transfer ACL names * @param cimClient * @return An ArrayList of ObjectPaths * @throws CIMException */ public ArrayList getAssociatedAllowTransferACLNames(CIMClient cimClient) throws CIMException { Enumeration enum = null; try{ enum = cimClient.associatorNames(this.cimObjectPath, CIM_ASSOCIATOR_CLASS_ALLOW_TRANSFER_ACL_FOR_ZONE, DNSAddressMatchList.CIM_CLASS_NAME, "Element","Setting"); } catch (CIMException e){ System.out.println(e.getMessage()); throw e; } ArrayList aclNamesList = new ArrayList(); while (enum.hasMoreElements()) { aclNamesList.add(enum.nextElement()); } return aclNamesList; } /**Gets the associated Transfer ACL * @param cimClient * @return An ArrayList of DNSAddressMatchList * @throws CIMException */ public ArrayList getAssociatedAllowTransferACL(CIMClient cimClient) throws CIMException { Enumeration enum = null; try{ enum = cimClient.associators(this.cimObjectPath, CIM_ASSOCIATOR_CLASS_ALLOW_TRANSFER_ACL_FOR_ZONE, DNSAddressMatchList.CIM_CLASS_NAME, "Element","Setting",false,false,null); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } ArrayList aclList = new ArrayList(); while (enum.hasMoreElements()) { CIMInstance dummyInstance = (CIMInstance) enum.nextElement(); try { aclList.add(new DNSAddressMatchList(dummyInstance, dummyInstance.getObjectPath())); } catch (ObjectCreationException e){ System.out.println("Tried to create an ACL from null value"); } catch (InvalidCimClassException e){ System.out.println("Cim Instance is not of type "+DNSAddressMatchList.CIM_CLASS_NAME); } } return aclList; } /**Gets the "Contact" field of the dns zone * @return * @throws PropertyNotFoundException */ public String getContact() throws PropertyNotFoundException { String tmp = null; CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_CONTACT); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_CONTACT + " not found"); throw new PropertyNotFoundException("Property " + CIM_PROPERTY_CONTACT + " not found"); } if (property.getValue() == null) { return null; } tmp = (String)property.getValue().getValue(); try{ tmp = tmp.replaceFirst("\\.","@"); }catch(Exception e){ } return tmp; } /** * @return The Serial Number */ public String getSoaSN() throws PropertyNotFoundException { CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_SN); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_SN + " not found"); throw new PropertyNotFoundException("Property " + CIM_PROPERTY_SN + " not found"); } if (property.getValue() == null) { return null; } return (String)property.getValue().getValue(); } /** * @return The Server */ public String getSoaServer() throws PropertyNotFoundException { CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_SERVER); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_SERVER + " not found"); throw new PropertyNotFoundException("Property " + CIM_PROPERTY_SERVER + " not found"); } if (property.getValue() == null) { return null; } return (String)property.getValue().getValue(); } /** * @return The refresh time in seconds after a resource record is refreshed */ public Integer getSoaRefresh() throws PropertyNotFoundException { CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_REFRESH); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_REFRESH + " not found"); throw new PropertyNotFoundException("Propertry " + CIM_PROPERTY_REFRESH + " not found"); } CIMValue propertyValue = property.getValue(); if (propertyValue == null) { return null; } UnsignedInt32 propertyIntValue = (UnsignedInt32)propertyValue.getValue(); if (propertyIntValue == null) { return null; } return new Integer(propertyIntValue.intValue()); } /** * @return Time in seconds after a resource record is retried */ public Integer getSoaRetry() throws PropertyNotFoundException { CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_RETRY); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_RETRY + " not found"); throw new PropertyNotFoundException("Propertry " + CIM_PROPERTY_RETRY + " not found"); } CIMValue propertyValue = property.getValue(); if (propertyValue == null) { return null; } UnsignedInt32 propertyIntValue = (UnsignedInt32)propertyValue.getValue(); if (propertyIntValue == null) { return null; } return new Integer(propertyIntValue.intValue()); } /** * @return Time in seconds after a resource record expires */ public Integer getSoaExpire() throws PropertyNotFoundException { CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_EXPIRE); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_EXPIRE + " not found"); throw new PropertyNotFoundException("Propertry " + CIM_PROPERTY_EXPIRE + " not found"); } CIMValue propertyValue = property.getValue(); if (propertyValue == null) { return null; } UnsignedInt32 propertyIntValue = (UnsignedInt32)propertyValue.getValue(); if (propertyIntValue == null) { return null; } return new Integer(propertyIntValue.intValue()); } /** * @return The negative caching time to live */ public Integer getSoaNCTTL() throws PropertyNotFoundException { CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_NCTTL); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_NCTTL + " not found"); throw new PropertyNotFoundException("Propertry " + CIM_PROPERTY_NCTTL + " not found"); } CIMValue propertyValue = property.getValue(); if (propertyValue == null) { return null; } UnsignedInt32 propertyIntValue = (UnsignedInt32)propertyValue.getValue(); if (propertyIntValue == null) { return null; } return new Integer(propertyIntValue.intValue()); } /** * @return The forwarders data * @throws PropertyNotFoundException */ public Object[] getForwarders() throws PropertyNotFoundException { CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_FORWARDERS); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_FORWARDERS + " not found"); throw new PropertyNotFoundException("Property " + CIM_PROPERTY_FORWARDERS + " not found"); } if (property.getValue() == null) { return null; } Vector v = (Vector) property.getValue().getValue(); return v.toArray(); } /** * @return The forward option as a Short * @throws PropertyNotFoundException */ public Short getForward() throws PropertyNotFoundException { CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_FORWARD); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_FORWARD + " not found"); throw new PropertyNotFoundException("Propertry " + CIM_PROPERTY_FORWARD + " not found"); } CIMValue propertyValue = property.getValue(); if (propertyValue == null) { return null; } UnsignedInt16 propertyIntValue = (UnsignedInt16)propertyValue.getValue(); if (propertyIntValue == null) { return null; } return new Short(propertyIntValue.shortValue()); } /**The forward option as a String * @return * @throws PropertyNotFoundException */ public String getForwardString() throws PropertyNotFoundException { CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_FORWARD); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_FORWARD + " not found"); throw new PropertyNotFoundException("Propertry " + CIM_PROPERTY_FORWARD + " not found"); } CIMValue propertyValue = property.getValue(); if (propertyValue == null) { return null; } UnsignedInt16 propertyIntValue = (UnsignedInt16)propertyValue.getValue(); if (propertyIntValue == null) { return null; } if (propertyIntValue.shortValue() > 0 && propertyIntValue.shortValue() < CIM_VALUEMAP_FORWARD.length) { return CIM_VALUEMAP_FORWARD[propertyIntValue.shortValue()]; } return CIM_VALUEMAP_FORWARD[0]; } /**Sets the "Contact" field of the dns zone. Call modifyInstance * later to commit the changes * @param contact */ public void setContact(String contact) { String tmp = contact; tmp = tmp.replaceFirst("@","."); CIMValue updatedValue = new CIMValue(tmp, new CIMDataType(CIMDataType.STRING)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_CONTACT); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } /**Sets the "SerialNumber" field of the dns zone. Call modifyInstance * later to commit the changes * @param sn */ public void setSoaSN(String sn){ CIMValue updatedValue = new CIMValue(sn, new CIMDataType(CIMDataType.STRING)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_SN); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } /**Sets the "Server" field of the dns zone. Call modifyInstance * later to commit the changes * @param sn */ public void setSoaServer(String server){ CIMValue updatedValue = new CIMValue(server, new CIMDataType(CIMDataType.STRING)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_SERVER); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } /**Sets the "Refresh" field of the dns zone. Call modifyInstance * later to commit the changes * @param refresh */ public void setSoaRefresh(Integer refresh){ CIMValue updatedValue = new CIMValue(new UnsignedInt32(refresh.intValue()),new CIMDataType(CIMDataType.UINT32)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_REFRESH); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } /**Sets the "Retry" field of the dns zone. Call modifyInstance * later to commit the changes * @param retry */ public void setSoaRetry(Integer retry){ CIMValue updatedValue = new CIMValue(new UnsignedInt32(retry.intValue()),new CIMDataType(CIMDataType.UINT32)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_RETRY); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } /**Sets the "Expire" field of the dns zone. Call modifyInstance * later to commit the changes * @param expire */ public void setSoaExpire(Integer expire){ CIMValue updatedValue = new CIMValue(new UnsignedInt32(expire.intValue()),new CIMDataType(CIMDataType.UINT32)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_EXPIRE); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } /**Sets the "NegativeCachingTTL" field of the dns zone. Call modifyInstance * later to commit the changes * @param ncttl */ public void setSoaNCTTL(Integer ncttl){ CIMValue updatedValue = new CIMValue(new UnsignedInt32(ncttl.intValue()),new CIMDataType(CIMDataType.UINT32)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_NCTTL); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } /**Sets the forward attribute. Call modifyInstance * later to commit the changes * @param type * @throws InvalidPropertyValueException */ public void setForward(Short value) throws InvalidPropertyValueException { if(value.shortValue()<0 || value.shortValue()>CIM_VALUEMAP_FORWARD.length){ System.out.println("Invalid "+CIM_PROPERTY_FORWARD); throw new InvalidPropertyValueException("Invalid "+CIM_PROPERTY_FORWARD); } CIMValue updatedValue = new CIMValue(new UnsignedInt16(value.shortValue()),new CIMDataType(CIMDataType.UINT16)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_FORWARD); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } /**Sets the forward attribute. Call modifyInstane to commit changes * @param type * @throws InvalidPropertyValueException */ public void setForward(String type) throws InvalidPropertyValueException { short pos = this.search(CIM_VALUEMAP_FORWARD,type); if(pos==-1) { System.out.println("Invalid "+CIM_PROPERTY_FORWARD); throw new InvalidPropertyValueException("Invalid "+CIM_PROPERTY_FORWARD); } CIMValue updatedValue = new CIMValue(new UnsignedInt16(pos),new CIMDataType(CIMDataType.UINT16)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_FORWARD); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } /**Sets forwarders * @param addressList */ public void setForwarders(String[] addressList){ CIMValue updatedValue = new CIMValue(addressList, new CIMDataType(CIMDataType.STRING_ARRAY)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_FORWARDERS); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } public static boolean checkProperty(String property, Object value){ try{ if(property.equals(CIM_PROPERTY_TYPE)){ if (value != null && ((Boolean)value).booleanValue()) return true; else return false; }else if(property.equals(CIM_PROPERTY_CONTACT)) return validateEmail((String)value); else if(property.equals(CIM_PROPERTY_RRFILE) || property.equals(CIM_PROPERTY_SN) || property.equals(CIM_PROPERTY_NAME) || property.equals(CIM_PROPERTY_SERVER)){ if (value != null && ((String)value).trim().length() > 0) return true; else return false; }else if(property.equals(CIM_PROPERTY_REFRESH) || property.equals(CIM_PROPERTY_RETRY) || property.equals(CIM_PROPERTY_EXPIRE) || property.equals(CIM_PROPERTY_NCTTL)){ if(value instanceof Integer && ((Integer)value).intValue()>=0) return true; else return false; }else if(property.equals(CIM_PROPERTY_FORWARDERS)) return validateAddressList((String[]) value); return false; }catch(Exception e){ e.printStackTrace(); return false; } } private static boolean validateEmail(String value) { if (value.indexOf('@') == -1) { return false; } return true; } /**Checks address list entries. Works only for ip addresses yet. * @param l * @return */ private static boolean validateAddressList(String[] l){ String s = null; String[] t = null; for (int i=0;i<l.length;i++){ s = l[i]; t = s.split("\\."); if(t.length!=4){ if(s.indexOf(":")<0) return false; } } return true; } } --- NEW FILE: DNSAddressMatchList.java --- /** * DNSAddressMatchList.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: **/ /* * Created on May 26, 2005, ceron */ package org.sblim.wbemsmt.dns.bl.fco; import java.util.ArrayList; import java.util.Enumeration; import java.util.Vector; import org.sblim.wbem.cim.CIMClass; import org.sblim.wbem.cim.CIMDataType; import org.sblim.wbem.cim.CIMException; import org.sblim.wbem.cim.CIMInstance; import org.sblim.wbem.cim.CIMObjectPath; import org.sblim.wbem.cim.CIMProperty; import org.sblim.wbem.cim.CIMValue; import org.sblim.wbem.cim.UnsignedInt16; import org.sblim.wbem.client.CIMClient; import org.sblim.wbemsmt.exception.InvalidCimClassException; import org.sblim.wbemsmt.exception.InvalidParameterException; import org.sblim.wbemsmt.exception.InvalidPropertyValueException; import org.sblim.wbemsmt.exception.ObjectCreationException; import org.sblim.wbemsmt.exception.PropertyNotFoundException; public class DNSAddressMatchList extends DNSCommonBase { public final static String CIM_CLASS_NAME = "Linux_DnsAddressMatchList"; public final static String CIM_PROPERTY_SERVICENAME = "ServiceName"; public final static String CIM_PROPERTY_NAME = "Name"; public final static String CIM_PROPERTY_ADDRESSLIST = "AddressList"; public final static String CIM_PROPERTY_ADDRESSLISTTYPE = "AddressListType"; public final static String[] CIM_VALUEMAP_ADDRESSLISTTYPE = {"Unknown","PreDefined", "IPv4","IPv6","IPPrefix","Key","AddressMatchList","NestedAddressMatchList"}; public final static short ADDRESS_LIST_TYPE_UNKNOWN = 0; public final static short ADDRESS_LIST_TYPE_PREDEFINED = 1; public final static short ADDRESS_LIST_TYPE_IPV4 = 2; public final static short ADDRESS_LIST_TYPE_IPV6 = 3; public final static short ADDRESS_LIST_TYPE_IPPREFIX = 4; public final static short ADDRESS_LIST_TYPE_KEY = 5; public final static short ADDRESS_LIST_TYPE_ADDRESSMATCHLIST = 6; public final static short ADDRESS_LIST_TYPE_NESTEDADDRESSMATCHLIST = 7; public final static String CIM_ASSOCIATOR_CLASS_ALLOW_UPDATE_ACL_FOR_ZONE = "Linux_DnsAllowUpdateACLForZone"; public final static String CIM_ASSOCIATOR_CLASS_ALLOW_QUERY_ACL_FOR_ZONE = "Linux_DnsAllowQueryACLForZone"; public final static String CIM_ASSOCIATOR_CLASS_ALLOW_TRANSFER_ACL_FOR_ZONE = "Linux_DnsAllowTransferACLForZone"; public final static String CIM_ASSOCIATOR_CLASS_ALLOW_NOTIFY_ACL_FOR_ZONE = "Linux_DnsAllowNotifyACLForZone"; public final static String CIM_ASSOCIATOR_CLASS_QUERY_ACL_FOR_SERVICE = "Linux_DnsQueryACLForService"; public final static String CIM_ASSOCIATOR_CLASS_XFER_ACL_FOR_SERVICE = "Linux_DnsTransferACLForService"; public final static String CIM_ASSOCIATOR_CLASS_RECURSION_ACL_FOR_SERVICE = "Linux_DnsRecursionACLForService"; public final static String CIM_ASSOCIATOR_CLASS_NOTIFY_ACL_FOR_SERVICE = "Linux_DnsNotifyACLForService"; public final static String CIM_ASSOCIATOR_CLASS_BLACKHOLE_ACL_FOR_SERVICE = "Linux_DnsBlackholeACLForService"; public final static String CIM_ASSOCIATOR_CLASS_ACL_IN_DNSSERVICE = "Linux_DnsAddressMatchListOfService"; public final static String[] PREDEFINED_ACLS = {"any","none","localhost","localnets"}; private final static boolean DEBUG = true; /**Creates an Addres Match List object from a cim Instance * @param cimInstance * @param cimObjectPath * @throws ObjectCreationException * @throws InvalidCimClassException */ public DNSAddressMatchList(CIMInstance cimInstance, CIMObjectPath cimObjectPath) throws ObjectCreationException, InvalidCimClassException { if (cimInstance==null || cimObjectPath == null) { throw new ObjectCreationException("Null instance passed"); } if (!CIM_CLASS_NAME.equals(cimInstance.getClassName())) { throw new InvalidCimClassException("Cim Instance's class must be "+CIM_CLASS_NAME); } this.cimInstance = cimInstance; this.original_cimInstance = (CIMInstance)cimInstance.clone(); this.cimObjectPath = cimObjectPath; } /**Creates a new Address Match List instance. This is not reflected into the * cim server yet, call createInstance later. * @param cimClient * @throws CIMException */ public DNSAddressMatchList(CIMClient cimClient) throws CIMException { try{ this.cimObjectPath = new CIMObjectPath(CIM_CLASS_NAME); CIMClass cimClass = cimClient.getClass(this.cimObjectPath, false, true, true); this.cimInstance = cimClass.newInstance(); this.original_cimInstance = (CIMInstance)cimInstance.clone(); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } } /** Returns the instance's names of the address match lists in the server * @param cimClient * @return An ArrayList of CIMObjectPath objects * @throws CIMException */ public static ArrayList enumerateInstanceNames(CIMClient cimClient) throws CIMException { ArrayList cimInstanceNamesList = new ArrayList(); Enumeration enum = null; try{ enum = cimClient.enumerateInstanceNames(new CIMObjectPath(CIM_CLASS_NAME)); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } CIMObjectPath cimObjectPath = null; while (enum.hasMoreElements()) { cimObjectPath = (CIMObjectPath) enum.nextElement(); cimInstanceNamesList.add(cimObjectPath); } return cimInstanceNamesList; } /** Returns the instances of address match lists that are in the cim * server * @param cimClient * @return An ArrayList of AddressMatchList objects * @throws CIMException */ public static ArrayList enumerateInstances(CIMClient cimClient) throws CIMException { ArrayList cimInstanceList = new ArrayList(); Enumeration enum = null; try{ enum = cimClient.enumerateInstances(new CIMObjectPath(CIM_CLASS_NAME)); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } CIMInstance cimInstance = null; while (enum.hasMoreElements()) { cimInstance = (CIMInstance) enum.nextElement(); try { cimInstanceList.add(new DNSAddressMatchList(cimInstance, cimInstance.getObjectPath())); } catch(ObjectCreationException e) { System.out.println("Null Cim Instance passed!"); } catch(InvalidCimClassException e){ System.out.println("Cim Instance's class must be "+CIM_CLASS_NAME); } } return cimInstanceList; } /**Gets an address match list from the cim server * @param cimClient * @param cimObjectPath * @return An address match list * @throws CIMException * @throws InvalidParameterException */ public static DNSAddressMatchList getInstance(CIMClient cimClient, CIMObjectPath cimObjectPath) throws CIMException, InvalidParameterException { CIMInstance cimInstance = null; DNSAddressMatchList aml = null; if (cimObjectPath == null) { throw new InvalidParameterException("Null ObjectPath passed!"); } try{ cimInstance = cimClient.getInstance(cimObjectPath); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } try { aml = new DNSAddressMatchList(cimInstance, cimObjectPath); } catch (ObjectCreationException e) { System.out.println("Returned Cim Instance was null"); return null; } catch (InvalidCimClassException e){ System.out.println("ObjectPath is not a path to a "+CIM_CLASS_NAME); return null; } return aml; } /**Creates a new dns address match list * @param cimClient * @param aml * @return * @throws CIMException * @throws InvalidParameterException */ public static DNSAddressMatchList createInstance(CIMClient cimClient, DNSAddressMatchList aml) throws CIMException, InvalidParameterException { DNSAddressMatchList naml = null; CIMObjectPath cimObjectPath = null; if (aml == null || aml.getCimInstance() == null) { throw new InvalidParameterException("Invalid Address Match List passed for creation"); } try{ cimObjectPath = cimClient.createInstance(aml.getCimObjectPath(), aml.getCimInstance()); }catch (CIMException e){ System.out.println(e.getMessage()); throw e; } try { naml = getInstance(cimClient,cimObjectPath); }catch(Exception e){ System.out.println("Error while retrieving created ACL!"); } return naml; } /**Gets associated dns service names * @param cimClient * @return An ArrayList of CIMObjectPath * @throws CIMException */ public ArrayList getAssociatedDnsServiceNames(CIMClient cimClient) throws CIMException { //we don't want to know which service the ACL belongs to. We want only //which are being globally used String[] associations = {CIM_ASSOCIATOR_CLASS_BLACKHOLE_ACL_FOR_SERVICE, CIM_ASSOCIATOR_CLASS_NOTIFY_ACL_FOR_SERVICE, CIM_ASSOCIATOR_CLASS_QUERY_ACL_FOR_SERVICE, CIM_ASSOCIATOR_CLASS_RECURSION_ACL_FOR_SERVICE, CIM_ASSOCIATOR_CLASS_XFER_ACL_FOR_SERVICE}; Enumeration enum = null; ArrayList serviceList = new ArrayList(); for(int i=0;i<associations.length;i++){ try{ enum = cimClient.associatorNames(this.cimObjectPath,associations[i], DNSService.CIM_CLASS_NAME, "Dependent","Antecedent"); } catch (CIMException e){ System.out.println(e.getMessage()); throw e; } while (enum.hasMoreElements()) { serviceList.add(enum.nextElement()); } } return serviceList; } /**Gets associated dns service instances * @param cimClient * @return An ArrayList of DNSService * @throws CIMException */ public ArrayList getAssociatedDnsServices(CIMClient cimClient) throws CIMException { //we don't want to know which service the ACL belongs to. We want only //which are being globally used String[] associations = {CIM_ASSOCIATOR_CLASS_BLACKHOLE_ACL_FOR_SERVICE, CIM_ASSOCIATOR_CLASS_NOTIFY_ACL_FOR_SERVICE, CIM_ASSOCIATOR_CLASS_QUERY_ACL_FOR_SERVICE, CIM_ASSOCIATOR_CLASS_RECURSION_ACL_FOR_SERVICE, CIM_ASSOCIATOR_CLASS_XFER_ACL_FOR_SERVICE}; Enumeration enum = null; ArrayList serviceList = new ArrayList(); for(int i=0;i<associations.length;i++){ try{ enum = cimClient.associators(this.cimObjectPath,associations[i], DNSService.CIM_CLASS_NAME, "Dependent","Antecedent",false,false,null); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } while (enum.hasMoreElements()) { CIMInstance dummyInstance = (CIMInstance) enum.nextElement(); try { serviceList.add(new DNSService(dummyInstance, dummyInstance.getObjectPath())); } catch (ObjectCreationException e){ System.out.println("Tried to create a DNSService from null value"); } catch (InvalidCimClassException e){ System.out.println("Cim Instance is not of type "+DNSService.CIM_CLASS_NAME); } } } return serviceList; } /**Gets the names of zones that use this address match list * @param cimClient * @return An ArrayList of CIMObjectPath objects * @throws CIMException */ public ArrayList getAssociatedZoneNames(CIMClient cimClient) throws CIMException { String[] associations = {CIM_ASSOCIATOR_CLASS_ALLOW_NOTIFY_ACL_FOR_ZONE, CIM_ASSOCIATOR_CLASS_ALLOW_QUERY_ACL_FOR_ZONE, CIM_ASSOCIATOR_CLASS_ALLOW_TRANSFER_ACL_FOR_ZONE, CIM_ASSOCIATOR_CLASS_ALLOW_UPDATE_ACL_FOR_ZONE}; Enumeration enum = null; ArrayList zoneList = new ArrayList(); for(int i=0;i<associations.length;i++){ try{ enum = cimClient.associatorNames(this.cimObjectPath,associations[i],DNSZone.CIM_CLASS_NAME, "Setting","Element"); } catch (CIMException e){ System.out.println(e.getMessage()); throw e; } while (enum.hasMoreElements()) { zoneList.add(enum.nextElement()); } } return zoneList; } /**Gets instances of the zones that use this address match list * @param cimClient * @return An ArrayList of DNSZone objects * @throws CIMException */ public ArrayList getAssociatedZones(CIMClient cimClient) throws CIMException { String[] associations = {CIM_ASSOCIATOR_CLASS_ALLOW_NOTIFY_ACL_FOR_ZONE, CIM_ASSOCIATOR_CLASS_ALLOW_QUERY_ACL_FOR_ZONE, CIM_ASSOCIATOR_CLASS_ALLOW_TRANSFER_ACL_FOR_ZONE, CIM_ASSOCIATOR_CLASS_ALLOW_UPDATE_ACL_FOR_ZONE}; Enumeration enum = null; ArrayList zoneList = new ArrayList(); for(int i=0;i<associations.length;i++){ try{ enum = cimClient.associators(this.cimObjectPath,associations[i],DNSZone.CIM_CLASS_NAME, "Setting","Element",false,false,null); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } while (enum.hasMoreElements()) { CIMInstance dummyInstance = (CIMInstance) enum.nextElement(); try { zoneList.add(new DNSZone(dummyInstance, dummyInstance.getObjectPath())); } catch (ObjectCreationException e){ System.out.println("Tried to create a DNSZone from null value"); } catch (InvalidCimClassException e){ System.out.println("Cim Instance is not of type "+DNSZone.CIM_CLASS_NAME); } } } return zoneList; } /** * @return The service name * @throws PropertyNotFoundException */ public String getServiceName() throws PropertyNotFoundException { CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_SERVICENAME); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_SERVICENAME + " not found"); throw new PropertyNotFoundException("Property " + CIM_PROPERTY_SERVICENAME + " not found"); } if (property.getValue() == null) { return null; } return (String)property.getValue().getValue(); } /** * @return The name of the addres match list * @throws PropertyNotFoundException */ public String getName() throws PropertyNotFoundException { CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_NAME); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_NAME + " not found"); throw new PropertyNotFoundException("Property " + CIM_PROPERTY_NAME + " not found"); } if (property.getValue() == null) { return null; } return (String)property.getValue().getValue(); } /** * @return The address match list data * @throws PropertyNotFoundException */ public Object[] getAddressList() throws PropertyNotFoundException { CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_ADDRESSLIST); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_ADDRESSLIST + " not found"); throw new PropertyNotFoundException("Property " + CIM_PROPERTY_ADDRESSLIST + " not found"); } if (property.getValue() == null) { return null; } Vector v = (Vector) property.getValue().getValue(); return v.toArray(); } /** * @return The address match list type as a Short * @throws PropertyNotFoundException */ public Short getAddressListType() throws PropertyNotFoundException { CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_ADDRESSLISTTYPE); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_ADDRESSLISTTYPE + " not found"); throw new PropertyNotFoundException("Propertry " + CIM_PROPERTY_ADDRESSLISTTYPE + " not found"); } CIMValue propertyValue = property.getValue(); if (propertyValue == null) { return null; } UnsignedInt16 propertyIntValue = (UnsignedInt16)propertyValue.getValue(); if (propertyIntValue == null) { return null; } return new Short(propertyIntValue.shortValue()); } /**The address match list type as a String * @return * @throws PropertyNotFoundException */ public String getAddressListTypeString() throws PropertyNotFoundException { CIMProperty property = this.cimInstance.getProperty(CIM_PROPERTY_ADDRESSLISTTYPE); if (property == null) { System.out.println("Propertry " + CIM_PROPERTY_ADDRESSLISTTYPE + " not found"); throw new PropertyNotFoundException("Propertry " + CIM_PROPERTY_ADDRESSLISTTYPE + " not found"); } CIMValue propertyValue = property.getValue(); if (propertyValue == null) { return null; } UnsignedInt16 propertyIntValue = (UnsignedInt16)propertyValue.getValue(); if (propertyIntValue == null) { return null; } if (propertyIntValue.shortValue() > 0 && propertyIntValue.shortValue() < CIM_VALUEMAP_ADDRESSLISTTYPE.length) { return CIM_VALUEMAP_ADDRESSLISTTYPE[propertyIntValue.shortValue()]; } return CIM_VALUEMAP_ADDRESSLISTTYPE[0]; } /**Sets the "ServiceName" field of the address match list. Call modifyInstance * later to commit the changes * @param serviceName */ public void setServiceName(String serviceName){ CIMValue updatedValue = new CIMValue(serviceName, new CIMDataType(CIMDataType.STRING)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_SERVICENAME); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } /**Sets the "Name" field of the address match list. Call modifyInstance * later to commit the changes * @param name */ public void setName(String name){ CIMValue updatedValue = new CIMValue(name, new CIMDataType(CIMDataType.STRING)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_NAME); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } public void setAddressList(String[] addressList){ CIMValue updatedValue = new CIMValue(addressList, new CIMDataType(CIMDataType.STRING_ARRAY)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_ADDRESSLIST); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } /**Sets the address list type of the address match list. Call modifyInstance * later to commit the changes * @param type * @throws InvalidPropertyValueException */ public void setAddressListType(Short type) throws InvalidPropertyValueException { if(type.shortValue()<0 || type.shortValue()>CIM_VALUEMAP_ADDRESSLISTTYPE.length){ System.out.println("Invalid "+CIM_PROPERTY_ADDRESSLISTTYPE); throw new InvalidPropertyValueException("Invalid "+CIM_PROPERTY_ADDRESSLISTTYPE); } CIMValue updatedValue = new CIMValue(new UnsignedInt16(type.shortValue()),new CIMDataType(CIMDataType.UINT16)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_ADDRESSLISTTYPE); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } /**Sets the address list type. Call modifyInstane to commit changes * @param type * @throws InvalidPropertyValueException */ public void setAddressListType(String type) throws InvalidPropertyValueException { short pos = this.search(CIM_VALUEMAP_ADDRESSLISTTYPE,type); if(pos==-1) { System.out.println("Invalid "+CIM_PROPERTY_ADDRESSLISTTYPE); throw new InvalidPropertyValueException("Invalid "+CIM_PROPERTY_ADDRESSLISTTYPE); } CIMValue updatedValue = new CIMValue(new UnsignedInt16(pos),new CIMDataType(CIMDataType.UINT16)); CIMProperty currentProperty = this.cimInstance.getProperty(CIM_PROPERTY_ADDRESSLISTTYPE); if (currentProperty != null) { currentProperty.setValue(updatedValue); } } public boolean checkProperty(String property, Object value){ try { if (property.equals(CIM_PROPERTY_ADDRESSLISTTYPE)) { if (value != null && ((Short)value).shortValue()>0) return true; else return false; }else if (property.equals(CIM_PROPERTY_NAME) || property.equals(CIM_PROPERTY_SERVICENAME)) { if(((String)value).equals("any") || ((String)value).equals("localhost") || ((String)value).equals("none") || ((String)value).equals("localnets")) return false; if (value != null && ((String)value).trim().length() > 0) return true; else return false; }else if(property.equals(CIM_PROPERTY_ADDRESSLIST)) return validateAddressList((String[]) value); return false; } catch (Exception ex) { ex.printStackTrace(); return false; } } /**Checks address list entries. Works only for ip addresses yet. * @param l * @return */ private boolean validateAddressList(String[] l){ String s = null; String[] t = null; for (int i=0;i<l.length;i++){ s = l[i]; t = s.split("\\."); if(t.length!=4){ if(s.indexOf(":")<0) return false; } } return true; } } --- NEW FILE: DNSSlaveZone.java --- /** * DNSSlaveZone.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Rodrigo Ceron <rc...@br...> * * Contributors: **/ /* * Created on May 17, 2005, ceron */ package org.sblim.wbemsmt.dns.bl.fco; import java.util.ArrayList; import java.util.Enumeration; import java.util.Vector; import org.sblim.wbem.cim.CIMClass; import org.sblim.wbem.cim.CIMDataType; import org.sblim.wbem.cim.CIMException; import org.sblim.wbem.cim.CIMInstance; import org.sblim.wbem.cim.CIMObjectPath; import org.sblim.wbem.cim.CIMProperty; import org.sblim.wbem.cim.CIMValue; import org.sblim.wbem.cim.UnsignedInt16; import org.sblim.wbem.client.CIMClient; import org.sblim.wbemsmt.exception.InvalidCimClassException; import org.sblim.wbemsmt.exception.InvalidParameterException; import org.sblim.wbemsmt.exception.InvalidPropertyValueException; import org.sblim.wbemsmt.exception.ObjectCreationException; import org.sblim.wbemsmt.exception.PropertyNotFoundException; //import org.sblim.wbemsmt.exception.PropertyNotFoundException; /** * Author ceron * */ public class DNSSlaveZone extends DNSZone { public final static String CIM_CLASS_NAME = "Linux_DnsSlaveZone"; public final static String CIM_PROPERTY_FORWARD = "Forward"; public final static String CIM_PROPERTY_FORWARDERS = "Forwarders"; public final static String CIM_ASSOCIATOR_CLASS_IPADDRESS = "Linux_DnsMastersOfSlaveZone"; public final static String CIM_ASSOCIATOR_CLASS_ALLOW_NOTIFY_ACL_FOR_ZONE = "Linux_DnsAllowNotifyACLForZone"; public final static String CIM_ASSOCIATOR_CLASS_ALLOW_QUERY_ACL_FOR_ZONE = "Linux_DnsAllowQueryACLForZone"; public final static String CIM_ASSOCIATOR_CLASS_ALLOW_TRANSFER_ACL_FOR_ZONE = "Linux_DnsAllowTransferACLForZone"; public final static String CIM_ASSOCIATOR_CLASS_BLACKHOLE_ACL_FOR_ZONE = "Linux_DnsBlackholeACLForZone"; public final static String[] CIM_VALUEMAP_FORWARD = {"Unknown","Only","First"}; public final static short FORWARD_UNKNOWN = 0; public final static short FORWARD_ONLY = 1; public final static short FORWARD_FIRST = 2; /**Creates a DNSSlaveZone Object from a cim instance * @param cimInstance * @param cimObjectPath * @throws ObjectCreationException * @throws InvalidCimClassException */ public DNSSlaveZone(CIMInstance cimInstance, CIMObjectPath cimObjectPath) throws ObjectCreationException, InvalidCimClassException { super(cimInstance,cimObjectPath); this.className = CIM_CLASS_NAME; } /**Creates a new DNSSlaveZone instance. This is not reflected into the * cim server yet, call createInstance later * @param cimClient * @throws CIMException */ public DNSSlaveZone(CIMClient cimClient) throws CIMException { super(cimClient); this.className = CIM_CLASS_NAME; try{ this.cimObjectPath = new CIMObjectPath(this.className); CIMClass cimClass = cimClient.getClass(this.cimObjectPath, false, true, true); this.cimInstance = cimClass.newInstance(); this.original_cimInstance = (CIMInstance)cimInstance.clone(); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } } /* (non-Javadoc) * @see com.ibm.wbem.smt.dns.DNSZone#enumerateInstanceNames(com.ibm.wbem.smt.CimClient) */ public static ArrayList enumerateInstanceNames(CIMClient cimClient) throws CIMException { ArrayList cimInstanceNamesList = new ArrayList(); Enumeration enum = null; try{ enum = cimClient.enumerateInstanceNames(new CIMObjectPath(CIM_CLASS_NAME)); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } CIMObjectPath cimObjectPath = null; while (enum.hasMoreElements()) { cimObjectPath = (CIMObjectPath) enum.nextElement(); cimInstanceNamesList.add(cimObjectPath); } return cimInstanceNamesList; } /* (non-Javadoc) * @see com.ibm.wbem.smt.dns.DNSZone#enumerateInstances(com.ibm.wbem.smt.CimClient) */ public static ArrayList enumerateInstances(CIMClient cimClient) throws CIMException { ArrayList cimInstanceList = new ArrayList(); Enumeration enum = null; CIMInstance cimInstance = null; try{ enum = cimClient.enumerateInstances(new CIMObjectPath(CIM_CLASS_NAME)); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } while (enum.hasMoreElements()) { cimInstance = (CIMInstance) enum.nextElement(); try { cimInstanceList.add(new DNSSlaveZone(cimInstance, cimInstance.getObjectPath())); } catch(ObjectCreationException e) { System.out.println("Null Cim Instance passed!"); } catch(InvalidCimClassException e){ System.out.println("Cim Instance's class must be "+CIM_CLASS_NAME); } } return cimInstanceList; } /* (non-Javadoc) * @see com.ibm.wbem.smt.dns.DNSZone#getInstance(com.ibm.wbem.smt.CimClient, javax.wbem.cim.CIMObjectPath) */ public static DNSZone getInstance(CIMClient cimClient, CIMObjectPath cimObjectPath) throws CIMException, InvalidParameterException { CIMInstance cimInstance = null; DNSSlaveZone zone = null; if (cimObjectPath == null) { throw new InvalidParameterException("Null ObjectPath passed!"); } try{ cimInstance = cimClient.getInstance(cimObjectPath); }catch (CIMException e){ System.out.println("Error within cim client"); throw e; } try { zone = new DNSSlaveZone(cimInstance, cimObjectPath); } catch (ObjectCreationException e) { System.out.println("Returned Cim Instance was null"); return null; } catch (InvalidCimClassException e){ System.out.println("ObjectPath is not a path to " + CIM_CLASS_NAME); return null; } return zone; } public static DNSSlaveZone createInstance(CIMClient cimClient, DNSSlaveZone dnsSlaveZone) throws CIMException, InvalidParameterException { DNSSlaveZone slaveZone = null; CIMObjectPath cimObjectPath = null; if (dnsSlaveZone == null || dnsSlaveZone.getCimInstance() == null) { throw new InvalidParameterException("Invalid Zone passed for creation"); } try{ cimObjectPath = cimClient.createInstance(dnsSlaveZone.getCimObjectPath(), dnsSlaveZone.getCimInstance()); }catch (CIMException e){ System.out.println(e.getMessage()); throw e; } try { slaveZone = (DNSSlaveZone) getInstance(cimClient,cimObjectPath); }catch(Exception e){ System.err.println("System internal error while retrieving created DNS zone"); } return slaveZone; } /**Gets the associated Notify ACL names * @param cimClient * @return An ArrayList of ACL ObjectPaths * @throws CIMException */ public ArrayList getAssociatedAllowNotifyACLNames(CIMClient cimClient) throws CIMException { Enumeration enum = null; try{ enum = cimClient.associatorNames(this.cimObjectPath, CIM_ASSOCIATOR_CLASS_ALLOW_NOTIFY_ACL_FOR_ZONE, DNSAddressMatchList.CIM_CLASS_NAME, "Element","Setting"); } catch (CIMException e){ System.out.println(e.getMessage()); ... [truncated message content] |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:31:56
|
Update of /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/dns In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13907/java/org/sblim/wbemsmt/dns Log Message: Directory /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/dns added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:31:52
|
Update of /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/dns/bl/adapter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13907/java/org/sblim/wbemsmt/dns/bl/adapter Log Message: Directory /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/dns/bl/adapter added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:31:51
|
Update of /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13907/java/org/sblim/wbemsmt Log Message: Directory /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:31:51
|
Update of /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/dns/bl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13907/java/org/sblim/wbemsmt/dns/bl Log Message: Directory /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/dns/bl added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:31:50
|
Update of /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/dns/bl/fco In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13907/java/org/sblim/wbemsmt/dns/bl/fco Log Message: Directory /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/dns/bl/fco added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:31:50
|
Update of /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/exception In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13907/java/org/sblim/wbemsmt/exception Log Message: Directory /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/exception added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:31:50
|
Update of /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/dns/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13907/java/org/sblim/wbemsmt/dns/test Log Message: Directory /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim/wbemsmt/dns/test added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:31:49
|
Update of /cvsroot/sblim/wbemsmt-dns-bl/java/org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13907/java/org Log Message: Directory /cvsroot/sblim/wbemsmt-dns-bl/java/org added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:31:48
|
Update of /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13907/java/org/sblim Log Message: Directory /cvsroot/sblim/wbemsmt-dns-bl/java/org/sblim added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:31:46
|
Update of /cvsroot/sblim/wbemsmt-dns-bl/java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13907/java Log Message: Directory /cvsroot/sblim/wbemsmt-dns-bl/java added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:30:32
|
Update of /cvsroot/sblim/wbemsmt-dns-bl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13614/wbemsmt-dns-bl Log Message: Directory /cvsroot/sblim/wbemsmt-dns-bl added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:25:36
|
Update of /cvsroot/sblim/wbemsmt-tools-wizard-framework/org/sblim/wbemsmt/tools/wizard/container In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12647/org/sblim/wbemsmt/tools/wizard/container Added Files: IWizardContainer.java WizardContainerBase.java Log Message: First initial version of the wizard framework that is used by wbem smt eui implementations. --- NEW FILE: IWizardContainer.java --- /** * IWizardContainer.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * @author: Bert Lange <La...@de...> * * Contributors: * * * Description: Methods which should be used in all JSF/Swing wizard container implementations. * * */ package org.sblim.wbemsmt.tools.wizard.container; import java.util.HashMap; import java.util.Stack; import java.util.Vector; public interface IWizardContainer { /* * CleanUp data object values if user input is no more valid (called in case of 'Back' or 'Cancel' action) */ public void cleanUP(String pageName); /* * Get the name of the current wizard page */ public String getCurrentPageName(); /* * Return the page next in wizard flow */ public String getNextWizardPageName(); /* * Returns the all page objects configured in wizard container class */ public HashMap getPages(); /* * Get the stack object holding the pages the wizard previously run through */ public Stack getUsedPages(); /* * Do initialization stuff for wizard container */ public void initWizardContainer(); public boolean isBackButtonFlag(); public boolean isCancelButtonFlag(); public boolean isFinishButtonFlag(); public boolean isNextButtonFlag(); /* * Check if the given page name ist the first page in wizard flow */ public boolean isFirst(String pageName); /* * Check if the given page name is the last page in wizard flow */ public boolean isLast(String pageName); /* * Use method to check (in data object) if user input for the named property is valid. * The 'result' vector can be filled with specific error messages, error IDs or own exception objects * for further processing */ public boolean isValid(String propertyName, Object value, Vector result); /* * Do actions if wizard flow complete and preWizardFinish method (successfully) executed */ public void postWizardFinish(); /* * Do actions if wizard flow complete (usual create related CIM objects on server side) */ public void preWizardFinish() throws Exception; /* * Set the name of the current wizard page */ public void setCurrentPageName(String pageName); /* * Set run type to container ('JSF' or 'SWING') */ public void setWizardRunType(String wizardRunType); /* * Set flags for navigation buttons according to actual wizard state */ public void updateButtonStates(boolean isLast, boolean isFirst); } --- NEW FILE: WizardContainerBase.java --- /** * WizardContainerBase.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * @author: Bert Lange <La...@de...> * * Contributors: * * * Description: Abstract class implementation for common parts for derived 'WizardContainer' * classes (for all JSF/Swing configuration tasks). * * */ package org.sblim.wbemsmt.tools.wizard.container; import java.util.HashMap; import java.util.Stack; public abstract class WizardContainerBase { private Stack usedPages = new Stack(); private String currentPageName = ""; private String summaryText = ""; public String wizardRunType = null; protected HashMap hmPages = null; protected String[] summary = null; protected boolean noPages = false; public boolean backButtonFlag = true; public boolean nextButtonFlag = true; public boolean finishButtonFlag = true; public boolean cancelButtonFlag = true; public void updateButtonStates(boolean isLast, boolean isFirst) { //System.out.println("isLast: "+isLast); //System.out.println("isFirst: "+isFirst); if (noPages) { //System.out.println("state1"); this.backButtonFlag = false; this.nextButtonFlag = false; this.finishButtonFlag = false; return; } if (isFirst) { //System.out.println("state22"); this.backButtonFlag = false; if (isLast) { //System.out.println("state33"); this.nextButtonFlag = false; this.finishButtonFlag = true; } else { this.finishButtonFlag = false; this.nextButtonFlag = true; } } else if (isLast) { //System.out.println("state55"); this.backButtonFlag = true; this.nextButtonFlag = false; this.finishButtonFlag = true; } else { //System.out.println("state66"); this.backButtonFlag = true; this.nextButtonFlag = true; this.finishButtonFlag = false; } } /** * @return Returns the backButtonFlag. */ public boolean isBackButtonFlag() { return backButtonFlag; } /** * @param backButtonFlag The backButtonFlag to set. */ public void setBackButtonFlag(boolean backButtonFlag) { this.backButtonFlag = backButtonFlag; } /** * @return Returns the cancelButtonFlag. */ public boolean isCancelButtonFlag() { return cancelButtonFlag; } /** * @param cancelButtonFlag The cancelButtonFlag to set. */ public void setCancelButtonFlag(boolean cancelButtonFlag) { this.cancelButtonFlag = cancelButtonFlag; } /** * @return Returns the finishButtonFlag. */ public boolean isFinishButtonFlag() { return finishButtonFlag; } /** * @param finishButtonFlag The finishButtonFlag to set. */ public void setFinishButtonFlag(boolean finishButtonFlag) { this.finishButtonFlag = finishButtonFlag; } /** * @return Returns the nextButtonFlag. */ public boolean isNextButtonFlag() { return nextButtonFlag; } /** * @param nextButtonFlag The nextButtonFlag to set. */ public void setNextButtonFlag(boolean nextButtonFlag) { this.nextButtonFlag = nextButtonFlag; } /** * @return Returns the noPages. */ public boolean isNoPages() { return noPages; } /** * @param noPages The noPages to set. */ public void setNoPages(boolean noPages) { this.noPages = noPages; } /** * @return Returns the usedPages. */ public Stack getUsedPages() { return usedPages; } /** * @param usedPages The usedPages to set. */ public void setUsedPages(Stack usedPages) { this.usedPages = usedPages; } /** * @return Returns the summary. */ public String[] getSummary() { return summary; } /** * @param summary The summary to set. */ public void setSummary(String[] summary) { this.summary = summary; } /** * @return Returns the hmPages. */ public HashMap getPages() { return hmPages; } /** * @param hmPages The hmPages to set. */ public void setPages(HashMap hmPages) { this.hmPages = hmPages; } /** * @return Returns the wizardRunType. */ public String getWizardRunType() { return wizardRunType; } /** * @param wizardRunType The runType to set. */ public void setWizardRunType(String wizardRunType) { this.wizardRunType = wizardRunType; } /** * @return Returns the summaryText. */ public String getSummaryText() { return summaryText; } /** * @param summaryText The summaryText to set. */ public void setSummaryText(String summaryText) { this.summaryText = summaryText; } /** * @return Returns the currentPageName. */ public String getCurrentPageName() { return currentPageName; } /** * @param currentPageName The currentPageName to set. */ public void setCurrentPageName(String currentPageName) { this.currentPageName = currentPageName; } } |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:25:36
|
Update of /cvsroot/sblim/wbemsmt-tools-wizard-framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12647 Added Files: .cvsignore .classpath build.xml .project license.txt Log Message: First initial version of the wizard framework that is used by wbem smt eui implementations. --- NEW FILE: .cvsignore --- compile tools-wizard_framework.jar doc --- NEW FILE: build.xml --- <!-- * build.xml * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * Author: Wolfgang Taphorn <ta...@de...> * * Contributors: --> <project name="wbemsmt-tools-wizard-framework" default="package" basedir="." > <description> Build file of sblim tools-wizard-framework project. </description> <property environment="env"/> <property name="project.packagepath" location="org/sblim/wbemsmt/tools/wizard/"/> <target name="build"> <mkdir dir="${basedir}/compile"/> <javac destdir="${basedir}/compile" debug="true" listfiles="true" compiler="modern" srcdir="${basedir}"> </javac> </target> <target name="package" depends="clean, build"> <jar index="true" destfile="${basedir}/${ant.project.name}.jar" basedir="${basedir}/compile/" includes="**/*.class" /> </target> <target name="clean"> <delete dir="${basedir}/compile/" verbose="true"/> <delete file="${basedir}/${ant.project.name}.jar" verbose="true"/> </target> </project> --- NEW FILE: .classpath --- <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry excluding="compile/|doc/" kind="src" path=""/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="output" path=""/> </classpath> --- NEW FILE: license.txt --- Common Public License Version 1.0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 1. DEFINITIONS "Contribution" means: a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and b) in the case of each subsequent Contributor: i) changes to the Program, and ii) additions to the Program; where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. "Contributor" means any person or entity that distributes the Program. "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. "Program" means the Contributions distributed in accordance with this Agreement. "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. 2. GRANT OF RIGHTS a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. 3. REQUIREMENTS A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: a) it complies with the terms and conditions of this Agreement; and b) its license agreement: i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. When the Program is made available in source code form: a) it must be made available under this Agreement; and b) a copy of this Agreement must be included with each copy of the Program. Contributors may not remove or alter any copyright notices contained within the Program. Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. 4. COMMERCIAL DISTRIBUTION Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. 5. NO WARRANTY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. 6. DISCLAIMER OF LIABILITY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 7. GENERAL If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>wbemsmt-tools-wizard-framework</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription> |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:25:36
|
Update of /cvsroot/sblim/wbemsmt-tools-wizard-framework/org/sblim/wbemsmt/tools/wizard/adapter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12647/org/sblim/wbemsmt/tools/wizard/adapter Added Files: SwingWizardAdapterBase.java IPageWizardAdapter.java Log Message: First initial version of the wizard framework that is used by wbem smt eui implementations. --- NEW FILE: SwingWizardAdapterBase.java --- /** * SwingWizardAdapterBase.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * @author: Bert Lange <La...@de...> * * Contributors: * * * Description: Abstract class implementation for common 'Swing' related * parts for derived 'SwingWizardAdapter' classes (for all Swing configuration tasks). * */ package org.sblim.wbemsmt.tools.wizard.adapter; import java.awt.CardLayout; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JPanel; import org.sblim.wbemsmt.tools.wizard.container.IWizardContainer; public abstract class SwingWizardAdapterBase extends JDialog implements ActionListener { private IPageWizardAdapter adapter = null; private javax.swing.JPanel jContentPane = null; protected IWizardContainer container = null; protected JPanel contentPanel = null; protected JPanel navigationPanel = null; public JButton cancelButton = null; public JButton nextButton = null; public JButton backButton = null; public JButton finishButton = null; public SwingWizardAdapterBase(JFrame owner) { super(owner); } protected void initialize(Dimension dimension, String title) { this.setName("JPanelWizard"); if (dimension != null) this.setSize(dimension); else this.setSize(500,300); this.setContentPane(getJContentPane()); this.setTitle(title); rootPane.setDefaultButton(getNextButton()); } public void initWizard(IWizardContainer container, IPageWizardAdapter adapter) throws Exception { this.container = container; this.adapter = adapter; container.setWizardRunType("JSWING"); container.initWizardContainer(); String nextPanelName = container.getNextWizardPageName(); if (container.getPages().get(nextPanelName) == null || nextPanelName.equals("")) { //System.out.println("found no panel to display"); this.backButton.setEnabled(false); this.nextButton.setEnabled(false); this.finishButton.setEnabled(false); throw new Exception("found no panel to display"); } JPanel nextPanel = (JPanel)container.getPages().get(nextPanelName); this.contentPanel.add(nextPanel, nextPanel.getClass().getName()); //System.out.println("added first panel to contentPanel"); container.updateButtonStates(container.isLast(nextPanelName), container.isFirst(nextPanelName)); switchButtons(); container.getUsedPages().push(nextPanelName); container.setCurrentPageName(nextPanelName); this.setPanelVisible(nextPanel.getClass().getName()); } public void actionPerformed(ActionEvent event) { String actualPanelName = null; JPanel nextPanel = null; JPanel oldPanel = null; String oldPanelName = null; boolean isLast = false; boolean isFirst = false; if(event.getSource() == this.nextButton) { actualPanelName = (String) container.getUsedPages().peek(); if (!adapter.savePageValues(actualPanelName)) return; String nextPanelName = container.getNextWizardPageName(); if (nextPanelName == null) { System.out.println("Missing following panel name."); return; } if (container.isLast(nextPanelName)) isLast = true; if (isLast) { adapter.setSummaryText(nextPanelName); } nextPanel = (JPanel)container.getPages().get(nextPanelName); contentPanel.add(nextPanel, nextPanel.getClass().getName()); //System.out.println("setting new panel name: "+nextPanel.getClass().getName()); container.getUsedPages().push(nextPanelName); container.setCurrentPageName(nextPanelName); this.setPanelVisible(nextPanel.getClass().getName()); } else if(event.getSource() == this.backButton ) { // remove now invalid values for further branch decisions (from actual panel) // cleanUP could be necessary for data object and/or for swing page object adapter.cleanUPPage(container.getCurrentPageName()); actualPanelName = (String) container.getUsedPages().pop(); contentPanel.remove((JPanel)container.getPages().get(actualPanelName)); // remove the current panel //from stack and from 'contentPanel' oldPanelName = (String) container.getUsedPages().peek(); oldPanel = (JPanel) container.getPages().get(oldPanelName); // use the previous one //System.out.println("setting old panel name: "+oldPanel.getClass().getName()); // remove now invalid values for further branch decisions (also from previous data object value) container.cleanUP(oldPanelName); if (container.isFirst(oldPanelName)) isFirst = true; container.setCurrentPageName(oldPanelName); this.setPanelVisible(oldPanel.getClass().getName()); } else if(event.getSource() == this.finishButton) { actualPanelName = (String) container.getUsedPages().peek(); if (!adapter.savePageValues(actualPanelName)) return; adapter.wizardComplete(); return; } else if(event.getSource() == this.cancelButton) { this.setVisible(false); this.dispose(); } this.container.updateButtonStates(isLast, isFirst); switchButtons(); } public void switchButtons() { if (container.isBackButtonFlag()) this.backButton.setEnabled(true); else this.backButton.setEnabled(false); if (container.isNextButtonFlag()) this.nextButton.setEnabled(true); else this.nextButton.setEnabled(false); if (container.isFinishButtonFlag()) this.finishButton.setEnabled(true); else this.finishButton.setEnabled(false); if (container.isCancelButtonFlag()) this.cancelButton.setEnabled((true)); else this.cancelButton.setEnabled(false); } public void startWizard(Point point, boolean modal) { if (point != null) this.setLocation(point); this.setModal(modal); //System.out.println("starting wizard"); this.setVisible(true); } protected void setPanelVisible(String panelName) { CardLayout cLayout = (CardLayout)this.contentPanel.getLayout(); cLayout.show(this.contentPanel, panelName); this.contentPanel.repaint(); } private javax.swing.JPanel getJContentPane() { if(jContentPane == null) { jContentPane = new javax.swing.JPanel(); jContentPane.setLayout(new java.awt.BorderLayout()); jContentPane.add(getContentPanel(), java.awt.BorderLayout.NORTH); jContentPane.add(getNavigationPanel(), java.awt.BorderLayout.SOUTH); } return jContentPane; } /** * @param contentPane The jContentPane to set. */ public void setJContentPane(javax.swing.JPanel contentPane) { jContentPane = contentPane; } /** * This method initializes jPanel * * @return javax.swing.JPanel */ private JPanel getContentPanel() { if (contentPanel == null) { contentPanel = new JPanel(); contentPanel.setLayout(new CardLayout()); contentPanel.setName("contentPanel"); } return contentPanel; } /** * @param contentPanel The contentPanel to set. */ public void setContentPanel(JPanel contentPanel) { this.contentPanel = contentPanel; } /** * This method initializes jPanel1 * * @return javax.swing.JPanel */ private JPanel getNavigationPanel() { if (navigationPanel == null) { FlowLayout flowLayout1 = new FlowLayout(); navigationPanel = new JPanel(); navigationPanel.setLayout(flowLayout1); flowLayout1.setAlignment(java.awt.FlowLayout.RIGHT); flowLayout1.setHgap(5); navigationPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.LOWERED)); navigationPanel.setName("navigationPanel"); navigationPanel.add(getBackButton(), null); navigationPanel.add(getNextButton(), null); navigationPanel.add(getFinishButton(), null); navigationPanel.add(getCancelButton(), null); } return navigationPanel; } /** * This method initializes cancelButton * * @return javax.swing.JButton */ private JButton getCancelButton() { if (cancelButton == null) { cancelButton = new JButton(); cancelButton.setText("Cancel"); cancelButton.setName("cancelButton"); cancelButton.addActionListener(this); } return cancelButton; } /** * This method initializes nextButton * * @return javax.swing.JButton */ public JButton getNextButton() { if (nextButton == null) { nextButton = new JButton(); nextButton.setText("Next >"); nextButton.setName("nextButton"); nextButton.addActionListener(this); } return nextButton; } /** * This method initializes backButton * * @return javax.swing.JButton */ private JButton getBackButton() { if (backButton == null) { backButton = new JButton(); backButton.setName("backButton"); backButton.setText("< Back"); backButton.addActionListener(this); } return backButton; } /** * This method initializes backButton * * @return javax.swing.JButton */ private JButton getFinishButton() { if (finishButton == null) { finishButton = new JButton(); finishButton.setName("finishButton"); finishButton.setText(">> Finish"); finishButton.addActionListener(this); } return finishButton; } } --- NEW FILE: IPageWizardAdapter.java --- /** * IPageWizardAdapter.java * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * @author: Bert Lange <La...@de...> * * Contributors: * * * Description: Methods which should be used in all JSF/Swing wizard adapter implementations. * */ package org.sblim.wbemsmt.tools.wizard.adapter; import org.sblim.wbemsmt.tools.wizard.container.IWizardContainer; public interface IPageWizardAdapter { /* * CleanUp user input values set in the page with given name (called in case of 'Back' or 'Cancel' actions) */ public void cleanUPPage(String pageName); /* * Do initial stuff for WizardAdapter and WizardContainer */ public void initWizard(IWizardContainer container, IPageWizardAdapter adapter) throws Exception; /* * Work with user input values (store in data objects) */ public boolean savePageValues(String pageName); /* * Build and set the summary text here (from (all) user input values from all shown pages) to show it on the last page */ public void setSummaryText(String pageName); /* * Activate/Deactivate state of 'Back', 'Next', 'Finish' button */ public void switchButtons(); /* * Execute actions necessary if all wizard pages has been shown */ public String wizardComplete(); } |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:25:02
|
Update of /cvsroot/sblim/wbemsmt-tools-wizard-framework/org/sblim/wbemsmt/tools/wizard/container In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12525/org/sblim/wbemsmt/tools/wizard/container Log Message: Directory /cvsroot/sblim/wbemsmt-tools-wizard-framework/org/sblim/wbemsmt/tools/wizard/container added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:25:01
|
Update of /cvsroot/sblim/wbemsmt-tools-wizard-framework/org/sblim/wbemsmt/tools/wizard/adapter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12525/org/sblim/wbemsmt/tools/wizard/adapter Log Message: Directory /cvsroot/sblim/wbemsmt-tools-wizard-framework/org/sblim/wbemsmt/tools/wizard/adapter added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:25:01
|
Update of /cvsroot/sblim/wbemsmt-tools-wizard-framework/org/sblim/wbemsmt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12525/org/sblim/wbemsmt Log Message: Directory /cvsroot/sblim/wbemsmt-tools-wizard-framework/org/sblim/wbemsmt added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:25:01
|
Update of /cvsroot/sblim/wbemsmt-tools-wizard-framework/org/sblim/wbemsmt/tools/wizard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12525/org/sblim/wbemsmt/tools/wizard Log Message: Directory /cvsroot/sblim/wbemsmt-tools-wizard-framework/org/sblim/wbemsmt/tools/wizard added to the repository |