Jazz Java APIs for stand alone application
Are there Jazz Java APIs that can be used in an application that does not
run as a plugin of the Jazz platform?
I am implementing the connector for an application that provides data
migration functionalities. In my case I need to implement the connector for
the Jazz platform.
Are there APIs that will allow my application to do login, logout, workitem
extract and workitem modification kind of function from an external
application?
--
Sincerely,
Ahmed Hadad
IBM STG
run as a plugin of the Jazz platform?
I am implementing the connector for an application that provides data
migration functionalities. In my case I need to implement the connector for
the Jazz platform.
Are there APIs that will allow my application to do login, logout, workitem
extract and workitem modification kind of function from an external
application?
--
Sincerely,
Ahmed Hadad
IBM STG
6 answers
This is possible. All common and client-library plugins can be used as
normal jars in plain java. A plain java program would roughly look like
this:
public static void main(String[] args) {
try {
TeamPlatform.startup();
ITeamRepositoryService svc=TeamPlatform.getTeamRepositoryService();
ITeamRepository repo = svc.getTeamRepository(REPOSITORY_URI);
repo.registerLoginHandler(new ITeamRepository.ILoginHandler() {
public ILoginInfo challenge(ITeamRepository repository) {
return new ILoginInfo() {
public String getUserId() {
return USER_ID;
}
public String getPassword() {
return PASSWORD;
}
};
}
});
repo.login(new NullProgressMonitor());
try {
TheServiceYouNeed service =
(TheServiceYouNeed) repo
.getClientLibrary(TheServiceYouNeed.class);
doYourStuff(service);
} finally {
if (repo.loggedIn()) {
repo.logout();
}
}
} catch (TeamRepositoryException x) {
handleException(x);
} finally {
if (TeamPlatform.isStarted()) {
TeamPlatform.shutdown();
}
}
}
Kai
Jazz Process team
Ahmed Hadad (IBM) wrote:
normal jars in plain java. A plain java program would roughly look like
this:
public static void main(String[] args) {
try {
TeamPlatform.startup();
ITeamRepositoryService svc=TeamPlatform.getTeamRepositoryService();
ITeamRepository repo = svc.getTeamRepository(REPOSITORY_URI);
repo.registerLoginHandler(new ITeamRepository.ILoginHandler() {
public ILoginInfo challenge(ITeamRepository repository) {
return new ILoginInfo() {
public String getUserId() {
return USER_ID;
}
public String getPassword() {
return PASSWORD;
}
};
}
});
repo.login(new NullProgressMonitor());
try {
TheServiceYouNeed service =
(TheServiceYouNeed) repo
.getClientLibrary(TheServiceYouNeed.class);
doYourStuff(service);
} finally {
if (repo.loggedIn()) {
repo.logout();
}
}
} catch (TeamRepositoryException x) {
handleException(x);
} finally {
if (TeamPlatform.isStarted()) {
TeamPlatform.shutdown();
}
}
}
Kai
Jazz Process team
Ahmed Hadad (IBM) wrote:
Are there Jazz Java APIs that can be used in an application that does
not run as a plugin of the Jazz platform?
I am implementing the connector for an application that provides data
migration functionalities. In my case I need to implement the connector
for the Jazz platform.
Are there APIs that will allow my application to do login, logout,
workitem extract and workitem modification kind of function from an
external application?
Hi,
I've tried to execute the code, but unfortunately TeamPlatform.startup() fails:
Exception in thread "main" java.lang.NoClassDefFoundError: com.ibm.team.repository.common.internal.util.InternalTeamPlatform (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:130)
at com.ibm.team.repository.client.TeamPlatform.isStarted(TeamPlatform.java:72)
at ca.ucalgary.jazz.connection.prototype.one.Connector.main(Connector.java:50)
Caused by: java.lang.NoClassDefFoundError: org.apache.log4j.Logger
at com.ibm.team.repository.common.internal.util.InternalTeamPlatform.<clinit>(InternalTeamPlatform.java:38)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:192)
at com.ibm.team.repository.client.TeamPlatform.startup(TeamPlatform.java:47)
at ca.ucalgary.jazz.connection.prototype.one.Connector.main(Connector.java:16)
It fails during the client-initializing process... (startup() in TeamPlatform.class)
Referenced Libraries:
com.ibm.team.repository.common
com.ibm.team.repository.client
org.eclipse.equinox.common
org.eclipse.equinox.registry
com.ibm.team.repository.common.remoteaccess
What went wrong?
Thanks in advance,
Kai
I've tried to execute the code, but unfortunately TeamPlatform.startup() fails:
Exception in thread "main" java.lang.NoClassDefFoundError: com.ibm.team.repository.common.internal.util.InternalTeamPlatform (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:130)
at com.ibm.team.repository.client.TeamPlatform.isStarted(TeamPlatform.java:72)
at ca.ucalgary.jazz.connection.prototype.one.Connector.main(Connector.java:50)
Caused by: java.lang.NoClassDefFoundError: org.apache.log4j.Logger
at com.ibm.team.repository.common.internal.util.InternalTeamPlatform.<clinit>(InternalTeamPlatform.java:38)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:192)
at com.ibm.team.repository.client.TeamPlatform.startup(TeamPlatform.java:47)
at ca.ucalgary.jazz.connection.prototype.one.Connector.main(Connector.java:16)
It fails during the client-initializing process... (startup() in TeamPlatform.class)
Referenced Libraries:
com.ibm.team.repository.common
com.ibm.team.repository.client
org.eclipse.equinox.common
org.eclipse.equinox.registry
com.ibm.team.repository.common.remoteaccess
What went wrong?
Thanks in advance,
Kai
A large number of jars will be required on your class path to use Jazz from
a plain java client. There is currently no pre-packaged plain Java SDK zip
available that I'm aware of. Our component executes the Jazz ant tasks in a
plain java context. To give you an idea of how many jars may be required
depending on what you are doing...take a look in your
jazz\buildsystem\buildtoolkit directory. As you'll see there are a large
number needed to allow our ant tasks to resolve all class references they
use. I'm am NOT recommending you use that directory for your class path
entries. We only include the jars necessary for our ant tasks to execute
successfully. You may need more or less and we freely change the directly
to suit our needs so don't create a dependency on it. I'm only presenting
it as an example.
From your exception it looks like you are missing the log4j-1.2.12.jar but I
imagine you'll be missing others as well.
Don Weinand
Jazz Team Build
"kainehring" <kai.nehring@vgsoft-dot-de.no-spam.invalid> wrote in message
news:ftj5bs$fva$1@localhost.localdomain...
a plain java client. There is currently no pre-packaged plain Java SDK zip
available that I'm aware of. Our component executes the Jazz ant tasks in a
plain java context. To give you an idea of how many jars may be required
depending on what you are doing...take a look in your
jazz\buildsystem\buildtoolkit directory. As you'll see there are a large
number needed to allow our ant tasks to resolve all class references they
use. I'm am NOT recommending you use that directory for your class path
entries. We only include the jars necessary for our ant tasks to execute
successfully. You may need more or less and we freely change the directly
to suit our needs so don't create a dependency on it. I'm only presenting
it as an example.
From your exception it looks like you are missing the log4j-1.2.12.jar but I
imagine you'll be missing others as well.
Don Weinand
Jazz Team Build
"kainehring" <kai.nehring@vgsoft-dot-de.no-spam.invalid> wrote in message
news:ftj5bs$fva$1@localhost.localdomain...
Hi,
I've tried to execute the code, but unfortunately
TeamPlatform.startup() fails:
Exception in thread "main" java.lang.NoClassDefFoundError:
com.ibm.team.repository.common.internal.util.InternalTeamPlatform
(initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:130)
at
com.ibm.team.repository.client.TeamPlatform.isStarted(TeamPlatform.java:72)
at
ca.ucalgary.jazz.connection.prototype.one.Connector.main(Connector.java:50)
Caused by: java.lang.NoClassDefFoundError: org.apache.log4j.Logger
at
com.ibm.team.repository.common.internal.util.InternalTeamPlatform.<clinit>(InternalTeamPlatform.java:38)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:192)
at
com.ibm.team.repository.client.TeamPlatform.startup(TeamPlatform.java:47)
at
ca.ucalgary.jazz.connection.prototype.one.Connector.main(Connector.java:16)
It fails during the client-initializing process... (startup() in
TeamPlatform.class)
Referenced Libraries:
com.ibm.team.repository.common
com.ibm.team.repository.client
org.eclipse.equinox.common
org.eclipse.equinox.registry
com.ibm.team.repository.common.remoteaccess
What went wrong?
Thanks in advise,
Kai
"Donald Weinand" <dmweinan@us.ibm.com> wrote in
news:ftjc57$jma$1@localhost.localdomain:
As FYI, I managed to run the basic code (not calling any services) using
the following JAR.
You may need more JAR than that, but at least the code Kai sent us will
run...
org.eclipse.equinox.common_3.3.0.v20070426.jar
org.eclipse.equinox.registry_3.3.1.R33x_v20070802.jar
log4j-1.2.12.jar
org.eclipse.osgi_3.3.1.R33x_v20070828.jar
org.apache.commons.logging_1.0.4.v200706111724.jar
org.eclipse.core.jobs_3.3.1.R33x_v20070709.jar
commons-httpclient-3.0.jar
org.eclipse.emf.ecore_2.3.1.v200709252135.jar
org.eclipse.emf.ecore.sdo_2.3.0.v200709252135.jar
org.eclipse.emf.ecore.xmi_2.3.1.v200709252135.jar
org.eclipse.emf.common_2.3.0.v200709252135.jar
org.eclipse.emf.ecore.change_2.3.0.v200709252135.jar
org.eclipse.emf.commonj.sdo_2.3.0.v200709252135.jar
commons-codec-1.3.jar
com.ibm.team.repository.client_0.6.0.I20080404-1743.jar
com.ibm.team.repository.common_0.6.0.I20080404-1743.jar
com.ibm.team.repository.common.json_0.6.0.I20080404-1743.jar
com.ibm.team.repository.common.serialize_0.6.0.I20080404-1743.jar
com.ibm.team.repository.common.transport_0.6.0.I20080404-1743.jar
com.ibm.team.repository.common.remoteaccess_0.6.0.I20080404-1743.jar
com.ibm.team.repository.common.remoteaccess.auth_0.6.0.I20080404-1743.jar
--
Christophe Elek
Serviceability Architect
IBM Software Group - Rational
news:ftjc57$jma$1@localhost.localdomain:
A large number of jars will be required on your class path to use Jazz
from a plain java client.
As FYI, I managed to run the basic code (not calling any services) using
the following JAR.
You may need more JAR than that, but at least the code Kai sent us will
run...
org.eclipse.equinox.common_3.3.0.v20070426.jar
org.eclipse.equinox.registry_3.3.1.R33x_v20070802.jar
log4j-1.2.12.jar
org.eclipse.osgi_3.3.1.R33x_v20070828.jar
org.apache.commons.logging_1.0.4.v200706111724.jar
org.eclipse.core.jobs_3.3.1.R33x_v20070709.jar
commons-httpclient-3.0.jar
org.eclipse.emf.ecore_2.3.1.v200709252135.jar
org.eclipse.emf.ecore.sdo_2.3.0.v200709252135.jar
org.eclipse.emf.ecore.xmi_2.3.1.v200709252135.jar
org.eclipse.emf.common_2.3.0.v200709252135.jar
org.eclipse.emf.ecore.change_2.3.0.v200709252135.jar
org.eclipse.emf.commonj.sdo_2.3.0.v200709252135.jar
commons-codec-1.3.jar
com.ibm.team.repository.client_0.6.0.I20080404-1743.jar
com.ibm.team.repository.common_0.6.0.I20080404-1743.jar
com.ibm.team.repository.common.json_0.6.0.I20080404-1743.jar
com.ibm.team.repository.common.serialize_0.6.0.I20080404-1743.jar
com.ibm.team.repository.common.transport_0.6.0.I20080404-1743.jar
com.ibm.team.repository.common.remoteaccess_0.6.0.I20080404-1743.jar
com.ibm.team.repository.common.remoteaccess.auth_0.6.0.I20080404-1743.jar
--
Christophe Elek
Serviceability Architect
IBM Software Group - Rational
Ahmed Hadad (IBM) wrote:
There are REST services available for reading WorkItems, that are
programmatically accessible via java.net.HttpURLConnection (e.g.). No
modifications to workitems are available at this time.
If you're using a secured connection to your server, the biggest
challenge will be dealing with the proprietary form-based auth, but the
code for dealing with that is isolated in a single (small) plugin.
-- Todd (Jazz Team)
Are there Jazz Java APIs that can be used in an application that does
not run as a plugin of the Jazz platform?
I am implementing the connector for an application that provides data
migration functionalities. In my case I need to implement the connector
for the Jazz platform.
Are there APIs that will allow my application to do login, logout,
workitem extract and workitem modification kind of function from an
external application?
There are REST services available for reading WorkItems, that are
programmatically accessible via java.net.HttpURLConnection (e.g.). No
modifications to workitems are available at this time.
If you're using a secured connection to your server, the biggest
challenge will be dealing with the proprietary form-based auth, but the
code for dealing with that is isolated in a single (small) plugin.
-- Todd (Jazz Team)