use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.
the class URLRosterViewerDropTarget method getURLShare.
private URLShare getURLShare(IRosterEntry rosterEntry1) {
final IPresenceContainerAdapter pca = rosterEntry1.getRoster().getPresenceContainerAdapter();
if (pca == null)
return null;
final IContainer container = (IContainer) pca.getAdapter(IContainer.class);
if (container == null)
return null;
return URLShare.getURLShare(container.getID());
}
use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.
the class URLShareRosterContributionItem method makeActions.
protected IAction[] makeActions() {
final IRoster roster = getSelectedRoster();
if (roster != null) {
// Roster is selected
final IContainer c = getContainerForRoster(roster);
if (c != null) {
// Get existing urlshare for this container (if it exists)
final URLShare urlshare = URLShare.getURLShare(c.getID());
// If it does exist already, then create action to remove
if (urlshare != null)
return createActionRemove(c.getID(), urlshare);
final IChannelContainerAdapter channelAdapter = (IChannelContainerAdapter) c.getAdapter(IChannelContainerAdapter.class);
return (channelAdapter == null) ? null : createActionAdd(c.getID(), channelAdapter);
}
}
return null;
}
use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.
the class ViewShareRosterContributionItem method makeActions.
protected IAction[] makeActions() {
final IRoster roster = getSelectedRoster();
if (roster != null) {
// Roster is selected
final IContainer c = getContainerForRoster(roster);
if (c != null) {
// Get existing ViewShare for this container (if it exists)
final ViewShare viewShare = ViewShare.getViewShare(c.getID());
// If it does exist already, then create action to remove
if (viewShare != null)
return createActionRemove(c.getID(), viewShare);
final IChannelContainerAdapter channelAdapter = (IChannelContainerAdapter) c.getAdapter(IChannelContainerAdapter.class);
return (channelAdapter == null) ? null : createActionAdd(c.getID(), channelAdapter);
}
}
return null;
}
use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.
the class SSLSimpleConcatClient method start.
public void start(int port) throws Exception {
IContainer client = ContainerFactory.getDefault().createContainer(CLIENT_TYPE);
// Get adapter for accessing remote services
IRemoteServiceContainerAdapter adapter = (IRemoteServiceContainerAdapter) client.getAdapter(IRemoteServiceContainerAdapter.class);
rsContainer = new RemoteServiceContainer(client, adapter);
System.out.println("Client created with ID=" + client.getID());
ID connectTargetID = IDFactory.getDefault().createStringID(NLS.bind(SERVER_ID, new Integer(port)));
System.out.println("Attempting connect to id=" + connectTargetID);
client.connect(connectTargetID, null);
System.out.println("Client connected to connectTargetID=" + connectTargetID);
Thread.sleep(1000);
// Get remote service reference
IRemoteServiceReference[] refs = adapter.getRemoteServiceReferences((ID[]) null, IConcatService.class.getName(), null);
rsReference = refs[0];
System.out.println("Remote service with ref=" + refs[0]);
}
use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.
the class GenericAuthConsumerContainerSelector method createContainer.
@Override
protected IRemoteServiceContainer createContainer(ContainerTypeDescription containerTypeDescription, String containerTypeDescriptionName, @SuppressWarnings("rawtypes") Map properties) throws SelectContainerException {
IRemoteServiceContainer result = super.createContainer(containerTypeDescription, containerTypeDescriptionName, properties);
ISharedObjectContainerClient client = (ISharedObjectContainerClient) result.getContainer().getAdapter(ISharedObjectContainerClient.class);
if (client != null) {
client.setConnectInitiatorPolicy(new IConnectInitiatorPolicy() {
public void refresh() {
}
public Object createConnectData(IContainer container, ID targetID, IConnectContext context) {
// to the server.
return getConnectData();
}
public int getConnectTimeout() {
return 30000;
}
});
}
return result;
}
Aggregations