com.groiss.store
Interface Exportable

All Superinterfaces:
Persistent
All Known Implementing Classes:
DirectoryServer, ExportablePersistentObject

public interface Exportable
extends Persistent

Classes that want to provide the possibility of being exported/imported by the import/export functionality of @enterprise must implement this interface.

Since:
@enterprise 6.3

Field Summary
static java.lang.String[][] emptyKeys
          Empty String array which can be used by classes which don't want to define keys.
 
Method Summary
 void beforeImport(java.util.Map<java.lang.String,Persistent> values)
          This method is called by the importer after the object is filled with data.
 java.util.List<java.lang.reflect.Field> exportFields()
          Here a class can return the names of fields which should be exported during an @enterprise export.
 java.util.List<Exportable> getAdditionalObjects(boolean isReference)
          return a list of objects that must be exported with this object (after it).
 java.lang.String[][] getKeys()
          A class has to return key groups in order to identify already existing objects of that class.
 java.util.List<Exportable> getRequiredObjects(boolean isReference)
          This method is called by the exporter before an object is exported.
 java.util.List<Exportable> getRequiredReferences()
          Returns a list of references that cannot be found in the persistent fields.
 
Methods inherited from interface com.groiss.store.Persistent
dbFields, getOid, getStore, getTableName, isFilled, onDelete, onInsert, onRead, onUpdate, setFilled, setOid, setStore
 

Field Detail

emptyKeys

static final java.lang.String[][] emptyKeys
Empty String array which can be used by classes which don't want to define keys.

Method Detail

getKeys

java.lang.String[][] getKeys()
A class has to return key groups in order to identify already existing objects of that class. A key group must uniquely identify an object. This method returns an array of arrays, because a class can have more than one key group. In that case each of the key groups must be unique for an object to be unique (thus, group1 matches OR group2 matches etc.).

Returns:
An array of arrays containing object field names of the fields which form key groups for uniquely identifying objects of classes implementing this interface. An example would be {{"name", "birthdate"}} for a class defining one key group containing the fields name and birthdate.

exportFields

java.util.List<java.lang.reflect.Field> exportFields()
                                                     throws java.lang.Exception
Here a class can return the names of fields which should be exported during an @enterprise export.

Returns:
A list containing the fields for export.
Throws:
java.lang.Exception

getRequiredObjects

java.util.List<Exportable> getRequiredObjects(boolean isReference)
                                              throws java.lang.Exception
This method is called by the exporter before an object is exported. The object can add required objects.

Parameters:
isReference - is this a reference to an exported object
Returns:
preReqObjects List containing required objects. Required objects must be Persistent objects implementing the Exportable interface.
Throws:
java.lang.Exception

getRequiredReferences

java.util.List<Exportable> getRequiredReferences()
                                                 throws java.lang.Exception
Returns a list of references that cannot be found in the persistent fields.

Returns:
a list of exportable
Throws:
java.lang.Exception

getAdditionalObjects

java.util.List<Exportable> getAdditionalObjects(boolean isReference)
                                                throws java.lang.Exception
return a list of objects that must be exported with this object (after it).

Parameters:
isReference - is this a reference to an exported object
Throws:
java.lang.Exception

beforeImport

void beforeImport(java.util.Map<java.lang.String,Persistent> values)
This method is called by the importer after the object is filled with data. The object can change itself

Parameters:
values - contains a map of the object identifier (classname:oid) to the new objects.


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.