Interface DSNews
- All Superinterfaces:
DSData
,DSPacket
,DSSerializable
,Iterable<DSField>
Extends DSData
to provide helper methods for sending News.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Change the headline identified with the story code in this update.static final int
Delete the headline identified with the story code in this update.static final int
The field used to hold the news authentication string.static final int
The field used to hold the list of company codes associated with this news storystatic final int
The base field used to hold any custstatic final int
The maximum number of custom user-defined news code types allowed.static final int
The field used to hold the news date/time stringstatic final int
The field used to hold the news headline stringstatic final int
The field used to hold the list of product codes associated with this news storystatic final int
Typically used to indicate a reason for a zero-headline response to a client-driven news search.static final int
Field number used for client-driven news search requests - if present, will contain the oldest date bound for the search.static final int
Field number used for client-driven news search requests - if present, will contain the most recent date bound for the search.static final int
Field number used for client-driven news search requests - if present, will contain any flags for the search, for example to represent full-story search / headline search etc.static final int
Field number used for client-driven news search requests - will contain the search string.static final int
Field number used for client-driven news search requests - if present, will contain the last storycode received by the client - useful for more granular batching than simple date-bounded requests.static final int
Use to indicate to the clients the size of the subsequent headline response.static final int
The field used to hold the news storycode identifiedstatic final int
The field used to hold the list of topic codes associated with this news storyFields inherited from interface com.caplin.datasource.interfaces.DSData
CONTAINER_TYPE, F_AUTH_UPDATE, F_AUTHGLOBAL, F_CHANGEDFIELDS, F_CLEAR_PERMISSIONS, F_CLEAR_TYPE2, F_CLEAR_TYPE3, F_CREATEOBJECT, F_CREATEPARENT, F_DELETE_PERMISSION, F_FILTER_TYPE2, F_FILTER_TYPE3, F_IMAGE, F_NONACTIVE, GENERIC_TYPE, NEWS_TYPE, PAGE_TYPE, PERMISSION_TYPE, RECORD_TYPE, STORY_TYPE, TYPE2_RECORD_TYPE, TYPE3_RECORD_TYPE, UNKNOWN_TYPE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCompanyCode
(String code) Adds a company code.void
addCompanyCodes
(String[] codes) Adds an array of company codes.void
addCustomCode
(int codeNum, String code) Adds a custom user-define code.void
addCustomCodes
(int codeNum, String[] codes) Adds an array of custom user-define codes.void
addProductCode
(String code) Adds a product code.void
addProductCodes
(String[] codes) Adds an array of product code.void
addTopicCode
(String code) Adds a topic code.void
addTopicCodes
(String[] codes) Adds an array of topic codes.void
setAuthString
(String auth) Sets an authorisation string for this headline.void
setDisplayTimeStamp
(String date) Sets the date/time of this news headline.void
setHeadline
(String headline) Set the news headline text.void
setStoryCode
(String story) Set the headline's associated story code.Methods inherited from interface com.caplin.datasource.interfaces.DSData
addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addData, addData, addData, addData, addData, addData, addData, addData, clearFields, count, elements, getFieldByFieldNumber, getFieldByFieldNumber, getFlags, getKeys, getSubject, getType, getValues, iterator, removeField, setFlags, setSubject, setType, updateData, updateData
Methods inherited from interface com.caplin.datasource.interfaces.DSPacket
send, sendDirect, sendToPeer
Methods inherited from interface com.caplin.datasource.interfaces.DSSerializable
toBytes
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
F_DELETE_HEADLINE
static final int F_DELETE_HEADLINEDelete the headline identified with the story code in this update.- See Also:
-
F_CHANGE_HEADLINE
static final int F_CHANGE_HEADLINEChange the headline identified with the story code in this update.- See Also:
-
NEWS_HEADLINE_FIELDNUM
static final int NEWS_HEADLINE_FIELDNUMThe field used to hold the news headline string- See Also:
-
NEWS_STORYCODE_FIELDNUM
static final int NEWS_STORYCODE_FIELDNUMThe field used to hold the news storycode identified- See Also:
-
NEWS_DATETIME_FIELDNUM
static final int NEWS_DATETIME_FIELDNUMThe field used to hold the news date/time string- See Also:
-
NEWS_AUTHSTRING_FIELDNUM
static final int NEWS_AUTHSTRING_FIELDNUMThe field used to hold the news authentication string.- See Also:
-
NEWS_PRODUCT_CODE_FIELDNUM
static final int NEWS_PRODUCT_CODE_FIELDNUMThe field used to hold the list of product codes associated with this news story- See Also:
-
NEWS_TOPIC_CODE_FIELDNUM
static final int NEWS_TOPIC_CODE_FIELDNUMThe field used to hold the list of topic codes associated with this news story- See Also:
-
NEWS_COMPANY_CODE_FIELDNUM
static final int NEWS_COMPANY_CODE_FIELDNUMThe field used to hold the list of company codes associated with this news story- See Also:
-
NEWS_CUSTOM_CODE_BASE_FIELDNUM
static final int NEWS_CUSTOM_CODE_BASE_FIELDNUMThe base field used to hold any cust- See Also:
-
NEWS_CUSTOM_CODE_MAX
static final int NEWS_CUSTOM_CODE_MAXThe maximum number of custom user-defined news code types allowed.
The codes will use field numbers ranging from
NEWS_CUSTOM_CODE_BASE_FIELDNUM
toNEWS_CUSTOM_CODE_BASE_FIELDNUM
+NEWS_CUSTOM_CODE_MAX
- 1. -
NEWS_SIZE_FIELDNUM
static final int NEWS_SIZE_FIELDNUMUse to indicate to the clients the size of the subsequent headline response. Typically used in the initial packet as a response to a client-driven news search request. This can be used for batching of results, useful when a client search has generated a large number of matches.- See Also:
-
NEWS_REASON_FIELDNUM
static final int NEWS_REASON_FIELDNUMTypically used to indicate a reason for a zero-headline response to a client-driven news search. For example: news service unavailable, no matches found etc.- See Also:
-
NEWS_REQ_SEARCH
static final int NEWS_REQ_SEARCHField number used for client-driven news search requests - will contain the search string.- See Also:
-
NEWS_REQ_DATE_TO
static final int NEWS_REQ_DATE_TOField number used for client-driven news search requests - if present, will contain the most recent date bound for the search.- See Also:
-
NEWS_REQ_DATE_FROM
static final int NEWS_REQ_DATE_FROMField number used for client-driven news search requests - if present, will contain the oldest date bound for the search.- See Also:
-
NEWS_REQ_FLAGS
static final int NEWS_REQ_FLAGSField number used for client-driven news search requests - if present, will contain any flags for the search, for example to represent full-story search / headline search etc.- See Also:
-
NEWS_REQ_STORYCODE
static final int NEWS_REQ_STORYCODEField number used for client-driven news search requests - if present, will contain the last storycode received by the client - useful for more granular batching than simple date-bounded requests.- See Also:
-
-
Method Details
-
setHeadline
Set the news headline text.
- Parameters:
headline
- the headline text.
-
setStoryCode
Set the headline's associated story code.
- Parameters:
story
- the story code.
-
setDisplayTimeStamp
Sets the date/time of this news headline.
- Parameters:
date
- the date and time of the headline.
-
setAuthString
Sets an authorisation string for this headline. This can be used for a check by an authentication module to see if a user is entitled to view the headline.
- Parameters:
auth
- the authorisation string - there is a maximum of 32 characters supported by the Liberator for this string (any additional characters will be truncated).
-
addProductCode
Adds a product code.
- Parameters:
code
- the product code to be added.
-
addProductCodes
Adds an array of product code.
- Parameters:
codes
- the product codes to be added.
-
addTopicCode
Adds a topic code.
- Parameters:
code
- the topic code to be added.
-
addTopicCodes
Adds an array of topic codes.
- Parameters:
codes
- the topic codes to be added.
-
addCompanyCode
Adds a company code.
- Parameters:
code
- the company code to be added.
-
addCompanyCodes
Adds an array of company codes.
- Parameters:
codes
- the company codes to be added.
-
addCustomCode
Adds a custom user-define code.
- Parameters:
codeNum
- an identifier for this type of code.code
- the code to be added.- Throws:
IndexOutOfBoundsException
- if the codeNum is < 1 or >=NEWS_CUSTOM_CODE_MAX
-
addCustomCodes
Adds an array of custom user-define codes.
- Parameters:
codeNum
- an identifier for this type of code.codes
- the codes to be added.- Throws:
IndexOutOfBoundsException
- if the codeNum is < 1 or >=NEWS_CUSTOM_CODE_MAX
-