org.eclipse.emf.emfstore.internal.client.model.util
Class EMFStoreClientUtil

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.client.model.util.EMFStoreClientUtil

public final class EMFStoreClientUtil
extends Object

Utility class for EMFStore clients to ease connecting to the server.

Author:
koegel

Method Summary
static boolean areEqual(ESLocalProject projectA, ESLocalProject projectB)
          Determine if the contents of two projects are equal.
static ServerInfo createServerInfo(String url, int port, String certificateAlias)
          Create a server info for a given port and URL.
static Usersession createUsersession()
          Create a default user session with the default super user and password and a server on localhost on the default port.
static Usersession createUsersession(String username, String password, String serverUrl, int serverPort)
          Create a Usersession for the given credentials and server info.
static boolean dryLogin(String username, String password, String serverUrl, int serverPort, String certificateAlias)
          Checks, if the given credentials can be authenticated at the given server.
static ServerInfo giveServerInfo(String url, int port)
          Gives a server info for a given port and URL.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

giveServerInfo

public static ServerInfo giveServerInfo(String url,
                                        int port)
Gives a server info for a given port and URL. Searches first for already existing ones. If the search fails, it creates a new one and registers it for later lookup.

Parameters:
url - the server URL (e.g. IP address or DNS name)
port - the server port
Returns:
a server info

createServerInfo

public static ServerInfo createServerInfo(String url,
                                          int port,
                                          String certificateAlias)
Create a server info for a given port and URL.

Parameters:
url - the server URL (e.g. IP address or DNS name)
port - the server port
certificateAlias - the certificateAlias
Returns:
a server info

createUsersession

public static Usersession createUsersession()
Create a default user session with the default super user and password and a server on localhost on the default port.

Returns:
a user session

createUsersession

public static Usersession createUsersession(String username,
                                            String password,
                                            String serverUrl,
                                            int serverPort)
Create a Usersession for the given credentials and server info.

Parameters:
username - the user name
password - the password
serverUrl - server URL
serverPort - server port
Returns:
a user session

dryLogin

public static boolean dryLogin(String username,
                               String password,
                               String serverUrl,
                               int serverPort,
                               String certificateAlias)
                        throws ESException
Checks, if the given credentials can be authenticated at the given server.

Parameters:
username - the user name
password - the password
serverUrl - server url
serverPort - server port
certificateAlias - the certificateAlias
Returns:
true, if user name & password are right
Throws:
ESException - Problem with the EMFStore Server

areEqual

public static boolean areEqual(ESLocalProject projectA,
                               ESLocalProject projectB)
Determine if the contents of two projects are equal.

Parameters:
projectA - a project
projectB - another project
Returns:
true if the projects´ contents are identical


Copyright © 2015. All Rights Reserved.