com.ibm.cics.atomservice
Class AtomserviceImpl

java.lang.Object
  extended by com.ibm.cics.atomservice.Atomservice
      extended by com.ibm.cics.atomservice.AtomserviceImpl

public class AtomserviceImpl
extends Atomservice

Usage:
This class is used to create and update the Atomservice configuration file.

Class level design/service information:
This class provides the functionality for the user to create, update, marshall and unmarshall (between JAVA instance and XML) an atom config file.

Version:
%E%
Author:
Pradeep Gohil
See Also:
AtomserviceImpl

Nested Class Summary
static class AtomserviceImpl.PreferredMapper
           
 
Field Summary
static java.lang.String CATEGORY
           
static java.lang.String COLLECTION
           
static java.lang.String FEED
           
static java.lang.String FILE
           
static java.lang.String PROGRAM
           
static java.lang.String SERVICE
           
static java.lang.String TSQUEUE
           
 
Constructor Summary
AtomserviceImpl(java.io.InputStream infile)
          Usage:
Constructor to create an AtomserviceImpl from an existing Atomservice configuration file.
AtomserviceImpl(java.lang.String version, java.lang.String atomservice_type, java.lang.String resource_name, java.lang.String resource_type, java.lang.String default_URI, java.lang.String xmltransform_name)
          Usage:
Constructor to create an AtomserviceImpl
 
Method Summary
 void changeCollectiontoFeed()
          Usage:
Change the Atomservice configuration file from type COLLECTION to FEED
 void changeFeedtoCollection()
          Usage:
Change the Atomservice configuration file from type FEED to COLLECTION
 java.lang.String getAtomEntryContentCicsResource()
          Usage:
Function to return the CICS resource name in the <atom:content cics:resource="name"> element contained within the <atom:entry> element
 java.lang.String getAtomEntryContentCicsType()
          Usage:
Function to return the CICS resource type in the <atom:content cics:type="cicstype"> element contained within the <atom:entry> element
 java.lang.String getAtomEntryLinkUri()
          Usage:
Function to return the href URI attribute of the <atom:link href="uri"> element contained within the <atom:entry> element
 java.lang.String getAtomEntryTitle()
          Usage:
Function to return the content of the <atom:title> element in the <atom:entry> element
 java.lang.String getAtomFeedLinkUri()
          Usage:
Function to return the href URI attribute of the <atom:link href="uri"> element contained within the <atom:feed> element
 java.lang.String getAtomFeedTitle()
          Usage:
Function to return the content of the <atom:title> element in the <atom:feed> element
 java.lang.String getAtomserviceType()
          Usage:
Function to return the Atomservice type in the <cics:atomservice type="value"> element
 java.lang.String getBindRoot()
          Usage:
Function to return the value of the root attribute in the <cics:bind root="value"> element
 java.lang.String getBindXmltransformName()
          Usage:
Function to get the optional XML Transform name in the <cics:bind xmltransform="value"> element
 int getCicsFeedWindow()
          Usage:
Function to return the CICS feed window attribute < cics:feed window="n">
 java.lang.String getCicsResourceName()
          Usage:
Function to return the CICS resource name in the <cics:resource name="value"> element contained within the <cics:feed> element
 java.lang.String getCicsResourceType()
          Usage:
Function to return the CICS resource type in the <cics:resource type="cicstype"> element contained within the <cics:feed> element
 java.lang.String getUrimapTransaction()
          Usage:
Function to return the optional transaction ID of the <cics:urimap transaction="value"> element
 java.lang.String getUrimapUri()
          Usage:
Function to return the value of the URI attribute in the <cics:urimap uri="value"> element
 java.lang.String getUrimapUserid()
          Usage:
Function to return the optional user ID of the <cics:urimap userid="value"> element
 void updateAtomEntryContent(java.lang.String cics_resource_name, java.lang.String cics_resource_type)
          Usage:
Function to update the element.
 void updateAtomEntryLinkUri(java.lang.String uri)
          Usage:
Function to update the href attribute.
 void updateAtomEntryTitle(java.lang.String title)
          Usage:
Function to update the element.
 void updateAtomFeedLinkUri(java.lang.String uri)
          Usage:
Function to update the href attribute.
 void updateAtomFeedTitle(java.lang.String title)
          Usage:
Function to update the element.
 void updateCicsFeedResource(java.lang.String name, java.lang.String type)
          Usage:
Function to update the cics:resource element.
 void updateCicsFeedWindow(int window_size)
          Usage:
Function to add/update the CICS feed window attribute
 void updateCicsResourceBind(java.lang.String xmltransform_name, java.lang.String root)
          Usage:
