public class SDOUtils
extends com.streamscape.sef.dispatcher.AbstractFabricContextFactory
Title: Structured Data Objects
Description: Contains useful utilities.
Copyright: Copyright (c) 2010
Company: StreamScape Technologies
DEFAULT_SERIAL_VERSION_ID
Constructor and Description |
---|
SDOUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addAdvisoryPrototype(java.lang.String eventId,
AdvisoryEventDatagram event)
|
static void |
addAdvisoryPrototype(java.lang.String model,
java.lang.String eventId)
|
static void |
addDataEventPrototype(java.lang.String eventId,
CloneableDataObject data)
|
static void |
addDataEventPrototype(java.lang.String eventId,
DataEvent event)
|
static void |
addDataEventPrototype(java.lang.String eventId,
java.lang.String dataType)
|
static void |
addDeltaEventPrototype(java.lang.String eventId,
CloneableDataObject data)
|
static void |
addDeltaEventPrototype(java.lang.String eventId,
DeltaEvent event)
|
static void |
addDeltaEventPrototype(java.lang.String eventId,
java.lang.String dataType)
|
static void |
addEventPrototype(java.lang.String eventId,
EventDatagram event)
|
static void |
addEventPrototype(java.lang.String model,
java.lang.String eventId)
|
static void |
addExceptionPrototype(java.lang.String eventId,
ExceptionEventDatagram event)
|
static void |
addExceptionPrototype(java.lang.String model,
java.lang.String eventId)
|
static void |
addOpaqueEventPrototype(java.lang.String eventId,
CloneableDataObject data)
|
static void |
addOpaqueEventPrototype(java.lang.String eventId,
OpaqueEvent event)
|
static void |
addOpaqueEventPrototype(java.lang.String eventId,
java.lang.String dataType)
|
static void |
checkDataClass(FabricContext context,
java.lang.Class dataClass)
Checks the specified class which is intended for a using as data class
for
DataEvent or DeltaEvent or OpaqueEvent . |
static java.lang.Object |
clone(java.lang.Object object)
Clones the specified object.
|
static java.lang.Object |
cloneByJSerializer(java.lang.Object object)
Clones the specified object using 'serialization/deserialization' way.
|
static DataEvent |
createDataEvent(java.lang.String eventId,
java.lang.Object data)
Creates a new
DataEvent having the specified identifier and data object. |
static java.lang.Object |
createDataObject(SemanticType type)
Creates a new object which can be used as data object for
DataEvent or DeltaEvent or OpaqueEvent . |
static java.lang.Object |
createDataObject(java.lang.String semanticType)
Creates a new object which can be used as data for
DataEvent or DeltaEvent or OpaqueEvent . |
static OpaqueEvent |
createOpaqueEvent(java.lang.String eventId,
java.lang.Object data)
Creates a new
OpaqueEvent having the specified identifier and data object. |
static boolean |
equals(java.lang.Object obj1,
java.lang.Object obj2)
Compares two specified objects.
|
static boolean |
equalsByJSerializer(java.lang.Object obj1,
java.lang.Object obj2)
Compares two specified objects using serialization.
|
static java.util.Map |
findSDOElements(java.lang.Object object,
java.lang.String regex,
java.lang.String pathPrefix,
ReferencePathManager sdrManager,
TypeAnalyzer typeAnalyzer) |
static boolean |
isSystemEventId(java.lang.String eventId)
Checks if the specified event id is reserved for system purposes.
|
static void |
validateEventId(java.lang.String eventId)
Checks a format of the specified event id.
|
getContext, getContextType, hasContext
clone, getSerialVersionUID
public static java.lang.Object clone(java.lang.Object object) throws SDOException
object
- the object to be cloned.SDOException
- if some error occurs during the cloning.public static java.lang.Object cloneByJSerializer(java.lang.Object object) throws SDOException
object
- the object to be cloned.SDOException
- if some error occurs during the cloning.public static boolean equals(java.lang.Object obj1, java.lang.Object obj2)
obj1
- the first object to be compared.obj2
- the second object to be compared.true
if the objects equal, false
otherwise.public static boolean equalsByJSerializer(java.lang.Object obj1, java.lang.Object obj2)
obj1
- the first object to be compared.obj2
- the second object to be compared.true
if the objects equal, false
otherwise.public static void validateEventId(java.lang.String eventId) throws SDOFormatException
eventId
- the event id to be checked.SDOFormatException
- if the specified event id has invalid format.public static void addAdvisoryPrototype(java.lang.String model, java.lang.String eventId) throws DatagramFactoryException
PrototypeFactory.addAdvisoryPrototype(String, String)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static void addAdvisoryPrototype(java.lang.String eventId, AdvisoryEventDatagram event) throws DatagramFactoryException
PrototypeFactory.addAdvisoryPrototype(String, com.streamscape.sdo.AdvisoryEventDatagram)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static void addEventPrototype(java.lang.String model, java.lang.String eventId) throws DatagramFactoryException
PrototypeFactory.addEventPrototype(String, String)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static void addEventPrototype(java.lang.String eventId, EventDatagram event) throws DatagramFactoryException
PrototypeFactory.addEventPrototype(String, com.streamscape.sdo.EventDatagram)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static void addDataEventPrototype(java.lang.String eventId, java.lang.String dataType) throws DatagramFactoryException
PrototypeFactory.addDataEventPrototype(String, String)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static void addDataEventPrototype(java.lang.String eventId, CloneableDataObject data) throws DatagramFactoryException
PrototypeFactory.addDataEventPrototype(String, com.streamscape.sdo.CloneableDataObject)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static void addDataEventPrototype(java.lang.String eventId, DataEvent event) throws DatagramFactoryException
PrototypeFactory.addDataEventPrototype(String, com.streamscape.sdo.event.DataEvent)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static void addDeltaEventPrototype(java.lang.String eventId, java.lang.String dataType) throws DatagramFactoryException
PrototypeFactory.addDeltaEventPrototype(String, String)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static void addDeltaEventPrototype(java.lang.String eventId, CloneableDataObject data) throws DatagramFactoryException
PrototypeFactory.addDeltaEventPrototype(String, com.streamscape.sdo.CloneableDataObject)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static void addDeltaEventPrototype(java.lang.String eventId, DeltaEvent event) throws DatagramFactoryException
PrototypeFactory.addDeltaEventPrototype(String, com.streamscape.sdo.event.DeltaEvent)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static void addOpaqueEventPrototype(java.lang.String eventId, java.lang.String dataType) throws DatagramFactoryException
PrototypeFactory.addOpaqueEventPrototype(String, String)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static void addOpaqueEventPrototype(java.lang.String eventId, CloneableDataObject data) throws DatagramFactoryException
PrototypeFactory.addOpaqueEventPrototype(String, com.streamscape.sdo.CloneableDataObject)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static void addOpaqueEventPrototype(java.lang.String eventId, OpaqueEvent event) throws DatagramFactoryException
PrototypeFactory.addOpaqueEventPrototype(String, com.streamscape.sdo.event.OpaqueEvent)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static void addExceptionPrototype(java.lang.String model, java.lang.String eventId) throws DatagramFactoryException
PrototypeFactory.addExceptionPrototype(String, String)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static void addExceptionPrototype(java.lang.String eventId, ExceptionEventDatagram event) throws DatagramFactoryException
PrototypeFactory.addExceptionPrototype(String, com.streamscape.sdo.ExceptionEventDatagram)
.
This method does nothing if the corresponding prototype already exists.DatagramFactoryException
public static DataEvent createDataEvent(java.lang.String eventId, java.lang.Object data) throws DatagramFactoryException, SDOException, SecurityViolationException
DataEvent
having the specified identifier and data object.eventId
- the id of the event to be created.data
- the data of the event to be created.DatagramFactoryException
- if a creation of the event instance has failed.SecurityViolationException
- if the specified data can be set to the created event.SDOException
public static OpaqueEvent createOpaqueEvent(java.lang.String eventId, java.lang.Object data) throws DatagramFactoryException, SDOException, SecurityViolationException
OpaqueEvent
having the specified identifier and data object.eventId
- the id of the event to be created.data
- the data of the event to be created.DatagramFactoryException
- if a creation of the event instance has failed.SecurityViolationException
- if the specified data can be set to the created event.SDOException
public static java.lang.Object createDataObject(java.lang.String semanticType) throws DatagramFactoryException
DataEvent
or DeltaEvent
or OpaqueEvent
.semanticType
- the name of SemanticType
of the created object.DatagramFactoryException
- if some error occurs during this operation.public static java.lang.Object createDataObject(SemanticType type) throws DatagramFactoryException
DataEvent
or DeltaEvent
or OpaqueEvent
.type
- the SemanticType
of the created object.DatagramFactoryException
- if some error occurs during this operation.public static void checkDataClass(FabricContext context, java.lang.Class dataClass) throws DatagramFactoryException
DataEvent
or DeltaEvent
or OpaqueEvent
.context
- the current Fabric Context.dataClass
- the specified data class.DatagramFactoryException
- if the specified class has not an associated semantic type or this type is invalid.public static boolean isSystemEventId(java.lang.String eventId)
eventId
- the event id to be checked.true
if the event id is reserved for system purposes, false
otherwise.public static java.util.Map findSDOElements(java.lang.Object object, java.lang.String regex, java.lang.String pathPrefix, ReferencePathManager sdrManager, TypeAnalyzer typeAnalyzer) throws TypeAnalyzerException
TypeAnalyzerException
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.