use of com.sun.identity.federation.common.FSRemoteException in project OpenAM by OpenRock.
the class FSAssertionManagerClient method getErrorStatus.
protected Status getErrorStatus(AssertionArtifact artifact) throws FSException {
String status = null;
try {
Object[] obj = { metaAlias, artifact.getAssertionArtifact() };
status = (String) stub.send("getErrorStatus", obj, null, null);
if (status == null && FSUtils.debug.messageEnabled()) {
if (FSUtils.debug.messageEnabled()) {
FSUtils.debug.message("AMC:getErrorStatus(" + artifact + "): Server returned NULL");
}
} else {
if (FSUtils.debug.messageEnabled()) {
FSUtils.debug.message("AMC:getErrorStatus: status:" + status);
}
}
if (null != status) {
Document doc = XMLUtils.toDOMDocument(status, FSUtils.debug);
if (null != doc) {
return new Status(doc.getDocumentElement());
}
}
} catch (RemoteException re) {
if (FSUtils.debug.warningEnabled()) {
FSUtils.debug.warning("AMC:getErrorStatus: " + artifact, re);
}
throw (new FSException(re.getMessage()));
} catch (FSRemoteException re) {
if (FSUtils.debug.warningEnabled()) {
FSUtils.debug.warning("AMC:getErrorStatus: " + artifact, re);
}
throw (new FSException(re.getMessage()));
} catch (SAMLException re) {
if (FSUtils.debug.warningEnabled()) {
FSUtils.debug.warning("AMC:getErrorStatus: " + artifact, re);
}
throw (new FSException(re.getMessage()));
} catch (Exception re) {
if (FSUtils.debug.warningEnabled()) {
FSUtils.debug.warning("AMC:getErrorStatus: " + artifact, re);
}
throw (new FSException(re.getMessage()));
}
return null;
}
use of com.sun.identity.federation.common.FSRemoteException in project OpenAM by OpenRock.
the class FSAssertionManagerImpl method getErrorStatus.
public String getErrorStatus(String metaAlias, String artifact) throws FSRemoteException {
try {
if (FSUtils.debug.messageEnabled()) {
FSUtils.debug.message("FSAssertionManagerImpl.getErrStatus(" + metaAlias + ", " + artifact);
}
AssertionArtifact aa = new FSAssertionArtifact(artifact);
Status s = FSAssertionManager.getInstance(metaAlias).getErrorStatus(aa);
if (null != s)
return s.toString(true, true);
} catch (FSMsgException e) {
FSUtils.debug.error("getErrStatus: FSMsgException:" + e.getMessage());
throw new FSRemoteException(e.getMessage());
} catch (FSException e) {
FSUtils.debug.error("getErrStatus: FSException:" + e.getMessage());
throw new FSRemoteException(e.getMessage());
}
if (FSUtils.debug.messageEnabled()) {
FSUtils.debug.message("getErrStatus: returning null");
}
return null;
}
use of com.sun.identity.federation.common.FSRemoteException in project OpenAM by OpenRock.
the class FSAssertionManagerImpl method isUserExists.
/**
* Checks if the user exists.
* @param userDN user ID
* @param metaAlias provider's Meta Alias.
* @return <code>true</code> if the user exists; <code>false</code>
* otherwise.
* @exception FSRemoteException,RemoteException if error occurred.
*/
public boolean isUserExists(String userDN, String metaAlias) throws FSRemoteException {
try {
FSSessionManager sessionMgr = FSSessionManager.getInstance(metaAlias);
synchronized (sessionMgr) {
FSUtils.debug.message("About to call getSessionList");
List sessionList = sessionMgr.getSessionList(userDN);
if (sessionList == null) {
FSUtils.debug.message("AMC:isUserExists:List is empty");
return false;
} else {
if (FSUtils.debug.messageEnabled()) {
FSUtils.debug.message("AMC:isUserExists: List is not empty User found: " + userDN);
}
return true;
}
}
} catch (Exception e) {
if (FSUtils.debug.messageEnabled()) {
FSUtils.debug.message("AMC.isUserExists:", e);
}
throw new FSRemoteException(e.getMessage());
}
}
use of com.sun.identity.federation.common.FSRemoteException in project OpenAM by OpenRock.
the class FSAssertionManagerImpl method getAssertion.
/**
* Returns assertion associated with the artifact.
* @param metaAlias hosted provider's meta alias.
* @param artifact assertion artifact.
* @param destID The destination site requesting the assertion using
* the artifact.
* @return The Assertion referenced to by artifact.
* @exception FSRemoteException, RemoteException If an error occurred during * the process
*/
public String getAssertion(String metaAlias, String artifact, String destID) throws FSRemoteException {
try {
FSAssertionManager assertionManager = FSAssertionManager.getInstance(metaAlias);
FSAssertion a = (FSAssertion) assertionManager.getAssertion(new FSAssertionArtifact(artifact), SAMLUtils.byteArrayToString(Base64.decode(destID)));
if (a == null) {
if (FSUtils.debug.messageEnabled()) {
FSUtils.debug.message("FSAssertionManagerImpl: Unable to " + "get assertion from Artifact: " + artifact);
}
return (null);
}
if (FSUtils.debug.messageEnabled()) {
FSUtils.debug.message("FSAssertionManagerImpl: Assertion got from " + "assertionManager.getAssertion: " + a.toXMLString(true, true));
}
return (a.toXMLString(true, true));
} catch (Exception e) {
throw new FSRemoteException(e.getMessage());
}
}
use of com.sun.identity.federation.common.FSRemoteException in project OpenAM by OpenRock.
the class FSAssertionManagerImpl method getDestIdForArtifact.
/**
* Returns the destination id the artifact is created for.
* @param metaAlias hosted provider's meta alias
* @param artifact assertion artifact string
* @return destination id
* @exception FSRemoteException if error occurred.
*/
public String getDestIdForArtifact(String metaAlias, String artifact) throws FSRemoteException {
try {
FSAssertionManager assertionManager = FSAssertionManager.getInstance(metaAlias);
String destID = assertionManager.getDestIdForArtifact(new FSAssertionArtifact(artifact));
if (destID == null) {
if (FSUtils.debug.messageEnabled()) {
FSUtils.debug.message("FSAssertionManagerImpl: Unable to " + "get destination ID from remote : ");
}
}
return destID;
} catch (Exception e) {
throw new FSRemoteException(e.getMessage());
}
}
Aggregations