/** * Retrieves a message from a message queue, provided the queue is not in a QUIT state. * The message will be stored in the buffer specified in the Buffer argument.<br> * Note: The error code {@link INotesErrorConstants#ERR_MQ_QUITTING} indicates that the * message queue is in the QUIT state, denoting that applications that are reading * the message queue should terminate. For instance, a server addin's message queue * will be placed in the QUIT state when a "tell <addin> quit" command is input at the console. * @param buffer buffer used to read data * @param waitForMessage if the specified message queue is empty, wait for a message to appear in the queue. The timeout argument specifies the amount of time to wait for a message. * @param timeoutMillis if waitForMessage is set to <code>true</code>, the number of milliseconds to wait for a message before timing out. Specify 0 to wait forever. If the message queue goes into a QUIT state before the Timeout expires, MQGet will return immediately. * @param offset the offset in the buffer where to start writing the message * @param length the max length of the message in the buffer * @return Number of bytes written to the buffer */ public int get(Memory buffer, boolean waitForMessage, int timeoutMillis, int offset, int length) { checkHandle(); if (length > NotesConstants.MQ_MAX_MSGSIZE) { throw new IllegalArgumentException("Max size for the buffer is "+NotesConstants.MQ_MAX_MSGSIZE+" bytes. You specified one with "+length+" bytes."); } ShortByReference retMsgLength = new ShortByReference(); short result = NotesNativeAPI.get().MQGet(m_queue, buffer, (short) (length & 0xffff), waitForMessage ? NotesConstants.MQ_WAIT_FOR_MSG : 0, timeoutMillis, retMsgLength); NotesErrorUtils.checkResult(result); return retMsgLength.getValue(); }
/** * Returns the currently active collation * * @return collation */ private short getCollation() { checkHandle(); short result; ShortByReference retCollationNum = new ShortByReference(); if (PlatformUtils.is64Bit()) { result = NotesNativeAPI64.get().NIFGetCollation(m_hCollection64, retCollationNum); } else { result = NotesNativeAPI32.get().NIFGetCollation(m_hCollection32, retCollationNum); } NotesErrorUtils.checkResult(result); return retCollationNum.getValue(); }
/** * This function converts a distinguished name in abbreviated format to canonical format. * A fully distinguished name is in canonical format - it contains all possible naming components. * The abbreviated format of a distinguished name removes the labels from the naming components. * * @param name name to convert * @param templateName name to be used when the input name is in common name format * @return canonical name */ public static String toCanonicalName(String name, String templateName) { if (name==null) return null; if (name.length()==0) return name; String cacheKey = name + ((templateName!=null && templateName.length()>0) ? ("|" + templateName) : ""); String abbrName = m_nameCanonicalCache.get(cacheKey); if (abbrName!=null) { return abbrName; } Memory templateNameMem = templateName==null ? null : NotesStringUtils.toLMBCS(templateName, true); //used when abbrName is only a common name Memory inNameMem = NotesStringUtils.toLMBCS(name, true); Memory outNameMem = new Memory(NotesConstants.MAXUSERNAME); ShortByReference outLength = new ShortByReference(); short result = NotesNativeAPI.get().DNCanonicalize(0, templateNameMem, inNameMem, outNameMem, NotesConstants.MAXUSERNAME, outLength); NotesErrorUtils.checkResult(result); String sOutName = NotesStringUtils.fromLMBCS(outNameMem, (int) (outLength.getValue() & 0xffff)); m_nameCanonicalCache.put(cacheKey, sOutName); return sOutName; }
/** * This function converts a distinguished name in canonical format to abbreviated format. * A fully distinguished name is in canonical format - it contains all possible naming components. * The abbreviated format of a distinguished name removes the labels from the naming components. * * @param name name to convert * @param templateName name to be used when the input name is in common name format * @return abbreviated name */ public static String toAbbreviatedName(String name, String templateName) { if (name==null) return null; if (name.length()==0) return name; String cacheKey = name + ((templateName!=null && templateName.length()>0) ? ("|" + templateName) : ""); String abbrName = m_nameAbbrCache.get(cacheKey); if (abbrName!=null) { return abbrName; } Memory templateNameMem = templateName==null || templateName.length()==0 ? null : NotesStringUtils.toLMBCS(templateName, true); //used when abbrName is only a common name Memory inNameMem = NotesStringUtils.toLMBCS(name, true); Memory outNameMem = new Memory(NotesConstants.MAXUSERNAME); ShortByReference outLength = new ShortByReference(); short result = NotesNativeAPI.get().DNAbbreviate(0, templateNameMem, inNameMem, outNameMem, NotesConstants.MAXUSERNAME, outLength); NotesErrorUtils.checkResult(result); String sOutName = NotesStringUtils.fromLMBCS(outNameMem, (int) (outLength.getValue() & 0xffff)); m_nameAbbrCache.put(cacheKey, sOutName); return sOutName; }
public short ListAllocate( short ListEntries, short TextSize, int fPrefixDataType, LongByReference rethList, Memory retpList, ShortByReference retListSize);
public short NSFItemInfo( long note_handle, Memory item_name, short name_len, NotesBlockIdStruct retbhItem, ShortByReference retDataType, NotesBlockIdStruct retbhValue, IntByReference retValueLength);
public short NSFItemInfoNext( long note_handle, NotesBlockIdStruct.ByValue NextItem, Memory item_name, short name_len, NotesBlockIdStruct retbhItem, ShortByReference retDataType, NotesBlockIdStruct retbhValue, IntByReference retValueLength);
public short NSFItemInfoPrev( long note_handle, NotesBlockIdStruct.ByValue CurrItem, Memory item_name, short name_len, NotesBlockIdStruct item_blockid_ptr, ShortByReference value_type_ptr, NotesBlockIdStruct value_blockid_ptr, IntByReference value_len_ptr);
public short NSFDbGetNoteInfoExt( long hDB, int NoteID, NotesOriginatorIdStruct retNoteOID, NotesTimeDateStruct retModified, ShortByReference retNoteClass, NotesTimeDateStruct retAddedToFile, ShortByReference retResponseCount, IntByReference retParentNoteID);
public native short NSFComputeEvaluate( long hCompute, long hNote, LongByReference rethResult, ShortByReference retResultLength, IntByReference retNoteMatchesFormula, IntByReference retNoteShouldBeDeleted, IntByReference retNoteModified);
public short NSFDbGetObjectSize( long hDB, int ObjectID, short ObjectType, IntByReference retSize, ShortByReference retClass, ShortByReference retPrivileges);
public short NIFReadEntriesExt(long hCollection, NotesCollectionPositionStruct CollectionPos, short SkipNavigator, int SkipCount, short ReturnNavigator, int ReturnCount, int ReturnMask, NotesTimeDateStruct DiffTime, long DiffIDTable, int ColumnNumber, int Flags, LongByReference rethBuffer, ShortByReference retBufferLength, IntByReference retNumEntriesSkipped, IntByReference retNumEntriesReturned, ShortByReference retSignalFlags, NotesTimeDateStruct retDiffTime, NotesTimeDateStruct retModifiedTime, IntByReference retSequence);
public long NIFFindByKeyExtended3 (long hCollection, Memory keyBuffer, int findFlags, int returnFlags, NotesCollectionPositionStruct retIndexPos, IntByReference retNumMatches, ShortByReference retSignalFlags, LongByReference rethBuffer, IntByReference retSequence, NotesCallbacks.NIFFindByKeyProc NIFFindByKeyCallback, NIFFindByKeyContextStruct Ctx);
public native short ACLLookupAccess( long hACL, Pointer pNamesList, ShortByReference retAccessLevel, Memory retPrivileges, ShortByReference retAccessFlags, LongByReference rethPrivNames);
public short NSFFormulaCompile( Memory FormulaName, short FormulaNameLength, Memory FormulaText, short FormulaTextLength, LongByReference rethFormula, ShortByReference retFormulaLength, ShortByReference retCompileError, ShortByReference retCompileErrorLine, ShortByReference retCompileErrorColumn, ShortByReference retCompileErrorOffset, ShortByReference retCompileErrorLength);
public short NSFComputeEvaluate( long hCompute, long hNote, LongByReference rethResult, ShortByReference retResultLength, IntByReference retNoteMatchesFormula, IntByReference retNoteShouldBeDeleted, IntByReference retNoteModified);
public short ECLUserTrustSigner ( long hCESCtx, short ECLType, short bSessionOnly, short wCapabilities, short wCapabilities2, ShortByReference retwCurrentCapabilities, ShortByReference retwCurrentCapabilities2);
public short ACLLookupAccess( long hACL, Pointer pNamesList, ShortByReference retAccessLevel, Memory retPrivileges, ShortByReference retAccessFlags, LongByReference rethPrivNames);
public native short ListAllocate( short ListEntries, short TextSize, int fPrefixDataType, IntByReference rethList, Memory retpList, ShortByReference retListSize);
public native short ListAddEntry( int hList, int fPrefixDataType, ShortByReference pListSize, short EntryNumber, Memory Text, short TextSize);
public native short NSFItemInfo( int note_handle, Memory item_name, short name_len, NotesBlockIdStruct retbhItem, ShortByReference retDataType, NotesBlockIdStruct retbhValue, IntByReference retValueLength);
public native short NSFItemInfoNext( int note_handle, NotesBlockIdStruct.ByValue NextItem, Memory item_name, short name_len, NotesBlockIdStruct retbhItem, ShortByReference retDataType, NotesBlockIdStruct retbhValue, IntByReference retValueLength);
public native short NSFItemInfoPrev( int note_handle, NotesBlockIdStruct.ByValue CurrItem, Memory item_name, short name_len, NotesBlockIdStruct item_blockid_ptr, ShortByReference value_type_ptr, NotesBlockIdStruct value_blockid_ptr, IntByReference value_len_ptr);
public native void NSFItemQueryEx( int note_handle, NotesBlockIdStruct.ByValue item_bid, Memory item_name, short return_buf_len, ShortByReference name_len_ptr, ShortByReference item_flags_ptr, ShortByReference value_datatype_ptr, NotesBlockIdStruct value_bid_ptr, IntByReference value_len_ptr, ByteByReference retSeqByte, ByteByReference retDupItemID);
public native short NSFDbGetNoteInfoExt( int hDB, int NoteID, NotesOriginatorIdStruct retNoteOID, NotesTimeDateStruct retModified, ShortByReference retNoteClass, NotesTimeDateStruct retAddedToFile, ShortByReference retResponseCount, IntByReference retParentNoteID);
public native short NSFDbGetObjectSize( int hDB, int ObjectID, short ObjectType, IntByReference retSize, ShortByReference retClass, ShortByReference retPrivileges);
public native short NIFReadEntriesExt(int hCollection, NotesCollectionPositionStruct CollectionPos, short SkipNavigator, int SkipCount, short ReturnNavigator, int ReturnCount, int ReturnMask, NotesTimeDateStruct DiffTime, int DiffIDTable, int ColumnNumber, int Flags, IntByReference rethBuffer, ShortByReference retBufferLength, IntByReference retNumEntriesSkipped, IntByReference retNumEntriesReturned, ShortByReference retSignalFlags, NotesTimeDateStruct retDiffTime, NotesTimeDateStruct retModifiedTime, IntByReference retSequence);
public native short NIFFindByKeyExtended2 (int hCollection, Memory keyBuffer, int findFlags, int returnFlags, NotesCollectionPositionStruct retIndexPos, IntByReference retNumMatches, ShortByReference retSignalFlags, IntByReference rethBuffer, IntByReference retSequence);
public native short NIFFindByKeyExtended3 (int hCollection, Memory keyBuffer, int findFlags, int returnFlags, NotesCollectionPositionStruct retIndexPos, IntByReference retNumMatches, ShortByReference retSignalFlags, IntByReference rethBuffer, IntByReference retSequence, NotesCallbacks.NIFFindByKeyProc NIFFindByKeyCallback, NIFFindByKeyContextStruct Ctx);
public native short NSFFormulaCompile( Memory FormulaName, short FormulaNameLength, Memory FormulaText, short FormulaTextLength, IntByReference rethFormula, ShortByReference retFormulaLength, ShortByReference retCompileError, ShortByReference retCompileErrorLine, ShortByReference retCompileErrorColumn, ShortByReference retCompileErrorOffset, ShortByReference retCompileErrorLength);
public native short NSFComputeEvaluate( int hCompute, int hNote, IntByReference rethResult, ShortByReference retResultLength, IntByReference retNoteMatchesFormula, IntByReference retNoteShouldBeDeleted, IntByReference retNoteModified);
public native short ECLUserTrustSigner ( int hCESCtx, short ECLType, short bSessionOnly, short wCapabilities, short wCapabilities2, ShortByReference retwCurrentCapabilities, ShortByReference retwCurrentCapabilities2);
public native short ACLLookupAccess( int hACL, Pointer pNamesList, ShortByReference retAccessLevel, Memory retPrivileges, ShortByReference retAccessFlags, IntByReference rethPrivNames);
public native short NSFFormulaCompile( Memory FormulaName, short FormulaNameLength, Memory FormulaText, short FormulaTextLength, LongByReference rethFormula, ShortByReference retFormulaLength, ShortByReference retCompileError, ShortByReference retCompileErrorLine, ShortByReference retCompileErrorColumn, ShortByReference retCompileErrorOffset, ShortByReference retCompileErrorLength);
public short ListAllocate( short ListEntries, short TextSize, int fPrefixDataType, IntByReference rethList, Memory retpList, ShortByReference retListSize);
public short ListAddEntry( int hList, int fPrefixDataType, ShortByReference pListSize, short EntryNumber, Memory Text, short TextSize);
public short NSFItemInfo( int note_handle, Memory item_name, short name_len, NotesBlockIdStruct retbhItem, ShortByReference retDataType, NotesBlockIdStruct retbhValue, IntByReference retValueLength);
public short NSFItemInfoNext( int note_handle, NotesBlockIdStruct.ByValue NextItem, Memory item_name, short name_len, NotesBlockIdStruct retbhItem, ShortByReference retDataType, NotesBlockIdStruct retbhValue, IntByReference retValueLength);
public short NSFItemInfoPrev( int note_handle, NotesBlockIdStruct.ByValue CurrItem, Memory item_name, short name_len, NotesBlockIdStruct item_blockid_ptr, ShortByReference value_type_ptr, NotesBlockIdStruct value_blockid_ptr, IntByReference value_len_ptr);
public void NSFItemQueryEx( int note_handle, NotesBlockIdStruct.ByValue item_bid, Memory item_name, short return_buf_len, ShortByReference name_len_ptr, ShortByReference item_flags_ptr, ShortByReference value_datatype_ptr, NotesBlockIdStruct value_bid_ptr, IntByReference value_len_ptr, ByteByReference retSeqByte, ByteByReference retDupItemID);