Exemplo de bloqueio, desbloqueio, recuperação de status de bloqueio de um usuário.
package doxy.examples;
import com.dinamonetworks.Dinamo;
import br.com.trueaccess.TacException;
import br.com.trueaccess.TacNDJavaLib;
public class BlockUnblockUser {
public static void main(String[] args) throws TacException {
Dinamo opUserSession = new Dinamo();
String hsmIP = "127.0.0.1";
String operatorId = "master";
String userId = "user01";
String password = "12345678";
int authMask = 0;
opUserSession.openSession(hsmIP, operatorId, password, TacNDJavaLib.DEFAULT_PORT, false, false, true);
opUserSession.createUser(userId, password, authMask);
System.out.println("Is user " + userId + " blocked: " +
opUserSession.isUserBlocked(userId));
opUserSession.blockUser(userId);
System.out.println("Is user " + userId + " blocked: " +
opUserSession.isUserBlocked(userId));
opUserSession.unblockUser(userId);
System.out.println("Is user " + userId + " blocked: " +
opUserSession.isUserBlocked(userId));
opUserSession.deleteUser(userId);
opUserSession.closeSession();
}
}