com.pkrete.jsip2.messages
Class SIP2MessageRequest

java.lang.Object
  extended by com.pkrete.jsip2.messages.SIP2Message
      extended by com.pkrete.jsip2.messages.SIP2MessageRequest
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SIP2BlockPatronRequest, SIP2CirculationTransactionRequest, SIP2EndPatronSessionRequest, SIP2FeePaidRequest, SIP2HoldRequest, SIP2ItemInformationRequest, SIP2ItemStatusUpdateRequest, SIP2LoginRequest, SIP2PatronEnableRequest, SIP2PatronRequest, SIP2RenewAllRequest, SIP2RequestResend, SIP2SCStatusRequest

public abstract class SIP2MessageRequest
extends SIP2Message

This abstract class is a base class of the SIP2 request messages sent to the ILS SIP server.

Author:
Petteri Kivimäki
See Also:
Serialized Form

Field Summary
protected static int counter
          Number of messages that the system has sent.
protected static boolean errorDetectionEnabled
          When error detection is enabled, a sequence number field, followed by a checksum number field, is appended to every message.
protected  boolean feeAcknowledged
          If false and there's a fee associated with the transaction, the ILS SIP server should tell the system in the response that there's a fee, and refuse to complete the transaction.
protected  String patronPassword
          Password (PIN) of the patron.
protected  String terminalPassword
          Password for the system to login to the ILS.
protected  boolean useFeeAcknowledged
          Tells if fee acknowledged field show be added to the request.
 
Fields inherited from class com.pkrete.jsip2.messages.SIP2Message
bibId, checkSum, code, currencyType, currentLocation, expirationDate, feeAmount, feeType, institutionId, itemIdentifier, itemProperties, patronIdentifier, pickupLocation, sequence, titleIdentifier, transactionDate, transactionId
 
Constructor Summary
protected SIP2MessageRequest(String code)
          Constructs and initializes a new SIP2MessageRequest object with the given command identifier and sets the transacation date.
 
Method Summary
 String getCheckSum()
          Returns the checksum representing the binary sum of the characters included the message.
 String getPatronPassword()
          Returns the password (PIN) of the patron.
 String getTerminalPassword()
          Returns the password for the system to login to the ILS.
 boolean isErrorDetectionEnabled()
          Returns true if and only if the error detection is enabled.
 boolean isFeeAcknowledged()
          Returns true if and only if there's a fee associated with the transaction and the patron has agreed to pay the fee.
 boolean isUseFeeAcknowledged()
          Returns true if and only if the fee acknowledged should be added to the request.
 void setErrorDetectionEnabled(boolean errorDetection)
          Sets the value that defines if the error detection is enabled.
 void setFeeAcknowledged(boolean feeAcknowledged)
          Changes the boolean value that tells if the patron has agreed to pay the fee associated with the transaction.
 void setPatronPassword(String patronPassword)
          Sets the password (PIN) of the patron.
 void setTerminalPassword(String terminalPassword)
          Sets the password for the system to login to the ILS.
 void setUseFeeAcknowledged(boolean useFeeAcknowledged)
          Sets the value that tells if the fee acknowledged field should be added to the request.
 
Methods inherited from class com.pkrete.jsip2.messages.SIP2Message
getBibId, getCode, getCurrencyType, getCurrentLocation, getData, getExpirationDate, getFeeAmount, getFeeType, getInstitutionId, getItemIdentifier, getItemProperties, getPatronIdentifier, getPickupLocation, getSequence, getTitleIdentifier, getTransactionDate, getTransactionId, isChecksum, isSequence, setBibId, setCheckSum, setCode, setCurrencyType, setCurrentLocation, setExpirationDate, setFeeAmount, setFeeType, setInstitutionId, setItemIdentifier, setItemProperties, setPatronIdentifier, setPickupLocation, setSequence, setTitleIdentifier, setTransactionDate, setTransactionId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

terminalPassword

protected String terminalPassword
Password for the system to login to the ILS. If this feature is not used by the ILS in the library then the value should be empty if it's required in the request, and can be omitted entirely if the field is optional in the message.


patronPassword

protected String patronPassword
Password (PIN) of the patron. If this feature is not used by the ILS in the library then the value should be empty if it's required in the request, and can be omitted entirely if the field is optional in the message.


feeAcknowledged

protected boolean feeAcknowledged
If false and there's a fee associated with the transaction, the ILS SIP server should tell the system in the response that there's a fee, and refuse to complete the transaction. If the system and the patron then interact and the patron agrees to pay the fee, this field will be set to true on a second request message, indicatin to the ILS SIP server that the patron has acknowledged the fee and the transaction should not be refused just because there is a fee associated with it.


useFeeAcknowledged

protected boolean useFeeAcknowledged
Tells if fee acknowledged field show be added to the request.


errorDetectionEnabled

protected static boolean errorDetectionEnabled
When error detection is enabled, a sequence number field, followed by a checksum number field, is appended to every message.


counter

protected static int counter
Number of messages that the system has sent. Value must be 0-9.

Constructor Detail

SIP2MessageRequest

protected SIP2MessageRequest(String code)
Constructs and initializes a new SIP2MessageRequest object with the given command identifier and sets the transacation date. By default the error detection is not enabled.

Parameters:
code - command identifier
Method Detail

isErrorDetectionEnabled

public boolean isErrorDetectionEnabled()
Returns true if and only if the error detection is enabled. When error detection is enabled, a sequence number field, followed by a checksum number field, is appended to every message.

Returns:
true if error detection is enabled, otherwise false

setErrorDetectionEnabled

public void setErrorDetectionEnabled(boolean errorDetection)
Sets the value that defines if the error detection is enabled.

Parameters:
errorDetection - true or false

getTerminalPassword

public String getTerminalPassword()
Returns the password for the system to login to the ILS.

Returns:
password for the system to login to the ILS

setTerminalPassword

public void setTerminalPassword(String terminalPassword)
Sets the password for the system to login to the ILS.

Parameters:
terminalPassword - new value

getPatronPassword

public String getPatronPassword()
Returns the password (PIN) of the patron.

Returns:
password (PIN) of the patron

setPatronPassword

public void setPatronPassword(String patronPassword)
Sets the password (PIN) of the patron.

Parameters:
patronPassword - new value

isFeeAcknowledged

public boolean isFeeAcknowledged()
Returns true if and only if there's a fee associated with the transaction and the patron has agreed to pay the fee. Otherwise returns false. Optional field.

Returns:
true if there's a fee associated with the transaction and the patron has agreed to pay the fee, otherwise false

setFeeAcknowledged

public void setFeeAcknowledged(boolean feeAcknowledged)
Changes the boolean value that tells if the patron has agreed to pay the fee associated with the transaction.

Parameters:
feeAcknowledged - new value

isUseFeeAcknowledged

public boolean isUseFeeAcknowledged()
Returns true if and only if the fee acknowledged should be added to the request. Otherwise returns false.

Returns:
true if the fee acknowledged field should be added to the request, otherwise false

setUseFeeAcknowledged

public void setUseFeeAcknowledged(boolean useFeeAcknowledged)
Sets the value that tells if the fee acknowledged field should be added to the request.

Parameters:
useFeeAcknowledged - new value

getCheckSum

public String getCheckSum()
Returns the checksum representing the binary sum of the characters included the message. The checksum is formed with four ASCII charater digits.

Overrides:
getCheckSum in class SIP2Message
Returns:
the checkSum


Copyright © 2012-2014. All Rights Reserved.