Commit 2753eb84 authored by Fotis Soldatos's avatar Fotis Soldatos
Browse files

Merge branch 'policy/update-domain-models' into 'develop'

Policy/update domain models

See merge request teraflow-h2020/controller!139
parents 386d9747 d30f4a57
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -302,6 +302,7 @@
                        <exclude>monitoring/*</exclude>
                        <exclude>service/*</exclude>
                        <exclude>kpi_sample_types/*</exclude>
                        <exclude>acl/*</exclude>
                    </excludes>
                </configuration>
                <executions>
+43 −0
Original line number Diff line number Diff line
/*
* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package eu.teraflow.policy.acl;

public class AclAction {

    private final AclForwardActionEnum aclForwardActionEnum;
    private final AclLogActionEnum aclLogActionEnum;

    public AclAction(AclForwardActionEnum aclForwardActionEnum, AclLogActionEnum aclLogActionEnum) {
        this.aclForwardActionEnum = aclForwardActionEnum;
        this.aclLogActionEnum = aclLogActionEnum;
    }

    public AclForwardActionEnum getAclForwardActionEnum() {
        return aclForwardActionEnum;
    }

    public AclLogActionEnum getAclLogActionEnum() {
        return aclLogActionEnum;
    }

    @Override
    public String toString() {
        return String.format(
                "%s:{aclForwardActionEnum:\"%s\", aclLogActionEnum:\"%s\"}",
                getClass().getSimpleName(), aclForwardActionEnum.toString(), aclLogActionEnum.toString());
    }
}
+55 −0
Original line number Diff line number Diff line
/*
* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package eu.teraflow.policy.acl;

public class AclEntry {

    private final int sequenceId;
    private final String description;
    private final AclMatch match;
    private final AclAction action;

    public AclEntry(int sequenceId, String description, AclMatch match, AclAction action) {
        this.sequenceId = sequenceId;
        this.description = description;
        this.match = match;
        this.action = action;
    }

    public int getSequenceId() {
        return sequenceId;
    }

    public String getDescription() {
        return description;
    }

    public AclMatch getMatch() {
        return match;
    }

    public AclAction getAction() {
        return action;
    }

    @Override
    public String toString() {
        return String.format(
                "%s:{sequenceId:\"%d\", description:\"%s\", %s, %s}",
                getClass().getSimpleName(), sequenceId, description, match, action);
    }
}
+24 −0
Original line number Diff line number Diff line
/*
* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package eu.teraflow.policy.acl;

public enum AclForwardActionEnum {
    UNDEFINED,
    DROP,
    ACCEPT,
    REJECT,
}
+23 −0
Original line number Diff line number Diff line
/*
* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package eu.teraflow.policy.acl;

public enum AclLogActionEnum {
    UNDEFINED,
    NO_LOG,
    SYSLOG
}
Loading