use of org.eclipse.ecf.core.identity.ID in project ecf by eclipse.
the class ConnectedTester method hasContainer.
private boolean hasContainer(Object receiver) {
// get the container instance
IServiceInfo serviceInfo = DiscoveryPropertyTesterUtil.getIServiceInfoReceiver(receiver);
final String connectNamespace = getConnectNamespace(serviceInfo);
final String connectId = getConnectID(serviceInfo);
try {
final ID createConnectId = IDFactory.getDefault().createID(connectNamespace, connectId);
return (getContainerByConnectID(createConnectId) != null);
} catch (IDCreateException e) {
// Trace.trace(...);
return false;
}
}
use of org.eclipse.ecf.core.identity.ID in project ecf by eclipse.
the class RemoteServiceRegistrationImpl method publish.
public void publish(RegistrySharedObject sharedObject1, RemoteServiceRegistryImpl registry, Object svc, String[] clzzes, Dictionary props) {
this.sharedObject = sharedObject1;
this.service = svc;
this.clazzes = clzzes;
this.reference = new RemoteServiceReferenceImpl(this);
synchronized (registry) {
ID containerID = registry.getContainerID();
if (containerID == null)
// $NON-NLS-1$
throw new NullPointerException("Local containerID must be non-null to register remote services");
this.remoteServiceID = registry.createRemoteServiceID(registry.getNextServiceId());
this.properties = createProperties(props);
registry.publishService(this);
}
}
use of org.eclipse.ecf.core.identity.ID in project ecf by eclipse.
the class FeedSharedObject method changeItem.
public boolean changeItem(ID itemID, String description) {
if (feed != null) {
List items = feed.getItems();
for (int i = 0; i < items.size(); i++) {
RssItem rssItem = (RssItem) items.get(i);
ID id = createID(rssItem.getSync().getId());
if (id != null && id.equals(itemID)) {
rssItem.setDescription(description);
return true;
}
}
}
return false;
}
use of org.eclipse.ecf.core.identity.ID in project ecf by eclipse.
the class CompareWithHandler method execute.
public Object execute(ExecutionEvent event) throws ExecutionException {
IRosterEntry selectedEntry = getRosterEntry();
IRoster roster = selectedEntry.getRoster();
final IUser remoteUser = roster.getUser();
ID localId = remoteUser.getID();
ID remoteId = selectedEntry.getUser().getID();
IContainer container = (IContainer) roster.getPresenceContainerAdapter().getAdapter(IContainer.class);
final IResource resource = getResource(event);
if (resource == null) {
MessageDialog.openInformation(HandlerUtil.getActiveShell(event), null, Messages.CompareWithHandler_FileNotSelectedError);
return null;
}
RemoteShare share = TeamSynchronization.getShare(container.getID());
final RemoteResourceVariantTreeSubscriber subscriber = new RemoteResourceVariantTreeSubscriber(share, localId, remoteId);
Job job = new Job(Messages.CompareWithHandler_ResourceComparisonJobTitle) {
protected IStatus run(IProgressMonitor monitor) {
try {
openCompareEditor(subscriber.getSyncInfo(resource, monitor), remoteUser);
return Status.OK_STATUS;
} catch (TeamException e) {
return e.getStatus();
}
}
};
job.setUser(true);
job.schedule();
return null;
}
use of org.eclipse.ecf.core.identity.ID in project ecf by eclipse.
the class AbstractParser method parseMemberGroups.
public Map<ID, IMemberGroup> parseMemberGroups(final CharSequence seq) throws BBException {
Matcher m = getMemberGroupContainerPattern().matcher(seq);
if (m.find()) {
// TODO is stripHTMLTrim needed? GenericParser doesn't do it
Map<ID, IBBObject> objects = genericParser.parseMultiIdName(getMemberGroupPattern(), m.group(0), getMemberGroupFactory(), true);
Map<ID, IMemberGroup> members = new LinkedHashMap<ID, IMemberGroup>(objects.size());
for (IBBObject obj : objects.values()) {
members.put(obj.getID(), (IMemberGroup) obj);
}
return members;
} else {
throwException("Could not find member groups.", seq);
}
return Collections.emptyMap();
}
Aggregations