public LogoutRequest newLogoutRequest(final String id, final DateTime issueInstant,
                                          final String destination, final Issuer issuer,
                                          final String sessionIndex, final NameID nameId) {
        val request = newSamlObject(LogoutRequest.class);
        request.setID(id);
        request.setVersion(SAMLVersion.VERSION_20);
        request.setIssueInstant(issueInstant);
        request.setIssuer(issuer);
        request.setDestination(destination);

        if (StringUtils.isNotBlank(sessionIndex)) {
            val sessionIdx = newSamlObject(SessionIndex.class);
            sessionIdx.setSessionIndex(sessionIndex);
            request.getSessionIndexes().add(sessionIdx);
        }

        if (nameId != null) {
            request.setNameID(nameId);
        }
        return request;
    }
public LogoutRequest newLogoutRequest ( final String id , final DateTime issueInstant , final String destination , final Issuer issuer , final String sessionIndex , final NameID nameId ) { val request = newSamlObject ( LogoutRequest . class ) ; request . setID ( id ) ; request . setVersion ( SAMLVersion . VERSION_20 ) ; request . setIssueInstant ( issueInstant ) ; request . setIssuer ( issuer ) ; request . setDestination ( destination ) ; if ( StringUtils . isNotBlank ( sessionIndex ) ) { val sessionIdx = newSamlObject ( SessionIndex . class ) ; sessionIdx . setSessionIndex ( sessionIndex ) ; request . getSessionIndexes ( ) . add ( sessionIdx ) ; } if ( nameId != null ) { request . setNameID ( nameId ) ; } return request ; }
New saml2 logout request.

@param id           the id
@param issueInstant the issue instant
@param destination  the destination
@param issuer       the issuer
@param sessionIndex the session index
@param nameId       the name id
@return the logout request