use of org.eclipse.ecf.provider.xmpp.XMPPSContainer in project ecf by eclipse.
the class XMPPSContainerInstantiator method createInstance.
public IContainer createInstance(ContainerTypeDescription description, Object[] args) throws ContainerCreateException {
try {
Integer ka = new Integer(XMPPSContainer.DEFAULT_KEEPALIVE);
String name = null;
if (args != null) {
if (args.length > 0) {
name = (String) args[0];
if (args.length > 1) {
ka = getIntegerFromArg(args[1]);
}
}
}
if (name == null) {
if (ka == null) {
return new XMPPSContainer();
} else {
return new XMPPSContainer(ka.intValue());
}
} else {
if (ka == null) {
ka = new Integer(XMPPSContainer.DEFAULT_KEEPALIVE);
}
return new XMPPSContainer(name, ka.intValue());
}
} catch (Exception e) {
throw new ContainerCreateException("Exception creating generic container", e);
}
}
use of org.eclipse.ecf.provider.xmpp.XMPPSContainer in project ecf by eclipse.
the class XMPPHyperlink method getContainers.
protected IContainer[] getContainers() {
final IContainerManager manager = Activator.getDefault().getContainerManager();
if (manager == null)
return EMPTY;
final List results = new ArrayList();
final IContainer[] containers = manager.getAllContainers();
for (int i = 0; i < containers.length; i++) {
final ID connectedID = containers[i].getConnectedID();
// Must be connected and ID of correct type
if (connectedID != null && ((isXMPPS && containers[i] instanceof XMPPSContainer) || (!isXMPPS && containers[i] instanceof XMPPContainer)))
results.add(containers[i]);
}
return (IContainer[]) results.toArray(EMPTY);
}
Aggregations