Search in sources :

Example 36 with ID

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;
    }
}
Also used : IDCreateException(org.eclipse.ecf.core.identity.IDCreateException) IServiceInfo(org.eclipse.ecf.discovery.IServiceInfo) ID(org.eclipse.ecf.core.identity.ID)

Example 37 with ID

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);
    }
}
Also used : ID(org.eclipse.ecf.core.identity.ID)

Example 38 with ID

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;
}
Also used : RssItem(org.eclipse.higgins.rsse.RssItem) List(java.util.List) ID(org.eclipse.ecf.core.identity.ID)

Example 39 with ID

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;
}
Also used : TeamException(org.eclipse.team.core.TeamException) IRoster(org.eclipse.ecf.presence.roster.IRoster) RemoteShare(org.eclipse.team.internal.ecf.core.RemoteShare) RemoteResourceVariantTreeSubscriber(org.eclipse.team.internal.ecf.core.variants.RemoteResourceVariantTreeSubscriber) IUser(org.eclipse.ecf.core.user.IUser) IRosterEntry(org.eclipse.ecf.presence.roster.IRosterEntry) ID(org.eclipse.ecf.core.identity.ID) IContainer(org.eclipse.ecf.core.IContainer) WorkbenchJob(org.eclipse.ui.progress.WorkbenchJob) Job(org.eclipse.core.runtime.jobs.Job) IResource(org.eclipse.core.resources.IResource)

Example 40 with ID

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();
}
Also used : IMemberGroup(org.eclipse.ecf.bulletinboard.IMemberGroup) Matcher(java.util.regex.Matcher) IBBObject(org.eclipse.ecf.bulletinboard.IBBObject) ID(org.eclipse.ecf.core.identity.ID) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

ID (org.eclipse.ecf.core.identity.ID)256 IContainer (org.eclipse.ecf.core.IContainer)29 IOException (java.io.IOException)19 IDCreateException (org.eclipse.ecf.core.identity.IDCreateException)18 UUID (java.util.UUID)17 HashMap (java.util.HashMap)12 ArrayList (java.util.ArrayList)11 ContainerConnectException (org.eclipse.ecf.core.ContainerConnectException)11 GUID (org.eclipse.ecf.core.identity.GUID)11 ISharedObjectManager (org.eclipse.ecf.core.sharedobject.ISharedObjectManager)11 XMPPRoomID (org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID)11 Namespace (org.eclipse.ecf.core.identity.Namespace)10 XMPPID (org.eclipse.ecf.provider.xmpp.identity.XMPPID)10 Map (java.util.Map)9 Matcher (java.util.regex.Matcher)9 ECFException (org.eclipse.ecf.core.util.ECFException)9 List (java.util.List)8 ISharedObject (org.eclipse.ecf.core.sharedobject.ISharedObject)8 IChannel (org.eclipse.ecf.datashare.IChannel)8 Iterator (java.util.Iterator)7