本文整理汇总了Java中org.opensaml.saml2.core.Status类的典型用法代码示例。如果您正苦于以下问题:Java Status类的具体用法?Java Status怎么用?Java Status使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Status类属于org.opensaml.saml2.core包,在下文中一共展示了Status类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processChildElement
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
throws UnmarshallingException {
ArtifactResponse artifactResponse = (ArtifactResponse) parentSAMLObject;
if (childSAMLObject instanceof Issuer) {
artifactResponse.setIssuer((Issuer) childSAMLObject);
} else if (childSAMLObject instanceof Signature) {
artifactResponse.setSignature((Signature) childSAMLObject);
} else if (childSAMLObject instanceof Extensions) {
artifactResponse.setExtensions((Extensions) childSAMLObject);
} else if (childSAMLObject instanceof Status) {
artifactResponse.setStatus((Status) childSAMLObject);
} else {
artifactResponse.setMessage((SAMLObject) childSAMLObject);
}
}
示例2: processChildElement
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
throws UnmarshallingException {
StatusResponseType sr = (StatusResponseType) parentSAMLObject;
if (childSAMLObject instanceof Issuer) {
sr.setIssuer((Issuer) childSAMLObject);
} else if (childSAMLObject instanceof Signature) {
sr.setSignature((Signature) childSAMLObject);
} else if (childSAMLObject instanceof Extensions) {
sr.setExtensions((Extensions) childSAMLObject);
} else if (childSAMLObject instanceof Status) {
sr.setStatus((Status) childSAMLObject);
} else {
super.processChildElement(parentSAMLObject, childSAMLObject);
}
}
示例3: buildStatus
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
private Status buildStatus(String status, String statMsg) {
Status stat = new StatusBuilder().buildObject();
// Set the status code.
StatusCode statCode = new StatusCodeBuilder().buildObject();
statCode.setValue(status);
stat.setStatusCode(statCode);
// Set the status Message.
if (statMsg != null) {
StatusMessage statMesssage = new StatusMessageBuilder().buildObject();
statMesssage.setMessage(statMsg);
stat.setStatusMessage(statMesssage);
}
return stat;
}
示例4: buildStatus
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
private Status buildStatus(String status, String statMsg) {
Status stat = new StatusBuilder().buildObject();
// Set the status code
StatusCode statCode = new StatusCodeBuilder().buildObject();
statCode.setValue(status);
stat.setStatusCode(statCode);
// Set the status Message
if (statMsg != null) {
StatusMessage statMesssage = new StatusMessageBuilder().buildObject();
statMesssage.setMessage(statMsg);
stat.setStatusMessage(statMesssage);
}
return stat;
}
示例5: buildResponse
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
/**
* Build the error response
*
* @param inResponseToID
* @param statusCodes
* @param statusMsg
* @return
*/
public Response buildResponse(String inResponseToID, List<String> statusCodes, String statusMsg,
String destination) throws IdentityException {
if (statusCodes == null || statusCodes.isEmpty()) {
throw IdentityException.error("No Status Values");
}
response.setIssuer(SAMLSSOUtil.getIssuer());
Status status = new StatusBuilder().buildObject();
StatusCode statusCode = null;
for (String statCode : statusCodes) {
statusCode = buildStatusCode(statCode, statusCode);
}
status.setStatusCode(statusCode);
buildStatusMsg(status, statusMsg);
response.setStatus(status);
response.setVersion(SAMLVersion.VERSION_20);
response.setID(SAMLSSOUtil.createID());
if (inResponseToID != null) {
response.setInResponseTo(inResponseToID);
}
if (destination != null) {
response.setDestination(destination);
}
response.setIssueInstant(new DateTime());
return response;
}
示例6: buildStatus
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
private Status buildStatus(String status, String statMsg) {
Status stat = new StatusBuilder().buildObject();
//Set the status code
StatusCode statCode = new StatusCodeBuilder().buildObject();
statCode.setValue(status);
stat.setStatusCode(statCode);
//Set the status Message
if (statMsg != null) {
StatusMessage statMesssage = new StatusMessageBuilder().buildObject();
statMesssage.setMessage(statMsg);
stat.setStatusMessage(statMesssage);
}
return stat;
}
示例7: buildStatus
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
/**
* Get status
*
* @param status
* @param statMsg
* @return Status object
*/
private Status buildStatus(String status, String statMsg) {
Status stat = new StatusBuilder().buildObject();
// Set the status code
StatusCode statCode = new StatusCodeBuilder().buildObject();
statCode.setValue(status);
stat.setStatusCode(statCode);
// Set the status Message
if (statMsg != null) {
StatusMessage statMesssage = new StatusMessageBuilder().buildObject();
statMesssage.setMessage(statMsg);
stat.setStatusMessage(statMesssage);
}
return stat;
}
示例8: setUp
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
/** {@inheritDoc} */
protected void setUp() throws Exception {
super.setUp();
expectedID = "def456";
expectedInResponseTo = "abc123";
expectedSAMLVersion = SAMLVersion.VERSION_20;
expectedIssueInstant = new DateTime(2006, 2, 21, 16, 40, 0, 0, ISOChronology.getInstanceUTC());
expectedDestination = "http://sp.example.org/endpoint";
expectedConsent = "urn:string:consent";
QName issuerQName = new QName(SAMLConstants.SAML20_NS, Issuer.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
expectedIssuer = (Issuer) buildXMLObject(issuerQName);
QName statusQName = new QName(SAMLConstants.SAML20P_NS, Status.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20P_PREFIX);
expectedStatus = (Status) buildXMLObject(statusQName);
}
示例9: processChildElement
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
throws UnmarshallingException {
Status status = (Status) parentSAMLObject;
if (childSAMLObject instanceof StatusCode) {
status.setStatusCode((StatusCode) childSAMLObject);
} else if (childSAMLObject instanceof StatusMessage) {
status.setStatusMessage((StatusMessage) childSAMLObject);
} else if (childSAMLObject instanceof StatusDetail) {
status.setStatusDetail((StatusDetail) childSAMLObject);
} else {
super.processChildElement(parentSAMLObject, childSAMLObject);
}
}
示例10: createLogoutResponse
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private LogoutResponse createLogoutResponse(String id,
String code, String msg) {
// Consume LogoutResponse
LogoutResponse lresp = ((SAMLObjectBuilder<LogoutResponse>)
_bf.getBuilder(LogoutResponse.DEFAULT_ELEMENT_NAME)).
buildObject();
String uid = UUID.randomUUID().toString();
lresp.setID(uid);
lresp.setInResponseTo(id);
lresp.setIssueInstant(new DateTime());
lresp.setVersion(SAMLVersion.VERSION_20);
lresp.setIssuer(getIssuer());
// Set status code
Status status = ((SAMLObjectBuilder<Status>) _bf.getBuilder(
Status.DEFAULT_ELEMENT_NAME)).buildObject();
StatusCode scode = ((SAMLObjectBuilder<StatusCode>) _bf.getBuilder(
StatusCode.DEFAULT_ELEMENT_NAME)).buildObject();
scode.setValue(code);
status.setStatusCode(scode);
if (!msg.equals("")) {
StatusMessage smsg = ((SAMLObjectBuilder<StatusMessage>) _bf.getBuilder(
StatusMessage.DEFAULT_ELEMENT_NAME)).buildObject();
smsg.setMessage(msg);
status.setStatusMessage(smsg);
}
lresp.setStatus(status);
return lresp;
}
示例11: testCreateStatus
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
@Test
public void testCreateStatus() {
Status s = SAMLUtil.createStatus("status");
assertNotNull(s);
assertNull(s.getStatusDetail());
assertNull(s.getStatusMessage());
assertNotNull(s.getStatusCode());
assertEquals("status", s.getStatusCode().getValue());
}
示例12: buildStatus
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
/**
* Build a SAML Status object
*
* @param pStatusCode Code the the SAML Status Object
* @return SAML Status object
*/
private Status buildStatus(String pStatusCode) {
Status lStatus = new StatusBuilder().buildObject();
// Set the status code
StatusCode lStatusCode = new StatusCodeBuilder().buildObject();
lStatusCode.setValue(pStatusCode);
lStatus.setStatusCode(lStatusCode);
return lStatus;
}
示例13: buildStatusMsg
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
/**
* Set the StatusMessage for Status of Response
*
* @param statusMsg
* @return
*/
private Status buildStatusMsg(Status status, String statusMsg) {
if (statusMsg != null) {
StatusMessage statusMesssage = new StatusMessageBuilder().buildObject();
statusMesssage.setMessage(statusMsg);
status.setStatusMessage(statusMesssage);
}
return status;
}
示例14: buildStatus
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
private static Status buildStatus() {
Status stat = new StatusBuilder().buildObject();
//Set the status code
StatusCode statCode = new StatusCodeBuilder().buildObject();
statCode.setValue("urn:oasis:names:tc:SAML:2.0:status:Responder");
stat.setStatusCode(statCode);
StatusMessage statMesssage = new StatusMessageBuilder().buildObject();
statMesssage.setMessage("Error when processing the Authentication Request");
stat.setStatusMessage(statMesssage);
return stat;
}
示例15: populateRequiredData
import org.opensaml.saml2.core.Status; //导入依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
super.populateRequiredData();
Status status = (Status) target;
StatusCode code = (StatusCode) buildXMLObject(new QName(SAMLConstants.SAML20P_NS, StatusCode.DEFAULT_ELEMENT_LOCAL_NAME));
status.setStatusCode(code);
}