01: /*
02: * Copyright 2006 Luca Garulli (luca.garulli@assetdata.it)
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.romaframework.aspect.etl;
18:
19: import java.io.InputStream;
20: import java.io.OutputStream;
21: import java.util.Set;
22:
23: import org.romaframework.core.Utility;
24: import org.romaframework.core.aspect.SelfRegistrantConfigurableAspect;
25: import org.romaframework.core.config.RomaApplicationContext;
26: import org.romaframework.core.schema.SchemaClassResolver;
27:
28: public abstract class EtlAspect extends
29: SelfRegistrantConfigurableAspect {
30:
31: @Deprecated
32: public abstract int doImport(Object iRootObject,
33: String iMappingName, InputStream iStream,
34: ImportFactory iFactory) throws EtlException;
35:
36: public abstract int doExport(String iMappingName,
37: OutputStream iStream) throws EtlException;
38:
39: /**
40: * launches an ETL procedure given its name
41: * @param name the symbolic name of an ETL definition
42: * @return the number of records imported
43: * @throws EtlException
44: */
45: public abstract int doImport(String name) throws EtlException;
46:
47: public String aspectName() {
48: return ASPECT_NAME;
49: }
50:
51: /**
52: * @return the names of all available ETL procedure
53: */
54: public abstract Set<String> getEtlDefinitionNames();
55:
56: /**
57: * given an etl definition name, returns its description
58: * @param etlName the name of an etl definition
59: * @return the descriprion of the etl procedure
60: */
61: public abstract String getEtlDescription(String etlName);
62:
63: @Override
64: public void startup() {
65: // REGISTER THE VIEW DOMAIN TO SCHEMA CLASS RESOLVER
66: RomaApplicationContext.getInstance().getBean(
67: SchemaClassResolver.class).addDomainPackage(
68: Utility.getApplicationAspectPackage(aspectName()));
69: }
70:
71: public static final String ASPECT_NAME = "etl";
72: }
|