}
/**
+ * Constructs a new <CODE>Token</CODE> object instance given the
+ * name of the AFS cell it represents; the token for administrative
+ * access will be extracted from the kernel cache manager if possible.
+ *
+ * @param cellName the name of the cell to Token into
+ * @exception AFSException If an error occurs in the native code
+ */
+ public Token(String cellName)
+ throws AFSException
+ {
+ this(null, null, cellName);
+ }
+
+ /**
* Constructs a new <CODE>Token</CODE> object instance given
* the name of the AFS cell it represents and the username and password
* of the user to be Tokend for
#include <kautils.h>
#include <cellconfig.h>
#include <afs_AdminClientErrors.h>
+#include <rx/rxkad.h>
/**
* Static function used to initialize the client library and the
const char *password;
void *tokenHandle;
int rc;
+ int err;
// convert java strings
if( jcellName != NULL ) {
password = NULL;
}
- if ( !(afsclient_TokenGetNew( cellName, userName, password, &tokenHandle,
- &ast) ) ) {
+ err = (password==NULL || userName==NULL)
+ ? afsclient_TokenGetExisting( cellName, &tokenHandle, &ast)
+ : afsclient_TokenGetNew( cellName, userName, password, &tokenHandle, &ast);
+
+ if ( !err ) {
// release converted strings
if( cellName != NULL ) {
(*env)->ReleaseStringUTFChars(env, jcellName, cellName);
TOP_INCDIR=@TOP_INCDIR@
TOP_LIBDIR=@TOP_LIBDIR@
TOP_JLIBDIR=@TOP_SRCDIR@/JAVA/libjafs
-JNI_INC=${JAVA_HOME}/include
+JNI_INC=-I ${JAVA_HOME}/include -I `dirname ${JAVA_HOME}/include/*/jni_md.h`
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
OBJECT_FLAGS = -fPIC -c
ifeq "$(BUILD_TYPE)" "admin"
- INC := -I${TOP_INCDIR} -I${TOP_INCDIR}/afs/ -I${JAVA_HOME}/include -I ${JNI_INC}
+ INC := -I${TOP_INCDIR} -I${TOP_INCDIR}/afs/ ${JNI_INC}
CFLAGS := ${INC} ${DBG} ${OPTMZ} -I${TOP_SRCDIR}/config ${MT_CFLAGS}
else
- INC := -I${TOP_SRCDIR}/libuafs -I${TOP_INCDIR} -I${JAVA_HOME}/include -I ${JNI_INC}
+ INC := -I${TOP_SRCDIR}/libuafs -I${TOP_INCDIR} ${JNI_INC}
CFLAGS := ${INC} ${DBG} ${OPTMZ} ${FSINCLUDES} -D_REENTRANT -DLIBJUAFS ${MT_CFLAGS}
endif
JAVADOCSDIR = javadocs/
JAVAH = ${JAVA_HOME}/bin/javah -classpath ${ROOTPACKAGEDIR} -jni -d ${LIBJAFSADMDIR}
-JAVAC = ${JAVA_HOME}/bin/javac -classpath ${ROOTPACKAGEDIR}
+JAVAC = ${JAVA_HOME}/bin/javac -source 1.4 -classpath ${ROOTPACKAGEDIR}
J_NATIVE_PREFIX = org.openafs.jafs.
C_NATIVE_PREFIX = org_openafs_jafs_
LIBJAFS_LIBS =\
${TOP_LIBDIR}/libjuafs.a \
+ ${TOP_LIBDIR}/libafsutil.a \
${TOP_LIBDIR}/libdes.a \
-lresolv \
-lpthread