Protege 3.4.4

edu.stanford.smi.protege.server
Class Server

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by edu.stanford.smi.protege.server.Server
All Implemented Interfaces:
RemoteServer, Serializable, Remote

public class Server
extends UnicastRemoteObject
implements RemoteServer

See Also:
Serialized Form

Nested Class Summary
static class Server.ServerStatus
           
 
Field Summary
static int NO_SAVE
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Method Summary
 boolean allowsCreateUsers()
           
protected  void bindName()
           
 boolean cancelShutdownProject(RemoteSession session, String projectName)
           
 RemoteSession cloneSession(RemoteSession session)
           
 void closeSession(RemoteSession session)
           
 RemoteServerProject createProject(String newProjectName, RemoteSession session, KnowledgeBaseFactory kbfactory, boolean saveToMetaProject)
           
 boolean createUser(String userName, String password)
           
 void disconnectFromProject(RemoteServerProject serverProject, RemoteSession session)
           
 Object executeServerJob(ServerJob job, RemoteSession session)
           
protected  void extractMetaProjectLocation(String s)
           
 Collection<Operation> getAllowedOperations(RemoteSession session, String projectName, String userName)
           
 Collection<String> getAllProjectNames()
           
 Collection<ProjectInfo> getAvailableProjectInfo(RemoteSession session)
           
 Collection<String> getAvailableProjectNames(RemoteSession session)
           
static String getBoundName()
           
 Collection<ServerProject> getCurrentProjects(RemoteSession session)
           
 Collection<RemoteSession> getCurrentSessions()
           
 Collection<RemoteSession> getCurrentSessions(RemoteServerProject project)
           
 Collection<RemoteSession> getCurrentSessions(String projectName, RemoteSession session)
           
static Server getInstance()
           
protected static String getLocalBoundName()
           
 KnowledgeBase getMetaProject()
          Deprecated. In ProtegeJobs use getMetaProjectInstance
 MetaProject getMetaProjectNew()
           
 Slot getNameSlot()
          Deprecated. In ProtegeJobs use getMetaProjectInstance
 Project getOrCreateProject(String name)
           
static Policy getPolicy()
           
 Project getProject(String name)
           
 Cls getProjectCls()
          Deprecated. In ProtegeJobs use getMetaProjectInstance
 Map<String,ServerProject.ProjectStatus> getProjectsStatusMap()
           
 ServerProject.ProjectStatus getProjectStatus(String name)
           
 int getSaveIntervalMsec()
           
 ServerProject getServerProject(Project p)
           
 ServerProject getServerProject(String projectName)
           
 boolean hasValidCredentials(String userName, String password)
           
 boolean isActive(RemoteSession session)
           
 boolean isGroupOperationAllowed(RemoteSession session, Operation op, String groupName)
           
 boolean isOperationAllowed(RemoteSession session, Operation op, String projectName)
           
 boolean isServerOperationAllowed(RemoteSession session, Operation op)
           
 boolean isServerOperationAllowed(RemoteSession session, Operation op, String serverName)
           
 void killOtherUserSession(RemoteSession sessionToKill, RemoteSession session)
           
 void killOtherUserSession(RemoteSession sessionToKill, RemoteSession session, int finalGracePeriod)
           
static void main(String[] args)
           
 void notifyProject(String projectName, String message, RemoteSession session)
           
 RemoteServerProject openMetaProject(RemoteSession session)
           
 RemoteServerProject openProject(String projectName, RemoteSession session)
           
 RemoteSession openSession(String username, String userIpAddress, String password)
           
protected  void parseArg(String arg)
           
protected  void printUsage()
           
 void reinitialize()
           
 void saveAllProjects()
           
 boolean saveMetaProject(RemoteSession session)
           
 void setFrameCalculatorDisabled(boolean disabled)
           
 void setProjectStatus(String name, ServerProject.ProjectStatus status)
           
 void setProjectStatus(String projectName, ServerProject.ProjectStatus status, RemoteSession session)
           
 void setSaveIntervalMsec(int saveIntervalMsec)
           
 void shutdown()
           
 void shutdown(String projectName, RemoteSession session)
           
 void shutdownProject(RemoteSession session, String projectName, float warningTimeInSeconds)
          Shuts down the remote project with the name projectName and sends shutdown notifications at certain time periods: it starts with the warningTimeInSeconds argument and divides it by two.
 void shutdownProject(RemoteSession session, String projectName, Integer[] warningTimesInSeconds, int finalGracePeriodInSeconds)
          Shuts down the remote project with the name projectName and sends shutdown notifications at time periods (in seconds) from the warningTimesInSeconds argument.