Function to update the cics:bind element.
 void updateUrimap(java.lang.String uri, java.lang.String userid, java.lang.String transaction)
          Usage:
Function to update the cics:urimap element.
 void updateUrimapOptions(java.lang.String userid, java.lang.String transaction)
          Usage:
Function to update the optional cics:urimap User ID and Transaction ID attributes.
 void updateUrimapUri(java.lang.String uri)
          Usage:
Function to update the cics:urimap URI attribute.
 void writeConfigFile(java.io.OutputStream ConfigOutStream)
          Usage:
Function to write the configuration file java instance to a stream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TSQUEUE

public static final java.lang.String TSQUEUE
See Also:
Constant Field Values

FILE

public static final java.lang.String FILE
See Also:
Constant Field Values

PROGRAM

public static final java.lang.String PROGRAM
See Also:
Constant Field Values

FEED

public static final java.lang.String FEED
See Also:
Constant Field Values

SERVICE

public static final java.lang.String SERVICE
See Also:
Constant Field Values

COLLECTION

public static final java.lang.String COLLECTION
See Also:
Constant Field Values

CATEGORY

public static final java.lang.String CATEGORY
See Also:
Constant Field Values
Constructor Detail

AtomserviceImpl

public AtomserviceImpl(java.io.InputStream infile)
                throws javax.xml.bind.JAXBException,
                       org.xml.sax.SAXException
Usage:
Constructor to create an AtomserviceImpl from an existing Atomservice configuration file. The existing file will be validated against the schema. Note: If this is a "version 1" atom service configuration file, the version remain the same unless a version 2 element/attribute is added. In which case the version will become 2

Parameters:
infile - Stream of existing atom configuration file
Throws:
javax.xml.bind.JAXBException
org.xml.sax.SAXException

AtomserviceImpl

public AtomserviceImpl(java.lang.String version,
                       java.lang.String atomservice_type,
                       java.lang.String resource_name,
                       java.lang.String resource_type,
                       java.lang.String default_URI,
                       java.lang.String xmltransform_name)
Usage:
Constructor to create an AtomserviceImpl

Parameters:
version - Current valid values is 2
atomservice_type - current valid values are AtomserviceImpl.FEED, AtomserviceImpl.COLLECTION
resource_name - Name of the CICS resource
resource_type - Type of the CICS resource. Current valid values are AtomserviceImpl.FILE AtomserviceImpl.TSQUEUE and AtomserviceImpl.PROGRAM
default_URI - Default URI to be used within the configuration file
xmltransform_name - Name of the CICS XML Transform resource
Method Detail

getAtomserviceType

public java.lang.String getAtomserviceType()
Usage:
Function to return the Atomservice type in the <cics:atomservice type="value"> element

Returns:
Atomservice type (eg feed, collection)

getCicsResourceName

public java.lang.String getCicsResourceName()
Usage:
Function to return the CICS resource name in the <cics:resource name="value"> element contained within the <cics:feed> element

Returns:
Return the CICS feed resource name.

getCicsResourceType

public java.lang.String getCicsResourceType()
Usage:
Function to return the CICS resource type in the <cics:resource type="cicstype"> element contained within the <cics:feed> element

Returns:
Return the CICS feed resource type. (eg file, tsqueue, program)

changeFeedtoCollection

public void changeFeedtoCollection()
Usage:
Change the Atomservice configuration file from type FEED to COLLECTION


changeCollectiontoFeed

public void changeCollectiontoFeed()
Usage:
Change the Atomservice configuration file from type COLLECTION to FEED


updateCicsFeedWindow

public void updateCicsFeedWindow(int window_size)
Usage:
Function to add/update the CICS feed window attribute

Parameters:
window_size - Positive number to set the window size

getCicsFeedWindow

public int getCicsFeedWindow()
Usage:
Function to return the CICS feed window attribute < cics:feed window="n">

Returns:
Returns the window size or default 8 if not present

updateCicsFeedResource

public void updateCicsFeedResource(java.lang.String name,
                                   java.lang.String type)
Usage:
Function to update the cics:resource element. Specify parameters to be updated. Arguments specified as null will not be updated.

Parameters:
name - CICS resource name
type - CICS resource type (AtomserviceImpl.FILE AtomserviceImpl.TSQUEUE AtomserviceImpl.PROGRAM)

updateCicsResourceBind

public void updateCicsResourceBind(java.lang.String xmltransform_name,
                                   java.lang.String root)
Usage:
Function to update the cics:bind element. Specify the updated parameters.

Parameters:
xmltransform_name - CICS XMLTransform resource name
root - Root string

getBindRoot

public java.lang.String getBindRoot()
Usage:
Function to return the value of the root attribute in the <cics:bind root="value"> element

