Source Code Cross Referenced for RequestSecurityTokenResponseImpl.java in  » 6.0-JDK-Modules-com.sun » wsit » com » sun » xml » ws » security » trust » impl » elements » 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 » 6.0 JDK Modules com.sun » wsit » com.sun.xml.ws.security.trust.impl.elements 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: RequestSecurityTokenResponseImpl.java,v 1.11 2007/05/29 22:11:34 ofung Exp $
003:         */
004:
005:        /*
006:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
007:         * 
008:         * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
009:         * 
010:         * The contents of this file are subject to the terms of either the GNU
011:         * General Public License Version 2 only ("GPL") or the Common Development
012:         * and Distribution License("CDDL") (collectively, the "License").  You
013:         * may not use this file except in compliance with the License. You can obtain
014:         * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
015:         * or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific
016:         * language governing permissions and limitations under the License.
017:         * 
018:         * When distributing the software, include this License Header Notice in each
019:         * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
020:         * Sun designates this particular file as subject to the "Classpath" exception
021:         * as provided by Sun in the GPL Version 2 section of the License file that
022:         * accompanied this code.  If applicable, add the following below the License
023:         * Header, with the fields enclosed by brackets [] replaced by your own
024:         * identifying information: "Portions Copyrighted [year]
025:         * [name of copyright owner]"
026:         * 
027:         * Contributor(s):
028:         * 
029:         * If you wish your version of this file to be governed by only the CDDL or
030:         * only the GPL Version 2, indicate your decision by adding "[Contributor]
031:         * elects to include this software in this distribution under the [CDDL or GPL
032:         * Version 2] license."  If you don't indicate a single choice of license, a
033:         * recipient has the option to distribute your version of this file under
034:         * either the CDDL, the GPL Version 2 or to extend the choice of license to
035:         * its licensees as provided above.  However, if you add GPL Version 2 code
036:         * and therefore, elected the GPL Version 2 license, then the option applies
037:         * only if the new code is made subject to such option by the copyright
038:         * holder.
039:         */
040:
041:        package com.sun.xml.ws.security.trust.impl.elements;
042:
043:        import java.net.URISyntaxException;
044:        import java.util.List;
045:
046:        import java.net.URI;
047:
048:        import com.sun.xml.ws.policy.impl.bindings.AppliesTo;
049:        import com.sun.xml.ws.policy.Policy;
050:        import com.sun.xml.ws.policy.impl.bindings.PolicyReference;
051:        import javax.xml.bind.JAXBElement;
052:
053:        import com.sun.xml.ws.api.security.trust.WSTrustException;
054:        import com.sun.xml.ws.security.trust.WSTrustConstants;
055:
056:        import com.sun.xml.ws.security.trust.elements.*;
057:
058:        import com.sun.xml.ws.security.trust.impl.bindings.AllowPostdatingType;
059:        import com.sun.xml.ws.security.trust.impl.bindings.AuthenticatorType;
060:        import com.sun.xml.ws.security.trust.impl.bindings.BinaryExchangeType;
061:        import com.sun.xml.ws.security.trust.impl.bindings.DelegateToType;
062:        import com.sun.xml.ws.security.trust.impl.bindings.EncryptionType;
063:        import com.sun.xml.ws.security.trust.impl.bindings.RequestSecurityTokenResponseType;
064:        import com.sun.xml.ws.security.trust.impl.bindings.EntropyType;
065:        import com.sun.xml.ws.security.trust.impl.bindings.LifetimeType;
066:        import com.sun.xml.ws.security.trust.impl.bindings.RequestedReferenceType;
067:        import com.sun.xml.ws.security.trust.impl.bindings.RequestedProofTokenType;
068:        import com.sun.xml.ws.security.trust.impl.bindings.RequestedSecurityTokenType;
069:        import com.sun.xml.ws.security.trust.impl.bindings.RequestedTokenCancelledType;
070:
071:        import com.sun.xml.ws.security.trust.impl.bindings.ObjectFactory;
072:        import com.sun.xml.ws.security.trust.impl.bindings.ProofEncryptionType;
073:        import com.sun.xml.ws.security.trust.impl.bindings.RenewingType;
074:        import com.sun.xml.ws.security.trust.impl.bindings.SignChallengeType;
075:        import com.sun.xml.ws.security.trust.impl.bindings.StatusType;
076:        import com.sun.xml.ws.security.trust.impl.bindings.UseKeyType;
077:
078:        import java.util.logging.Level;
079:        import java.util.logging.Logger;
080:        import com.sun.xml.ws.security.trust.logging.LogDomainConstants;
081:
082:        import com.sun.istack.NotNull;
083:
084:        import com.sun.xml.ws.security.trust.logging.LogStringsMessages;
085:
086:        /**
087:         * Implementation of a RequestSecurityTokenResponse.
088:         *
089:         * @author Manveen Kaur
090:         */
091:        public class RequestSecurityTokenResponseImpl extends
092:                RequestSecurityTokenResponseType implements 
093:                RequestSecurityTokenResponse {
094:
095:            private static final Logger log = Logger.getLogger(
096:                    LogDomainConstants.TRUST_IMPL_DOMAIN,
097:                    LogDomainConstants.TRUST_IMPL_DOMAIN_BUNDLE);
098:
099:            private URI tokenType = null;
100:
101:            private long keySize = 0;
102:
103:            private URI keyType = null;
104:            private URI computedKeyAlgorithm = null;
105:            private URI signatureAlgorithm = null;
106:            private URI encryptionAlgorithm = null;
107:            private URI canonAlgorithm = null;
108:
109:            private Lifetime lifetime = null;
110:            private Entropy entropy = null;
111:            private AppliesTo appliesTo = null;
112:            private Authenticator authenticator = null;
113:            private UseKey useKey = null;
114:            private ProofEncryption proofEncryption = null;
115:            private Encryption encryption = null;
116:            private DelegateTo delegateTo = null;
117:
118:            private OnBehalfOf obo = null;
119:            private RequestedSecurityToken requestedSecToken = null;
120:            private RequestedProofToken requestedProofToken = null;
121:            private RequestedAttachedReference requestedAttachedReference = null;
122:            private RequestedUnattachedReference requestedUnattachedReference = null;
123:
124:            private URI signWith = null;
125:            private URI encryptWith = null;
126:            private URI authenticationType = null;
127:
128:            private SignChallenge signChallenge = null;
129:            private SignChallengeResponse signChallengeRes = null;
130:
131:            private boolean forwardable = true;
132:            private boolean delegatable = false;
133:
134:            private Issuer issuer = null;
135:            private Renewing renewable = null;
136:
137:            private BinaryExchange binaryExchange = null;
138:            private AllowPostdating apd = null;
139:            private Status status = null;
140:
141:            private Policy policy = null;
142:            private PolicyReference policyRef = null;
143:
144:            private RequestedTokenCancelled rtc = null;
145:
146:            public RequestSecurityTokenResponseImpl() {
147:                // default empty constructor
148:            }
149:
150:            public RequestSecurityTokenResponseImpl(URI tokenType, URI context,
151:                    RequestedSecurityToken token, AppliesTo scopes,
152:                    RequestedAttachedReference attached,
153:                    RequestedUnattachedReference unattached,
154:                    RequestedProofToken proofToken, Entropy entropy,
155:                    Lifetime lifetime, Status status) {
156:
157:                setTokenType(tokenType);
158:                if (context != null) {
159:                    setContext(context.toString());
160:                }
161:                if (token != null) {
162:                    setRequestedSecurityToken(token);
163:                }
164:                if (attached != null) {
165:                    setRequestedAttachedReference(attached);
166:                }
167:                if (unattached != null) {
168:                    setRequestedUnattachedReference(unattached);
169:                }
170:                if (scopes != null) {
171:                    setAppliesTo(scopes);
172:                }
173:                if (proofToken != null) {
174:                    setRequestedProofToken(proofToken);
175:                }
176:                if (entropy != null) {
177:                    setEntropy(entropy);
178:                }
179:                if (lifetime != null) {
180:                    setLifetime(lifetime);
181:                }
182:                if (status != null) {
183:                    setStatus(status);
184:                }
185:            }
186:
187:            public URI getTokenType() {
188:                return tokenType;
189:            }
190:
191:            public final void setTokenType(final URI tokenType) {
192:                if (tokenType != null) {
193:                    this .tokenType = tokenType;
194:                    final JAXBElement<String> ttElement = (new ObjectFactory())
195:                            .createTokenType(tokenType.toString());
196:                    getAny().add(ttElement);
197:                }
198:            }
199:
200:            public Lifetime getLifetime() {
201:                return lifetime;
202:            }
203:
204:            public final void setLifetime(final Lifetime lifetime) {
205:                this .lifetime = lifetime;
206:                final JAXBElement<LifetimeType> ltElement = (new ObjectFactory())
207:                        .createLifetime((LifetimeType) lifetime);
208:                getAny().add(ltElement);
209:            }
210:
211:            public RequestedTokenCancelled getRequestedTokenCancelled() {
212:                return this .rtc;
213:            }
214:
215:            public final void setRequestedTokenCancelled(
216:                    final RequestedTokenCancelled rtc) {
217:                this .rtc = rtc;
218:                final JAXBElement<RequestedTokenCancelledType> rtcElement = (new ObjectFactory())
219:                        .createRequestedTokenCancelled((RequestedTokenCancelledType) rtc);
220:                getAny().add(rtcElement);
221:            }
222:
223:            public Status getStatus() {
224:                return status;
225:            }
226:
227:            public final void setStatus(final Status status) {
228:                this .status = status;
229:                final JAXBElement<StatusType> sElement = (new ObjectFactory())
230:                        .createStatus((StatusType) status);
231:                getAny().add(sElement);
232:            }
233:
234:            public Entropy getEntropy() {
235:                return entropy;
236:            }
237:
238:            public final void setEntropy(final Entropy entropy) {
239:                this .entropy = entropy;
240:                final JAXBElement<EntropyType> etElement = (new ObjectFactory())
241:                        .createEntropy((EntropyType) entropy);
242:                getAny().add(etElement);
243:            }
244:
245:            public final void setAppliesTo(final AppliesTo appliesTo) {
246:                getAny().add(appliesTo);
247:                this .appliesTo = appliesTo;
248:            }
249:
250:            public AppliesTo getAppliesTo() {
251:                return appliesTo;
252:            }
253:
254:            public final void setOnBehalfOf(final OnBehalfOf onBehalfOf) {
255:                obo = onBehalfOf;
256:            }
257:
258:            public OnBehalfOf getOnBehalfOf() {
259:                return obo;
260:            }
261:
262:            public final void setIssuer(final Issuer issuer) {
263:                this .issuer = issuer;
264:                /* JAXBElement<EndpointReferenceImpl> eprType =
265:                         (new com.sun.xml.ws.security.trust.impl.bindings.ObjectFactory()).createIssuer((EndpointReferenceImpl)issuer);
266:                 getAny().add(eprType);*/
267:            }
268:
269:            public Issuer getIssuer() {
270:                return issuer;
271:            }
272:
273:            public final void setRenewable(final Renewing renew) {
274:                renewable = renew;
275:                final JAXBElement<RenewingType> renewType = (new ObjectFactory())
276:                        .createRenewing((RenewingType) renew);
277:                getAny().add(renewType);
278:            }
279:
280:            public Renewing getRenewable() {
281:                return renewable;
282:            }
283:
284:            public final void setSignChallenge(final SignChallenge challenge) {
285:                signChallenge = challenge;
286:                final JAXBElement<SignChallengeType> challengeType = (new ObjectFactory())
287:                        .createSignChallenge((SignChallengeType) challenge);
288:                getAny().add(challengeType);
289:            }
290:
291:            public SignChallenge getSignChallenge() {
292:                return signChallenge;
293:            }
294:
295:            public final void setBinaryExchange(final BinaryExchange exchange) {
296:                binaryExchange = exchange;
297:                final JAXBElement<BinaryExchangeType> exchangeType = (new ObjectFactory())
298:                        .createBinaryExchange((BinaryExchangeType) exchange);
299:                getAny().add(exchangeType);
300:            }
301:
302:            public BinaryExchange getBinaryExchange() {
303:                return binaryExchange;
304:            }
305:
306:            public final void setAuthenticationType(final URI uri) {
307:                this .authenticationType = uri;
308:                final JAXBElement<String> atElement = (new ObjectFactory())
309:                        .createAuthenticationType(uri.toString());
310:                getAny().add(atElement);
311:            }
312:
313:            public URI getAuthenticationType() {
314:                return authenticationType;
315:            }
316:
317:            public final void setKeyType(@NotNull
318:            final URI keytype) throws WSTrustException {
319:
320:                if (!(keytype.toString().equalsIgnoreCase(
321:                        RequestSecurityToken.PUBLIC_KEY_TYPE) || keytype
322:                        .toString().equalsIgnoreCase(
323:                                RequestSecurityToken.SYMMETRIC_KEY_TYPE))) {
324:                    log.log(Level.SEVERE,
325:                            LogStringsMessages.WST_0025_INVALID_KEY_TYPE(
326:                                    keytype.toString(), null));
327:                    throw new WSTrustException(
328:                            LogStringsMessages.WST_0025_INVALID_KEY_TYPE(
329:                                    keytype.toString(), null));
330:                } else {
331:                    this .keyType = keytype;
332:                    final JAXBElement<String> ktElement = (new ObjectFactory())
333:                            .createKeyType(keyType.toString());
334:                    getAny().add(ktElement);
335:                }
336:            }
337:
338:            public URI getKeyType() {
339:                return keyType;
340:            }
341:
342:            public final void setKeySize(@NotNull
343:            final long size) {
344:                keySize = size;
345:                final JAXBElement<Long> ksElement = (new ObjectFactory())
346:                        .createKeySize(size);
347:                getAny().add(ksElement);
348:            }
349:
350:            public long getKeySize() {
351:                return keySize;
352:            }
353:
354:            public final void setSignatureAlgorithm(@NotNull
355:            final URI algorithm) {
356:                signatureAlgorithm = algorithm;
357:                final JAXBElement<String> signElement = (new ObjectFactory())
358:                        .createSignatureAlgorithm(algorithm.toString());
359:                getAny().add(signElement);
360:            }
361:
362:            public URI getSignatureAlgorithm() {
363:                return signatureAlgorithm;
364:            }
365:
366:            public final void setEncryptionAlgorithm(@NotNull
367:            final URI algorithm) {
368:                encryptionAlgorithm = algorithm;
369:                final JAXBElement<String> encElement = (new ObjectFactory())
370:                        .createEncryptionAlgorithm(algorithm.toString());
371:                getAny().add(encElement);
372:            }
373:
374:            public URI getEncryptionAlgorithm() {
375:                return encryptionAlgorithm;
376:            }
377:
378:            public final void setCanonicalizationAlgorithm(@NotNull
379:            final URI algorithm) {
380:                canonAlgorithm = algorithm;
381:                final JAXBElement<String> canonElement = (new ObjectFactory())
382:                        .createCanonicalizationAlgorithm(algorithm.toString());
383:                getAny().add(canonElement);
384:            }
385:
386:            public URI getCanonicalizationAlgorithm() {
387:                return canonAlgorithm;
388:            }
389:
390:            public final void setUseKey(final UseKey useKey) {
391:                this .useKey = useKey;
392:                final JAXBElement<UseKeyType> ukElement = (new ObjectFactory())
393:                        .createUseKey((UseKeyType) useKey);
394:                getAny().add(ukElement);
395:            }
396:
397:            public UseKey getUseKey() {
398:                return useKey;
399:            }
400:
401:            public final void setProofEncryption(
402:                    final ProofEncryption proofEncryption) {
403:                this .proofEncryption = proofEncryption;
404:                final JAXBElement<ProofEncryptionType> proofElement = (new ObjectFactory())
405:                        .createProofEncryption((ProofEncryptionType) proofEncryption);
406:                getAny().add(proofElement);
407:            }
408:
409:            public ProofEncryption getProofEncryption() {
410:                return proofEncryption;
411:            }
412:
413:            public final void setComputedKeyAlgorithm(@NotNull
414:            final URI algorithm) {
415:                if (algorithm != null) {
416:                    final String ckaString = algorithm.toString();
417:                    if (!ckaString.equalsIgnoreCase(WSTrustConstants.CK_HASH)
418:                            && !ckaString
419:                                    .equalsIgnoreCase(WSTrustConstants.CK_PSHA1)) {
420:                        throw new RuntimeException(
421:                                "Invalid Computed Key Algorithm specified");
422:                    }
423:                    computedKeyAlgorithm = algorithm;
424:                    final JAXBElement<String> ckaElement = (new ObjectFactory())
425:                            .createComputedKeyAlgorithm(ckaString);
426:                    getAny().add(ckaElement);
427:                }
428:            }
429:
430:            public URI getComputedKeyAlgorithm() {
431:                return computedKeyAlgorithm;
432:            }
433:
434:            public final void setEncryption(final Encryption enc) {
435:                this .encryption = enc;
436:                final JAXBElement<EncryptionType> encElement = (new ObjectFactory())
437:                        .createEncryption((EncryptionType) enc);
438:                getAny().add(encElement);
439:            }
440:
441:            public Encryption getEncryption() {
442:                return encryption;
443:            }
444:
445:            public final void setSignWith(final URI algorithm) {
446:                signWith = algorithm;
447:                final JAXBElement<String> sElement = (new ObjectFactory())
448:                        .createSignWith(algorithm.toString());
449:                getAny().add(sElement);
450:            }
451:
452:            public URI getSignWith() {
453:                return signWith;
454:            }
455:
456:            public final void setEncryptWith(@NotNull
457:            final URI algorithm) {
458:                encryptWith = algorithm;
459:                final JAXBElement<String> sElement = (new ObjectFactory())
460:                        .createEncryptWith(algorithm.toString());
461:                getAny().add(sElement);
462:            }
463:
464:            public URI getEncryptWith() {
465:                return encryptWith;
466:            }
467:
468:            public final void setDelegateTo(final DelegateTo to) {
469:                this .delegateTo = to;
470:                final JAXBElement<DelegateToType> dtElement = (new ObjectFactory())
471:                        .createDelegateTo((DelegateToType) to);
472:                getAny().add(dtElement);
473:            }
474:
475:            public DelegateTo getDelegateTo() {
476:                return delegateTo;
477:            }
478:
479:            public final void setForwardable(final boolean flag) {
480:                forwardable = flag;
481:                final JAXBElement<Boolean> forward = (new ObjectFactory())
482:                        .createForwardable(flag);
483:                getAny().add(forward);
484:            }
485:
486:            public boolean getForwardable() {
487:                return forwardable;
488:            }
489:
490:            public final void setDelegatable(final boolean flag) {
491:                this .delegatable = flag;
492:                final JAXBElement<Boolean> del = (new ObjectFactory())
493:                        .createDelegatable(flag);
494:                getAny().add(del);
495:            }
496:
497:            public boolean getDelegatable() {
498:                return delegatable;
499:            }
500:
501:            public final void setPolicy(final Policy policy) {
502:                this .policy = policy;
503:                getAny().add(policy);
504:            }
505:
506:            public Policy getPolicy() {
507:                return policy;
508:            }
509:
510:            public final void setPolicyReference(final PolicyReference policyRef) {
511:                this .policyRef = policyRef;
512:                getAny().add(policyRef);
513:            }
514:
515:            public PolicyReference getPolicyReference() {
516:                return policyRef;
517:            }
518:
519:            public AllowPostdating getAllowPostdating() {
520:                return apd;
521:            }
522:
523:            public final void setAllowPostdating(
524:                    final AllowPostdating allowPostdating) {
525:                apd = allowPostdating;
526:                final JAXBElement<AllowPostdatingType> allowPd = (new ObjectFactory())
527:                        .createAllowPostdating((AllowPostdatingType) apd);
528:                getAny().add(allowPd);
529:            }
530:
531:            public final void setSignChallengeResponse(
532:                    final SignChallengeResponse challenge) {
533:                signChallengeRes = challenge;
534:                final JAXBElement<SignChallengeType> challengeType = (new ObjectFactory())
535:                        .createSignChallengeResponse((SignChallengeType) challenge);
536:                getAny().add(challengeType);
537:            }
538:
539:            public SignChallengeResponse getSignChallengeResponse() {
540:                return signChallengeRes;
541:            }
542:
543:            public final void setAuthenticator(final Authenticator authenticator) {
544:                this .authenticator = authenticator;
545:                final JAXBElement<AuthenticatorType> authType = (new ObjectFactory())
546:                        .createAuthenticator((AuthenticatorType) authenticator);
547:                getAny().add(authType);
548:            }
549:
550:            public Authenticator getAuthenticator() {
551:                return authenticator;
552:            }
553:
554:            public final void setRequestedProofToken(
555:                    final RequestedProofToken proofToken) {
556:                requestedProofToken = proofToken;
557:                final JAXBElement<RequestedProofTokenType> pElement = (new ObjectFactory())
558:                        .createRequestedProofToken((RequestedProofTokenType) proofToken);
559:                getAny().add(pElement);
560:            }
561:
562:            public RequestedProofToken getRequestedProofToken() {
563:                return requestedProofToken;
564:            }
565:
566:            public final void setRequestedSecurityToken(
567:                    final RequestedSecurityToken securityToken) {
568:                requestedSecToken = securityToken;
569:                final JAXBElement<RequestedSecurityTokenType> rstElement = (new ObjectFactory())
570:                        .createRequestedSecurityToken((RequestedSecurityTokenType) securityToken);
571:
572:                getAny().add(rstElement);
573:            }
574:
575:            public RequestedSecurityToken getRequestedSecurityToken() {
576:                return requestedSecToken;
577:            }
578:
579:            public final void setRequestedAttachedReference(
580:                    final RequestedAttachedReference reference) {
581:                requestedAttachedReference = reference;
582:                final JAXBElement<RequestedReferenceType> raElement = (new ObjectFactory())
583:                        .createRequestedAttachedReference((RequestedReferenceType) reference);
584:                getAny().add(raElement);
585:            }
586:
587:            public RequestedAttachedReference getRequestedAttachedReference() {
588:                return requestedAttachedReference;
589:            }
590:
591:            public final void setRequestedUnattachedReference(
592:                    final RequestedUnattachedReference reference) {
593:                requestedUnattachedReference = reference;
594:                final JAXBElement<RequestedReferenceType> raElement = (new ObjectFactory())
595:                        .createRequestedUnattachedReference((RequestedReferenceType) reference);
596:                getAny().add(raElement);
597:            }
598:
599:            public RequestedUnattachedReference getRequestedUnattachedReference() {
600:                return requestedUnattachedReference;
601:            }
602:
603:            public RequestSecurityTokenResponseImpl(
604:                    RequestSecurityTokenResponseType rstrType)
605:                    throws URISyntaxException, WSTrustException {
606:
607:                this .context = rstrType.getContext();
608:                final List<Object> list = rstrType.getAny();
609:                for (int i = 0; i < list.size(); i++) {
610:
611:                    if (list.get(i) instanceof  AppliesTo) {
612:                        setAppliesTo((AppliesTo) list.get(i));
613:                        continue;
614:                    }
615:
616:                    final JAXBElement obj = (JAXBElement) list.get(i);
617:
618:                    final String local = obj.getName().getLocalPart();
619:                    if (local.equalsIgnoreCase("KeySize")) {
620:                        setKeySize((Long) obj.getValue());
621:                    } else if (local.equalsIgnoreCase("KeyType")) {
622:                        setKeyType(new URI((String) obj.getValue()));
623:                    } else if (local.equalsIgnoreCase("ComputedKeyAlgorithm")) {
624:                        setComputedKeyAlgorithm(new URI((String) obj.getValue()));
625:                    } else if (local.equalsIgnoreCase("TokenType")) {
626:                        setTokenType(new URI((String) obj.getValue()));
627:                    } else if (local.equalsIgnoreCase("AuthenticationType")) {
628:                        setAuthenticationType(new URI((String) obj.getValue()));
629:                    } else if (local.equalsIgnoreCase("Lifetime")) {
630:                        final LifetimeType ltType = (LifetimeType) obj
631:                                .getValue();
632:                        setLifetime(new LifetimeImpl(ltType));
633:                    } else if (local.equalsIgnoreCase("Entropy")) {
634:                        final EntropyType eType = (EntropyType) obj.getValue();
635:                        setEntropy(new EntropyImpl(eType));
636:                    } else if (local.equalsIgnoreCase("Forwardable")) {
637:                        setForwardable((Boolean) obj.getValue());
638:                    } else if (local.equalsIgnoreCase("Delegatable")) {
639:                        setDelegatable((Boolean) obj.getValue());
640:                    } else if (local.equalsIgnoreCase("SignWith")) {
641:                        setSignWith(new URI((String) obj.getValue()));
642:                    } else if (local.equalsIgnoreCase("EncryptWith")) {
643:                        setEncryptWith(new URI((String) obj.getValue()));
644:                    } else if (local.equalsIgnoreCase("SignatureAlgorithm")) {
645:                        setSignatureAlgorithm(new URI((String) obj.getValue()));
646:                    } else if (local.equalsIgnoreCase("EncryptionAlgorithm")) {
647:                        setEncryptionAlgorithm(new URI((String) obj.getValue()));
648:                    } else if (local
649:                            .equalsIgnoreCase("CanonicalizationAlgorithm")) {
650:                        setCanonicalizationAlgorithm(new URI((String) obj
651:                                .getValue()));
652:                    } else if (local.equalsIgnoreCase("AllowPostdating")) {
653:                        setAllowPostdating(new AllowPostdatingImpl());
654:                    } else if (local.equalsIgnoreCase("SignChallenge")) {
655:                        setSignChallenge(new SignChallengeImpl());
656:                    } else if (local.equalsIgnoreCase("SignChallengeResponse")) {
657:                        setSignChallengeResponse(new SignChallengeResponseImpl());
658:                    } else if (local.equalsIgnoreCase("BinaryExchange")) {
659:                        final BinaryExchangeType bcType = (BinaryExchangeType) obj
660:                                .getValue();
661:                        setBinaryExchange(new BinaryExchangeImpl(bcType));
662:                    } else if (local.equalsIgnoreCase("Issuer")) {
663:                        /* EndpointReferenceImpl isType = (EndpointReferenceImpl)obj.getValue();
664:                        setIssuer(new IssuerImpl(isType));*/
665:                    } else if (local.equalsIgnoreCase("Authenticator")) {
666:                        final AuthenticatorType aType = (AuthenticatorType) obj
667:                                .getValue();
668:                        setAuthenticator(new AuthenticatorImpl(aType));
669:                    } else if (local.equalsIgnoreCase("Renewing")) {
670:                        setRenewable(new RenewingImpl());
671:                    } else if (local.equalsIgnoreCase("ProofEncryption")) {
672:                        final ProofEncryptionType peType = (ProofEncryptionType) obj
673:                                .getValue();
674:                        setProofEncryption(new ProofEncryptionImpl(peType));
675:                    } else if (local.equalsIgnoreCase("Policy")) {
676:                        setPolicy((Policy) obj.getValue());
677:                    } else if (local.equalsIgnoreCase("PolicyReference")) {
678:                        setPolicyReference((PolicyReference) obj.getValue());
679:                    } else if (local.equalsIgnoreCase("AppliesTo")) {
680:                        setAppliesTo((AppliesTo) obj.getValue());
681:                    } else if (local.equalsIgnoreCase("OnBehalfOf")) {
682:                        this .obo = (OnBehalfOf) obj.getValue();
683:                    } else if (local.equalsIgnoreCase("Encryption")) {
684:                        final EncryptionType encType = (EncryptionType) obj
685:                                .getValue();
686:                        setEncryption(new EncryptionImpl(encType));
687:                    } else if (local.equalsIgnoreCase("UseKey")) {
688:                        final UseKeyType ukType = (UseKeyType) obj.getValue();
689:                        setUseKey(new UseKeyImpl(ukType));
690:                    } else if (local.equalsIgnoreCase("Status")) {
691:                        setStatus((Status) obj.getValue());
692:                    } else if (local.equalsIgnoreCase("DelegateTo")) {
693:                        final DelegateToType dtType = (DelegateToType) obj
694:                                .getValue();
695:                        setDelegateTo(new DelegateToImpl(dtType));
696:                    } else if (local.equalsIgnoreCase("RequestedProofToken")) {
697:                        final RequestedProofTokenType rptType = (RequestedProofTokenType) obj
698:                                .getValue();
699:                        setRequestedProofToken(new RequestedProofTokenImpl(
700:                                rptType));
701:                    } else if (local.equalsIgnoreCase("RequestedSecurityToken")) {
702:                        final RequestedSecurityTokenType rdstType = (RequestedSecurityTokenType) obj
703:                                .getValue();
704:                        setRequestedSecurityToken(new RequestedSecurityTokenImpl(
705:                                rdstType));
706:                    } else if (local
707:                            .equalsIgnoreCase("RequestedAttachedReference")) {
708:                        final RequestedReferenceType rarType = (RequestedReferenceType) obj
709:                                .getValue();
710:                        setRequestedAttachedReference(new RequestedAttachedReferenceImpl(
711:                                rarType));
712:                    } else if (local
713:                            .equalsIgnoreCase("RequestedUnattachedReference")) {
714:                        final RequestedReferenceType rarType = (RequestedReferenceType) obj
715:                                .getValue();
716:                        setRequestedUnattachedReference(new RequestedUnattachedReferenceImpl(
717:                                rarType));
718:                    } else if (local
719:                            .equalsIgnoreCase("RequestedTokenCancelled")) {
720:                        setRequestedTokenCancelled(new RequestedTokenCancelledImpl());
721:                    }
722:                }
723:            }
724:
725:        }
w_w___w_.ja__v___a2_s__.___com_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.