com.pkrete.jsip2.messages
Class SIP2MessageResponse

java.lang.Object
  extended by com.pkrete.jsip2.messages.SIP2Message
      extended by com.pkrete.jsip2.messages.SIP2MessageResponse
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SIP2ACSStatusResponse, SIP2CirculationTransactionResponse, SIP2EndSessionResponse, SIP2FeePaidResponse, SIP2ItemInformationResponse, SIP2ItemStatusUpdateResponse, SIP2LoginResponse, SIP2PatronResponse, SIP2RenewAllResponse

public abstract class SIP2MessageResponse
extends SIP2Message

This abstract class is a base class of the SIP2 response messages received from the ILS SIP server.

Author:
Petteri Kivimäki
See Also:
Serialized Form

Field Summary
protected  String data
          Message data received from the ILS SIP server
protected  String dueDate
          Due date for the item.
protected  MediaType mediaType
          Media type of the item.
protected  boolean ok
          Tells that the requested action was allowable and completed succesfully.
protected  String permanentLocation
          The location where the item is normally stored.
protected  List<String> printLine
          Variable-length field.
protected  List<String> screenMessage
          Variable-length field.
 
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 SIP2MessageResponse(String code, String data)
          Constructs and initializes a new SIP2MessageResponse object.
 
Method Summary
abstract  String countChecksum()
          Returns the checksum of the message.
 String getData()
          Returns the message data received from the ILS SIP server.
 String getDueDate()
          Returns the due date for this item.
 MediaType getMediaType()
          Returns the media type of the item.
 String getPermanentLocation()
          Returns the location where the item is normally stored.
 List<String> getPrintLine()
          Returns a list of messages received from the ILS to print on the system's printer.
 List<String> getScreenMessage()
          Returns a list of messages received from the ILS to display on the system's screen.
 boolean isOk()
          Returns true if and only if the requested action was allowable and completed succesfully.
 boolean isValid()
          Returns true, if and only if, the response message is valid.
 void setData(String data)
          Changes the message data.
 void setDueDate(String dueDate)
          Sets the due date for the item.
 void setMediaType(MediaType mediaType)
          Sets the media type of the item
 void setOk(boolean ok)
          Sets the value that tells if the requested action was allowable and completed succesfully.
 void setPermanentLocation(String permanentLocation)
          Changes the location where the item is normally stored.
 void setPrintLine(List<String> printLines)
          Sets the printLine value, that's a list of messages received from the ILS to print on the system's printer.
 void setScreenMessage(List<String> screenMessages)
          Sets the screenMessage value, that's a list of messages received from the ILS to display on the system's screen.
 
Methods inherited from class com.pkrete.jsip2.messages.SIP2Message
getBibId, getCheckSum, getCode, getCurrencyType, getCurrentLocation, 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

ok

protected boolean ok
Tells that the requested action was allowable and completed succesfully.


data

protected String data
Message data received from the ILS SIP server


screenMessage

protected List<String> screenMessage
Variable-length field. This field provides a way for the ILS to display messages on the system's screen. They are never required. When used, there can be one or more of those fields, which are then displayed on consecutive lines of the screen.


printLine

protected List<String> printLine
Variable-length field. This field provides a way for the ILS to print messages on the system's printer. They are never required. When used, there can be one or more of these fields, which are then pronted on consecutive lines of the printer.


dueDate

protected String dueDate
Due date for the item. The ILS can send this information in any format it wishes.


permanentLocation

protected String permanentLocation
The location where the item is normally stored.


mediaType

protected MediaType mediaType
Media type of the item.

Constructor Detail

SIP2MessageResponse

protected SIP2MessageResponse(String code,
                              String data)
Constructs and initializes a new SIP2MessageResponse object.

Parameters:
code - command identifier
data - message data
Method Detail

countChecksum

public abstract String countChecksum()
Returns the checksum of the message.

Returns:
checksum of the message

isOk

public boolean isOk()
Returns true if and only if the requested action was allowable and completed succesfully. Otherwise returns false.

Returns:
true if the requested action was allowable and completed succesfully, otherwise returns false

setOk

public void setOk(boolean ok)
Sets the value that tells if the requested action was allowable and completed succesfully.

Parameters:
ok - new value

getDueDate

public String getDueDate()
Returns the due date for this item. The ILS can send this information in any format it wishes.

Returns:
due date for the item

setDueDate

public void setDueDate(String dueDate)
Sets the due date for the item.

Parameters:
dueDate - new due date

getPermanentLocation

public String getPermanentLocation()
Returns the location where the item is normally stored.

Returns:
location where the item is normally stored

setPermanentLocation

public void setPermanentLocation(String permanentLocation)
Changes the location where the item is normally stored.

Parameters:
permanentLocation - new location

getMediaType

public MediaType getMediaType()
Returns the media type of the item.

Returns:
media type of the item

setMediaType

public void setMediaType(MediaType mediaType)
Sets the media type of the item

Parameters:
mediaType - new value

getScreenMessage

public List<String> getScreenMessage()
Returns a list of messages received from the ILS to display on the system's screen.

Returns:
the screenMessage

setScreenMessage

public void setScreenMessage(List<String> screenMessages)
Sets the screenMessage value, that's a list of messages received from the ILS to display on the system's screen.

Parameters:
screenMessages - list of messages received from the ILS to display on the system's screen

getPrintLine

public List<String> getPrintLine()
Returns a list of messages received from the ILS to print on the system's printer.

Returns:
the printLine

setPrintLine

public void setPrintLine(List<String> printLines)
Sets the printLine value, that's a list of messages received from the ILS to print on the system's printer.

Parameters:
printLines - list of messages received from the ILS to print on the system's printer.

getData

public String getData()
Returns the message data received from the ILS SIP server.

Specified by:
getData in class SIP2Message
Returns:
data message data received from the ILS SIP server

setData

public void setData(String data)
Changes the message data.

Parameters:
data - new value

isValid

public boolean isValid()
Returns true, if and only if, the response message is valid. The response is validated by comparing the checksum parsed from the response message and the checksum calculated by the system. If the two checksums match, this reponse is valid. If the response doesn't include a checksum, false is returned, because in this case the validity of the response cannot be guaranteed.

Returns:
true if the response is valid, otherwise false


Copyright © 2012-2014. All Rights Reserved.