org.eclipse.emf.emfstore.internal.client.model.impl.api
Class ESServerImpl

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.common.api.AbstractAPIImpl<ESServerImpl,ServerInfo>
      extended by org.eclipse.emf.emfstore.internal.client.model.impl.api.ESServerImpl
All Implemented Interfaces:
ESServer, InternalAPIDelegator<ESServerImpl,ServerInfo>

public class ESServerImpl
extends AbstractAPIImpl<ESServerImpl,ServerInfo>
implements ESServer

Mapping between ESServer and ServerInfo.

Author:
emueller

Field Summary
 
Fields inherited from interface org.eclipse.emf.emfstore.client.ESServer
FACTORY
 
Constructor Summary
ESServerImpl(ServerInfo serverInfo)
          Constructor.
 
Method Summary
 ESRemoteProject createRemoteProject(ESUsersession usersession, String projectName, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
          Creates an empty project on the server.
 ESRemoteProject createRemoteProject(String projectName, org.eclipse.core.runtime.IProgressMonitor monitor)
          Creates an empty project on the server.
 String getCertificateAlias()
          Returns the alias for the certificate used by this server.
 ESUsersession getLastUsersession()
          Returns the ESUsersession which was used on the last call to this server.
 String getName()
          Returns the local name of the server.
 int getPort()
          Returns the port of the server where EMFStore is listening on.
 ESRemoteProject getRemoteProject(ESGlobalProjectId projectId)
          Returns the remote project with the given ID.
 ESRemoteProject getRemoteProject(ESUsersession usersession, ESGlobalProjectId projectId)
          Returns the remote project with the given ID.
 List<ESRemoteProject> getRemoteProjects()
          Returns a list with all remote projects hosted on this server.
 List<ESRemoteProject> getRemoteProjects(ESUsersession usersession)
          Returns a list with all remote projects hosted on this server.
 String getURL()
          Returns the URL of the server.
 ESUsersession login(String name, String password)
          Logs into this server, returning a ESUsersession.
 void setCertificateAlias(String alias)
          Sets a new certificate alias.
 void setName(String serverName)
          Sets the local name of the server.
 void setPort(int port)
          Sets the port of the server where EMFStore is listening on.
 void setURL(String url)
          Sets the URL of the server.
 
Methods inherited from class org.eclipse.emf.emfstore.internal.common.api.AbstractAPIImpl
equals, hashCode, toInternalAPI
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ESServerImpl

public ESServerImpl(ServerInfo serverInfo)
Constructor.

Parameters:
serverInfo - the delegate
Method Detail

getName

public String getName()
Returns the local name of the server.

Specified by:
getName in interface ESServer
Returns:
the name of the server
See Also:
ESServer.getName()

setName

public void setName(String serverName)
Sets the local name of the server.

Specified by:
setName in interface ESServer
Parameters:
serverName - the new local name of th server
See Also:
ESServer.setName(java.lang.String)

getPort

public int getPort()
Returns the port of the server where EMFStore is listening on.

Specified by:
getPort in interface ESServer
Returns:
the port of the server EMFStore is listing on
See Also:
ESServer.getPort()

setPort

public void setPort(int port)
Sets the port of the server where EMFStore is listening on.

Specified by:
setPort in interface ESServer
Parameters:
port - the port of the server EMFStore is listing on
See Also:
ESServer.setPort(int)

getURL

public String getURL()
Returns the URL of the server.

Specified by:
getURL in interface ESServer
Returns:
the URL of the server as a string
See Also:
ESServer.getURL()

setURL

public void setURL(String url)
Sets the URL of the server.

Specified by:
setURL in interface ESServer
Parameters:
url - the URL of the server as a string
See Also:
ESServer.setURL(java.lang.String)

getCertificateAlias

public String getCertificateAlias()
Returns the alias for the certificate used by this server. Certificates are managed by the KeyStoreManager

Specified by:
getCertificateAlias in interface ESServer
Returns:
the certificate alias
See Also:
ESServer.getCertificateAlias()

setCertificateAlias

public void setCertificateAlias(String alias)
Sets a new certificate alias.

Specified by:
setCertificateAlias in interface ESServer
Parameters:
alias - the alias of the the certificate to be set
See Also:
ESServer.setCertificateAlias(java.lang.String)

getLastUsersession

public ESUsersession getLastUsersession()
Returns the ESUsersession which was used on the last call to this server.

Specified by:
getLastUsersession in interface ESServer
Returns:
the lastly used session
See Also:
ESServer.getLastUsersession()

createRemoteProject

public ESRemoteProject createRemoteProject(String projectName,
                                           org.eclipse.core.runtime.IProgressMonitor monitor)
                                    throws ESException
Creates an empty project on the server.

Specified by:
createRemoteProject in interface ESServer
Parameters:
projectName - The name of the project to be created
monitor - a IProgressMonitor instance that is used to indicate progress about creating the remote project
Returns:
a ESRemoteProject object containing information about the created project
Throws:
ESException - If an error occurs while creating the remote project
See Also:
ESServer.createRemoteProject(java.lang.String, org.eclipse.core.runtime.IProgressMonitor)

createRemoteProject

public ESRemoteProject createRemoteProject(ESUsersession usersession,
                                           String projectName,
                                           org.eclipse.core.runtime.IProgressMonitor progressMonitor)
                                    throws ESException
Creates an empty project on the server.

Specified by:
createRemoteProject in interface ESServer
Parameters:
usersession - the ESUsersession that should be used to create the remote project.
If null, the session manager will search for a session.
projectName - the name of the project
progressMonitor - a monitor to show the progress
Returns:
a ESRemoteProject object containing information about the created project
Throws:
ESException - If an error occurs while creating the remote project
See Also:
ESServer.createRemoteProject(org.eclipse.emf.emfstore.client.ESUsersession, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)

login

public ESUsersession login(String name,
                           String password)
                    throws ESException
Logs into this server, returning a ESUsersession.

Specified by:
login in interface ESServer
Parameters:
name - the name of the user
password - the cleartext password of the user
Returns:
a logged in ESUsersession
Throws:
ESException - in case an error occurs while creating and logging in the session for the given user
See Also:
ESServer.login(java.lang.String, java.lang.String)

getRemoteProjects

public List<ESRemoteProject> getRemoteProjects()
                                        throws ESException
Returns a list with all remote projects hosted on this server.

Specified by:
getRemoteProjects in interface ESServer
Returns:
a list with all remote project
Throws:
ESException - in case an error occurs while retrieving the list of remote projects
See Also:
ESServer.getRemoteProjects()

getRemoteProjects

public List<ESRemoteProject> getRemoteProjects(ESUsersession usersession)
                                        throws ESException
Returns a list with all remote projects hosted on this server.

Specified by:
getRemoteProjects in interface ESServer
Parameters:
usersession - the ESUsersession that should be used to fetch the remote projects.
If null, the session manager will try to inject a session.
Returns:
a list with all remote project
Throws:
ESException - in case an error occurs while retrieving the list of remote projects
See Also:
ESServer.getRemoteProjects(org.eclipse.emf.emfstore.client.ESUsersession)

getRemoteProject

public ESRemoteProject getRemoteProject(ESGlobalProjectId projectId)
                                 throws ESException
Returns the remote project with the given ID.

Parameters:
projectId - the ID of the project
Returns:
the remote project or null, if no project with the given ID has been found
Throws:
ESException - in case an error occurs while retrieving the remote project

getRemoteProject

public ESRemoteProject getRemoteProject(ESUsersession usersession,
                                        ESGlobalProjectId projectId)
                                 throws ESException
Returns the remote project with the given ID.

Parameters:
usersession - the ESUsersession that should be used to fetch the remote project.
If null, the session manager will try to inject a session.
projectId - the ID of the project
Returns:
the remote project or null, if no project with the given ID has been found
Throws:
ESException - in case an error occurs while retrieving the remote project


Copyright © 2015. All Rights Reserved.