Returns:
Return the value of the root attribute

getBindXmltransformName

public java.lang.String getBindXmltransformName()
Usage:
Function to get the optional XML Transform name in the <cics:bind xmltransform="value"> element

Returns:
Return the value of the XML Transform attribute

updateUrimap

public void updateUrimap(java.lang.String uri,
                         java.lang.String userid,
                         java.lang.String transaction)
Usage:
Function to update the cics:urimap element. Specify parameters to be updated. Arguments specified as null will not be updated.

Parameters:
uri - URI to be used
userid - User ID to be used
transaction - Transaction ID to be used

updateUrimapUri

public void updateUrimapUri(java.lang.String uri)
Usage:
Function to update the cics:urimap URI attribute. Warning: Assumes caller provides the correct URI, in the correct form If you want to perform some validation (and auto append "/*") use updateUrimap

Parameters:
uri - URI to be used

updateUrimapOptions

public void updateUrimapOptions(java.lang.String userid,
                                java.lang.String transaction)
Usage:
Function to update the optional cics:urimap User ID and Transaction ID attributes.

Parameters:
userid - User ID to be used
transaction - Transaction ID to be used

getUrimapUri

public java.lang.String getUrimapUri()
Usage:
Function to return the value of the URI attribute in the <cics:urimap uri="value"> element

Returns:
Return the URI value of the URIMAP

getUrimapUserid

public java.lang.String getUrimapUserid()
Usage:
Function to return the optional user ID of the <cics:urimap userid="value"> element

Returns:
Return the URIMAP user ID

getUrimapTransaction

public java.lang.String getUrimapTransaction()
Usage:
Function to return the optional transaction ID of the <cics:urimap transaction="value"> element

Returns:
Return the URIMAP transaction ID

updateAtomFeedTitle

public void updateAtomFeedTitle(java.lang.String title)
Usage:
Function to update the element.

Parameters:
title - Updated title to be used.

getAtomFeedTitle

public java.lang.String getAtomFeedTitle()
Usage:
Function to return the content of the <atom:title> element in the <atom:feed> element

Returns:
Return the atom feed title

updateAtomFeedLinkUri

public void updateAtomFeedLinkUri(java.lang.String uri)
Usage:
Function to update the href attribute. Warning: Assumes caller provides the correct URI, in the correct form

Parameters:
uri - URI to be used

getAtomFeedLinkUri

public java.lang.String getAtomFeedLinkUri()
Usage:
Function to return the href URI attribute of the <atom:link href="uri"> element contained within the <atom:feed> element

Returns:
Return the atom feed link URI

updateAtomEntryTitle

public void updateAtomEntryTitle(java.lang.String title)
Usage:
Function to update the element.

Parameters:
title - Updated title to be used.

getAtomEntryTitle

public java.lang.String getAtomEntryTitle()
Usage:
Function to return the content of the <atom:title> element in the <atom:entry> element

Returns:
Return the atom entry title

updateAtomEntryLinkUri

public void updateAtomEntryLinkUri(java.lang.String uri)
Usage:
Function to update the href attribute. Warning: Assumes caller provides the correct URI, in the correct form

Parameters:
uri - URI to be used

getAtomEntryLinkUri

public java.lang.String getAtomEntryLinkUri()
Usage:
Function to return the href URI attribute of the <atom:link href="uri"> element contained within the <atom:entry> element

Returns:
Return the atom entry link URI

updateAtomEntryContent

public void updateAtomEntryContent(java.lang.String cics_resource_name,
                                   java.lang.String cics_resource_type)
Usage:
Function to update the element. Specify parameters to be updated. Arguments specified as null will not be updated.

Parameters:
cics_resource_name - CICS resource name
cics_resource_type - CICS resource type

getAtomEntryContentCicsResource

public java.lang.String getAtomEntryContentCicsResource()
Usage:
Function to return the CICS resource name in the <atom:content cics:resource="name"> element contained within the <atom:entry> element

Returns:
Return the atom entry CICS resource name

getAtomEntryContentCicsType

public java.lang.String getAtomEntryContentCicsType()
Usage:
Function to return the CICS resource type in the <atom:content cics:type="cicstype"> element contained within the <atom:entry> element

Returns:
Return the atom entry CICS type. (eg file, tsqueue, program)

writeConfigFile

public void writeConfigFile(java.io.OutputStream ConfigOutStream)
                     throws javax.xml.bind.JAXBException,
                            java.io.IOException,
                            org.xml.sax.SAXException
Usage:
Function to write the configuration file java instance to a stream

Parameters:
ConfigOutStream - Java Stream to be written to
Throws:
javax.xml.bind.JAXBException
java.io.IOException
org.xml.sax.SAXException