public class Client extends java.lang.Object implements IUpdateEventListener, IProcessEventListener, ISimpleResourceProvider, IWidgetClosedListener, IClient
The Client class is a base class for clients of the Core. It's primary function is to manage calls to and from the Core to and from whatever user interface is provided by IWidgetFactory.
The Client realizes the IClient interface and is registered as an OSGi service. It requires an implementation of the IWidgetFactory so that it can present data from ICE to users. It also implements IUpdateEvenListener, IProcessEventListener, ISimpleResourceProvider and IWidgetClosedLIstener so that it can handle notifications and requests from the widgets and data structures.
Constructor and Description |
---|
Client()
The Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
cancelled()
(non-Javadoc)
|
void |
cancelRequested(Form form,
java.lang.String process)
(non-Javadoc)
|
void |
closedOK()
(non-Javadoc)
|
boolean |
connectToCore(java.lang.String hostname,
int port)
(non-Javadoc)
|
int |
createItem(java.lang.String itemType)
(non-Javadoc)
|
void |
deleteItem(int id)
(non-Javadoc)
|
void |
formUpdated(Form form)
(non-Javadoc)
|
java.util.ArrayList<java.lang.String> |
getAvailableItemTypes()
(non-Javadoc)
|
java.lang.Object |
getFileSystem()
(non-Javadoc)
|
java.util.ArrayList<Identifiable> |
getItems()
(non-Javadoc)
|
void |
importFile(java.net.URI file)
(non-Javadoc)
|
int |
importFileAsItem(java.net.URI file,
java.lang.String itemType)
This operation direct ICE import a file into its workspace and load that file as an input for the specified Item type.
|
void |
loadItem(int itemId)
(non-Javadoc)
|
void |
loadResource(ICEResource resource)
(non-Javadoc)
|
void |
processItem(int itemId,
java.lang.String actionName)
(non-Javadoc)
|
void |
processSelected(Form form,
java.lang.String process)
(non-Javadoc)
|
void |
setCoreService(ICore core)
(non-Javadoc)
|
void |
setUIWidgetFactory(IWidgetFactory widgetFactory)
(non-Javadoc)
|
void |
throwSimpleError(java.lang.String error)
(non-Javadoc)
|
public void setCoreService(ICore core)
setCoreService
in interface IClient
IClient.setCoreService(ICore core)
public int createItem(java.lang.String itemType)
createItem
in interface IClient
itemType
- The type of Item to create.
The identification number of the new Item.
IClient.createItem(String itemType)
public void setUIWidgetFactory(IWidgetFactory widgetFactory)
setUIWidgetFactory
in interface IClient
IClient.setUIWidgetFactory(IWidgetFactory widgetFactory)
public void loadItem(int itemId)
loadItem
in interface IClient
itemId
- The identification number of the Item that should be loaded.
IClient.loadItem(int itemId)
public void throwSimpleError(java.lang.String error)
throwSimpleError
in interface IClient
error
- The error message.
IClient.throwSimpleError(String error)
public java.util.ArrayList<java.lang.String> getAvailableItemTypes()
getAvailableItemTypes
in interface IClient
The list of ItemTypes that can be created by ICE.
IClient.getAvailableItemTypes()
public void processItem(int itemId, java.lang.String actionName)
processItem
in interface IClient
itemId
- The id number of Item that should be processed.
actionName
- The name of the Action that should be performed for the Item.
IClient.processItem(int itemId, String actionName)
public boolean connectToCore(java.lang.String hostname, int port)
connectToCore
in interface IClient
hostname
- The hostname of the remote ICore.
port
- The port on which the client should connect to the remote ICore.
True if the client was able to connect to the core and false if not.
IClient.connectToCore(String hostname, int port)
public java.util.ArrayList<Identifiable> getItems()
getItems
in interface IClient
The list of Identifiables that represents the Items.
IClient.getItems()
public void deleteItem(int id)
deleteItem
in interface IClient
id
- The identification number of the new Item.
IClient.deleteItem(int id)
public void importFile(java.net.URI file)
importFile
in interface IClient
file
- The file that should be imported. Nothing will happen if this argument is null.
IClient.importFile(URI file)
public void formUpdated(Form form)
formUpdated
in interface IUpdateEventListener
form
- The widget that was changed.
IUpdateEventListener.formUpdated(Form form)
public void processSelected(Form form, java.lang.String process)
processSelected
in interface IProcessEventListener
IProcessEventListener.processSelected(Form form, String process)
public void cancelRequested(Form form, java.lang.String process)
cancelRequested
in interface IProcessEventListener
form
- The form that was previously processed.
process
- The name of the process that was requested for the previous form.
IProcessEventListener.cancelRequested(Form form, String process)
public void loadResource(ICEResource resource)
loadResource
in interface ISimpleResourceProvider
resource
- The ICEResource that should be loaded by the provider.
ISimpleResourceProvider.loadResource(ICEResource resource)
public void closedOK()
closedOK
in interface IWidgetClosedListener
IWidgetClosedListener.closedOK()
public void cancelled()
cancelled
in interface IWidgetClosedListener
IWidgetClosedListener.cancelled()
public java.lang.Object getFileSystem()
getFileSystem
in interface IClient
A hierarchical list of the workspace directories available to the Eclipse User.
IClient.getFileSystem()
public int importFileAsItem(java.net.URI file, java.lang.String itemType)
IClient
This operation direct ICE import a file into its workspace and load that file as an input for the specified Item type.
importFileAsItem
in interface IClient
file
- The file that should be imported. Nothing will happen if this argument is null.
itemType
- The type of Item to create.
The identification number given of the newly created Item or -1 if it was unable to create the Item.