/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import javax.smartcardio.*;
/**
* TerminalFactorySpi implementation class.
*
* @since 1.6
* @author Andreas Sterbenz
*/
private static long contextId;
// terminal state used by waitForCard()
PCSCTerminals() {
// empty
}
if (contextId == 0) {
}
}
return terminal;
}
return terminal;
}
throw new NullPointerException();
}
try {
// If waitForChange() has never been called, treat event
// queries as status queries.
if (state == CARD_INSERTION) {
} else if (state == CARD_REMOVAL) {
state = CARD_ABSENT;
}
}
switch (state) {
case ALL:
break;
case CARD_PRESENT:
if (terminal.isCardPresent()) {
}
break;
case CARD_ABSENT:
if (terminal.isCardPresent() == false) {
}
break;
case CARD_INSERTION:
}
break;
case CARD_REMOVAL:
}
break;
default:
}
}
} catch (PCSCException e) {
throw new CardException("list() failed", e);
}
}
private static class ReaderState {
ReaderState() {
}
int get() {
return current;
}
}
boolean isInsertion() {
}
boolean isRemoval() {
}
}
}
if (timeout < 0) {
throw new IllegalArgumentException
("Timeout must not be negative: " + timeout);
}
// We need to initialize the state database.
// Do that with a recursive call, which will return immediately
// because we pass SCARD_STATE_UNAWARE.
// After that, proceed with the real call.
waitForChange(0);
}
if (timeout == 0) {
}
try {
int n = readerNames.length;
if (n == 0) {
throw new IllegalStateException("No terminals available");
}
int[] status = new int[n];
state = new ReaderState();
}
readerStates[i] = state;
}
for (int i = 0; i < n; i++) {
}
return true;
} catch (PCSCException e) {
if (e.code == SCARD_E_TIMEOUT) {
return false;
} else {
throw new CardException("waitForChange() failed", e);
}
}
}
// the argument sanity checks are performed in
// javax.smartcardio.TerminalFactory or TerminalImpl
long thisTimeout;
if (timeout == 0) {
} else {
// if timeout is not infinite, do the initial call that retrieves
// the status with a 0 timeout. Otherwise, we might get incorrect
thisTimeout = 0;
}
int i = 0;
if (terminal instanceof TerminalImpl == false) {
throw new IllegalArgumentException
}
}
try {
while (true) {
// that means that if we end up making multiple (more than 2)
// calls, we might wait too long.
// for now assume that is unlikely and not a problem.
if (nowPresent == wantPresent) {
}
}
}
}
}
} catch (PCSCException e) {
if (e.code == SCARD_E_TIMEOUT) {
return Collections.emptyList();
} else {
throw new CardException("waitForCard() failed", e);
}
}
}
}