Class ItemProxy

java.lang.Object
org.cristalise.kernel.entity.proxy.ItemProxy
Direct Known Subclasses:
AgentProxy

@Immutable public class ItemProxy extends Object
It is a immutable wrapper for the connection and communication with Item and its data. It relies on the ClusterStorage mechanism to retrieve and to cache data, i.e. it does not do any cashing itself.
  • Field Details

    • mItem

      protected Item mItem
    • mItemPath

      protected ItemPath mItemPath
    • transactionKey

      protected TransactionKey transactionKey
      Set Transaction key (a.k.a. transKey/locker) when ItemProxy is used in server side scripting
  • Constructor Details

    • ItemProxy

      protected ItemProxy(ItemPath itemPath)
      Parameters:
      itemPath -
    • ItemProxy

      protected ItemProxy(ItemPath itemPath, TransactionKey transKey)
  • Method Details

    • getItem

      public Item getItem()
    • getPath

      public ItemPath getPath()
      Return the ItemPath object of the Item this proxy is linked with
      Returns:
      the ItemPath of the Item
    • getUuid

      public String getUuid()
      Returns the UUID string of the Item this proxy is linked with
      Returns:
      UUID string of the Item
    • setProperty

      public void setProperty(AgentProxy agent, String name, String value) throws AccessRightsException, PersistencyException, InvalidDataException
      Sets the value of the given Property
      Parameters:
      agent - the Agent who is setting the Property
      name - the name of the Property
      value - the value of the Property
      Throws:
      AccessRightsException - Agent does not the rights to execute this operation
      PersistencyException - there was a database problems during this operations
      InvalidDataException - data was invalid
    • requestAction

      public String requestAction(String itemUuid, String agentUuid, String stepPath, int transitionID, String requestData, String fileName, List<Byte> attachment) throws CriseVertxException
      Parameters:
      itemUuid -
      agentUuid -
      stepPath -
      transitionID -
      requestData -
      fileName -
      attachment -
      Returns:
      Throws:
      CriseVertxException
    • requestAction

      public String requestAction(Job thisJob) throws CriseVertxException
      Executes the given Job of this Item
      Parameters:
      thisJob - the Job to be executed
      Returns:
      the result of the execution
      Throws:
      CriseVertxException - if the operation failed
    • getJobs

      public List<Job> getJobs(AgentPath agentPath) throws CriseVertxException
      Get the list of active Jobs of the Item that can be executed by the Agent
      Parameters:
      agentPath - the Agent requesting the job
      Returns:
      list of active Jobs
      Throws:
      AccessRightsException - Agent does not the rights to execute this operation
      PersistencyException - there was a database problems during this operations
      ObjectNotFoundException - data was invalid
      CriseVertxException
    • checkJobForAgent

      public boolean checkJobForAgent(Job job, AgentPath agentPath) throws CriseVertxException
      Throws:
      CriseVertxException
    • getJobs

      public List<Job> getJobs(AgentProxy agent) throws CriseVertxException
      Get the list of active Jobs of the Item that can be executed by the Agent
      Parameters:
      agent - requesting the job
      Returns:
      list of Jobs
      Throws:
      CriseVertxException
    • getJobs

      public List<Job> getJobs(AgentPath agent, String stepPath) throws CriseVertxException
      Get the list of active Jobs of the Item for the given Activity that can be executed by the Agent.
      Parameters:
      agent - requesting the job
      stepPath - the path of the Activity instance
      Returns:
      list of active Jobs of the Item for the given Activity that can be executed by the Agent
      Throws:
      CriseVertxException
    • checkCollection

      public boolean checkCollection(BuiltInCollections collection) throws ObjectNotFoundException
      Checks if the given built-in Collection exists
      Parameters:
      collection - the built-in Collection
      Returns:
      true of Collection exists false otherwise
      Throws:
      ObjectNotFoundException - if Item does not have any Collections at all
    • checkCollection

      public boolean checkCollection(BuiltInCollections collection, TransactionKey transKey) throws ObjectNotFoundException
      Checks if the given built-in Collection exists
      Parameters:
      collection - the built-in Collection
      transKey - the transaction key
      Returns:
      true of Collection exists false otherwise
      Throws:
      ObjectNotFoundException - if Item does not have any Collections at all
    • checkCollection

      public boolean checkCollection(String collection) throws ObjectNotFoundException
      Checks if the given Collection exists
      Parameters:
      collection - the name Collection
      Returns:
      true of Collection exists false otherwise
      Throws:
      ObjectNotFoundException - if Item does not have any Collections at all
    • checkCollection

      public boolean checkCollection(String collection, TransactionKey transKey) throws ObjectNotFoundException
      Checks if the given Collection exists
      Parameters:
      collection - the name Collection
      transKey - the transaction key
      Returns:
      true of Collection exists false otherwise
      Throws:
      ObjectNotFoundException - if Item does not have any Collections at all
    • getCollection

      public Collection<?> getCollection(BuiltInCollections collection) throws ObjectNotFoundException
      Gets the current version of the named Collection
      Parameters:
      collection - The built-in collection
      Returns:
      the Collection object
      Throws:
      ObjectNotFoundException - objects were not found
    • getCollection

      public Collection<?> getCollection(BuiltInCollections collection, TransactionKey transKey) throws ObjectNotFoundException
      Gets the current version of the named Collection. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      collection - The built-in collection
      transKey - the transaction key
      Returns:
      the Collection object
      Throws:
      ObjectNotFoundException - objects were not found
    • getCollection

      public Collection<?> getCollection(BuiltInCollections collection, Integer version) throws ObjectNotFoundException
      Gets a numbered version (snapshot) of a collection
      Parameters:
      collection - The built-in Collection
      version - The collection number. Use null to get the 'last' version.
      Returns:
      the Collection object
      Throws:
      ObjectNotFoundException - objects were not found
    • getCollection

      public Collection<?> getCollection(BuiltInCollections collection, Integer version, TransactionKey transKey) throws ObjectNotFoundException
      Gets a numbered version (snapshot) of a collection
      Parameters:
      collection - The built-in Collection
      version - The collection number. Use null to get the 'last' version.
      transKey - the transaction key
      Returns:
      the Collection object
      Throws:
      ObjectNotFoundException - objects were not found
    • getCollection

      public Collection<?> getCollection(String collName) throws ObjectNotFoundException
      Gets the last version of the named collection
      Parameters:
      collName - The collection name
      Returns:
      the Collection object
      Throws:
      ObjectNotFoundException - objects were not found
    • getCollection

      public Collection<?> getCollection(String collName, TransactionKey transKey) throws ObjectNotFoundException
      Gets the last version of the named collection. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      collName - The collection name
      transKey - the transaction key
      Returns:
      the Collection object
      Throws:
      ObjectNotFoundException - objects were not found
    • getCollection

      public Collection<?> getCollection(String collName, Integer version) throws ObjectNotFoundException
      Gets a numbered version (snapshot) of a collection
      Parameters:
      collName - The collection name
      version - The collection number. Use null to get the 'last' version.
      Returns:
      the Collection object
      Throws:
      ObjectNotFoundException - objects were not found
    • getCollection

      public Collection<?> getCollection(String collName, Integer version, TransactionKey transKey) throws ObjectNotFoundException
      Gets a numbered version (snapshot) of a collection. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      collName - The collection name
      version - The collection number. Use null to get the 'last' version.
      transKey - the transaction key
      Returns:
      the Collection object
      Throws:
      ObjectNotFoundException - objects were not found
    • getWorkflow

      public Workflow getWorkflow() throws ObjectNotFoundException
      Gets the Workflow object of this Item
      Returns:
      the Item's Workflow object
      Throws:
      ObjectNotFoundException - objects were not found
    • getWorkflow

      public Workflow getWorkflow(TransactionKey transKey) throws ObjectNotFoundException
      Gets the Workflow object of this Item. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      transKey - the transaction key
      Returns:
      the Item's Workflow object
      Throws:
      ObjectNotFoundException - objects were not found
    • checkViewpoint

      public boolean checkViewpoint(String schemaName, String viewName) throws ObjectNotFoundException
      Check if the given Viewpoint exists
      Parameters:
      schemaName - the name of the Schema associated with the Viewpoint
      viewName - the name of the View
      Returns:
      true if the ViewPoint exist false otherwise
      Throws:
      ObjectNotFoundException - Object not found
    • checkViewpoint

      public boolean checkViewpoint(String schemaName, String viewName, TransactionKey transKey) throws ObjectNotFoundException
      Check if the given Viewpoint exists. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      schemaName - the name of the Schema associated with the Viewpoint
      viewName - the name of the View
      transKey - the transaction key
      Returns:
      true if the ViewPoint exist false otherwise
      Throws:
      ObjectNotFoundException - Object not found
    • getViewpoints

      public String[] getViewpoints(String schemaName) throws ObjectNotFoundException
      Reads the list of existing Viewpoint names for the given schema
      Parameters:
      schemaName - the name of the schema
      Returns:
      array of strings containing the Viewpoint names
      Throws:
      ObjectNotFoundException - Object not found
    • getViewpoints

      public String[] getViewpoints(String schemaName, TransactionKey transKey) throws ObjectNotFoundException
      Reads the list of existing Viewpoint names for the given schema. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      schemaName - the name of the schema
      transKey - the transaction key
      Returns:
      array of strings containing the Viewpoint names
      Throws:
      ObjectNotFoundException - Object not found
    • getViewpoint

      public Viewpoint getViewpoint(String schemaName, String viewName) throws ObjectNotFoundException
      Gets the named Viewpoint
      Parameters:
      schemaName - the name of the Schema associated with the Viewpoint
      viewName - name if the View
      Returns:
      a Viewpoint object
      Throws:
      ObjectNotFoundException - objects were not found
    • getViewpoint

      public Viewpoint getViewpoint(String schemaName, String viewName, TransactionKey transKey) throws ObjectNotFoundException
      Gets the named Viewpoint. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      schemaName - the name of the Schema associated with the Viewpoint
      viewName - name if the View
      transKey - the transaction key
      Returns:
      a Viewpoint object
      Throws:
      ObjectNotFoundException - objects were not found
    • checkOutcome

      public boolean checkOutcome(String schemaName, int schemaVersion, int eventId) throws ObjectNotFoundException
      Check if the given Outcome exists
      Parameters:
      schemaName - the name of the Schema used to create the Outcome
      schemaVersion - the version of the Schema used to create the Outcome
      eventId - the id of the Event created when the Outcome was stored
      Returns:
      true if the Outcome exist false otherwise
      Throws:
      ObjectNotFoundException - Object not found
    • checkOutcome

      public boolean checkOutcome(String schemaName, int schemaVersion, int eventId, TransactionKey transKey) throws ObjectNotFoundException
      Check if the given Outcome exists. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      schemaName - the name of the Schema used to create the Outcome
      schemaVersion - the version of the Schema used to create the Outcome
      eventId - the id of the Event created when the Outcome was stored
      transKey - the transaction key
      Returns:
      true if the Outcome exist false otherwise
      Throws:
      ObjectNotFoundException - Object not found
    • checkOutcome

      public boolean checkOutcome(Schema schema, int eventId) throws ObjectNotFoundException
      Check if the given Outcome exists
      Parameters:
      schema - the Schema used to create the Outcome
      eventId - the id of the Event created when the Outcome was stored
      Returns:
      true if the Outcome exist false otherwise
      Throws:
      ObjectNotFoundException - Object not found
    • checkOutcome

      public boolean checkOutcome(Schema schema, int eventId, TransactionKey transKey) throws ObjectNotFoundException
      Check if the given Outcome exists. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      schema - the Schema used to create the Outcome
      eventId - the id of the Event created when the Outcome was stored
      transKey - transaction key
      Returns:
      true if the Outcome exist false otherwise
      Throws:
      ObjectNotFoundException - Object not found
    • getOutcome

      public Outcome getOutcome(String schemaName, int schemaVersion, int eventId) throws ObjectNotFoundException
      Gets the selected Outcome. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      schemaName - the name of the Schema of the Outcome
      schemaVersion - the version of the Schema of the Outcome
      eventId - the event id
      Returns:
      the Outcome object
      Throws:
      ObjectNotFoundException - object was not found
    • getOutcome

      public Outcome getOutcome(String schemaName, int schemaVersion, int eventId, TransactionKey transKey) throws ObjectNotFoundException
      Gets the selected Outcome. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      schemaName - the name of the Schema of the Outcome
      schemaVersion - the version of the Schema of the Outcome
      eventId - the event id
      transKey - the transaction key
      Returns:
      the Outcome object
      Throws:
      ObjectNotFoundException - object was not found
    • getOutcome

      public Outcome getOutcome(Schema schema, int eventId) throws ObjectNotFoundException
      Gets the selected Outcome,
      Parameters:
      schema - the Schema used to create the Outcome
      eventId - the id of the Event created when the Outcome was stored
      Returns:
      the Outcome object
      Throws:
      ObjectNotFoundException - object was not found
    • getOutcome

      public Outcome getOutcome(Schema schema, int eventId, TransactionKey transKey) throws ObjectNotFoundException
      Gets the selected Outcome. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      schema - the Schema used to create the Outcome
      eventId - the id of the Event created when the Outcome was stored
      transKey - the transaction key
      Returns:
      the Outcome object
      Throws:
      ObjectNotFoundException - object was not found
    • getOutcome

      public Outcome getOutcome(Viewpoint view) throws ObjectNotFoundException
      Gets the Outcome selected by the Viewpoint
      Parameters:
      view - the Viewpoint to be used
      Returns:
      the Outcome object
      Throws:
      ObjectNotFoundException - object was not found
    • getOutcome

      public Outcome getOutcome(Viewpoint view, TransactionKey transKey) throws ObjectNotFoundException
      Gets the Outcome selected by the Viewpoint. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      view - the Viewpoint to be used
      transKey - the transaction key
      Returns:
      the Outcome object
      Throws:
      ObjectNotFoundException - object was not found
    • getOutcome

      public Outcome getOutcome(Event event) throws ObjectNotFoundException
      Gets the Outcome associated with the Event.
      Parameters:
      event - the Event to be used
      Returns:
      the Outcome object
      Throws:
      ObjectNotFoundException
    • getOutcome

      public Outcome getOutcome(Event event, TransactionKey transKey) throws ObjectNotFoundException
      Gets the Outcome associated with the Event. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      event - the Event to be used
      transKey - the transaction key
      Returns:
      the Outcome object
      Throws:
      ObjectNotFoundException - object was not found
    • checkOutcomeAttachment

      public boolean checkOutcomeAttachment(Schema schema, int eventId) throws ObjectNotFoundException
      Check if the given OutcomeAttachment exists
      Parameters:
      schema - the Schema used to create the Outcome and its OutcomeAttachment
      eventId - the id of the Event created when the Outcome and its OutcomeAttachment was stored
      Returns:
      true if the OutcomeAttachment exist false otherwise
      Throws:
      ObjectNotFoundException - Object not found
    • checkOutcomeAttachment

      public boolean checkOutcomeAttachment(Schema schema, int eventId, TransactionKey transKey) throws ObjectNotFoundException
      Check if the given OutcomeAttachment exists. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      schema - the Schema used to create the Outcome and its OutcomeAttachment
      eventId - the id of the Event created when the Outcome and its OutcomeAttachment was stored
      transKey - the transaction key
      Returns:
      true if the OutcomeAttachment exist false otherwise
      Throws:
      ObjectNotFoundException - Object not found
    • getOutcomeAttachment

      public OutcomeAttachment getOutcomeAttachment(String schemaName, int schemaVersion, int eventId) throws ObjectNotFoundException
      Gets the selected OutcomeAttachment
      Parameters:
      schemaName - the name of the Schema used to create the Outcome and its OutcomeAttachment
      schemaVersion - the version of the Schema of the Outcome
      eventId - the event id
      Returns:
      the Outcome object
      Throws:
      ObjectNotFoundException - object was not found
    • getOutcomeAttachment

      public OutcomeAttachment getOutcomeAttachment(String schemaName, int schemaVersion, int eventId, TransactionKey transKey) throws ObjectNotFoundException
      Gets the selected OutcomeAttachment. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      schemaName - the name of the Schema used to create the Outcome and its OutcomeAttachment
      schemaVersion - the version of the Schema of the Outcome
      eventId - the event id
      transKey - the transaction key
      Returns:
      the Outcome object
      Throws:
      ObjectNotFoundException - object was not found
    • getOutcomeAttachment

      public OutcomeAttachment getOutcomeAttachment(Schema schema, int eventId) throws ObjectNotFoundException
      Gets the selected OutcomeAttachment
      Parameters:
      schema - the Schema used to create the Outcome and its OutcomeAttachment
      eventId - the id of the Event created when the Outcome and the OutcomeAttachment was stored
      Returns:
      the Outcome object
      Throws:
      ObjectNotFoundException - object was not found
    • getOutcomeAttachment

      public OutcomeAttachment getOutcomeAttachment(Schema schema, int eventId, TransactionKey transKey) throws ObjectNotFoundException
      Gets the selected OutcomeAttachment. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      schema - the Schema used to create the Outcome and its OutcomeAttachment
      eventId - the id of the Event created when the Outcome and the OutcomeAttachment was stored
      transKey - the transaction key
      Returns:
      the Outcome object
      Throws:
      ObjectNotFoundException - object was not found
    • getJobByName

      public Job getJobByName(String actName, AgentProxy agent) throws CriseVertxException
      Finds the first finishing job with the given name for the given Agent in the workflow.
      Parameters:
      actName - the name of the Activity to look for
      agent - The agent to fetch jobs for
      Returns:
      the JOB object or null if nothing was found
      Throws:
      AccessRightsException - Agent has not rights
      ObjectNotFoundException - objects were not found
      PersistencyException - Error loading the relevant objects
      CriseVertxException
    • getJobByTransitionName

      public Job getJobByTransitionName(String actName, String transName, AgentProxy agent) throws CriseVertxException
      Finds the Job with the given Activity and Transition name for the Agent in the Items Workflow
      Parameters:
      actName - the name of the Activity to look for
      transName - the name of the Transition to look for
      agent - The AgentProxy to fetch jobs for
      Returns:
      the JOB object or null if nothing was found
      Throws:
      AccessRightsException - Agent has not rights
      ObjectNotFoundException - objects were not found
      PersistencyException - Error loading the relevant objects
      CriseVertxException
    • getJobByTransitionName

      public Job getJobByTransitionName(String actName, String transName, AgentPath agentPath) throws CriseVertxException
      Finds the Job with the given Activity and Transition name for the Agent in the Items Workflow
      Parameters:
      actName - the name of the Activity to look for
      transName - the name of the Transition to look for
      agentPath - The agent to fetch jobs for
      Returns:
      the JOB object or null if nothing was found
      Throws:
      AccessRightsException - Agent has not rights
      ObjectNotFoundException - objects were not found
      PersistencyException - Error loading the relevant objects
      CriseVertxException
    • queryData

      public String queryData(String path) throws ObjectNotFoundException
      Query data of the Item located by the ClusterStorage path
      Parameters:
      path - the ClusterStorage path
      Returns:
      the data in XML form
      Throws:
      ObjectNotFoundException - path was not correct
    • queryData

      public String queryData(String path, TransactionKey transKey) throws ObjectNotFoundException
      Query data of the Item located by the ClusterStorage path
      Parameters:
      path - the ClusterStorage path
      transKey - the transaction key
      Returns:
      the data in XML form
      Throws:
      ObjectNotFoundException - path was not correct
    • checkContent

      public boolean checkContent(String path, String name) throws ObjectNotFoundException
      Check if the data of the Item located by the ClusterStorage path is exist
      Parameters:
      path - the ClusterStorage path
      name - the name of the content to be checked
      Returns:
      true if there is content false otherwise
      Throws:
      ObjectNotFoundException - path was not correct
    • checkContent

      public boolean checkContent(ClusterType cluster, String name) throws ObjectNotFoundException
      Check the root content of the given ClusterType
      Parameters:
      cluster - the type of the cluster
      name - the name of the content to be checked
      Returns:
      true if there is content false otherwise
      Throws:
      ObjectNotFoundException - path was not correct
    • checkContent

      public boolean checkContent(ClusterType cluster, String name, TransactionKey transKey) throws ObjectNotFoundException
      Check the root content of the given ClusterType
      Parameters:
      cluster - the type of the cluster
      name - the name of the content to be checked
      transKey - the transaction key
      Returns:
      true if there is content false otherwise
      Throws:
      ObjectNotFoundException - path was not correct
    • checkContent

      public boolean checkContent(String path, String name, TransactionKey transKey) throws ObjectNotFoundException
      Check if the data of the Item located by the ClusterStorage path is exist. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      path - the type of the cluster
      name - the name of the content to be checked
      transKey - the transaction key
      Returns:
      true if there is content false otherwise
      Throws:
      ObjectNotFoundException - path was not correct
    • getContents

      public String[] getContents(ClusterType type) throws ObjectNotFoundException
      List the root content of the given ClusterType.
      Parameters:
      type - the type of the cluster
      Returns:
      list of String of the cluster content
      Throws:
      ObjectNotFoundException - Object nt found
    • getContents

      public String[] getContents(ClusterType type, TransactionKey transKey) throws ObjectNotFoundException
      List the root content of the given ClusterType. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      type - the type of the cluster
      transKey - the transaction key
      Returns:
      list of String of the cluster content
      Throws:
      ObjectNotFoundException - Object nt found
    • getContents

      public String[] getContents(String path) throws ObjectNotFoundException
      List the content of the cluster located by the cluster path
      Parameters:
      path - the ClusterStorage path
      Returns:
      list of String of the cluster content
      Throws:
      ObjectNotFoundException - Object not found
    • getContents

      public String[] getContents(String path, TransactionKey transKey) throws ObjectNotFoundException
      List the content of the cluster located by the cluster path. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      path - the ClusterStorage path
      transKey - the transaction key
      Returns:
      list of String of the cluster content
      Throws:
      ObjectNotFoundException - Object not found
    • executeQuery

      public String executeQuery(Query query) throws PersistencyException
      Executes the Query in the target database. The query can be any of these type: SQL/OQL/XQuery/XPath/etc.
      Parameters:
      query - the query to be executed
      Returns:
      the xml result of the query
      Throws:
      PersistencyException - there was a fundamental DB issue
    • getObject

      public C2KLocalObject getObject(ClusterType type) throws ObjectNotFoundException
      Retrieve the C2KLocalObject for the ClusterType
      Parameters:
      type - the ClusterTyoe
      Returns:
      the C2KLocalObject
      Throws:
      ObjectNotFoundException - the type did not result in a C2KLocalObject
    • getObject

      public C2KLocalObject getObject(ClusterType type, TransactionKey transKey) throws ObjectNotFoundException
      Retrieve the C2KLocalObject for the ClusterType. Actually it returns an instance of C2KLocalObjectMap
      Parameters:
      type - the ClusterTyoe
      Returns:
      the C2KLocalObjectMap representing all the Object in the ClusterType
      Throws:
      ObjectNotFoundException - the type did not result in a C2KLocalObject
    • getObject

      public C2KLocalObject getObject(String path) throws ObjectNotFoundException
      Retrieve the C2KLocalObject for the Cluster path
      Parameters:
      path - the path to the cluster content
      Returns:
      the C2KLocalObject
      Throws:
      ObjectNotFoundException - the path did not result in a C2KLocalObject
    • getObject

      public C2KLocalObject getObject(String path, TransactionKey transKey) throws ObjectNotFoundException
      Retrieve the C2KLocalObject for the Cluster path. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      path - the path to the cluster object
      transKey - the transaction key
      Returns:
      the C2KLocalObject
      Throws:
      ObjectNotFoundException - the path did not result in a C2KLocalObject
    • getProperty

      public String getProperty(BuiltInItemProperties prop) throws ObjectNotFoundException
      Retrieves the values of a BuiltInItemProperty
      Parameters:
      prop - one of the Built-In Item Property
      Returns:
      the value of the property
      Throws:
      ObjectNotFoundException - property was not found
    • getProperty

      public String getProperty(BuiltInItemProperties prop, String defaultValue)
      Retrieves the values of a BuiltInItemProperty or returns the defaulValue if no Property was found
      Parameters:
      prop - one of the Built-In Item Property
      defaultValue - the value to be used if no Property was found
      Returns:
      the value or the defaultValue
    • getProperty

      public String getProperty(BuiltInItemProperties prop, String defaultValue, TransactionKey transKey)
      Retrieves the values of a BuiltInItemProperty or returns the defaulValue if no Property was found. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      prop - one of the Built-In Item Property
      defaultValue - the value to be used if no Property was found
      transKey - the transaction key
      Returns:
      the value or the defaultValue
    • getProperty

      public String getProperty(String name, String defaultValue)
      Retrieves the values of a named property or returns the defaulValue if no Property was found
      Parameters:
      name - of the Item Property
      defaultValue - the value to be used if no Property was found
      Returns:
      the value or the defaultValue
    • getProperty

      public String getProperty(String name, String defaultValue, TransactionKey transKey)
      Retrieves the value of a named property. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      name - of the Item Property
      defaultValue - the value to be used if no Property was found
      transKey - the transaction key
      Returns:
      the value of the property
    • getProperty

      public String getProperty(String name) throws ObjectNotFoundException
      Retrieves the value of a named property
      Parameters:
      name - of the Item Property
      Returns:
      the value of the property
      Throws:
      ObjectNotFoundException - property was not found
    • getProperty

      public String getProperty(String name, TransactionKey transKey) throws ObjectNotFoundException
      Parameters:
      name -
      transKey -
      Returns:
      Throws:
      ObjectNotFoundException
    • checkProperty

      public boolean checkProperty(BuiltInItemProperties prop) throws ObjectNotFoundException
      Check if the given built-in Property exists
      Parameters:
      prop - the built-in Property
      Returns:
      true if the Property exist false otherwise
      Throws:
      ObjectNotFoundException - Item does not have any properties at all
    • checkProperty

      public boolean checkProperty(BuiltInItemProperties prop, TransactionKey transKey) throws ObjectNotFoundException
      Check if the given built-in Property exists. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      prop - the built-in Property
      transKey - the transaction key
      Returns:
      true if the Property exist false otherwise
      Throws:
      ObjectNotFoundException - Item does not have any properties at all
    • checkProperty

      public boolean checkProperty(String name) throws ObjectNotFoundException
      Check if the given Property exists
      Parameters:
      name - of the Property
      Returns:
      true if the Property exist false otherwise
      Throws:
      ObjectNotFoundException - Item does not have any properties at all
    • checkProperty

      public boolean checkProperty(String name, TransactionKey transKey) throws ObjectNotFoundException
      Check if the given Property exists. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      name - of the Property
      transKey - the transaction key
      Returns:
      true if the Property exist false otherwise
      Throws:
      ObjectNotFoundException - Item does not have any properties at all
    • getName

      public String getName()
      Get the name of the Item from its Property called Name
      Returns:
      the name of the Item or null if no Name Property exists
    • getName

      public String getName(TransactionKey transKey)
      Get the name of the Item from its Property called Name. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      transKey - the transaction key
      Returns:
      the name of the Item or null if no Name Property exists
    • getType

      public String getType()
      Get the type of the Item from its Property called Type
      Returns:
      the type of the Item or null if no Type Property exists
    • getType

      public String getType(TransactionKey transKey)
      Get the type of the Item from its Property called Type. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      transKey - the transaction key
      Returns:
      the type of the Item or null if no Type Property exists
    • getEvent

      public Event getEvent(int eventId) throws ObjectNotFoundException
      Retrieves the Event of the given id.
      Parameters:
      eventId - the id of the Event
      Returns:
      the Event object
      Throws:
      ObjectNotFoundException - there is no event for the given id
    • getEvent

      public Event getEvent(int eventId, TransactionKey transKey) throws ObjectNotFoundException
      Retrieves the Event of the given id. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      eventId - the id of the Event
      transKey - the transaction key
      Returns:
      the Event object
      Throws:
      ObjectNotFoundException - there is no event for the given id
    • getHistory

      public History getHistory() throws ObjectNotFoundException
      Retrieves the History of the item.
      Returns:
      the History object
      Throws:
      ObjectNotFoundException - there is no event for the given id
    • getHistory

      public History getHistory(TransactionKey transKey) throws ObjectNotFoundException
      Retrieves the History of the item. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      transKey - the transaction key
      Returns:
      the History object
      Throws:
      ObjectNotFoundException - there is no event for the given id
    • getJob

      public Job getJob(String id) throws ObjectNotFoundException
      Retrieves single persistent Job.
      Parameters:
      id - of the persistent Job
      Returns:
      persistent Job of the Item
      Throws:
      ObjectNotFoundException - there is no persistent Job for the given id
    • getJob

      public Job getJob(String id, TransactionKey transKey) throws ObjectNotFoundException
      Retrieves single persistent Job. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      id - of the Job
      transKey - the transaction key
      Returns:
      persistent Job of the Item
      Throws:
      ObjectNotFoundException - there is no Job for the given id
    • getJobs

      public C2KLocalObjectMap<Job> getJobs()
      Retrieves the complete list of Jobs of the Item.
      Returns:
      C2KLocalObjectMap of Jobs
    • getJobs

      public C2KLocalObjectMap<Job> getJobs(TransactionKey transKey)
      Retrieves the complete list of Jobs of the Item. This method can be used in server side Script to find uncommitted changes during the active transaction.
      Parameters:
      transKey - the transaction key
      Returns:
      C2KLocalObjectMap of Jobs
    • getMasterSchema

      public Schema getMasterSchema() throws InvalidDataException, ObjectNotFoundException
      Returns the so called Master Schema which can be used to construct master outcome.
      Returns:
      the actual Schema
      Throws:
      InvalidDataException - the Schema could not be constructed
      ObjectNotFoundException - no Schema was found for the name and version
    • getMasterSchema

      public Schema getMasterSchema(String schemaName, Integer schemaVersion) throws InvalidDataException, ObjectNotFoundException
      Returns the so called Master Schema which can be used to construct master outcome.
      Parameters:
      schemaName - the name or UUID of the Schema or can be blank. It overwrites the master schema settings in the Properties
      schemaVersion - the version of the schema or can be null. It overwrites the master schema settings in the Properties
      Returns:
      the Schema
      Throws:
      InvalidDataException - the Schema could not be constructed
      ObjectNotFoundException - no Schema was found for the name and version
    • getUpdateSchema

      public Schema getUpdateSchema() throws ObjectNotFoundException, InvalidDataException
      Returns the so called UpdateSchema which is used while creating new Items. It can be either the "constructor" Schema retrieved from the 'SchemaInitialise' dependency or the Schema used by the Update Activity
      Returns:
      schema
      Throws:
      InvalidDataException - the Schema could not be constructed
      ObjectNotFoundException - no Schema was found
    • getAggregateScript

      public Script getAggregateScript() throws InvalidDataException, ObjectNotFoundException
      Returns the so called Aggregate Script which can be used to construct master outcome.
      Returns:
      the script
      Throws:
      InvalidDataException - something was wrong with the provided data
      ObjectNotFoundException - no Script can be found
    • getAggregateScript

      public Script getAggregateScript(String scriptName, Integer scriptVersion) throws InvalidDataException, ObjectNotFoundException
      Returns the so called Aggregate Script which can be used to construct master outcome.
      Parameters:
      scriptName - the name of the script received in the rest call (can be null)
      scriptVersion - the version of the script received in the rest call (can be null)
      Returns:
      the script or null
      Throws:
      InvalidDataException
      ObjectNotFoundException
    • marshall

      public String marshall(Object obj) throws Exception
      Throws:
      Exception
    • unmarshall

      public Object unmarshall(String obj) throws Exception
      Throws:
      Exception
    • clearCache

      public void clearCache()
    • toString

      public String toString()
      Overrides:
      toString in class Object