|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softwareag.mdm.service.ProgrammaticService
This class provides the ability to log programmatically a user session so as to be able to execute procedures in a well-defined context, for example in a script or in a batch.
For creating an instance of this class, the external program an authenticated session and a home:
ProgrammaticService.createForSession(Session, AdaptationHome)
For updating the repository, for importing or exporting data, a Procedure.execute()
method must be called in transactional container via:
ProgrammaticService.execute(Procedure)
Session session = Repository.getDefault().createSessionFromLoginPassword("xxx", "yyy"); AdaptationHome home = Repository.getDefault().lookupHome(BranchKey.forName("myBranch")); ProgrammaticService svc = ProgrammaticService.createForSession(session, home); // optional svc.setSessionTrackingInfo("My Script Sample"); Procedure proc = new Procedure() { public void execute(ProcedureContext aContext) throws Exception { // ... } }; ProcedureResult result = svc.execute(proc); if (result.hasFailed()) // ... else //...
Method Summary | |
static ProgrammaticService |
createForLogin(String login,
String password)
Deprecated. Replaced by createForSession(Session, AdaptationHome) . |
static ProgrammaticService |
createForSession(Session aSession,
AdaptationHome aHome)
Instantiates a service that will execute as the session specified in the home specified. |
ProcedureResult |
execute(Procedure aProcedure)
Executes the procedure specified. |
AdaptationHome |
getCurrentHome()
Returns the current branch or version of this service. |
Session |
getSession()
Returns the current session of this service. |
void |
setSessionTrackingInfo(String trackingInfo)
Specifies session's tracking info. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static ProgrammaticService createForLogin(String login, String password)
createForSession(Session, AdaptationHome)
.
public static ProgrammaticService createForSession(Session aSession, AdaptationHome aHome)
public ProcedureResult execute(Procedure aProcedure)
Procedure.execute(ProcedureContext)
.
public AdaptationHome getCurrentHome()
public Session getSession()
public void setSessionTrackingInfo(String trackingInfo)
Session.getTrackingInfo()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
(report a bug)
webMethods MDM 4.2.8 [0558]
Copyright Software AG 2000-2007. All rights reserved.