/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* 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.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
jsonbean.getItemSchema().getName(), jsonbean.getItemSchema().getVersion(), jsonbean.getUuid(),
jsonbean.getDescription());
- session.finishSession(result.isOk());
+ if (result != null) {
+ session.finishSession(result.isOk());
+ LOGGER.exit("ContextAlbum/Create" + (result.isOk() ? OK : NOT_OK));
+ }
- LOGGER.exit("ContextAlbum/Create" + (result != null && result.isOk() ? OK : NOT_OK));
return result;
}
jsonbean.getItemSchema().getName(), jsonbean.getItemSchema().getVersion(), jsonbean.getUuid(),
jsonbean.getDescription());
- session.finishSession(result.isOk());
+ if (result != null) {
+ session.finishSession(result.isOk());
+ LOGGER.exit("ContextAlbum/Update" + (result.isOk() ? OK : NOT_OK));
+ }
- LOGGER.exit("ContextAlbum/Update" + (result != null && result.isOk() ? OK : NOT_OK));
return result;
}
ApexApiResult result = session.getApexModelEdited().deleteContextAlbum(blank2Null(name), blank2Null(version));
- session.finishSession(result.isOk());
+ if (result != null) {
+ session.finishSession(result.isOk());
+ LOGGER.exit("ContextAlbum/Delete" + (result.isOk() ? OK : NOT_OK));
+ }
- LOGGER.exit("ContextAlbum/Delete" + (result != null && result.isOk() ? OK : NOT_OK));
return result;
}
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* 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.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
jsonbean.getVersion(), jsonbean.getSchemaFlavour(), jsonbean.getSchemaDefinition(),
jsonbean.getUuid(), jsonbean.getDescription());
- session.finishSession(result.isOk());
+ if (result != null) {
+ session.finishSession(result.isOk());
+ LOGGER.exit("ContextSchema/create" + (result.isOk() ? OK : NOT_OK));
+ }
- LOGGER.exit("ContextSchema/create" + (result != null && result.isOk() ? OK : NOT_OK));
return result;
}
jsonbean.getVersion(), jsonbean.getSchemaFlavour(), jsonbean.getSchemaDefinition(),
jsonbean.getUuid(), jsonbean.getDescription());
- session.finishSession(result.isOk());
+ if (result != null) {
+ session.finishSession(result.isOk());
+ LOGGER.exit("ContextSchema/Update" + (result.isOk() ? OK : NOT_OK));
+ }
- LOGGER.exit("ContextSchema/Update" + (result != null && result.isOk() ? OK : NOT_OK));
return result;
}
ApexApiResult result = session.getApexModelEdited().deleteContextSchema(blank2Null(name), blank2Null(version));
- session.finishSession(result.isOk());
+ if (result != null) {
+ session.finishSession(result.isOk());
+ LOGGER.exit("ContextSchema/Delete" + (result.isOk() ? OK : NOT_OK));
+ }
- LOGGER.exit("ContextSchema/Delete" + (result != null && result.isOk() ? OK : NOT_OK));
return result;
}
/**
* Validate a context schema.
- *
+ *
* @param session the session holding the Apex model
* @param name the context schema name to operate on
* @param version the context schema version to operate on
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
session.finishSession(result.isOk());
- LOGGER.exit("Event/Create" + (result != null && result.isOk() ? OK : NOT_OK));
+ LOGGER.exit("Event/Create" + (result.isOk() ? OK : NOT_OK));
return result;
}
session.finishSession(result.isOk());
- LOGGER.exit("Event/Update" + (result != null && result.isOk() ? OK : NOT_OK));
+ LOGGER.exit("Event/Update" + (result.isOk() ? OK : NOT_OK));
return result;
}
ApexApiResult result = session.getApexModelEdited().deleteEvent(blank2Null(name), blank2Null(version));
- session.finishSession(result.isOk());
+ if (result != null) {
+ session.finishSession(result.isOk());
+ LOGGER.exit("Event/Delete" + (result.isOk() ? OK : NOT_OK));
+ }
- LOGGER.exit("Event/Delete" + (result != null && result.isOk() ? OK : NOT_OK));
return result;
}
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
ApexApiResult result = session.getApexModelEdited().loadFromString(jsonString);
- session.finishSession(result.isOk());
+ if (result != null) {
+ session.finishSession(result.isOk());
+ LOGGER.exit("Model/Load" + (result.isOk() ? OK : NOT_OK));
+ }
- LOGGER.exit("Model/Load" + (result != null && result.isOk() ? OK : NOT_OK));
return result;
}
ApexApiResult result = session.getApexModelEdited().createModel(jsonbean.getName(), jsonbean.getVersion(),
jsonbean.getUuid(), jsonbean.getDescription());
- session.finishSession(result.isOk());
-
- LOGGER.exit("Model/Create" + (result != null && result.isOk() ? OK : NOT_OK));
+ if (result != null) {
+ session.finishSession(result.isOk());
+ LOGGER.exit("Model/Create" + (result.isOk() ? OK : NOT_OK));
+ }
return result;
}
ApexApiResult result = session.getApexModelEdited().updateModel(jsonbean.getName(), jsonbean.getVersion(),
jsonbean.getUuid(), jsonbean.getDescription());
- session.finishSession(result.isOk());
+ if (result != null) {
+ session.finishSession(result.isOk());
+ LOGGER.exit("Model/Update" + (result.isOk() ? OK : NOT_OK));
+ }
- LOGGER.exit("Model/Update" + (result != null && result.isOk() ? OK : NOT_OK));
return result;
}
ApexApiResult result = session.getApexModel().listModel();
- result = addKeyInfo2Messages(session, result);
-
- LOGGER.exit("Model/Get" + (result != null && result.isOk() ? OK : NOT_OK));
+ if (result != null) {
+ result = addKeyInfo2Messages(session, result);
+ LOGGER.exit("Model/Get" + (result.isOk() ? OK : NOT_OK));
+ }
return result;
}
ApexApiResult result = session.getApexModel().deleteModel();
- session.finishSession(result.isOk());
+ if (result != null) {
+ session.finishSession(result.isOk());
+ LOGGER.exit("Model/Delete" + (result.isOk() ? OK : NOT_OK));
+ }
- LOGGER.exit("Model/Delete" + (result != null && result.isOk() ? OK : NOT_OK));
return result;
}
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* 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.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
session.finishSession(result.isOk());
- LOGGER.exit("Policy/Create" + (result != null && result.isOk() ? OK : NOT_OK));
+ LOGGER.exit("Policy/Create" + (result.isOk() ? OK : NOT_OK));
return result;
}
/**
* Create the content of the policy.
- *
+ *
* @param session the Apex model editing session
* @param jsonString the JSON string to be parsed See {@linkplain BeanPolicy}
* @return an ApexAPIResult object. If successful then {@link ApexApiResult#isOk()} will return true. Any
/**
* Create a state on the policy.
- *
+ *
* @param session the Apex model editing session
* @param policyName the policy name
* @param policVersion the policy version
/**
* Create the content of a state on the policy.
- *
+ *
* @param session the Apex model editing session
* @param policyName the policy name
* @param policVersion the policy version
/**
* Create the task selection logic for the state.
- *
+ *
* @param session the Apex model editing session
* @param policyName the policy name
* @param policVersion the policy version
/**
* Create the context references for the state.
- *
+ *
* @param session the Apex model editing session
* @param policyName the policy name
* @param policVersion the policy version
/**
* Create the state finalizers for the state.
- *
+ *
* @param session the Apex model editing session
* @param policyName the policy name
* @param policVersion the policy version
/**
* Create the state outputs for the state.
- *
+ *
* @param session the Apex model editing session
* @param policyName the policy name
* @param policVersion the policy version
/**
* Create the task references for the state.
- *
+ *
* @param session the Apex model editing session
* @param policyName the policy name
* @param policVersion the policy version
session.finishSession(result.isOk());
- LOGGER.exit("Policy/Update" + (result != null && result.isOk() ? OK : NOT_OK));
+ LOGGER.exit("Policy/Update" + (result.isOk() ? OK : NOT_OK));
return result;
}
// deleting the task removes all of these
ApexApiResult result = session.getApexModelEdited().deletePolicy(blank2Null(name), blank2Null(version));
- session.finishSession(result.isOk());
+ if (result != null) {
+ session.finishSession(result.isOk());
+ LOGGER.exit("Policy/Delete" + (result.isOk() ? OK : NOT_OK));
+ }
- LOGGER.exit("Policy/Delete" + (result != null && result.isOk() ? OK : NOT_OK));
return result;
}
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* 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.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
session.finishSession(result.isOk());
- LOGGER.exit("Task/Create" + (result != null && result.isOk() ? OK : NOT_OK));
+ LOGGER.exit("Task/Create" + (result.isOk() ? OK : NOT_OK));
return result;
}
/**
* Create the content of the task.
- *
+ *
* @param session the Apex model editing session
* @param jsonString the JSON string to be parsed. See {@linkplain BeanTask}
* @return an ApexAPIResult object. If successful then {@link ApexApiResult#isOk()} will return true. Any
/**
* Create the input fields for the task.
- *
+ *
* @param session the Apex model editing session
* @param jsonbean the ban containing the fields
* @return the result of the operation
/**
* Create the output fields for the task.
- *
+ *
* @param session the Apex model editing session
* @param jsonbean the ban containing the fields
* @return the result of the operation
/**
* Create the task logic for the task.
- *
+ *
* @param session the Apex model editing session
* @param jsonbean the bean containing the logic
* @return the result of the operation
/**
* Create the task parameters for the task.
- *
+ *
* @param session the Apex model editing session
* @param jsonbean the bean containing the parameters
* @return the result of the operation
/**
* Create the context references for the task.
- *
+ *
* @param session the Apex model editing session
* @param jsonbean the bean containing the context references
* @return the result of the operation
session.finishSession(result.isOk());
- LOGGER.exit("Task/Update" + (result != null && result.isOk() ? OK : NOT_OK));
+ LOGGER.exit("Task/Update" + (result.isOk() ? OK : NOT_OK));
return result;
}
// deleting the task removes all of these
ApexApiResult result = session.getApexModelEdited().deleteTask(blank2Null(name), blank2Null(version));
- session.finishSession(result.isOk());
+ if (result != null) {
+ session.finishSession(result.isOk());
+ LOGGER.exit("Task/Delete" + (result.isOk() ? OK : NOT_OK));
+ }
- LOGGER.exit("Task/Delete" + (result != null && result.isOk() ? OK : NOT_OK));
return result;
}