Search in sources :

Example 1 with FSRemoteException

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;
}
Also used : Status(com.sun.identity.saml.protocol.Status) FSException(com.sun.identity.federation.common.FSException) Document(org.w3c.dom.Document) FSRemoteException(com.sun.identity.federation.common.FSRemoteException) RemoteException(java.rmi.RemoteException) SAMLException(com.sun.identity.saml.common.SAMLException) FSRemoteException(com.sun.identity.federation.common.FSRemoteException) RemoteException(java.rmi.RemoteException) SAMLException(com.sun.identity.saml.common.SAMLException) FSException(com.sun.identity.federation.common.FSException) FSRemoteException(com.sun.identity.federation.common.FSRemoteException)

Example 2 with FSRemoteException

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;
}
Also used : Status(com.sun.identity.saml.protocol.Status) FSMsgException(com.sun.identity.federation.message.common.FSMsgException) FSException(com.sun.identity.federation.common.FSException) FSAssertionArtifact(com.sun.identity.federation.message.FSAssertionArtifact) FSAssertionArtifact(com.sun.identity.federation.message.FSAssertionArtifact) AssertionArtifact(com.sun.identity.saml.protocol.AssertionArtifact) FSRemoteException(com.sun.identity.federation.common.FSRemoteException)

Example 3 with FSRemoteException

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());
    }
}
Also used : List(java.util.List) FSException(com.sun.identity.federation.common.FSException) FSRemoteException(com.sun.identity.federation.common.FSRemoteException) FSMsgException(com.sun.identity.federation.message.common.FSMsgException) FSRemoteException(com.sun.identity.federation.common.FSRemoteException)

Example 4 with FSRemoteException

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());
    }
}
Also used : FSAssertion(com.sun.identity.federation.message.FSAssertion) FSAssertionArtifact(com.sun.identity.federation.message.FSAssertionArtifact) FSException(com.sun.identity.federation.common.FSException) FSRemoteException(com.sun.identity.federation.common.FSRemoteException) FSMsgException(com.sun.identity.federation.message.common.FSMsgException) FSRemoteException(com.sun.identity.federation.common.FSRemoteException)

Example 5 with FSRemoteException

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());
    }
}
Also used : FSAssertionArtifact(com.sun.identity.federation.message.FSAssertionArtifact) FSException(com.sun.identity.federation.common.FSException) FSRemoteException(com.sun.identity.federation.common.FSRemoteException) FSMsgException(com.sun.identity.federation.message.common.FSMsgException) FSRemoteException(com.sun.identity.federation.common.FSRemoteException)

Aggregations

FSException (com.sun.identity.federation.common.FSException)5 FSRemoteException (com.sun.identity.federation.common.FSRemoteException)5 FSMsgException (com.sun.identity.federation.message.common.FSMsgException)4 FSAssertionArtifact (com.sun.identity.federation.message.FSAssertionArtifact)3 Status (com.sun.identity.saml.protocol.Status)2 FSAssertion (com.sun.identity.federation.message.FSAssertion)1 SAMLException (com.sun.identity.saml.common.SAMLException)1 AssertionArtifact (com.sun.identity.saml.protocol.AssertionArtifact)1 RemoteException (java.rmi.RemoteException)1 List (java.util.List)1 Document (org.w3c.dom.Document)1