Package com.isode.dsapi
Class DSapi
- java.lang.Object
-
- com.isode.dsapi.DSapi
-
- All Implemented Interfaces:
SWIG_DSAPIConstants
public class DSapi extends java.lang.Object implements SWIG_DSAPIConstants
This class provides miscellaneous static methods which may be useful to Java DSAPI clients
-
-
Field Summary
-
Fields inherited from interface com.isode.dsapi.SWIG_DSAPIConstants
DS_BOOL_TYPE, DS_BYTES_TYPE, DS_E_AB_CANNOTABANDON, DS_E_AB_NOSUCHOPERATION, DS_E_AB_TOOLATE, DS_E_ABANDONED, DS_E_ABANDONFAILED, DS_E_ABORTED, DS_E_AT_CONSTRAINTVIOLATION, DS_E_AT_INAPPROPRIATEMATCHING, DS_E_AT_INVALIDATTRIBUTESYNTAX, DS_E_AT_NOSUCHATTRIBUTE, DS_E_AT_TYPEORVALUEEXISTS, DS_E_AT_UNDEFINEDATTRIBUTETYPE, DS_E_ATTRIBUTE, DS_E_BADADDR, DS_E_BADATTRSYNTAX, DS_E_BADATTRTYPE, DS_E_BADATTRVALUE, DS_E_BADDN, DS_E_BADENTRY, DS_E_BADFILTER, DS_E_BADPARAM, DS_E_CONNECTIONLOST, DS_E_DSAREFERRAL, DS_E_DSOPFAILED, DS_E_INTERNAL, DS_E_LOCAL, DS_E_NAME, DS_E_NAME_ALIASDEREFERENCE, DS_E_NAME_ALIASPROBLEM, DS_E_NAME_INVALIDATTRIBUTESYNTAX, DS_E_NAME_NOSUCHOBJECT, DS_E_NOERROR, DS_E_NOINFO, DS_E_NOMEMORY, DS_E_NOSPACE, DS_E_NOTBOUND, DS_E_NOTFOUND, DS_E_NOTIMPLEMENTED, DS_E_OPFAILED, DS_E_REFERRAL, DS_E_REMOTE, DS_E_SEC_ACCESSRIGHTS, DS_E_SEC_AUTHENTICATION, DS_E_SEC_INVALIDCREDENTIALS, DS_E_SEC_INVALIDSIGNATURE, DS_E_SEC_NOINFORMATION, DS_E_SEC_PROTECTIONREQUIRED, DS_E_SECURITY, DS_E_SERVICE, DS_E_SIGNEDOPFAILED, DS_E_SUCCESS, DS_E_SVC_ADMINISTRATIVELIMITEXCEEDED, DS_E_SVC_BUSY, DS_E_SVC_CHAININGREQUIRED, DS_E_SVC_DITERROR, DS_E_SVC_INVALIDQUERYREFERENCE, DS_E_SVC_INVALIDREFERENCE, DS_E_SVC_LOOPDETECTED, DS_E_SVC_OUTOFSCOPE, DS_E_SVC_TIMELIMITEXCEEDED, DS_E_SVC_UNABLETOPROCEED, DS_E_SVC_UNAVAILABLE, DS_E_SVC_UNAVAILABLECRITICALEXTENSION, DS_E_SVC_UNWILLINGTOPERFORM, DS_E_UNKNOWN, DS_E_UPD_AFFECTSMULTIPLEDSAS, DS_E_UPD_ALREADYEXISTS, DS_E_UPD_NAMINGVIOLATION, DS_E_UPD_NOOBJECTCLASSMODS, DS_E_UPD_NOTONNONLEAF, DS_E_UPD_NOTONRDN, DS_E_UPD_OBJECTCLASSVIOLATION, DS_E_UPDATE, DS_E_X509, DS_E_X509_RESULTSDISCARDED, DS_EXT_OPT_MANAGEDSAIT, DS_EXT_OPT_USEALIASONUPDATE, DS_INT_TYPE, DS_PARAM_TYPE_MASK, DS_PP_ACCOUNT_LOCKED, DS_PP_CHANGE_AFTER_RESET, DS_PP_INSUFFICIENT_PASSWORD_QUALITY, DS_PP_MUST_SUPPLY_OLD_PASSWORD, DS_PP_NO_ERROR, DS_PP_PASSWORD_EXPIRED, DS_PP_PASSWORD_IN_HISTORY, DS_PP_PASSWORD_MOD_NOT_ALLOWED, DS_PP_PASSWORD_TOO_SHORT, DS_PP_PASSWORD_TOO_YOUNG, DS_SASL_BEST_SSF, DS_SEC_DISABLEVERIFICATION, DS_SEC_ENCRYPTED, DS_SEC_SIGNED, DS_STR_TYPE, DS_SVC_OPT_ATTRSONLY, DS_SVC_OPT_CHAININGPROHIBIT, DS_SVC_OPT_COPYSHALLDO, DS_SVC_OPT_DONTDEREFALIAS, DS_SVC_OPT_DONTUSECOPY, DS_SVC_OPT_LOCALSCOPE, DS_SVC_OPT_PAGESIZE, DS_SVC_OPT_PREFERCHAIN, DS_SVC_OPT_SEARCHALIASES, DS_SVC_OPT_SUBENTRIES, DS_SVC_OPT_TXNID, DS_SVC_PASSWORDPOLICY, DS_SVC_PRIORITY, DS_SVC_SIZELIMIT, DS_SVC_TIMELIMIT, DSActionAbort, DSActionContinue, DSAnonymous, DSAPI_VERSION, DSConnectionAnonymous, DSConnectionBound, DSConnectionLost, DSConnectionSasl, DSConnectionSimple, DSConnectionStrong, DSEntryAdd, DSEntryDelete, DSEntryModify, DSEntryNormal, DSEntryRename, DSLimitAdminLimitExceeded, DSLimitNoProblem, DSLimitSizeExceeded, DSLimitTimeExceeded, DSModAdd, DSModDelete, DSModReplace, DSNotYetConnected, DSSASL, DSScopeBaseObject, DSScopeOneLevel, DSScopeSubtree, DSSimple, DSStrong, DSUnbound, DSVerificationFailed, JAVADSAPI_VERSION
-
-
Constructor Summary
Constructors Constructor Description DSapi()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getBuildVersion(boolean fullInfo)
Returns a String containing information about the library build version.static int
getDSAPIVersion()
Determine the version of the DSAPI library which is currently being used.static int
getJavaDSAPIVersion()
Determine the version of the native component of the Java DSAPI library which is currently being used.static java.lang.String
getSupportedSaslMech()
Returns space separated list of supported SASL mechanisms.static void
initialize()
Initialize the DSAPI library without setting up an Isode DUA logging stream.static void
initialize(java.lang.String appName)
Ensure that the Java DSAPI library has been initialized.static void
initializeSecurity(java.lang.String secPath)
Initialize the X.509 librarystatic boolean
isIsodeServer(DirectorySession ds, DN dn)
Determine if the entry at a specified DN appears to be entry used for storing Isode server configuration (e.g.static boolean
isPrintableSyntax(int syntaxID)
Determine whether a specific syntax has a printable String representation.static int
nameToSyntaxID(java.lang.String syntaxName)
Get the syntax identifier associated with the given syntax name.static java.lang.String
syntaxIDToName(int syntaxID)
Get a string representation of the syntax name for the specified syntax identifier.
-
-
-
Method Detail
-
getDSAPIVersion
public static int getDSAPIVersion()
Determine the version of the DSAPI library which is currently being used. This is the version returned by the DSAPI library itself at run-time: it won't necessarily be the same as the version of DSAPI that was used to build Java DSAPI.- Returns:
- the DSAPI library version.
-
getJavaDSAPIVersion
public static int getJavaDSAPIVersion()
Determine the version of the native component of the Java DSAPI library which is currently being used. This is the version returned by the library itself at run-time: it won't necessarily be the same as the version that was used when this Java class was built.- Returns:
- the Java DSAPI library version.
-
initialize
public static void initialize(java.lang.String appName) throws NativeLibraryException
Ensure that the Java DSAPI library has been initialized. The library must be initialized before using any of the other Java DSAPI classes.It is safe to call this method multiple times.
Note that the Java DSAPI library uses com.isode.util.Logger to generate logging messages. When this method is called, then a log handler is configured which sends messages to the Isode log system using the message facility "javadsapimsg". This log handler is in addition to any other handlers which may have been configured by the user.
- Parameters:
appName
- the identifier to be used for a logstream that will capture all Isode DUA logging events. logstreamName may be null, in which case no DUA messages will be logged. Once DUA logging has been initialised, subsequent call to this method subsequent calls that specify appName will have no effect (the first caller is the one whose appName gets used).- Throws:
NativeLibraryException
- if it was not possible to initialize the library; any subsequent attempts to use the library will probably fail.
-
initialize
public static void initialize() throws NativeLibraryException
Initialize the DSAPI library without setting up an Isode DUA logging stream.- Throws:
NativeLibraryException
- if it was not possible to initialize the library; any subsequent attempts to use the library will probably fail.- See Also:
Logger
,dsapiInitialize(String)
-
initializeSecurity
public static void initializeSecurity(java.lang.String secPath) throws NativeLibraryException
Initialize the X.509 library- Parameters:
secPath
- the path to use for X.509 credentials. This may be null, in which case the DSAPI library will supply a suitable default value.- Throws:
NativeLibraryException
- if an unrecoverable error was detected by the native library
-
syntaxIDToName
public static java.lang.String syntaxIDToName(int syntaxID) throws NativeLibraryException
Get a string representation of the syntax name for the specified syntax identifier. This may or may not return a useful value.- Parameters:
syntaxID
- the syntax ID in question- Returns:
- A string representation of syntaxID (such as "ia5string"), or null if no name is available.
- Throws:
NativeLibraryException
- if an unrecoverable error was detected by the native library
-
nameToSyntaxID
public static int nameToSyntaxID(java.lang.String syntaxName) throws NativeLibraryException, java.lang.NullPointerException
Get the syntax identifier associated with the given syntax name.- Parameters:
syntaxName
- Syntax name (for example, "ia5string"). Must not be null.- Returns:
- an integer that identifies this syntax.
- Throws:
java.lang.NullPointerException
- if syntaxName is null.NativeLibraryException
- if an unrecoverable error was detected by the native library
-
isPrintableSyntax
public static boolean isPrintableSyntax(int syntaxID) throws NativeLibraryException
Determine whether a specific syntax has a printable String representation. Values without printable syntaxes will be held as BER encoded values.- Parameters:
syntaxID
- the numeric syntax ID- Returns:
- true if syntaxID is a valid syntax ID, and is one which has a printable representation; false otherwise.
- Throws:
NativeLibraryException
- if an unrecoverable error was detected by the native library- Since:
- 14.6
- See Also:
nameToSyntaxID(String)
,syntaxIDToName(int)
,AttributeValue.getBer()
,AttributeValue.getString()
,AttributeType.isPrintable()
-
getBuildVersion
public static java.lang.String getBuildVersion(boolean fullInfo) throws NativeLibraryException
Returns a String containing information about the library build version. This method cannot be called until the library has been initialized.The String returned by this method is derived from the Isode build version. A full version string might look something like
isodejavalib 12.0a0-0-pt #335 (build.system.net) of Fri Aug 11 15:31:33 BST 2006 (dsapi:2008; javadsapi:2)
. An abbreviated version string will be of the form "R12.0v0".- Parameters:
fullInfo
- true to return a long-form String, false otherwise.- Returns:
- a version string.
- Throws:
NativeLibraryException
- if an unrecoverable error was detected by the native library
-
isIsodeServer
public static boolean isIsodeServer(DirectorySession ds, DN dn)
Determine if the entry at a specified DN appears to be entry used for storing Isode server configuration (e.g. a DSA, or MTA, or M-Link or M-Box server).- Parameters:
ds
- Bound Directory session; most not be null.dn
- Given DN; must not be null.- Returns:
- true if the entry appears to relate to an Isode server; false otherwise.
- Since:
- 15.0
-
getSupportedSaslMech
public static java.lang.String getSupportedSaslMech() throws NativeLibraryException
Returns space separated list of supported SASL mechanisms. (depending on OS and installed SASL plug-ins).- Returns:
- string with space separated list of SASL mechanisms
- Throws:
NativeLibraryException
- Since:
- 16.1
-
-