+++ /dev/null
-/*-\r
- * ================================================================================\r
- * ECOMP Portal SDK\r
- * ================================================================================\r
- * Copyright (C) 2017 AT&T Intellectual Property\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ================================================================================\r
- */\r
-package org.openecomp.portalapp.scheduler;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;\r
-import org.openecomp.portalsdk.core.scheduler.Registerable;\r
-import org.openecomp.portalsdk.core.util.SystemProperties;\r
-import org.quartz.Trigger;\r
-import org.springframework.beans.factory.annotation.Autowired;\r
-import org.springframework.context.annotation.DependsOn;\r
-import org.springframework.stereotype.Component;\r
-\r
-@Component\r
-@DependsOn({ "logRegistry", "systemProperties" })\r
-public class Register implements Registerable {\r
-\r
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(Register.class);\r
-\r
- private List<Trigger> scheduleTriggers = new ArrayList<Trigger>();\r
- Trigger trigger[] = new Trigger[1];\r
-\r
- @Autowired\r
- private LogRegistry logRegistry;\r
-\r
- @Override\r
- public Trigger[] getTriggers() {\r
- return getScheduleTriggers().toArray(trigger);\r
- }\r
-\r
- @Override\r
- public void registerTriggers() {\r
- // if the property value is not available; the cron will not be added\r
- // and can be ignored. its safe to ignore the exceptions\r
- try {\r
- if (SystemProperties.getProperty(SystemProperties.LOG_CRON) != null)\r
- getScheduleTriggers().add(logRegistry.getTrigger());\r
- } catch (IllegalStateException ies) {\r
- logger.info(EELFLoggerDelegate.debugLogger, ("Log Cron not available"));\r
- }\r
-\r
- }\r
-\r
- public List<Trigger> getScheduleTriggers() {\r
- return scheduleTriggers;\r
- }\r
-\r
- public void setScheduleTriggers(List<Trigger> scheduleTriggers) {\r
- this.scheduleTriggers = scheduleTriggers;\r
- }\r
-\r
-}\r