001: /*
002: * $Id: RequestSecurityTokenImpl.java,v 1.13 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.api.security.trust.Claims;
049: import com.sun.xml.ws.api.security.trust.WSTrustException;
050: import com.sun.xml.ws.policy.impl.bindings.AppliesTo;
051: import com.sun.xml.ws.policy.Policy;
052: import com.sun.xml.ws.policy.impl.bindings.PolicyReference;
053: import javax.xml.bind.JAXBElement;
054:
055: import com.sun.xml.ws.security.trust.WSTrustConstants;
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.BinaryExchangeType;
060: import com.sun.xml.ws.security.trust.impl.bindings.CancelTargetType;
061: import com.sun.xml.ws.security.trust.impl.bindings.RequestSecurityTokenType;
062: import com.sun.xml.ws.security.trust.impl.bindings.LifetimeType;
063: import com.sun.xml.ws.security.trust.impl.bindings.EntropyType;
064: import com.sun.xml.ws.security.trust.impl.bindings.ClaimsType;
065: import com.sun.xml.ws.security.trust.impl.bindings.DelegateToType;
066: import com.sun.xml.ws.security.trust.impl.bindings.EncryptionType;
067: import com.sun.xml.ws.security.trust.impl.bindings.OnBehalfOfType;
068: import com.sun.xml.ws.security.trust.impl.bindings.ObjectFactory;
069: import com.sun.xml.ws.security.trust.impl.bindings.ParticipantsType;
070: import com.sun.xml.ws.security.trust.impl.bindings.ProofEncryptionType;
071: import com.sun.xml.ws.security.trust.impl.bindings.RenewTargetType;
072: import com.sun.xml.ws.security.trust.impl.bindings.RenewingType;
073: import com.sun.xml.ws.security.trust.impl.bindings.SignChallengeType;
074: import com.sun.xml.ws.security.trust.impl.bindings.UseKeyType;
075:
076: import java.util.logging.Level;
077: import java.util.logging.Logger;
078: import com.sun.xml.ws.security.trust.logging.LogDomainConstants;
079:
080: import com.sun.istack.NotNull;
081:
082: import com.sun.xml.ws.security.trust.logging.LogStringsMessages;
083:
084: /**
085: * Implementation of the RequestSecurityToken interface.
086: *
087: * @author Manveen Kaur
088: */
089: public class RequestSecurityTokenImpl extends RequestSecurityTokenType
090: implements RequestSecurityToken {
091:
092: private static final Logger log = Logger.getLogger(
093: LogDomainConstants.TRUST_IMPL_DOMAIN,
094: LogDomainConstants.TRUST_IMPL_DOMAIN_BUNDLE);
095:
096: private Claims claims = null;
097: private Participants participants = null;
098: private URI tokenType = null;
099:
100: private URI requestType = null;
101:
102: private long keySize = 0;
103: private URI keyType = null;
104: private URI computedKeyAlgorithm = null;
105:
106: private URI signWith = null;
107: private URI encryptWith = null;
108: private URI authenticationType = null;
109: private URI signatureAlgorithm = null;
110: private URI encryptionAlgorithm = null;
111: private URI canonAlgorithm = null;
112:
113: private Lifetime lifetime = null;
114: private Entropy entropy = null;
115: private AppliesTo appliesTo = null;
116: private OnBehalfOf obo = null;
117: private SignChallenge signChallenge = null;
118: private Encryption encryption = null;
119: private UseKey useKey = null;
120: private DelegateTo delegateTo = null;
121: private RenewTarget renewTarget = null;
122: private CancelTarget cancelTarget = null;
123:
124: private AllowPostdating apd = null;
125: private BinaryExchange binaryExchange = null;
126: private Issuer issuer = null;
127: private Renewing renewable = null;
128: private ProofEncryption proofEncryption = null;
129:
130: private boolean forwardable = true;
131: private boolean delegatable = false;
132:
133: private Policy policy = null;
134: private PolicyReference policyRef = null;
135:
136: public RequestSecurityTokenImpl() {
137: setRequestType(URI.create(WSTrustConstants.ISSUE_REQUEST));
138: }
139:
140: public RequestSecurityTokenImpl(URI tokenType, URI requestType) {
141: setTokenType(tokenType);
142: setRequestType(requestType);
143: }
144:
145: public RequestSecurityTokenImpl(URI tokenType, URI requestType,
146: URI context, AppliesTo scopes, Claims claims,
147: Entropy entropy, Lifetime lifetime, URI algorithm) {
148: setTokenType(tokenType);
149: setRequestType(requestType);
150: if (context != null) {
151: setContext(context.toString());
152: }
153: if (scopes != null) {
154: setAppliesTo(scopes);
155: }
156: if (claims != null) {
157: setClaims(claims);
158: }
159: if (entropy != null) {
160: setEntropy(entropy);
161: }
162: if (lifetime != null) {
163: setLifetime(lifetime);
164: }
165: if (algorithm != null) {
166: setComputedKeyAlgorithm(algorithm);
167: }
168: }
169:
170: public RequestSecurityTokenImpl(URI tokenType, URI requestType,
171: URI context, RenewTarget target, AllowPostdating apd,
172: Renewing renewingInfo) {
173: setTokenType(tokenType);
174: setRequestType(requestType);
175: if (context != null) {
176: setContext(context.toString());
177: }
178: if (context != null) {
179: setContext(context.toString());
180: }
181: if (target != null) {
182: setRenewTarget(target);
183: }
184: if (apd != null) {
185: setAllowPostdating(apd);
186: }
187: if (renewingInfo != null) {
188: setRenewable(renewingInfo);
189: }
190: }
191:
192: public RequestSecurityTokenImpl(URI tokenType, URI requestType,
193: CancelTarget cancel) {
194: setTokenType(tokenType);
195: setRequestType(requestType);
196: setCancelTarget(cancel);
197: }
198:
199: public final void setClaims(final Claims claims) {
200: this .claims = claims;
201: final JAXBElement<ClaimsType> cElement = (new ObjectFactory())
202: .createClaims((ClaimsType) claims);
203: getAny().add(cElement);
204: }
205:
206: public Claims getClaims() {
207: return claims;
208: }
209:
210: public final void setCancelTarget(final CancelTarget cTarget) {
211: this .cancelTarget = cTarget;
212: final JAXBElement<CancelTargetType> ctElement = (new ObjectFactory())
213: .createCancelTarget((CancelTargetType) cTarget);
214: getAny().add(ctElement);
215: }
216:
217: public CancelTarget getCancelTarget() {
218: return cancelTarget;
219: }
220:
221: public final void setRenewTarget(final RenewTarget target) {
222: this .renewTarget = target;
223: final JAXBElement<RenewTargetType> rElement = (new ObjectFactory())
224: .createRenewTarget((RenewTargetType) target);
225: getAny().add(rElement);
226: }
227:
228: public RenewTarget getRenewTarget() {
229: return renewTarget;
230: }
231:
232: public final void setParticipants(final Participants participants) {
233: this .participants = participants;
234: final JAXBElement<ParticipantsType> rElement = (new ObjectFactory())
235: .createParticipants((ParticipantsType) participants);
236: getAny().add(rElement);
237: }
238:
239: public Participants getParticipants() {
240: return participants;
241: }
242:
243: public URI getTokenType() {
244: return tokenType;
245: }
246:
247: public final void setTokenType(final URI tokenType) {
248: if (tokenType != null) {
249: this .tokenType = tokenType;
250: final JAXBElement<String> ttElement = (new ObjectFactory())
251: .createTokenType(tokenType.toString());
252: getAny().add(ttElement);
253: }
254: }
255:
256: public URI getRequestType() {
257: return requestType;
258: }
259:
260: public final void setRequestType(@NotNull
261: final URI requestType) {
262:
263: final String rtString = requestType.toString();
264: if (!rtString.equalsIgnoreCase(WSTrustConstants.ISSUE_REQUEST)
265: && !rtString
266: .equalsIgnoreCase(WSTrustConstants.CANCEL_REQUEST)
267: && !rtString
268: .equalsIgnoreCase(WSTrustConstants.KEY_EXCHANGE_REQUEST)
269: && !rtString
270: .equalsIgnoreCase(WSTrustConstants.RENEW_REQUEST)
271: && !rtString
272: .equalsIgnoreCase(WSTrustConstants.VALIDATE_REQUEST)) {
273: log.log(Level.SEVERE, LogStringsMessages
274: .WST_0024_INVALID_REQUEST_TYPE(rtString));
275: throw new RuntimeException(LogStringsMessages
276: .WST_0024_INVALID_REQUEST_TYPE(rtString));
277: }
278: this .requestType = requestType;
279: final JAXBElement<String> rtElement = (new ObjectFactory())
280: .createRequestType(rtString);
281: getAny().add(rtElement);
282: }
283:
284: public Lifetime getLifetime() {
285: return lifetime;
286: }
287:
288: public final void setLifetime(final Lifetime lifetime) {
289: this .lifetime = lifetime;
290: final JAXBElement<LifetimeType> ltElement = (new ObjectFactory())
291: .createLifetime((LifetimeType) lifetime);
292: getAny().add(ltElement);
293: }
294:
295: public Entropy getEntropy() {
296: return entropy;
297: }
298:
299: public final void setEntropy(final Entropy entropy) {
300: this .entropy = entropy;
301: final JAXBElement<EntropyType> etElement = (new ObjectFactory())
302: .createEntropy((EntropyType) entropy);
303: getAny().add(etElement);
304: }
305:
306: public final void setAppliesTo(final AppliesTo appliesTo) {
307: getAny().add(appliesTo);
308: this .appliesTo = appliesTo;
309: }
310:
311: public AppliesTo getAppliesTo() {
312: return appliesTo;
313: }
314:
315: public final void setOnBehalfOf(final OnBehalfOf onBehalfOf) {
316: obo = onBehalfOf;
317: }
318:
319: public OnBehalfOf getOnBehalfOf() {
320: return obo;
321: }
322:
323: public final void setIssuer(final Issuer issuer) {
324: this .issuer = issuer;
325: /*JAXBElement<EndpointReferenceImpl> eprType =
326: (new com.sun.xml.ws.security.trust.impl.bindings.ObjectFactory()).createIssuer((EndpointReferenceImpl)issuer);
327: getAny().add(eprType);*/
328: }
329:
330: public Issuer getIssuer() {
331: return issuer;
332: }
333:
334: public final void setRenewable(final Renewing renew) {
335: renewable = renew;
336: final JAXBElement<RenewingType> renewType = (new ObjectFactory())
337: .createRenewing((RenewingType) renew);
338: getAny().add(renewType);
339: }
340:
341: public Renewing getRenewable() {
342: return renewable;
343: }
344:
345: public final void setSignChallenge(final SignChallenge challenge) {
346: signChallenge = challenge;
347: final JAXBElement<SignChallengeType> challengeType = (new ObjectFactory())
348: .createSignChallenge((SignChallengeType) challenge);
349: getAny().add(challengeType);
350: }
351:
352: public SignChallenge getSignChallenge() {
353: return signChallenge;
354: }
355:
356: public final void setBinaryExchange(final BinaryExchange exchange) {
357: binaryExchange = exchange;
358: final JAXBElement<BinaryExchangeType> exchangeType = (new ObjectFactory())
359: .createBinaryExchange((BinaryExchangeType) exchange);
360: getAny().add(exchangeType);
361: }
362:
363: public BinaryExchange getBinaryExchange() {
364: return binaryExchange;
365: }
366:
367: public final void setAuthenticationType(final URI uri) {
368: this .authenticationType = uri;
369: final JAXBElement<String> atElement = (new ObjectFactory())
370: .createAuthenticationType(uri.toString());
371: getAny().add(atElement);
372: }
373:
374: public URI getAuthenticationType() {
375: return authenticationType;
376: }
377:
378: public final void setKeyType(@NotNull
379: final URI keytype) throws WSTrustException {
380:
381: if (!(keytype.toString().equalsIgnoreCase(
382: RequestSecurityToken.PUBLIC_KEY_TYPE) || keytype
383: .toString().equalsIgnoreCase(
384: RequestSecurityToken.SYMMETRIC_KEY_TYPE))) {
385: log.log(Level.SEVERE,
386: LogStringsMessages.WST_0025_INVALID_KEY_TYPE(
387: keytype.toString(), null));
388: throw new WSTrustException(
389: LogStringsMessages.WST_0025_INVALID_KEY_TYPE(
390: keytype.toString(), null));
391: } else {
392: this .keyType = keytype;
393: final JAXBElement<String> ktElement = (new ObjectFactory())
394: .createKeyType(keyType.toString());
395: getAny().add(ktElement);
396: }
397: }
398:
399: public URI getKeyType() {
400: return keyType;
401: }
402:
403: public final void setKeySize(final long size) {
404: keySize = size;
405: final JAXBElement<Long> ksElement = (new ObjectFactory())
406: .createKeySize(size);
407: getAny().add(ksElement);
408: }
409:
410: public long getKeySize() {
411: return keySize;
412: }
413:
414: public final void setSignatureAlgorithm(final URI algorithm) {
415: signatureAlgorithm = algorithm;
416: final JAXBElement<String> signElement = (new ObjectFactory())
417: .createSignatureAlgorithm(algorithm.toString());
418: getAny().add(signElement);
419: }
420:
421: public URI getSignatureAlgorithm() {
422: return signatureAlgorithm;
423: }
424:
425: public final void setEncryptionAlgorithm(final URI algorithm) {
426: encryptionAlgorithm = algorithm;
427: final JAXBElement<String> encElement = (new ObjectFactory())
428: .createEncryptionAlgorithm(algorithm.toString());
429: getAny().add(encElement);
430: }
431:
432: public URI getEncryptionAlgorithm() {
433: return encryptionAlgorithm;
434: }
435:
436: public final void setCanonicalizationAlgorithm(final URI algorithm) {
437: canonAlgorithm = algorithm;
438: final JAXBElement<String> canonElement = (new ObjectFactory())
439: .createCanonicalizationAlgorithm(algorithm.toString());
440: getAny().add(canonElement);
441: }
442:
443: public URI getCanonicalizationAlgorithm() {
444: return canonAlgorithm;
445: }
446:
447: public final void setUseKey(final UseKey useKey) {
448: this .useKey = useKey;
449: final JAXBElement<UseKeyType> ukElement = (new ObjectFactory())
450: .createUseKey((UseKeyType) useKey);
451: getAny().add(ukElement);
452: }
453:
454: public UseKey getUseKey() {
455: return useKey;
456: }
457:
458: public final void setProofEncryption(
459: final ProofEncryption proofEncryption) {
460: this .proofEncryption = proofEncryption;
461: final JAXBElement<ProofEncryptionType> proofElement = (new ObjectFactory())
462: .createProofEncryption((ProofEncryptionType) proofEncryption);
463: getAny().add(proofElement);
464: }
465:
466: public ProofEncryption getProofEncryption() {
467: return proofEncryption;
468: }
469:
470: public final void setComputedKeyAlgorithm(@NotNull
471: final URI algorithm) {
472:
473: if (algorithm != null) {
474: final String ckaString = algorithm.toString();
475: if (!ckaString.equalsIgnoreCase(WSTrustConstants.CK_HASH)
476: && !ckaString
477: .equalsIgnoreCase(WSTrustConstants.CK_PSHA1)) {
478: log.log(Level.SEVERE, LogStringsMessages
479: .WST_0026_INVALID_CK_ALGORITHM(ckaString));
480: throw new RuntimeException(LogStringsMessages
481: .WST_0026_INVALID_CK_ALGORITHM(ckaString));
482: }
483: computedKeyAlgorithm = algorithm;
484: final JAXBElement<String> ckaElement = (new ObjectFactory())
485: .createComputedKeyAlgorithm(ckaString);
486: getAny().add(ckaElement);
487: }
488: }
489:
490: public URI getComputedKeyAlgorithm() {
491: return computedKeyAlgorithm;
492: }
493:
494: public final void setEncryption(final Encryption enc) {
495: this .encryption = enc;
496: final JAXBElement<EncryptionType> encElement = (new ObjectFactory())
497: .createEncryption((EncryptionType) enc);
498: getAny().add(encElement);
499: }
500:
501: public Encryption getEncryption() {
502: return encryption;
503: }
504:
505: public final void setSignWith(final URI algorithm) {
506: signWith = algorithm;
507: final JAXBElement<String> sElement = (new ObjectFactory())
508: .createSignWith(algorithm.toString());
509: getAny().add(sElement);
510: }
511:
512: public URI getSignWith() {
513: return signWith;
514: }
515:
516: public final void setEncryptWith(final URI algorithm) {
517: encryptWith = algorithm;
518: final JAXBElement<String> sElement = (new ObjectFactory())
519: .createEncryptWith(algorithm.toString());
520: getAny().add(sElement);
521: }
522:
523: public URI getEncryptWith() {
524: return encryptWith;
525: }
526:
527: public final void setDelegateTo(final DelegateTo delegateTo) {
528: this .delegateTo = delegateTo;
529: final JAXBElement<DelegateToType> dtElement = (new ObjectFactory())
530: .createDelegateTo((DelegateToType) delegateTo);
531: getAny().add(dtElement);
532: }
533:
534: public DelegateTo getDelegateTo() {
535: return delegateTo;
536: }
537:
538: public final void setForwardable(final boolean flag) {
539: forwardable = flag;
540: final JAXBElement<Boolean> forward = (new ObjectFactory())
541: .createForwardable(flag);
542: getAny().add(forward);
543: }
544:
545: public boolean getForwardable() {
546: return forwardable;
547: }
548:
549: public final void setDelegatable(final boolean flag) {
550: delegatable = flag;
551: final JAXBElement<Boolean> del = (new ObjectFactory())
552: .createDelegatable(flag);
553: getAny().add(del);
554: }
555:
556: public boolean getDelegatable() {
557: return delegatable;
558: }
559:
560: public final void setPolicy(final Policy policy) {
561: this .policy = policy;
562: getAny().add(policy);
563: }
564:
565: public Policy getPolicy() {
566: return policy;
567: }
568:
569: public final void setPolicyReference(final PolicyReference policyRef) {
570: this .policyRef = policyRef;
571: getAny().add(policyRef);
572: }
573:
574: public PolicyReference getPolicyReference() {
575: return policyRef;
576: }
577:
578: public AllowPostdating getAllowPostdating() {
579: return apd;
580: }
581:
582: public final void setAllowPostdating(
583: final AllowPostdating allowPostdating) {
584: apd = allowPostdating;
585: final JAXBElement<AllowPostdatingType> allowPd = (new ObjectFactory())
586: .createAllowPostdating((AllowPostdatingType) apd);
587: getAny().add(allowPd);
588: }
589:
590: public RequestSecurityTokenImpl(
591: final RequestSecurityTokenType rstType)
592: throws URISyntaxException, WSTrustException {
593: this .context = rstType.getContext();
594: final List<Object> list = rstType.getAny();
595: for (int i = 0; i < list.size(); i++) {
596: if (list.get(i) instanceof AppliesTo) {
597: setAppliesTo((AppliesTo) list.get(i));
598: continue;
599: }
600: if (list.get(i) instanceof JAXBElement) {
601: final JAXBElement obj = (JAXBElement) list.get(i);
602:
603: final String local = obj.getName().getLocalPart();
604: if (local.equalsIgnoreCase("RequestType")) {
605: setRequestType(new URI((String) obj.getValue()));
606: } else if (local.equalsIgnoreCase("KeySize")) {
607: setKeySize((Long) obj.getValue());
608: } else if (local.equalsIgnoreCase("KeyType")) {
609: setKeyType(new URI((String) obj.getValue()));
610: } else if (local
611: .equalsIgnoreCase("ComputedKeyAlgorithm")) {
612: setComputedKeyAlgorithm(new URI((String) obj
613: .getValue()));
614: } else if (local.equalsIgnoreCase("TokenType")) {
615: setTokenType(new URI((String) obj.getValue()));
616: } else if (local.equalsIgnoreCase("AuthenticationType")) {
617: setAuthenticationType(new URI((String) obj
618: .getValue()));
619: } else if (local.equalsIgnoreCase("Lifetime")) {
620: final LifetimeType ltType = (LifetimeType) obj
621: .getValue();
622: setLifetime(new LifetimeImpl(ltType.getCreated(),
623: ltType.getExpires()));
624: } else if (local.equalsIgnoreCase("Entropy")) {
625: final EntropyType eType = (EntropyType) obj
626: .getValue();
627: setEntropy(new EntropyImpl(eType));
628: } else if (local.equalsIgnoreCase("Forwardable")) {
629: setForwardable((Boolean) obj.getValue());
630: } else if (local.equalsIgnoreCase("Delegatable")) {
631: setDelegatable((Boolean) obj.getValue());
632: } else if (local.equalsIgnoreCase("SignWith")) {
633: setSignWith(new URI((String) obj.getValue()));
634: } else if (local.equalsIgnoreCase("EncryptWith")) {
635: setEncryptWith(new URI((String) obj.getValue()));
636: } else if (local.equalsIgnoreCase("SignatureAlgorithm")) {
637: setSignatureAlgorithm(new URI((String) obj
638: .getValue()));
639: } else if (local
640: .equalsIgnoreCase("EncryptionAlgorithm")) {
641: setEncryptionAlgorithm(new URI((String) obj
642: .getValue()));
643: } else if (local
644: .equalsIgnoreCase("CanonicalizationAlgorithm")) {
645: setCanonicalizationAlgorithm(new URI((String) obj
646: .getValue()));
647: } else if (local.equalsIgnoreCase("AllowPostdating")) {
648: setAllowPostdating(new AllowPostdatingImpl());
649: } else if (local.equalsIgnoreCase("SignChallenge")) {
650: setSignChallenge(new SignChallengeImpl());
651: } else if (local.equalsIgnoreCase("BinaryExchange")) {
652: final BinaryExchangeType bcType = (BinaryExchangeType) obj
653: .getValue();
654: setBinaryExchange(new BinaryExchangeImpl(bcType));
655: } else if (local.equalsIgnoreCase("Issuer")) {
656: // EndpointReferenceImpl isType = (EndpointReferenceImpl)obj.getValue();
657: // setIssuer(new IssuerImpl(isType));
658: } else if (local.equalsIgnoreCase("Claims")) {
659: final ClaimsType cType = (ClaimsType) obj
660: .getValue();
661: setClaims(new ClaimsImpl(cType));
662: } else if (local.equalsIgnoreCase("Participants")) {
663: final ParticipantsType psType = (ParticipantsType) obj
664: .getValue();
665: setParticipants(new ParticipantsImpl(psType));
666: } else if (local.equalsIgnoreCase("Renewing")) {
667: setRenewable(new RenewingImpl());
668: } else if (local.equalsIgnoreCase("ProofEncryption")) {
669: final ProofEncryptionType peType = (ProofEncryptionType) obj
670: .getValue();
671: setProofEncryption(new ProofEncryptionImpl(peType));
672: } else if (local.equalsIgnoreCase("Policy")) {
673: setPolicy((Policy) obj.getValue());
674: } else if (local.equalsIgnoreCase("PolicyReference")) {
675: setPolicyReference((PolicyReference) obj.getValue());
676: } else if (local.equalsIgnoreCase("AppliesTo")) {
677: setAppliesTo((AppliesTo) obj.getValue());
678: } else if (local.equalsIgnoreCase("OnBehalfOf")) {
679: final OnBehalfOfType oboType = (OnBehalfOfType) obj
680: .getValue();
681: setOnBehalfOf(new OnBehalfOfImpl(oboType));
682: } else if (local.equalsIgnoreCase("Encryption")) {
683: final EncryptionType encType = (EncryptionType) obj
684: .getValue();
685: setEncryption(new EncryptionImpl(encType));
686: } else if (local.equalsIgnoreCase("UseKey")) {
687: final UseKeyType ukType = (UseKeyType) obj
688: .getValue();
689: setUseKey(new UseKeyImpl(ukType));
690: } else if (local.equalsIgnoreCase("DelegateTo")) {
691: final DelegateToType dtType = (DelegateToType) obj
692: .getValue();
693: setDelegateTo(new DelegateToImpl(dtType));
694: } else if (local.equalsIgnoreCase("RenewTarget")) {
695: final RenewTargetType rtType = (RenewTargetType) obj
696: .getValue();
697: setRenewTarget(new RenewTargetImpl(rtType));
698: } else if (local.equalsIgnoreCase("CancelTarget")) {
699: final CancelTargetType ctType = (CancelTargetType) obj
700: .getValue();
701: setCancelTarget(new CancelTargetImpl(ctType));
702: } else if (local.equalsIgnoreCase("AppliesTo")) {
703: setAppliesTo((AppliesTo) obj.getValue());
704: }
705: }
706: }
707: }
708: }
|