Methods Summary |
---|
public com.sun.xml.ws.security.trust.elements.str.Reference | getReference()
return getReference((SecurityTokenReferenceType)this);
|
private com.sun.xml.ws.security.trust.elements.str.Reference | getReference(com.sun.xml.ws.security.secext10.SecurityTokenReferenceType strType)
final List<Object> list = strType.getAny();
final JAXBElement obj = (JAXBElement)list.get(0);
final String local = obj.getName().getLocalPart();
//final Reference ref = null;
if (REFERENCE.equals(local)) {
return new DirectReferenceImpl((ReferenceType)obj.getValue());
}
if (KEYIDENTIFIER.equalsIgnoreCase(local)) {
return new KeyIdentifierImpl((KeyIdentifierType)obj.getValue());
}
//ToDo
return null;
|
public java.lang.Object | getTokenValue()
try {
final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
final DocumentBuilder builder = dbf.newDocumentBuilder();
final Document doc = builder.newDocument();
final javax.xml.bind.Marshaller marshaller = WSTrustElementFactory.getContext().createMarshaller();
final JAXBElement<SecurityTokenReferenceType> rstElement = (new ObjectFactory()).createSecurityTokenReference((SecurityTokenReferenceType)this);
marshaller.marshal(rstElement, doc);
return doc.getDocumentElement();
} catch (Exception ex) {
throw new RuntimeException(ex.getMessage(), ex);
}
|
public java.lang.String | getType()
return WSTrustConstants.STR_TYPE;
|
public final void | setReference(com.sun.xml.ws.security.trust.elements.str.Reference ref)
JAXBElement rElement = null;
final String type = ref.getType();
final ObjectFactory objFac = new ObjectFactory();
if (KEYIDENTIFIER.equals(type)){
rElement = objFac.createKeyIdentifier((KeyIdentifierType)ref);
}
else if (REFERENCE.equals(type)){
rElement = objFac.createReference((ReferenceType)ref);
}else{
//ToDo
}
if (rElement != null){
getAny().clear();
getAny().add(rElement);
}
|