Source Code Cross Referenced for UserConfigClient.java in  » Content-Management-System » harmonise » org » openharmonise » him » harmonise » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » harmonise » org.openharmonise.him.harmonise 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the 
003:         * Mozilla Public License Version 1.1 (the "License"); 
004:         * you may not use this file except in compliance with the License. 
005:         * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006:         *
007:         * Software distributed under the License is distributed on an "AS IS"
008:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. 
009:         * See the License for the specific language governing rights and 
010:         * limitations under the License.
011:         *
012:         * The Initial Developer of the Original Code is Simulacra Media Ltd.
013:         * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014:         *
015:         * All Rights Reserved.
016:         *
017:         * Contributor(s):
018:         */
019:        package org.openharmonise.him.harmonise;
020:
021:        import java.net.*;
022:        import java.rmi.RemoteException;
023:
024:        import org.apache.axis.client.Call;
025:        import org.apache.axis.client.Service;
026:
027:        import javax.xml.namespace.QName;
028:        import javax.xml.rpc.ServiceException;
029:
030:        /**
031:         * This class provides a client interface to the Harmonise user config webservice
032:         * 
033:         * @author Michael Bell
034:         * @version $Revision: 1.2 $
035:         *
036:         */
037:        public class UserConfigClient {
038:
039:            public static final int CODE_SUCCESS = 200;
040:            public static final int CODE_AUTHENTICATION_FAIL = 402;
041:            public static final int CODE_INVALID_LENGTH = 403;
042:            public static final int CODE_NO_ALPHA_CHAR = 404;
043:            public static final int CODE_NO_NUM_CHAR = 405;
044:            public static final int CODE_NO_CASE_MIX = 406;
045:            public static final int CODE_INVALID_USER_STATE = 407;
046:            public static final int CODE_PWD_REPEAT = 408;
047:            public static final String SIMULACRA_WEBSERVICE_NAMESPACE_URI = "http://www.openharmonise.org/";
048:
049:            /**
050:             * 
051:             */
052:            public UserConfigClient() {
053:                super ();
054:            }
055:
056:            /**
057:             * Makes SOAP request to change the password of the user with the user name
058:             * <code>sChangeUserName</code> using the user with user name <code>sCurrUserName</code>
059:             * 
060:             * @param endpoint
061:             * @param sCurrUserName
062:             * @param sCurrUserPwd
063:             * @param sChangeUserName
064:             * @param sChangeOldPwd
065:             * @param sChangeNewPwd
066:             * @return
067:             * @throws java.rmi.RemoteException
068:             * @throws ServiceException
069:             */
070:            public static int setPassword(URL endpoint, String sCurrUserName,
071:                    String sCurrUserPwd, String sChangeUserName,
072:                    String sChangeNewPwd) throws java.rmi.RemoteException,
073:                    ServiceException {
074:
075:                Service service = new Service();
076:                Call call = (Call) service.createCall();
077:
078:                call.setTargetEndpointAddress(endpoint);
079:                call.setOperationName(new QName(
080:                        SIMULACRA_WEBSERVICE_NAMESPACE_URI, "setPassword"));
081:
082:                call.addParameter("sCurrUserName",
083:                        org.apache.axis.Constants.XSD_STRING,
084:                        javax.xml.rpc.ParameterMode.IN);
085:                call.addParameter("sCurrUserPwd",
086:                        org.apache.axis.Constants.XSD_STRING,
087:                        javax.xml.rpc.ParameterMode.IN);
088:
089:                call.addParameter("sChangeUserName",
090:                        org.apache.axis.Constants.XSD_STRING,
091:                        javax.xml.rpc.ParameterMode.IN);
092:
093:                call.addParameter("sChangeNewPwd",
094:                        org.apache.axis.Constants.XSD_STRING,
095:                        javax.xml.rpc.ParameterMode.IN);
096:
097:                call.setReturnType(org.apache.axis.Constants.XSD_INTEGER);
098:                call.setReturnClass(Integer.class);
099:
100:                Integer ret = (Integer) call.invoke(new Object[] {
101:                        sCurrUserName, sCurrUserPwd, sChangeUserName,
102:                        sChangeNewPwd });
103:
104:                return ret.intValue();
105:
106:            }
107:
108:            /**
109:             * Makes SOAP request to check whether the given password has expired for the user
110:             * with user name <code>sUserName</code>
111:             * 
112:             * @param endpoint
113:             * @param sUserName
114:             * @param sPwd
115:             * @return
116:             * @throws ServiceException
117:             * @throws RemoteException
118:             */
119:            static public boolean hasPasswordExpired(URL endpoint,
120:                    String sUserName, String sPwd) throws ServiceException,
121:                    RemoteException {
122:                Service service = new Service();
123:                Call call = (Call) service.createCall();
124:
125:                call.setTargetEndpointAddress(endpoint);
126:                call.setOperationName(new QName(
127:                        SIMULACRA_WEBSERVICE_NAMESPACE_URI,
128:                        "hasPasswordExpired"));
129:
130:                call.addParameter("sUserName",
131:                        org.apache.axis.Constants.XSD_STRING,
132:                        javax.xml.rpc.ParameterMode.IN);
133:                call.addParameter("sPwd", org.apache.axis.Constants.XSD_STRING,
134:                        javax.xml.rpc.ParameterMode.IN);
135:
136:                call.setReturnType(org.apache.axis.Constants.XSD_BOOLEAN);
137:                call.setReturnClass(Boolean.class);
138:
139:                Boolean ret = (Boolean) call.invoke(new Object[] { sUserName,
140:                        sPwd });
141:
142:                return ret.booleanValue();
143:            }
144:
145:            /**
146:             * Makes SOAP request to check with the user with the given user name and password
147:             * is a super user
148:             * 
149:             * @param endpoint
150:             * @param sUserName
151:             * @param sPwd
152:             * @return
153:             * @throws ServiceException
154:             * @throws RemoteException
155:             */
156:            static public boolean isSuperUser(URL endpoint, String sUserName,
157:                    String sPwd) throws ServiceException, RemoteException {
158:                Service service = new Service();
159:                Call call = (Call) service.createCall();
160:
161:                call.setTargetEndpointAddress(endpoint);
162:                call.setOperationName(new QName(
163:                        SIMULACRA_WEBSERVICE_NAMESPACE_URI, "isSuperUser"));
164:
165:                call.addParameter("sUserName",
166:                        org.apache.axis.Constants.XSD_STRING,
167:                        javax.xml.rpc.ParameterMode.IN);
168:                call.addParameter("sPwd", org.apache.axis.Constants.XSD_STRING,
169:                        javax.xml.rpc.ParameterMode.IN);
170:
171:                call.setReturnType(org.apache.axis.Constants.XSD_BOOLEAN);
172:                call.setReturnClass(Boolean.class);
173:
174:                Boolean ret = (Boolean) call.invoke(new Object[] { sUserName,
175:                        sPwd });
176:
177:                return ret.booleanValue();
178:            }
179:
180:            /**
181:             * Makes SOAP request to check with the user with the given user name and password
182:             * is a super user
183:             * 
184:             * @param endpoint
185:             * @param sUserName
186:             * @param sPwd
187:             * @return
188:             * @throws ServiceException
189:             * @throws RemoteException
190:             */
191:            static public boolean isSuperUser(URL endpoint, String sUserName,
192:                    String sPwd, String sCheckUser) throws ServiceException,
193:                    RemoteException {
194:                Service service = new Service();
195:                Call call = (Call) service.createCall();
196:
197:                call.setTargetEndpointAddress(endpoint);
198:                call.setOperationName(new QName(
199:                        SIMULACRA_WEBSERVICE_NAMESPACE_URI, "isSuperUser"));
200:
201:                call.addParameter("sUserName",
202:                        org.apache.axis.Constants.XSD_STRING,
203:                        javax.xml.rpc.ParameterMode.IN);
204:                call.addParameter("sPwd", org.apache.axis.Constants.XSD_STRING,
205:                        javax.xml.rpc.ParameterMode.IN);
206:                call.addParameter("sCheckUser",
207:                        org.apache.axis.Constants.XSD_STRING,
208:                        javax.xml.rpc.ParameterMode.IN);
209:
210:                call.setReturnType(org.apache.axis.Constants.XSD_BOOLEAN);
211:                call.setReturnClass(Boolean.class);
212:
213:                Boolean ret = (Boolean) call.invoke(new Object[] { sUserName,
214:                        sPwd, sCheckUser });
215:
216:                return ret.booleanValue();
217:            }
218:
219:            /**
220:             * Returns <code>true</code> if the user with the given user name is locked
221:             * out of the system
222:             * 
223:             * @param endpoint
224:             * @param sUserName
225:             * @return
226:             * @throws ServiceException
227:             * @throws RemoteException
228:             */
229:            static public boolean isUserLockedOut(URL endpoint, String sUserName)
230:                    throws ServiceException, RemoteException {
231:                Service service = new Service();
232:                Call call = (Call) service.createCall();
233:
234:                call.setTargetEndpointAddress(endpoint);
235:                call.setOperationName(new QName(
236:                        SIMULACRA_WEBSERVICE_NAMESPACE_URI, "isUserLockedOut"));
237:
238:                call.addParameter("sUserName",
239:                        org.apache.axis.Constants.XSD_STRING,
240:                        javax.xml.rpc.ParameterMode.IN);
241:
242:                call.setReturnType(org.apache.axis.Constants.XSD_BOOLEAN);
243:                call.setReturnClass(Boolean.class);
244:
245:                Boolean ret = (Boolean) call.invoke(new Object[] { sUserName });
246:
247:                return ret.booleanValue();
248:            }
249:
250:            /**
251:             * Makes SOAP request to set whether the user is a super user.
252:             * 
253:             * @param endpoint
254:             * @param sCurrUserName the user name of the user making the change
255:             * @param sPwd the password of the user making the change
256:             * @param sNewSuperUser the user name of the user to be changed
257:             * @param bIsSuper <code>true</code> if the user to be changed is to be a super user, otherwise <code>false</code>
258:             * @throws java.rmi.RemoteException if the current user is not allowed to make the change, 
259:             * there is a pending version of the user to be changed or a general 
260:             * error occurs
261:             * @throws ServiceException
262:             */
263:            public static void setIsSuperUser(URL endpoint,
264:                    String sCurrUserName, String sPwd, String sChangeUser,
265:                    boolean bIsSuper) throws java.rmi.RemoteException,
266:                    ServiceException {
267:
268:                Service service = new Service();
269:                Call call = (Call) service.createCall();
270:
271:                call.setTargetEndpointAddress(endpoint);
272:                call.setOperationName(new QName(
273:                        SIMULACRA_WEBSERVICE_NAMESPACE_URI, "setIsSuperUser"));
274:
275:                call.addParameter("sCurrUserName",
276:                        org.apache.axis.Constants.XSD_STRING,
277:                        javax.xml.rpc.ParameterMode.IN);
278:                call.addParameter("sPwd", org.apache.axis.Constants.XSD_STRING,
279:                        javax.xml.rpc.ParameterMode.IN);
280:
281:                call.addParameter("sChangeUser",
282:                        org.apache.axis.Constants.XSD_STRING,
283:                        javax.xml.rpc.ParameterMode.IN);
284:
285:                call.addParameter("bIsSuper",
286:                        org.apache.axis.Constants.XSD_BOOLEAN,
287:                        javax.xml.rpc.ParameterMode.IN);
288:
289:                call.setReturnType(org.apache.axis.Constants.XSD_INTEGER);
290:
291:                Integer ret = (Integer) call
292:                        .invoke(new Object[] { sCurrUserName, sPwd,
293:                                sChangeUser, new Boolean(bIsSuper) });
294:
295:            }
296:
297:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.