opencard.core.service
Class CardRequest

java.lang.Object
  |
  +--opencard.core.service.CardRequest

public class CardRequest
extends java.lang.Object

A CardRequest is used for waitForCard() invocations and specifies what kind of smart card an application is waited for.

See Also:
CardTerminalRegistry, CardTerminal, Slot

Field Summary
static int ANYCARD
          Wait behavior if cards already inserted are to be considered.
static int NEWCARD
          Wait behavior if cards already inserted are to be ignored.
 
Constructor Summary
CardRequest()
          Deprecated.  
CardRequest(CardIDFilter filter)
          Deprecated.  
CardRequest(CardIDFilter filter, int timeout)
          Deprecated.  
CardRequest(java.lang.Class cardServiceClass)
          Deprecated.  
CardRequest(java.lang.Class cardServiceClass, int timeout)
          Deprecated.  
CardRequest(int timeout)
          Deprecated.  
CardRequest(int waitBehavior, CardTerminal terminal, java.lang.Class cardServiceClass)
          Create a new CardRequest.
 
Method Summary
 java.lang.Class getCardServiceClass()
          Gets the service required by this CardRequest.
 CardTerminal getCardTerminal()
          Gets the CardTerminal of this CardRequest.
 CardIDFilter getFilter()
          Gets the filter of this CardRequest.
 int getTimeout()
          Gets the timeout value of this CardRequest.
 int getWaitBehavior()
          Return the wait behavior of the CardRequest.
 boolean isTimeoutSet()
          Determines whether a timeout period is set.
 void setCardServiceClass(java.lang.Class cardServiceClass)
          Deprecated.  
 void setCardTerminal(CardTerminal terminal)
          Deprecated.  
 void setFilter(CardIDFilter filter)
          Sets the filter of this CardRequest.
 void setTimeout(int timeout)
          Sets the timeout value of this CardRequest.
 void setWaitBehavior(int how)
          Deprecated.  
 java.lang.String toString()
          Returns a string representation of this card request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ANYCARD

public static final int ANYCARD
Wait behavior if cards already inserted are to be considered. This is the default wait behavior.

NEWCARD

public static final int NEWCARD
Wait behavior if cards already inserted are to be ignored.
Constructor Detail

CardRequest

public CardRequest(int waitBehavior,
                   CardTerminal terminal,
                   java.lang.Class cardServiceClass)
Create a new CardRequest. The constructor contains the most commonly used card request attributes. Additional attributes can be set using the setXXX methods.
Parameters:
waitBehaviour - specify whether cards already present should be included or ignored. This parameter is mandatory.
terminal - specify the terminal in which the card has to be available. Specify null for all terminals.
cardServiceClass - specify the card service interface (or implementation) class that should be available for the card. Specify null for all cards.

To set a timeout use setTimeout. To set your own filter use setFilter.

See Also:
NEWCARD, ANYCARD, setTimeout(int), setFilter(opencard.core.service.CardIDFilter)

CardRequest

public CardRequest()
Deprecated.  

CardRequest

public CardRequest(int timeout)
Deprecated.  

CardRequest

public CardRequest(CardIDFilter filter)
Deprecated.  

CardRequest

public CardRequest(CardIDFilter filter,
                   int timeout)
Deprecated.  

CardRequest

public CardRequest(java.lang.Class cardServiceClass)
Deprecated.  

CardRequest

public CardRequest(java.lang.Class cardServiceClass,
                   int timeout)
Deprecated.  
Method Detail

setTimeout

public void setTimeout(int timeout)
Sets the timeout value of this CardRequest. To unset the timeout, use a negative value.
Parameters:
timeout - The timeout in seconds.

setFilter

public void setFilter(CardIDFilter filter)
Sets the filter of this CardRequest. Only card IDs that pass this filter can be used to satisfy this request. If the filter is set to null, all card IDs can be used.
Parameters:
filter - the filter for card IDs that may satisfy this request

getFilter

public CardIDFilter getFilter()
Gets the filter of this CardRequest.
Returns:
the filter for card IDs, or null if not set

getCardServiceClass

public java.lang.Class getCardServiceClass()
Gets the service required by this CardRequest.
Returns:
the CardService that has to be supported, or null if not set

getCardTerminal

public CardTerminal getCardTerminal()
Gets the CardTerminal of this CardRequest.
Returns:
the CardTerminal which has to satisfy this request, or null if not set

getTimeout

public int getTimeout()
Gets the timeout value of this CardRequest.
Returns:
The timeout value in seconds, or null if not set.

getWaitBehavior

public int getWaitBehavior()
Return the wait behavior of the CardRequest.
Returns:
the waiting behavior, either ANYCARD or NEWCARD
See Also:
ANYCARD, NEWCARD

isTimeoutSet

public boolean isTimeoutSet()
Determines whether a timeout period is set.
Returns:
true if the timeout has been set, false otherwise

toString

public java.lang.String toString()
Returns a string representation of this card request.
Returns:
a human-readable representation of this request
Overrides:
toString in class java.lang.Object

setCardServiceClass

public void setCardServiceClass(java.lang.Class cardServiceClass)
Deprecated.  

setCardTerminal

public void setCardTerminal(CardTerminal terminal)
Deprecated.  

setWaitBehavior

public void setWaitBehavior(int how)
Deprecated.