001: /*
002:
003: * JAXBURIDereferencer.java
004:
005: *
006:
007: * Created on January 24, 2006, 11:47 AM
008:
009: */
010:
011: /*
012:
013: * The contents of this file are subject to the terms
014:
015: * of the Common Development and Distribution License
016:
017: * (the License). You may not use this file except in
018:
019: * compliance with the License.
020:
021: *
022:
023: * You can obtain a copy of the license at
024:
025: * https://glassfish.dev.java.net/public/CDDLv1.0.html.
026:
027: * See the License for the specific language governing
028:
029: * permissions and limitations under the License.
030:
031: *
032:
033: * When distributing Covered Code, include this CDDL
034:
035: * Header Notice in each file and include the License file
036:
037: * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
038:
039: * If applicable, add the following below the CDDL Header,
040:
041: * with the fields enclosed by brackets [] replaced by
042:
043: * you own identifying information:
044:
045: * "Portions Copyrighted [year] [name of copyright owner]"
046:
047: *
048:
049: * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
050:
051: */
052:
053: package com.sun.xml.ws.security.opt.crypto.jaxb;
054:
055: import javax.xml.bind.JAXBContext;
056:
057: import javax.xml.bind.JAXBElement;
058:
059: import javax.xml.crypto.Data;
060:
061: import javax.xml.crypto.URIReference;
062:
063: import javax.xml.crypto.URIReferenceException;
064:
065: import javax.xml.crypto.XMLCryptoContext;
066:
067: import com.sun.xml.ws.security.opt.impl.crypto.JAXBDataImpl;
068:
069: /**
070:
071: *
072:
073: * @author Abhijit Das
074:
075: */
076:
077: public class JAXBURIDereferencer implements
078: javax.xml.crypto.URIDereferencer {
079:
080: private JAXBElement jaxbElement = null;
081:
082: private JAXBContext jbContext = null;
083:
084: /**
085:
086: * Creates a new instance of JAXBURIDereferencer
087:
088: */
089:
090: public JAXBURIDereferencer() {
091:
092: }
093:
094: /**
095:
096: * Dereferences the specified URIReference and returns the dereferenced data.
097:
098: *
099:
100: * uriReference - the URIReference
101:
102: * xMLCryptoContext - an XMLCryptoContext that may contain additional useful
103:
104: * information for dereferencing the URI. This implementation should
105:
106: * dereference the specified URIReference against the context's baseURI
107:
108: * parameter, if specified.
109:
110: *
111:
112: *
113:
114: * @return Data - the dereferenced data
115:
116: */
117:
118: public Data dereference(URIReference uRIReference,
119: XMLCryptoContext xMLCryptoContext)
120: throws URIReferenceException {
121:
122: JAXBDataImpl data = new JAXBDataImpl(
123: getJaxbElement(),
124: getJbContext(),
125: new com.sun.xml.ws.security.opt.impl.util.NamespaceContextEx(
126: false));
127:
128: return data;
129:
130: }
131:
132: /**
133:
134: * Get the JAXBElement
135:
136: *
137:
138: * @return JAXBElement
139:
140: */
141:
142: public JAXBElement getJaxbElement() {
143:
144: return jaxbElement;
145:
146: }
147:
148: /*
149:
150: * Set JAXBElement
151:
152: * @param - jaxbElement
153:
154: */
155:
156: public void setJaxbElement(JAXBElement jaxbElement) {
157:
158: this .jaxbElement = jaxbElement;
159:
160: }
161:
162: /**
163:
164: * Get JAXBContext
165:
166: *
167:
168: * @return JAXBContext
169:
170: */
171:
172: public JAXBContext getJbContext() {
173:
174: return jbContext;
175:
176: }
177:
178: /**
179:
180: * Set JAXBContext
181:
182: *
183:
184: * @param jbContext - JAXBContext
185:
186: */
187:
188: public void setJbContext(JAXBContext jbContext) {
189:
190: this.jbContext = jbContext;
191:
192: }
193:
194: }
|