static void startServer(String[] args)
          Start up the server.
 String toString()
           
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_SAVE

public static final int NO_SAVE
See Also:
Constant Field Values
Method Detail

main

public static void main(String[] args)

startServer

public static void startServer(String[] args)
                        throws IOException
Start up the server.

Parameters:
args - the arguments to the server
sf - the socket factory to be used
Throws:
IOException - if the socket factory has already been set
See Also:
RMISocketFactory.setSocketFactory(RMISocketFactory)

getInstance

public static Server getInstance()

getPolicy

public static Policy getPolicy()

getBoundName

public static String getBoundName()

getLocalBoundName

protected static String getLocalBoundName()

getSaveIntervalMsec

public int getSaveIntervalMsec()

setSaveIntervalMsec

public void setSaveIntervalMsec(int saveIntervalMsec)

parseArg

protected void parseArg(String arg)

extractMetaProjectLocation

protected void extractMetaProjectLocation(String s)

printUsage

protected void printUsage()

bindName

protected void bindName()
                 throws RemoteException
Throws:
RemoteException

getServerProject

public ServerProject getServerProject(String projectName)

getOrCreateProject

public Project getOrCreateProject(String name)

toString

public String toString()
Overrides:
toString in class RemoteObject

saveMetaProject

public boolean saveMetaProject(RemoteSession session)
                        throws RemoteException
Specified by:
saveMetaProject in interface RemoteServer
Throws:
RemoteException

saveAllProjects

public void saveAllProjects()

isActive

public boolean isActive(RemoteSession session)

disconnectFromProject

public void disconnectFromProject(RemoteServerProject serverProject,
                                  RemoteSession session)
                           throws ServerSessionLost
Throws:
ServerSessionLost

getProject

public Project getProject(String name)

getServerProject

public ServerProject getServerProject(Project p)

getProjectStatus

public ServerProject.ProjectStatus getProjectStatus(String name)
Specified by:
getProjectStatus in interface RemoteServer

setProjectStatus

public void setProjectStatus(String name,
                             ServerProject.ProjectStatus status)

getCurrentProjects

public Collection<ServerProject> getCurrentProjects(RemoteSession session)

getCurrentSessions

public Collection<RemoteSession> getCurrentSessions()

getCurrentSessions

public Collection<RemoteSession> getCurrentSessions(RemoteServerProject project)

setFrameCalculatorDisabled

public void setFrameCalculatorDisabled(boolean disabled)

getMetaProjectNew

public MetaProject getMetaProjectNew()

getMetaProject

@Deprecated
public KnowledgeBase getMetaProject()
Deprecated. In ProtegeJobs use getMetaProjectInstance


getProjectCls

@Deprecated
public Cls getProjectCls()
Deprecated. In ProtegeJobs use getMetaProjectInstance


getNameSlot

@Deprecated
public Slot getNameSlot()
Deprecated. In ProtegeJobs use getMetaProjectInstance


reinitialize

public void reinitialize()
                  throws RemoteException
Specified by:
reinitialize in interface RemoteServer
Throws:
RemoteException

openSession

public RemoteSession openSession(String username,
                                 String userIpAddress,
                                 String password)
Specified by:
openSession in interface RemoteServer

cloneSession

public RemoteSession cloneSession(RemoteSession session)
Specified by:
cloneSession in interface RemoteServer

closeSession

public void closeSession(RemoteSession session)
Specified by:
closeSession in interface RemoteServer

getCurrentSessions

public Collection<RemoteSession> getCurrentSessions(String projectName,
                                                    RemoteSession session)
Specified by:
getCurrentSessions in interface RemoteServer

getAvailableProjectNames

public Collection<String> getAvailableProjectNames(RemoteSession session)
Specified by:
getAvailableProjectNames in interface RemoteServer

getAvailableProjectInfo

public Collection<ProjectInfo> getAvailableProjectInfo(RemoteSession session)
Specified by:
getAvailableProjectInfo in interface RemoteServer

getAllProjectNames

public Collection<String> getAllProjectNames()

getProjectsStatusMap

public Map<String,ServerProject.ProjectStatus> getProjectsStatusMap()

openProject

public RemoteServerProject openProject(String projectName,
                                       RemoteSession session)
                                throws ServerSessionLost
Specified by:
openProject in interface RemoteServer
Throws:
ServerSessionLost

openMetaProject

