|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ScriptStyleOpProcessor
Interface very closely related to OpProcessor except that its methods take native
scripts targeting their host connector (eg SQL for JDBC) to be executed in order to
carry out operations on their target managed objects. Note that activate()
is called when processors for all styles have been assigned to the parent connector
(which has been fully initialised and is ready to receive requests).
Implementing classes may well handle all updates (doAdd(), doModify(), doDelete(), doMove()) using the same underling script execution code because none return a value, but they are still presented as separate methods in this interface to offer the possibility of using "special case" Java code to assist execution of the script if required. Whilst possible such code should still be avoided where possible as it represents extra information which must be passed on to script authors.
An alternative approach would have been to use an interface
based on MethodStyleOpProcessor with an additional
scriptText argument, resulting in a single doUpdate() method.
This was not done because, unlike the method-style case (e.g. Stored Procedures for
JDBC), it is expected that supported scripting languages will be able to directly access Java
objects and avoid the need for simplifying user-defined mappings for inbound and outbound attributes.
Refer to the cacom module's opbindings.xsd.
| Method Summary | |
|---|---|
void |
doAdd(ObjectInfo objInfo,
Attributes attrs,
String scriptText)
Create a new object on the managed system with the provided attributes stored for it. |
void |
doDelete(ObjectInfo objInfo,
String scriptText)
Delete the object referenced by objInfo from a managed system. |
Attributes |
doLookup(ObjectInfo objInfo,
String[] attrIds,
String scriptText)
Look up the provided attribute names on the managed object referenced by objInfo,
attribute ids not mapped to connector-speak will either be discarded or cause an error depending
on the level of strictness configured for the parent connector. |
void |
doModify(ObjectInfo objInfo,
ModificationItem[] items,
String scriptText)
Apply the provided items to the object on the managed system referenced by
objInfo. |
void |
doModifyRn(ObjectInfo objInfo,
String newRdn,
String scriptText)
Rename the managed object referenced by objInfo so that it has the new
Relative Distinguished Name (RDN) provided (an example newRdn might be
nameAttrId=MyNewName). |
void |
doMove(ObjectInfo objInfo,
Name newParentName,
String scriptText)
Move managed object to a new parent. |
void |
doMove(ObjectInfo objInfo,
Name newParentName,
String newRdn,
String scriptText)
Move the managed object referenced by objInfo to a new parent whilst
also changing its RDN (of form "attr=value"). |
NamingEnumeration<SearchResult> |
doSearch(ObjectInfo baseObjInfo,
FilterInfo filterInfo,
Map<String,String> environment,
SearchControls searchControls,
String scriptText)
Perform search under specified baseName on managed system, using the standard
JNDI interfaces and semantics. |
Opbindings |
getMetaData()
|
void |
setMetaData(Opbindings opbindings)
Called when metadata used to configure this connector is changed. |
| Methods inherited from interface com.ca.jcs.Activatable |
|---|
activate, deactivate |
| Method Detail |
|---|
Opbindings getMetaData()
void setMetaData(Opbindings opbindings)
throws NamingException
opbindings - New opBindings to be internalised, where only
script payloads are included.
NamingException
void doDelete(ObjectInfo objInfo,
String scriptText)
throws NamingException
objInfo from a managed system.
objInfo - References managed object to be deleted.scriptText - Connector's native script to be executed to
delete object.
NamingExceptionOpProcessor.doDelete(com.ca.jcs.ObjectInfo)
void doAdd(ObjectInfo objInfo,
Attributes attrs,
String scriptText)
throws NamingException
objInfo - Contains information for the managed object which is to be created,
where its connector-speak distinguished Name (DN) is dictated by
objInfo.getConnectorDn() and its objectClass= is
dictated by objInfo.getobjectClassMapping().attrs - Attributes to be stored on the managed object.scriptText - Connector's native script to be executed to
add object.
NamingExceptionOpProcessor.doAdd(ObjectInfo, Attributes)
void doModify(ObjectInfo objInfo,
ModificationItem[] items,
String scriptText)
throws NamingException
items to the object on the managed system referenced by
objInfo.
objInfo - References managed object which is to be modified.items - Modifications to be applied to the referenced object.scriptText - Connector's native script to be executed to
modify object.
NamingExceptionOpProcessor.doModify(ObjectInfo, ModificationItem[])
NamingEnumeration<SearchResult> doSearch(ObjectInfo baseObjInfo,
FilterInfo filterInfo,
Map<String,String> environment,
SearchControls searchControls,
String scriptText)
throws NamingException
baseName on managed system, using the standard
JNDI interfaces and semantics. All values (DN/filter/return attribute ids) have been mapped into
connector-speak by the time this method is called.
baseObjInfo - filterInfo - Information regarding the filter to be used for the search,
including referenced objectClass= values. Note that attribute names have been converted
to connector-speak and any required validators/converters have been run by the framework
prior to this method being invoked. The filter's text can be retrieved via
ExprNode.printToBuffer(StringBuffer) on
contained mappedFilter. If required this mappedFilter can
be converted to a different syntax, refer to SimpleFilterVisitor /
FilterVisitor and related classes.environment - Defines any values effecting how the search is performed (eg whether to follow
referrals etc). Can usually be ignored.searchControls - Defines important information about the search itself, for instance what
scope the search should have under baseName and which attributes should be returned
for each object matching the provided filter. Note that specifying a null String[] for the returned
attributes will cause all non-expensive attributes to be returned for each matching objects, whereas
specifying String[0] will cause no attributes to be returned except for the DNs of matching objects.scriptText - Connector's native script to be executed to perform search.
SearchResult objects, one per object falling within the specified scope
under baseName which matches the provided filter. Results can be handled in two different
manners depending on the connector's requirement (indeed, an advanced connector can implement both and
choose the best one based on heuristics and a threshold):doSearch() call has returned.NamingExceptionOpProcessor.doSearch(com.ca.jcs.ObjectInfo,com.ca.jcs.filter.FilterInfo,Map,javax.naming.directory.SearchControls)
Attributes doLookup(ObjectInfo objInfo,
String[] attrIds,
String scriptText)
throws NamingException
objInfo,
attribute ids not mapped to connector-speak will either be discarded or cause an error depending
on the level of strictness configured for the parent connector. Extra attributes may also be
returned.
objInfo - Managed object for which attributes are to be looked up.attrIds - Connector-speak identifiers of attributes which are to be returned, null
means return all attributes and a zero length array means return no attributes (just
a way to check an object's existance).scriptText - Connector's native script to be executed to perform lookup.
attrIds.
NamingExceptionOpProcessor.doLookUp(ObjectInfo, String[])
void doModifyRn(ObjectInfo objInfo,
String newRdn,
String scriptText)
throws NamingException
objInfo so that it has the new
Relative Distinguished Name (RDN) provided (an example newRdn might be
nameAttrId=MyNewName).
objInfo - References managed object.newRdn - New terminal name (having form "attr=val") for managed object.scriptText - Connector's native script to be executed to perform rename.
NamingExceptionOpProcessor.doModifyRn(com.ca.jcs.ObjectInfo,javax.naming.ldap.Rdn)
void doMove(ObjectInfo objInfo,
Name newParentName,
String newRdn,
String scriptText)
throws NamingException
objInfo to a new parent whilst
also changing its RDN (of form "attr=value").
objInfo - References managed object to be moved.newParentName - New parent for managed object.newRdn - New relative distinguished name (RDN) for managed object, will be
different from the object's current RDN or doMove(ObjectInfo, Name, String) will
have been called instead.scriptText - Connector's native script to be executed to perform move + rename.
NamingExceptionOpProcessor.doMove(com.ca.jcs.ObjectInfo,javax.naming.Name,javax.naming.ldap.Rdn)
void doMove(ObjectInfo objInfo,
Name newParentName,
String scriptText)
throws NamingException
objInfo - References managed object to be moved.newParentName - New parent for managed object.scriptText - Connector's native script to be executed to perform move.
NamingExceptioncom.ca.jcs.processor.OpProcessor#doMove(ObjectInfo, Name)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||