com.mindoo.domino.jna.internal.structs.NotesScheduleStruct Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of domino-jna Show documentation
Show all versions of domino-jna Show documentation
Java project to access the HCL Domino C API using Java Native Access (JNA)
The newest version!
package com.mindoo.domino.jna.internal.structs;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Arrays;
import java.util.List;
import com.mindoo.domino.jna.IAdaptable;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
/**
* Data structure for a schedule.
*/
public class NotesScheduleStruct extends BaseStructure implements IAdaptable {
/** C type : DWORD[8] */
public int[] reserved = new int[8];
/**
* Users mail file replica ID
* C type : DBID
*/
public NotesTimeDateStruct dbReplicaID;
/**
* events etc. are in this
* interval
* C type : TIMEDATE_PAIR
*/
public NotesTimeDatePairStruct Interval;
/**
* gateway error retrieving this
* schedule
*/
public int dwErrGateway;
/**
* error retrieving this
* schedule
* C type : STATUS
*/
public short error;
/** unused at this time */
public short wReserved;
/**
* size of owner name
* (includes term.)
*/
public short wOwnerNameSize;
/**
* @deprecated only public to be used by JNA; use static newInstance method instead to run in AccessController.doPrivileged block
*/
public NotesScheduleStruct() {
super();
}
public static NotesScheduleStruct newInstance() {
return AccessController.doPrivileged(new PrivilegedAction() {
@Override
public NotesScheduleStruct run() {
return new NotesScheduleStruct();
}
});
}
protected List getFieldOrder() {
return Arrays.asList("reserved", "dbReplicaID", "Interval", "dwErrGateway", "error", "wReserved", "wOwnerNameSize");
}
/**
* @param reserved C type : DWORD[8]
* @param dbReplicaID Users mail file replica ID
* C type : DBID
* @param Interval events etc. are in this
* interval
* C type : TIMEDATE_PAIR
* @param dwErrGateway gateway error retrieving this
* schedule
* @param error error retrieving this
* schedule
* C type : STATUS
* @param wReserved unused at this time
* @param wOwnerNameSize size of owner name
* (includes term.)
*
* @deprecated only public to be used by JNA; use static newInstance method instead to run in AccessController.doPrivileged block
*/
public NotesScheduleStruct(int reserved[], NotesTimeDateStruct dbReplicaID, NotesTimeDatePairStruct Interval, int dwErrGateway, short error,
short wReserved, short wOwnerNameSize) {
super();
if ((reserved.length != this.reserved.length))
throw new IllegalArgumentException("Wrong array size !");
this.reserved = reserved;
this.dbReplicaID = dbReplicaID;
this.Interval = Interval;
this.dwErrGateway = dwErrGateway;
this.error = error;
this.wReserved = wReserved;
this.wOwnerNameSize = wOwnerNameSize;
}
public static NotesScheduleStruct newInstance(final int reserved[], final NotesTimeDateStruct dbReplicaID, final NotesTimeDatePairStruct interval, final int dwErrGateway, final short error,
final short wReserved, final short wOwnerNameSize) {
return AccessController.doPrivileged(new PrivilegedAction() {
@Override
public NotesScheduleStruct run() {
return new NotesScheduleStruct(reserved, dbReplicaID, interval, dwErrGateway, error,
wReserved, wOwnerNameSize);
}
});
}
/**
* @deprecated only public to be used by JNA; use static newInstance method instead to run in AccessController.doPrivileged block
*
* @param peer pointer
*/
public NotesScheduleStruct(Pointer peer) {
super(peer);
}
public static NotesScheduleStruct newInstance(final Pointer peer) {
return AccessController.doPrivileged(new PrivilegedAction() {
@Override
public NotesScheduleStruct run() {
return new NotesScheduleStruct(peer);
}
});
}
public static class ByReference extends NotesScheduleStruct implements Structure.ByReference {
};
public static class ByValue extends NotesScheduleStruct implements Structure.ByValue {
}
@Override
public T getAdapter(Class clazz) {
if (clazz == NotesScheduleStruct.class) {
return (T) this;
}
else if (clazz == Pointer.class) {
return (T) getPointer();
}
return null;
};
}