From 201afd98e355dee1aece1ff8883d78c006d071ea Mon Sep 17 00:00:00 2001 From: Emmanuel Raviart Date: Fri, 30 Jul 2004 20:35:07 +0000 Subject: Removed last profile_context or profileContext. --- java/src/c/com_entrouvert_lasso_Lasso.c | 2 +- java/src/c/com_entrouvert_lasso_LassoProfile.c | 193 +++++++++++++++++++++ .../c/com_entrouvert_lasso_LassoProfileContext.c | 193 --------------------- 3 files changed, 194 insertions(+), 194 deletions(-) create mode 100644 java/src/c/com_entrouvert_lasso_LassoProfile.c delete mode 100644 java/src/c/com_entrouvert_lasso_LassoProfileContext.c (limited to 'java/src/c') diff --git a/java/src/c/com_entrouvert_lasso_Lasso.c b/java/src/c/com_entrouvert_lasso_Lasso.c index 80ffd8ad..170d44b4 100644 --- a/java/src/c/com_entrouvert_lasso_Lasso.c +++ b/java/src/c/com_entrouvert_lasso_Lasso.c @@ -42,7 +42,7 @@ JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_Lasso_getRequestTypeFromSoapMsg char *value; value = (char*)(*env)->GetStringUTFChars(env, _value, NULL); - result = lasso_profile_context_get_request_type_from_soap_msg(value); + result = lasso_profile_get_request_type_from_soap_msg(value); (*env)->ReleaseStringUTFChars(env, _value, value); return result; } diff --git a/java/src/c/com_entrouvert_lasso_LassoProfile.c b/java/src/c/com_entrouvert_lasso_LassoProfile.c new file mode 100644 index 00000000..8f1cb94c --- /dev/null +++ b/java/src/c/com_entrouvert_lasso_LassoProfile.c @@ -0,0 +1,193 @@ +/* + * JLasso -- Java bindings for Lasso library + * + * Copyright (C) 2004 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: Benjamin Poussin + * Emmanuel Raviart + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include + +JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfile_getMsgBody +(JNIEnv * env, jobject this){ + LassoProfile * profile; + char * result; + + profile = getCObject(env, this); + + result = profile->msg_body; + + return (*env)->NewStringUTF(env, result); +} + +JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfile_getMsgRelayState +(JNIEnv * env, jobject this){ + LassoProfile * profile; + char * result; + + profile = getCObject(env, this); + + result = profile->msg_relayState; + + return (*env)->NewStringUTF(env, result); +} + +JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfile_getMsgUrl +(JNIEnv * env, jobject this){ + LassoProfile * profile; + char * result; + + profile = getCObject(env, this); + + result = profile->msg_url; + + return (*env)->NewStringUTF(env, result); +} + +JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfile_getNameIdentifier +(JNIEnv * env, jobject this){ + LassoProfile * profile; + char *result; + + profile = getCObject(env, this); + + result = profile->nameIdentifier; + if (result == NULL) + return NULL; + return (*env)->NewStringUTF(env, result); +} + +JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfile_getProviderID +(JNIEnv * env, jobject this){ + LassoProfile * profile; + char * result; + + profile = getCObject(env, this); + + result = profile->remote_providerID; + + return (*env)->NewStringUTF(env, result); +} + +JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoProfile_getRequestType +(JNIEnv * env, jobject this){ + LassoProfile * profile; + char * result; + + profile = getCObject(env, this); + + return profile->request_type; +} + +JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoProfile_getResponseType +(JNIEnv * env, jobject this){ + LassoProfile * profile; + char * result; + + profile = getCObject(env, this); + + return profile->response_type; +} + +JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfile_initRequestField +(JNIEnv * env, jobject this){ + LassoProfile * profile; + char * fieldName = "request"; + char * fieldType = "Lcom/entrouvert/lasso/LassoNode;"; + char * javaObjectClassName = "com/entrouvert/lasso/LassoNode"; + LassoNode *cObject; + + profile = getCObject(env, this); + cObject = profile->request; + + if (profile->request_type == lassoMessageTypeAuthnRequest) { + javaObjectClassName = "com/entrouvert/lasso/LassoAuthnRequest"; + } else if(profile->request_type == lassoMessageTypeRequest) { + javaObjectClassName = "com/entrouvert/lasso/LassoRequest"; + } else { + /* FIXME: Throw error */ + } + checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject); +} + +JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfile_initResponseField +(JNIEnv * env, jobject this){ + LassoProfile * profile; + char * fieldName = "response"; + char * fieldType = "Lcom/entrouvert/lasso/LassoNode;"; + char * javaObjectClassName = "com/entrouvert/lasso/LassoNode"; + LassoNode *cObject; + + profile = getCObject(env, this); + cObject = profile->response; + + if(profile->response_type == lassoMessageTypeAuthnResponse){ + javaObjectClassName = "com/entrouvert/lasso/LassoAuthnResponse"; + }else if(profile->response_type == lassoMessageTypeResponse){ + javaObjectClassName = "com/entrouvert/lasso/LassoResponse"; + }else{ + /* FIXME: Throw error */ + } + + checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject); +} + +JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfile_initServerField +(JNIEnv * env, jobject this){ + LassoProfile * profile; + char * fieldName = "server"; + char * fieldType = "Lcom/entrouvert/lasso/LassoServer;"; + char * javaObjectClassName = "com/entrouvert/lasso/LassoServer"; + LassoServer *cObject; + + profile = getCObject(env, this); + cObject = profile->server; + + checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject); +} + +JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfile_initUserField +(JNIEnv * env, jobject this){ + LassoProfile * profile; + char * fieldName = "user"; + char * fieldType = "Lcom/entrouvert/lasso/LassoUser;"; + char * javaObjectClassName = "com/entrouvert/lasso/LassoUser"; + LassoUser *cObject; + + profile = getCObject(env, this); + cObject = profile->user; + + checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject); +} + +JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoProfile_setUserFromDump +(JNIEnv * env, jobject this, jstring _dump) { + int result; + LassoProfile *profile; + char *dump; + + profile = getCObject(env, this); + dump = (char*)(*env)->GetStringUTFChars(env, _dump, NULL); + result = lasso_profile_set_user_from_dump(profile, dump); + (*env)->ReleaseStringUTFChars(env, _dump, dump); + return result; +} + diff --git a/java/src/c/com_entrouvert_lasso_LassoProfileContext.c b/java/src/c/com_entrouvert_lasso_LassoProfileContext.c deleted file mode 100644 index 0315e135..00000000 --- a/java/src/c/com_entrouvert_lasso_LassoProfileContext.c +++ /dev/null @@ -1,193 +0,0 @@ -/* - * JLasso -- Java bindings for Lasso library - * - * Copyright (C) 2004 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: Benjamin Poussin - * Emmanuel Raviart - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include -#include - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getMsgBody -(JNIEnv * env, jobject this){ - LassoProfileContext * profileContext; - char * result; - - profileContext = getCObject(env, this); - - result = profileContext->msg_body; - - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getMsgRelayState -(JNIEnv * env, jobject this){ - LassoProfileContext * profileContext; - char * result; - - profileContext = getCObject(env, this); - - result = profileContext->msg_relayState; - - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getMsgUrl -(JNIEnv * env, jobject this){ - LassoProfileContext * profileContext; - char * result; - - profileContext = getCObject(env, this); - - result = profileContext->msg_url; - - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getNameIdentifier -(JNIEnv * env, jobject this){ - LassoProfileContext * profileContext; - char *result; - - profileContext = getCObject(env, this); - - result = profileContext->nameIdentifier; - if (result == NULL) - return NULL; - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getProviderID -(JNIEnv * env, jobject this){ - LassoProfileContext * profileContext; - char * result; - - profileContext = getCObject(env, this); - - result = profileContext->remote_providerID; - - return (*env)->NewStringUTF(env, result); -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getRequestType -(JNIEnv * env, jobject this){ - LassoProfileContext * profileContext; - char * result; - - profileContext = getCObject(env, this); - - return profileContext->request_type; -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getResponseType -(JNIEnv * env, jobject this){ - LassoProfileContext * profileContext; - char * result; - - profileContext = getCObject(env, this); - - return profileContext->response_type; -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfileContext_initRequestField -(JNIEnv * env, jobject this){ - LassoProfileContext * profileContext; - char * fieldName = "request"; - char * fieldType = "Lcom/entrouvert/lasso/LassoNode;"; - char * javaObjectClassName = "com/entrouvert/lasso/LassoNode"; - LassoNode *cObject; - - profileContext = getCObject(env, this); - cObject = profileContext->request; - - if (profileContext->request_type == lassoMessageTypeAuthnRequest) { - javaObjectClassName = "com/entrouvert/lasso/LassoAuthnRequest"; - } else if(profileContext->request_type == lassoMessageTypeRequest) { - javaObjectClassName = "com/entrouvert/lasso/LassoRequest"; - } else { - /* FIXME: Throw error */ - } - checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfileContext_initResponseField -(JNIEnv * env, jobject this){ - LassoProfileContext * profileContext; - char * fieldName = "response"; - char * fieldType = "Lcom/entrouvert/lasso/LassoNode;"; - char * javaObjectClassName = "com/entrouvert/lasso/LassoNode"; - LassoNode *cObject; - - profileContext = getCObject(env, this); - cObject = profileContext->response; - - if(profileContext->response_type == lassoMessageTypeAuthnResponse){ - javaObjectClassName = "com/entrouvert/lasso/LassoAuthnResponse"; - }else if(profileContext->response_type == lassoMessageTypeResponse){ - javaObjectClassName = "com/entrouvert/lasso/LassoResponse"; - }else{ - /* FIXME: Throw error */ - } - - checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfileContext_initServerField -(JNIEnv * env, jobject this){ - LassoProfileContext * profileContext; - char * fieldName = "server"; - char * fieldType = "Lcom/entrouvert/lasso/LassoServer;"; - char * javaObjectClassName = "com/entrouvert/lasso/LassoServer"; - LassoServer *cObject; - - profileContext = getCObject(env, this); - cObject = profileContext->server; - - checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject); -} - -JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfileContext_initUserField -(JNIEnv * env, jobject this){ - LassoProfileContext * profileContext; - char * fieldName = "user"; - char * fieldType = "Lcom/entrouvert/lasso/LassoUser;"; - char * javaObjectClassName = "com/entrouvert/lasso/LassoUser"; - LassoUser *cObject; - - profileContext = getCObject(env, this); - cObject = profileContext->user; - - checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject); -} - -JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoProfileContext_setUserFromDump -(JNIEnv * env, jobject this, jstring _dump) { - int result; - LassoProfileContext *profileContext; - char *dump; - - profileContext = getCObject(env, this); - dump = (char*)(*env)->GetStringUTFChars(env, _dump, NULL); - result = lasso_profile_context_set_user_from_dump(profileContext, dump); - (*env)->ReleaseStringUTFChars(env, _dump, dump); - return result; -} - -- cgit