22//
33// SPDX-License-Identifier: Apache-2.0
44
5- package org .lfenergy .compas .service ;
5+ package org .lfenergy .compas .sct . commons . scl ;
66
77import org .lfenergy .compas .scl2007b4 .model .SCL ;
88import org .lfenergy .compas .scl2007b4 .model .TExtRef ;
1717import org .lfenergy .compas .sct .commons .dto .ResumedDataTemplate ;
1818import org .lfenergy .compas .sct .commons .dto .SubNetworkDTO ;
1919import org .lfenergy .compas .sct .commons .exception .ScdException ;
20- import org .lfenergy .compas .sct .commons .scl .SclRootAdapter ;
2120import org .lfenergy .compas .sct .commons .scl .com .CommunicationAdapter ;
2221import org .lfenergy .compas .sct .commons .scl .dtt .DataTypeTemplateAdapter ;
2322import org .lfenergy .compas .sct .commons .scl .dtt .LNodeTypeAdapter ;
3332import java .util .Set ;
3433import java .util .stream .Collectors ;
3534
36- public class SclManager {
35+ public class SclService {
3736
3837
39- public SclRootAdapter addHistoryItem (SCL scd , String who , String what , String why ){
38+ public static SclRootAdapter addHistoryItem (SCL scd , String who , String what , String why ){
4039 SclRootAdapter sclRootAdapter = new SclRootAdapter (scd );
4140 HeaderAdapter headerAdapter = sclRootAdapter .getHeaderAdapter ();
4241 headerAdapter .addHistoryItem (who ,what ,why );
4342 return sclRootAdapter ;
4443 }
4544
46- public IEDAdapter addIED (SCL scd , String iedName , SCL icd ) throws ScdException {
45+ public static IEDAdapter addIED (SCL scd , String iedName , SCL icd ) throws ScdException {
4746 SclRootAdapter sclRootAdapter = new SclRootAdapter (scd );
4847 return sclRootAdapter .addIED (icd ,iedName );
4948 }
5049
51- public CommunicationAdapter addSubnetworks (SCL scd , Set <SubNetworkDTO > subNetworks ) throws ScdException {
50+ public static CommunicationAdapter addSubnetworks (SCL scd , Set <SubNetworkDTO > subNetworks ) throws ScdException {
5251 SclRootAdapter sclRootAdapter = new SclRootAdapter (scd );
5352 CommunicationAdapter communicationAdapter = sclRootAdapter .getCommunicationAdapter (true );
5453 for (SubNetworkDTO subNetworkDTO : subNetworks ){
@@ -62,7 +61,7 @@ public CommunicationAdapter addSubnetworks(SCL scd, Set<SubNetworkDTO> subNetwor
6261 return communicationAdapter ;
6362 }
6463
65- public List <SubNetworkDTO > getSubnetwork (SCL scd ) throws ScdException {
64+ public static List <SubNetworkDTO > getSubnetwork (SCL scd ) throws ScdException {
6665 SclRootAdapter sclRootAdapter = new SclRootAdapter (scd );
6766 CommunicationAdapter communicationAdapter = sclRootAdapter .getCommunicationAdapter (false );
6867 return communicationAdapter .getSubNetworkAdapters ()
@@ -71,7 +70,7 @@ public List<SubNetworkDTO> getSubnetwork(SCL scd) throws ScdException {
7170 .collect (Collectors .toList ());
7271 }
7372
74- public List <ExtRefInfo > getExtRefInfo (SCL scd , String iedName , String ldInst ) throws ScdException {
73+ public static List <ExtRefInfo > getExtRefInfo (SCL scd , String iedName , String ldInst ) throws ScdException {
7574
7675 SclRootAdapter sclRootAdapter = new SclRootAdapter (scd );
7776 IEDAdapter iedAdapter = sclRootAdapter .getIEDAdapter (iedName );
@@ -83,7 +82,7 @@ public List<ExtRefInfo> getExtRefInfo(SCL scd, String iedName, String ldInst) th
8382 }
8483
8584
86- public List <ExtRefBindingInfo > getExtRefBinders (SCL scd , String iedName , String ldInst ,
85+ public static List <ExtRefBindingInfo > getExtRefBinders (SCL scd , String iedName , String ldInst ,
8786 String lnClass , String lnInst , ExtRefSignalInfo signalInfo ) throws ScdException {
8887 SclRootAdapter sclRootAdapter = new SclRootAdapter (scd );
8988 IEDAdapter iedAdapter = sclRootAdapter .getIEDAdapter (iedName );
@@ -109,7 +108,7 @@ public List<ExtRefBindingInfo> getExtRefBinders(SCL scd, String iedName, String
109108 return potentialBinders ;
110109 }
111110
112- public void updateExtRefBinders (SCL scd , String iedName , String ldInst , LNodeDTO lNodeDTO ) throws ScdException {
111+ public static void updateExtRefBinders (SCL scd , String iedName , String ldInst , LNodeDTO lNodeDTO ) throws ScdException {
113112 SclRootAdapter sclRootAdapter = new SclRootAdapter (scd );
114113 IEDAdapter iedAdapter = new IEDAdapter (sclRootAdapter ,iedName );
115114 LDeviceAdapter lDeviceAdapter = iedAdapter .getLDeviceAdapterByLdInst (ldInst )
@@ -128,7 +127,7 @@ public void updateExtRefBinders(SCL scd, String iedName, String ldInst, LNodeDTO
128127 }
129128
130129
131- public List <ControlBlock <?>> getExtRefSourceInfo (SCL scd , ExtRefInfo extRefInfo ) throws ScdException {
130+ public static List <ControlBlock <?>> getExtRefSourceInfo (SCL scd , ExtRefInfo extRefInfo ) throws ScdException {
132131
133132
134133 ExtRefSignalInfo signalInfo = extRefInfo .getSignalInfo ();
@@ -168,7 +167,7 @@ public List<ControlBlock<?>> getExtRefSourceInfo(SCL scd, ExtRefInfo extRefInfo)
168167 return srcIEDAdapter .getControlBlocksByBindingInfo (extRefInfo );
169168 }
170169
171- public TExtRef updateExtRefSource (SCL scd , ExtRefInfo extRefInfo ) throws ScdException {
170+ public static TExtRef updateExtRefSource (SCL scd , ExtRefInfo extRefInfo ) throws ScdException {
172171 String iedName = extRefInfo .getHolderIedName ();
173172 String ldInst = extRefInfo .getHolderLdInst ();
174173 String lnClass = extRefInfo .getHolderLnClass ();
@@ -204,7 +203,7 @@ public TExtRef updateExtRefSource(SCL scd, ExtRefInfo extRefInfo) throws ScdExce
204203 return anLNAdapter .updateExtRefSource (extRefInfo );
205204 }
206205
207- public Set <LNodeDTO > getDAI (SCL scd , String iedName , String ldInst ,
206+ public static Set <LNodeDTO > getDAI (SCL scd , String iedName , String ldInst ,
208207 ResumedDataTemplate rDtt , boolean updatable ) throws ScdException {
209208 SclRootAdapter sclRootAdapter = new SclRootAdapter (scd );
210209 IEDAdapter iedAdapter = new IEDAdapter (sclRootAdapter ,iedName );
@@ -234,7 +233,7 @@ public Set<LNodeDTO> getDAI(SCL scd, String iedName, String ldInst,
234233 return nodeDTOS ;
235234 }
236235
237- public void updateDAI (SCL scd , String iedName , String ldInst , ResumedDataTemplate rDtt ) throws ScdException {
236+ public static void updateDAI (SCL scd , String iedName , String ldInst , ResumedDataTemplate rDtt ) throws ScdException {
238237
239238 SclRootAdapter sclRootAdapter = new SclRootAdapter (scd );
240239 //check(rtt)
0 commit comments