private ServiceException createServiceException( ConnectionServiceProviderErrorCodes.SECURITY error) { final ServiceExceptionType serviceExceptionType = new ServiceExceptionType(); serviceExceptionType.setErrorId(error.getId()); serviceExceptionType.setText(error.getText()); return new ServiceException("403", serviceExceptionType); }
@Override public GenericAcknowledgmentType release(ReleaseRequestType parameters) throws ServiceException { validateOAuthScope(NsiScope.RELEASE); ServiceExceptionType exceptionType = new ServiceExceptionType(); exceptionType.setErrorId(NOT_IMPLEMENTED.getId()); exceptionType.setText(NOT_IMPLEMENTED.getText()); throw new ServiceException("Not supported", exceptionType); }
private ServiceException createServiceException( final String attributeName, final String errorCode, final String errorMessage) { final ServiceExceptionType serviceExceptionType = new ServiceExceptionType(); serviceExceptionType.setErrorId(errorCode); serviceExceptionType.setText(errorMessage); final AttributeType attribute = new AttributeType(); attribute.setName(attributeName); attribute.setNameFormat("urn:oasis:names:tc:SAML:2.0:attrname-format:basic"); final AttributeStatementType attributeStatement = new AttributeStatementType(); attributeStatement.getAttributeOrEncryptedAttribute().add(attribute); serviceExceptionType.setVariables(attributeStatement); return new ServiceException(errorCode, serviceExceptionType); }