Package org.eclipse.ecf.core.identity

Examples of org.eclipse.ecf.core.identity.ID


   * @param eventToSend
   *            the event to send. Will not be <code>null</code>.
   * @since 1.1
   */
  protected void sendMessage(Event eventToSend) {
    ID target = null;
    Object[] messageData = null;
    try {
      target = getTarget(eventToSend);
      messageData = createMessageDataFromEvent(target, eventToSend);
      sendSharedObjectMsgTo(target, SharedObjectMsg.createMsg(
View Full Code Here


    interpreter.println("--Container--");
    printID(interpreter, container.getID());
    if (verbose) {
      interpreter.print("\tclass=");
      interpreter.println(container.getClass().getName());
      ID connectedID = container.getConnectedID();
      if (connectedID != null) {
        interpreter.print("\tConnected to: ");
        printID(interpreter, connectedID);
      } else interpreter.println("\tNot connected.");
      Namespace ns = container.getConnectNamespace();
View Full Code Here

    String[] args = getArgs(interpreter);
    if (args == null || args.length != 2) {
      interpreter.println("Incorrect number of arguments for container destroy");
      return;
    }
    ID id = createID(interpreter, args[0],args[1]);
    if (id == null) return;
    IContainer container = getContainerManager().removeContainer(id);
    if (container == null) {
      interpreter.println("Container not found to remove");
      return;
View Full Code Here

   */
  protected void joinChatRoom(IContainer container, IChatRoomInfo roomInfo, String password) throws ECFException {
    Assert.isNotNull(container);
    Assert.isNotNull(roomInfo);
    // Check to make sure given container is connected.
    ID connectedID = container.getConnectedID();
    if (connectedID == null)
      throw new ECFException(Messages.MultiRosterView_EXCEPTION_JOIN_ROOM_NOT_CONNECTED);
    // Check to make sure that the given container is one that we have in
    // our accounts set
    if (findAccountForContainer(container) == null)
      throw new ECFException(Messages.MultiRosterView_EXCEPTION_JOIN_ROOM_INVALID_ACCOUNT);

    IWorkbenchWindow ww = getViewSite().getPage().getWorkbenchWindow();
    IWorkbenchPage wp = ww.getActivePage();
    // Get existing roomView...if it's there
    RoomWithAView roomView = (RoomWithAView) chatRooms.get(connectedID);
    if (roomView != null) {
      // We've already connected to this room, so just show it.
      ChatRoomManagerView chatroommanagerview = roomView.getView();
      wp.activate(chatroommanagerview);
      chatroommanagerview.joinRoom(roomInfo, password);
      return;
    }
    try {
      IViewReference ref = wp.findViewReference(org.eclipse.ecf.presence.ui.chatroom.ChatRoomManagerView.VIEW_ID, connectedID.getName());
      // Open view for given connectedID (secondaryID)
      final ChatRoomManagerView chatroommanagerview = (ChatRoomManagerView) ((ref == null) ? wp.showView(org.eclipse.ecf.presence.ui.chatroom.ChatRoomManagerView.VIEW_ID, connectedID.getName(), IWorkbenchPage.VIEW_ACTIVATE) : ref.getView(true));
      // initialize new view
      chatroommanagerview.initializeWithoutManager(ChatRoomManagerView.getUsernameFromID(connectedID), ChatRoomManagerView.getHostnameFromID(connectedID), createChatRoomCommandListener(), createChatRoomViewCloseListener(connectedID));
      // join room
      chatroommanagerview.joinRoom(roomInfo, password);

View Full Code Here

    // Get selected room, selected manager, and selected IChatRoomInfo
    IChatRoomInfo selectedInfo = dialog.getSelectedRoom().getRoomInfo();
    MultiRosterAccount account = dialog.getSelectedRoom().getAccount();
    // Now get the secondary ID from the selected room id
    final IContainer container = account.getContainer();
    final ID connectedID = container.getConnectedID();
    if (connectedID == null) {
      MessageDialog.openError(getViewSite().getShell(), Messages.MultiRosterView_NO_IDENTIFIER_FOR_ROOM_TITLE, NLS.bind(Messages.MultiRosterView_NO_IDENTIFIER_FOR_ROOM_MESSAGE, selectedInfo.getRoomID()));
      return;
    }
View Full Code Here

    disconnectAccountAction = new Action() {
      public void run() {
        IStructuredSelection iss = (IStructuredSelection) treeViewer.getSelection();
        IRoster roster = (IRoster) iss.getFirstElement();
        MultiRosterAccount account = findAccountForUser(roster.getUser().getID());
        ID connectedID = account.getContainer().getConnectedID();
        if (account != null && connectedID != null && MessageDialog.openQuestion(getViewSite().getShell(), Messages.MultiRosterView_DISCONNECT_QUESTION_TITLE, NLS.bind(Messages.MultiRosterView_DISCONNECT_ACCOUNT_QUESTION_MESSAGE, connectedID.getName()))) {
          disconnectAccounts(new MultiRosterAccount[] {account});
        }
      }
    };
    disconnectAccountAction.setText(Messages.MultiRosterView_DISCONNECT_ACCOUNT_ACTION_TEXT);
View Full Code Here

   * @param message
   *            the UpdateMessage received.
   * @throws IDCreateException
   */
  protected void handleStartMessage(final StartMessage message) throws IDCreateException {
    final ID senderID = message.getSenderID();
    Assert.isNotNull(senderID);
    final String senderUsername = message.getSenderUsername();
    Assert.isNotNull(senderUsername);
    final ID our = message.getReceiverID();
    Assert.isNotNull(our);
    final String filename = message.getFilename();
    Assert.isNotNull(filename);
    final String documentContent = message.getDocumentContent();
    Assert.isNotNull(documentContent);
View Full Code Here

  public void disconnect() {
    synchronized (lock) {
      if (getConnectedID() == null || disposed) {
        return;
      }
      final ID connectedID = getConnectedID();
      fireContainerEvent(new ContainerDisconnectingEvent(this.getID(), connectedID));
      queue.close();
      notificationThread.interrupt();
      notificationThread = null;
      this.targetID = null;
View Full Code Here

  public static final void main(String[] args) throws Exception {
    ISharedObjectContainerConfig config = new SOContainerConfig(IDFactory.getDefault().createGUID());
    TCPClientSOContainer container = new TCPClientSOContainer(config);
    // now join group
    ID serverID = IDFactory.getDefault().createStringID("ecftcp://localhost:3282/server"); //$NON-NLS-1$
    container.connect(serverID, null);
    Thread.sleep(200000);
  }
View Full Code Here

public class RemoteServiceHandlerUtil {

  public static IRemoteServiceContainerAdapter getActiveIRemoteServiceContainerAdapterChecked(
      ExecutionEvent event) throws ExecutionException {
    final ID activeConnectId = getActiveConnectIDChecked(event);
    final IContainer container = getContainerWithConnectID(activeConnectId);
    if (container == null) {
      return null;
    }
    final IRemoteServiceContainerAdapter adapter = (IRemoteServiceContainerAdapter) container
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.core.identity.ID

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.