public class Core extends javax.ws.rs.core.Application implements ICore
Constructor and Description |
---|
Core()
The Constructor
|
Core(ItemManager manager)
An alternative constructor that allows the Core to be constructed with a
particular ItemManager.
|
Modifier and Type | Method and Description |
---|---|
FormStatus |
cancelItemProcess(int itemId,
java.lang.String actionName)
(non-Javadoc)
|
java.lang.String |
connect()
(non-Javadoc)
|
java.lang.String |
createItem(java.lang.String itemType)
(non-Javadoc)
|
void |
deleteItem(java.lang.String itemId)
(non-Javadoc)
|
void |
disconnect(int uniqueClientId)
(non-Javadoc)
|
ICEList<java.lang.String> |
getAvailableItemTypes()
(non-Javadoc)
|
Form |
getFileSystem(int uniqueClientID)
(non-Javadoc)
|
Form |
getItem(int itemId)
(non-Javadoc)
|
java.util.ArrayList<Identifiable> |
getItemList()
(non-Javadoc)
|
java.io.File |
getItemOutputFile(int id)
(non-Javadoc)
|
FormStatus |
getItemStatus(java.lang.Integer id)
(non-Javadoc)
|
java.util.Set<java.lang.Object> |
getSingletons()
This operation returns the current instance of the ICE core to the HTTP
service so that it can be published.
|
void |
importFile(java.net.URI file)
(non-Javadoc)
|
java.lang.String |
importFileAsItem(java.net.URI file,
java.lang.String itemType)
(non-Javadoc)
|
java.lang.String |
postUpdateMessage(java.lang.String message)
(non-Javadoc)
|
FormStatus |
processItem(int itemId,
java.lang.String actionName,
int uniqueClientId)
(non-Javadoc)
|
void |
registerCompositeItem(ICompositeItemBuilder builder)
(non-Javadoc)
|
void |
registerItem(ItemBuilder itemBuilder)
(non-Javadoc)
|
void |
setHttpService(org.osgi.service.http.HttpService service)
This operation sets the HTTP service that should be used by the Core to
publish itself.
|
void |
setPersistenceProvider(IPersistenceProvider provider)
This operation sets the persistence provider from the
IPersistenceProvider interface.
|
void |
start(org.osgi.service.component.ComponentContext context)
This operation starts the Core, sets the component context and starts the
web client if the HTTP service is available.
|
void |
stop()
This operation stops the Core.
|
void |
unregisterItem(ItemBuilder itemBuilder)
(non-Javadoc)
|
FormStatus |
updateItem(Form form,
int uniqueClientId)
(non-Javadoc)
|
public Core(ItemManager manager)
manager
- The alternative ItemManager.public Core()
public void start(org.osgi.service.component.ComponentContext context)
context
- The bundle context for this OSGi bundle.public void stop()
public Form getFileSystem(int uniqueClientID)
getFileSystem
in interface ICore
uniqueClientID
- The unique ID of the Client calling the operation.ICore.getFileSystem(int uniqueClientID)
public void registerItem(ItemBuilder itemBuilder)
registerItem
in interface ICore
itemBuilder
- An instance of ItemBuilder for a particular Item that is
available to the Core.ICore.registerItem(ItemBuilder itemBuilder)
public void registerCompositeItem(ICompositeItemBuilder builder)
registerCompositeItem
in interface ICore
builder
- The ICompositeItemBuilder that will build the composite Item.ICore.registerCompositeItem(ICompositeItemBuilder builder)
public void unregisterItem(ItemBuilder itemBuilder)
unregisterItem
in interface ICore
itemBuilder
- An instance of ItemBuilder for a particular Item that is now
unavailable to the Core.ICore.unregisterItem(ItemBuilder itemBuilder)
public java.lang.String createItem(java.lang.String itemType)
createItem
in interface ICore
itemType
- The type of Item to create.ICore.createItem(String itemType)
public void deleteItem(java.lang.String itemId)
deleteItem
in interface ICore
itemId
- The identification number of the Item that should be deleted
given as a String. It is safe to parse this string as an
integer.ICore.deleteItem(String itemId)
public FormStatus getItemStatus(java.lang.Integer id)
getItemStatus
in interface ICore
id
- The identification number of the Item that should be checked.ICore.getItemStatus(Integer id)
public Form getItem(int itemId)
getItem
in interface ICore
itemId
- The identification number of the Item that should be
retrieved.ICore.getItem(int itemId)
public ICEList<java.lang.String> getAvailableItemTypes()
getAvailableItemTypes
in interface ICore
ICore.getAvailableItemTypes()
public FormStatus updateItem(Form form, int uniqueClientId)
updateItem
in interface ICore
form
- The Form that carries new information for an Item.uniqueClientId
- The unique client id the IClient that is making the update
request.ICore.updateItem(Form form, int uniqueClientId)
public FormStatus processItem(int itemId, java.lang.String actionName, int uniqueClientId)
processItem
in interface ICore
itemId
- The item id for the Item that should be processed with the
specified action.actionName
- The action that should be performed on the Item.uniqueClientId
- The unique identification number of the client making the
request.ICore.processItem(int itemId, String actionName, int uniqueClientId)
public java.util.ArrayList<Identifiable> getItemList()
getItemList
in interface ICore
ICore.getItemList()
public java.io.File getItemOutputFile(int id)
getItemOutputFile
in interface ICore
id
- The id of the Item.ICore.getItemOutputFile(int id)
public FormStatus cancelItemProcess(int itemId, java.lang.String actionName)
cancelItemProcess
in interface ICore
itemId
- The id of the Item whose process should be canceled.actionName
- The name of the action that should be canceled for the
specified Item.ICore.cancelItemProcess(int itemId, String actionName)
public void importFile(java.net.URI file)
importFile
in interface ICore
file
- The file that should be imported. Nothing will happen if this
argument is null.ICore.importFile(URI file)
public void setHttpService(org.osgi.service.http.HttpService service)
service
- The HTTP service.public java.util.Set<java.lang.Object> getSingletons()
getSingletons
in class javax.ws.rs.core.Application
public void setPersistenceProvider(IPersistenceProvider provider)
provider
- The persistence provider.public java.lang.String connect()
connect
in interface ICore
ICore.connect()
public void disconnect(int uniqueClientId)
disconnect
in interface ICore
uniqueClientId
- The unique client identification number of the client that
would like to disconnect.ICore.disconnect(int uniqueClientId)
public java.lang.String importFileAsItem(java.net.URI file, java.lang.String itemType)
importFileAsItem
in interface ICore
file
- The file that should be imported. Nothing will happen if this
argument is null.itemType
- The type of Item to create.ICore.importFileAsItem(URI file, String itemType)
public java.lang.String postUpdateMessage(java.lang.String message)
postUpdateMessage
in interface ICore
message
- The message that should be passed on to the specified Item.
This string must be in JSON and conform to the message format
of the ICE Updater.ICore.postUpdateMessage(String message)