public RemoteServerProject openMetaProject(RemoteSession session)
                                    throws RemoteException
Specified by:
openMetaProject in interface RemoteServer
Throws:
RemoteException

createProject

public RemoteServerProject createProject(String newProjectName,
                                         RemoteSession session,
                                         KnowledgeBaseFactory kbfactory,
                                         boolean saveToMetaProject)
                                  throws RemoteException
Specified by:
createProject in interface RemoteServer
Throws:
RemoteException

setProjectStatus

public void setProjectStatus(String projectName,
                             ServerProject.ProjectStatus status,
                             RemoteSession session)
Specified by:
setProjectStatus in interface RemoteServer

notifyProject

public void notifyProject(String projectName,
                          String message,
                          RemoteSession session)
Specified by:
notifyProject in interface RemoteServer

createUser

public boolean createUser(String userName,
                          String password)
Specified by:
createUser in interface RemoteServer

hasValidCredentials

public boolean hasValidCredentials(String userName,
                                   String password)
Specified by:
hasValidCredentials in interface RemoteServer

shutdown

public void shutdown()
Specified by:
shutdown in interface RemoteServer

shutdown

public void shutdown(String projectName,
                     RemoteSession session)
Specified by:
shutdown in interface RemoteServer

killOtherUserSession

public void killOtherUserSession(RemoteSession sessionToKill,
                                 RemoteSession session)
Specified by:
killOtherUserSession in interface RemoteServer

killOtherUserSession

public void killOtherUserSession(RemoteSession sessionToKill,
                                 RemoteSession session,
                                 int finalGracePeriod)
Specified by:
killOtherUserSession in interface RemoteServer

shutdownProject

public void shutdownProject(RemoteSession session,
                            String projectName,
                            float warningTimeInSeconds)
                     throws RemoteException
Shuts down the remote project with the name projectName and sends shutdown notifications at certain time periods: it starts with the warningTimeInSeconds argument and divides it by two. A SecurityException is thrown if the user of the session does not have the right to shutdown the project.

Specified by:
shutdownProject in interface RemoteServer
Parameters:
session - - the session that tries to shutdown the project
projectName - - the remote project name
warningTimeInSeconds - - the time of the first notification in seconds
Throws:
RemoteException

shutdownProject

public void shutdownProject(RemoteSession session,
                            String projectName,
                            Integer[] warningTimesInSeconds,
                            int finalGracePeriodInSeconds)
                     throws RemoteException
Shuts down the remote project with the name projectName and sends shutdown notifications at time periods (in seconds) from the warningTimesInSeconds argument. A SecurityException is thrown if the user of the session does not have the right to shutdown the project.

Specified by:
shutdownProject in interface RemoteServer
Parameters:
session - - the session that tries to shutdown the project
projectName - - the remote project name
warningTimesInSeconds - - a list of Integer with the notify periods of time in seconds
finalGracePeriodInSeconds - - the time the server will wait until shutting down the project after the last notification message
Throws:
RemoteException

cancelShutdownProject

public boolean cancelShutdownProject(RemoteSession session,
                                     String projectName)
Specified by:
cancelShutdownProject in interface RemoteServer

allowsCreateUsers

public boolean allowsCreateUsers()
                          throws RemoteException
Specified by:
allowsCreateUsers in interface RemoteServer
Throws:
RemoteException

isOperationAllowed

public boolean isOperationAllowed(RemoteSession session,
                                  Operation op,
                                  String projectName)
Specified by:
isOperationAllowed in interface RemoteServer

isServerOperationAllowed

public boolean isServerOperationAllowed(RemoteSession session,
                                        Operation op)
Specified by:
isServerOperationAllowed in interface RemoteServer

isServerOperationAllowed

public boolean isServerOperationAllowed(RemoteSession session,
                                        Operation op,
                                        String serverName)
Specified by:
isServerOperationAllowed in interface RemoteServer

isGroupOperationAllowed

public boolean isGroupOperationAllowed(RemoteSession session,
                                       Operation op,
                                       String groupName)
Specified by:
isGroupOperationAllowed in interface RemoteServer

getAllowedOperations

public Collection<Operation> getAllowedOperations(RemoteSession session,
                                                  String projectName,
                                                  String userName)
Specified by:
getAllowedOperations in interface RemoteServer

executeServerJob

public Object executeServerJob(ServerJob job,
                               RemoteSession session)
Specified by:
executeServerJob in interface RemoteServer

Protege 3.4.4

Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2010 Stanford University.