Oracle Application Server Web Services UDDI Client API Reference
10g (9.0.4)

Part No. B10396-01

oracle.uddi.message.util
Class UddiElementBag

java.lang.Object
  |
  +--oracle.uddi.message.UddiElement
        |
        +--oracle.uddi.message.util.UddiElementBag
All Implemented Interfaces:
BagRandomAccessor, BagSequentialAccessor
Direct Known Subclasses:
AddPublisherAssertions, AssertionStatusReport, BindingDetail, BindingTemplates, BusinessDetail, BusinessDetailExt, BusinessInfos, BusinessServices, CategoryBag, Contacts, DeletePublisherAssertions, DiscoveryURLs, IdentifierBag, PublisherAssertions, RelatedBusinessInfos, SaveBinding, SaveBusiness, SaveService, SaveTModel, ServiceDetail, ServiceInfos, SetPublisherAssertions, SharedRelationships, TModelDetail, TModelInfos, TModelInstanceDetails

public abstract class UddiElementBag
extends UddiElement
implements BagRandomAccessor, BagSequentialAccessor

A data structure that holds a bag of UddiElements of the same typ. Examples include CategoryBag, discoveryURLs, etc.

See Also:
BagRandomAccessor, BagSequentialAccessor

Constructor Summary
UddiElementBag(UddiElementFactory ueFactory)
           

 

Method Summary
 boolean addUddiElement(UddiElement uddiElt)
          Convenient method to add a UDDI Element to the bag.
static UddiElementIterator getOrCreateUddiElementIterator(UddiElementBag uddiEltBag)
          A helper method that returns an existing UddiElementIterator when available, or constructing a new UddiElementIterator when the sub elements are in a List.
static java.util.List getOrCreateUddiElementList(UddiElementBag uddiEltBag)
           A helper method that returns an existing List of sub UddiElements when available, or constructing a new List when the sub elements are in an UddiElementIterator.
 UddiElement getUddiElement(int index)
          Convenient method to get a UDDI Element from the bag.
 UddiElementIterator getUddiElementIterator()
           
 java.util.List getUddiElementList()
           
 boolean hasEmptyContent()
          Returns true if there is no sub UddiElement contained in this bag.
 void init()
          This method is not intended for use by clients of the API.
 void initWithEmptyList()
          Initalize the element with an empty list to hold sub UDDI elements.
 boolean removeUddiElement(UddiElement uddiElt)
          Convenient method to remove a UDDI Element from the bag.
 void setUddiElementIterator(UddiElementIterator uitr)
           
 void setUddiElementList(java.util.List listUddiElt)
           

 

Methods inherited from class oracle.uddi.message.UddiElement
getElementName, getElementPrefix, getGeneric, getNamespaceUri, getTagName, getUddiElementFactory, getVersion, isV1Compatible, isV2Compatible, marshall, unmarshall

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

UddiElementBag

public UddiElementBag(UddiElementFactory ueFactory)
Method Detail

init

public void init()
Description copied from class: UddiElement

This method is not intended for use by clients of the API.

Initalizes the element. If the element has been initalized, it re-initalizes the element so that it is as if it is a new object. This method enables object reuse.

Note on re-initalization: Reinitalization is done such that the object will be in the state as if it is a new object. It implies that all sub-elements will be discarded. If the caller wants to re-use sub-elements, it is caller's responsibility to get the sub-elements prior to re-initalization and reassign the optional sub-elements after re-initalization.

For example, A tModel contains an optional sub-element identifierBag. Hence identifierBag will be discarded. If the caller wishes to re-use the identifierBag, the caller has to get the identifierBag, re-initalize it and assign it back as the tModel's identifierBag :

   ...
   IdentifierBag identifierBag = tModel.getIdentifierBag();
   tModel.init();
   identifierBag.init();
   tModel.setIdentifierBag(identifierBag);
   ...


Access to UddiElement and its sub-structure is not guaranteed to be thread-safe.

Every subclass of UddiElement MUST overwrite init(). In the implementation, it should always invoke super.init() and intialize/reinitialize subclass-specific members. The pattern is exactly the same as a Java constructor.

Overrides:
init in class UddiElement

initWithEmptyList

public void initWithEmptyList()
Initalize the element with an empty list to hold sub UDDI elements.

setUddiElementList

public void setUddiElementList(java.util.List listUddiElt)
                        throws SequentialAccessOnlyException
Specified by:
setUddiElementList in interface BagRandomAccessor
SequentialAccessOnlyException

getUddiElementList

public java.util.List getUddiElementList()
                                  throws SequentialAccessOnlyException
Specified by:
getUddiElementList in interface BagRandomAccessor
SequentialAccessOnlyException

addUddiElement

public boolean addUddiElement(UddiElement uddiElt)
                       throws SequentialAccessOnlyException
Convenient method to add a UDDI Element to the bag. It works only if the bag is implemented by a random-access list. If a list has not been created, a list based on the factory implementation will be used.
SequentialAccessOnlyException

removeUddiElement

public boolean removeUddiElement(UddiElement uddiElt)
                          throws SequentialAccessOnlyException
Convenient method to remove a UDDI Element from the bag. It works only if the bag is implemented by a random-access list. If a list has not been created, a list based on the factory implementation will be used.
SequentialAccessOnlyException

getUddiElement

public UddiElement getUddiElement(int index)
                           throws SequentialAccessOnlyException
Convenient method to get a UDDI Element from the bag. It works only if the bag is implemented by a random-access list. If a list has not been created, a list based on the factory implementation will be used.
SequentialAccessOnlyException

getUddiElementIterator

public UddiElementIterator getUddiElementIterator()
                                           throws RandomAccessOnlyException
Specified by:
getUddiElementIterator in interface BagSequentialAccessor
RandomAccessOnlyException

setUddiElementIterator

public void setUddiElementIterator(UddiElementIterator uitr)
                            throws RandomAccessOnlyException
Specified by:
setUddiElementIterator in interface BagSequentialAccessor
RandomAccessOnlyException

hasEmptyContent

public boolean hasEmptyContent()
                        throws MarshallException
Returns true if there is no sub UddiElement contained in this bag.
Overrides:
hasEmptyContent in class UddiElement
MarshallException

getOrCreateUddiElementList

public static java.util.List getOrCreateUddiElementList(UddiElementBag uddiEltBag)
                                                 throws UddiException

A helper method that returns an existing List of sub UddiElements when available, or constructing a new List when the sub elements are in an UddiElementIterator.

Side effects: if the sub elements are in an UddiElementIterator, the iterator will be consumed.

Parameters:
uddiEltBag - the UddiElementBag that contains some sub elements.
Returns:
a non-null List representing the underlying sub elements
UddiException

getOrCreateUddiElementIterator

public static UddiElementIterator getOrCreateUddiElementIterator(UddiElementBag uddiEltBag)
A helper method that returns an existing UddiElementIterator when available, or constructing a new UddiElementIterator when the sub elements are in a List.
Parameters:
uddiEltBag - the UddiElementBag that contains some sub elements.
Returns:
a non-null UddiElementIterator representing the underlying sub elements

Oracle Application Server Web Services UDDI Client API Reference
10g (9.0.4)

Part No. B10396-01

Copyright © 2001, 2003, Oracle. All rights reserved.