public class ShimState extends java.lang.Object implements ConfigElement
Modifier and Type | Field and Description |
---|---|
static int |
DRIVER
Parameter value for getState() method indicating
DriverShim state. |
static int |
PUBLISHER
Parameter value for getState() method indicating
PublicationShim state. |
static int |
SUBSCRIBER
Parameter value for getState() method indicating
SubscriptionShim state. |
static java.lang.String |
TAG_SHIM_STATE
Tag name of "shim-state" element.
|
Constructor and Description |
---|
ShimState()
Construct an empty
ShimState instance. |
ShimState(org.w3c.dom.Element shimState)
Construct a
ShimState instance from a <shim-state> element. |
Modifier and Type | Method and Description |
---|---|
org.w3c.dom.Element |
getDriverState()
Get the
DriverShim state. |
org.w3c.dom.Element |
getPublisherState()
Get the
PublicationShim state |
org.w3c.dom.Element |
getState(int which)
Return state for one of the shims.
|
org.w3c.dom.Element |
getSubscriberState()
Get the
SubscriptionShim state |
boolean |
hasBeenModified()
Return
true if this instance has been modified. |
void |
resetModified()
Reset the modified flag for this instance such that
hasBeenModified()
will return false . |
void |
serializeXML(java.io.OutputStream os)
Serialize the shim state data as an XML document.
|
void |
setDriverState(org.w3c.dom.Element newDriverState)
Set the
DriverShim state. |
void |
setPublisherState(org.w3c.dom.Element newPublisherState)
Set the
PublicationShim state. |
void |
setSubscriberState(org.w3c.dom.Element newSubscriberState)
Set the
SubscriptionShim state. |
org.w3c.dom.Element |
toXML(org.w3c.dom.Node parent)
Construct an XML representation of this
ShimState instance
Note that the act of creating an XML representation does not reset this instance's
modified flag. |
public static final java.lang.String TAG_SHIM_STATE
public static final int DRIVER
DriverShim
state.getState(int)
,
Constant Field Valuespublic static final int SUBSCRIBER
SubscriptionShim
state.getState(int)
,
Constant Field Valuespublic static final int PUBLISHER
PublicationShim
state.getState(int)
,
Constant Field Valuespublic ShimState()
ShimState
instance.public ShimState(org.w3c.dom.Element shimState)
ShimState
instance from a <shim-state> element.shimState
- <shim-state> elementpublic boolean hasBeenModified()
true
if this instance has been modified.
The instance is considered to have been modified if a change was made
that affects the persistent representation since:
resetModified()
was last calledhasBeenModified
in interface ConfigElement
true
or false
resetModified()
,
toXML(org.w3c.dom.Node)
public void resetModified()
hasBeenModified()
will return false
.resetModified
in interface ConfigElement
hasBeenModified()
public org.w3c.dom.Element toXML(org.w3c.dom.Node parent)
ShimState
instance
Note that the act of creating an XML representation does not reset this instance's
modified flag. It must be reset by calling resetModified()
.toXML
in interface ConfigElement
parent
- Node
under which to build XML representationhasBeenModified()
,
resetModified()
public void serializeXML(java.io.OutputStream os) throws java.io.IOException
os
- OutputStream
to which to serialize.java.io.IOException
- if error occurs writing to OutputStream
public org.w3c.dom.Element getState(int which) throws java.lang.IllegalArgumentException
which
- DRIVER
, SUBSCRIBER
, or PUBLISHER
Element
java.lang.IllegalArgumentException
- if which
is incorrectpublic org.w3c.dom.Element getDriverState()
DriverShim
state.public void setDriverState(org.w3c.dom.Element newDriverState) throws java.lang.IllegalArgumentException
DriverShim
state.newDriverState
- <driver-state elementjava.lang.IllegalArgumentException
- if parameter doesn't have
the correct name, or is null
.public org.w3c.dom.Element getSubscriberState()
SubscriptionShim
statepublic void setSubscriberState(org.w3c.dom.Element newSubscriberState) throws java.lang.IllegalArgumentException
SubscriptionShim
state.newSubscriberState
- <subscriber-state elementjava.lang.IllegalArgumentException
- if parameter doesn't have
the correct name, or is null
.public org.w3c.dom.Element getPublisherState()
PublicationShim
statepublic void setPublisherState(org.w3c.dom.Element newPublisherState) throws java.lang.IllegalArgumentException
PublicationShim
state.newPublisherState
- <publisher-state elementjava.lang.IllegalArgumentException
- if parameter doesn't have
the correct name, or is null
.