diff --git a/contact-center/app/src/main/java/com/cskefu/cc/Application.java b/contact-center/app/src/main/java/com/cskefu/cc/Application.java index f1293b72..e034f128 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/Application.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/Application.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDAgentDispatcher.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDAgentDispatcher.java index 3d0f47dc..b34c507b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDAgentDispatcher.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDAgentDispatcher.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDAgentService.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDAgentService.java index 701603b8..6cb2f28c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDAgentService.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDAgentService.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDChatbotService.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDChatbotService.java index 06552a46..843ab777 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDChatbotService.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDChatbotService.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDPolicyService.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDPolicyService.java index 965cd282..3573a04f 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDPolicyService.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDPolicyService.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDQueueService.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDQueueService.java index c5fcf319..da035095 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDQueueService.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDQueueService.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDServiceRouter.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDServiceRouter.java index 85407efd..cf7bd181 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDServiceRouter.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDServiceRouter.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDVisitorDispatcher.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDVisitorDispatcher.java index 9da5995c..0d9dfade 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDVisitorDispatcher.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDVisitorDispatcher.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDWorkMonitor.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDWorkMonitor.java index 822eedb7..d8d24739 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDWorkMonitor.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/ACDWorkMonitor.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/basic/ACDComposeContext.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/basic/ACDComposeContext.java index e2b708ef..2c67c435 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/basic/ACDComposeContext.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/basic/ACDComposeContext.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd.basic; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/basic/ACDMessageHelper.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/basic/ACDMessageHelper.java index d850d957..d788622b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/basic/ACDMessageHelper.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/basic/ACDMessageHelper.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd.basic; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/basic/IACDDispatcher.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/basic/IACDDispatcher.java index 206aea96..e9ac6202 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/basic/IACDDispatcher.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/basic/IACDDispatcher.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd.basic; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisAllocatorMw.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisAllocatorMw.java index 62ca236a..d8483b21 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisAllocatorMw.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisAllocatorMw.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd.middleware.visitor; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisBindingMw.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisBindingMw.java index f953e2e2..868dbfca 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisBindingMw.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisBindingMw.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd.middleware.visitor; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisBodyParserMw.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisBodyParserMw.java index 528a9597..7da261a2 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisBodyParserMw.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisBodyParserMw.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd.middleware.visitor; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisServiceMw.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisServiceMw.java index 5df25bae..afc377d6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisServiceMw.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisServiceMw.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd.middleware.visitor; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisSessionCfgMw.java b/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisSessionCfgMw.java index 36ec6159..be149c3f 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisSessionCfgMw.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/acd/middleware/visitor/ACDVisSessionCfgMw.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.acd.middleware.visitor; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/activemq/AgentAuditSubscription.java b/contact-center/app/src/main/java/com/cskefu/cc/activemq/AgentAuditSubscription.java index a5415b52..b2e25b94 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/activemq/AgentAuditSubscription.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/activemq/AgentAuditSubscription.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.activemq; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/activemq/AgentSessionSubscription.java b/contact-center/app/src/main/java/com/cskefu/cc/activemq/AgentSessionSubscription.java index f5b9e9de..0c11c2f0 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/activemq/AgentSessionSubscription.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/activemq/AgentSessionSubscription.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.activemq; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/activemq/AgentSubscription.java b/contact-center/app/src/main/java/com/cskefu/cc/activemq/AgentSubscription.java index 9f16ce1f..b7c53367 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/activemq/AgentSubscription.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/activemq/AgentSubscription.java @@ -1,12 +1,14 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. */ package com.cskefu.cc.activemq; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/activemq/BlackListEventSubscription.java b/contact-center/app/src/main/java/com/cskefu/cc/activemq/BlackListEventSubscription.java index 1bcf0265..c3b41101 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/activemq/BlackListEventSubscription.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/activemq/BlackListEventSubscription.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.activemq; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/activemq/BrokerPublisher.java b/contact-center/app/src/main/java/com/cskefu/cc/activemq/BrokerPublisher.java index d842c180..b22c110b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/activemq/BrokerPublisher.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/activemq/BrokerPublisher.java @@ -1,12 +1,14 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. */ package com.cskefu.cc.activemq; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/activemq/OnlineUserSubscription.java b/contact-center/app/src/main/java/com/cskefu/cc/activemq/OnlineUserSubscription.java index 697028c3..2a6d5c93 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/activemq/OnlineUserSubscription.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/activemq/OnlineUserSubscription.java @@ -1,12 +1,14 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. */ package com.cskefu.cc.activemq; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/activemq/SocketioConnEventSubscription.java b/contact-center/app/src/main/java/com/cskefu/cc/activemq/SocketioConnEventSubscription.java index dc90bcb1..932a6230 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/activemq/SocketioConnEventSubscription.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/activemq/SocketioConnEventSubscription.java @@ -1,12 +1,14 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. */ package com.cskefu.cc.activemq; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/aspect/AgentStatusAspect.java b/contact-center/app/src/main/java/com/cskefu/cc/aspect/AgentStatusAspect.java index 181cd924..fd710c34 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/aspect/AgentStatusAspect.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/aspect/AgentStatusAspect.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.aspect; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/aspect/AgentUserAspect.java b/contact-center/app/src/main/java/com/cskefu/cc/aspect/AgentUserAspect.java index 900d9367..e342ff09 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/aspect/AgentUserAspect.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/aspect/AgentUserAspect.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.aspect; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/aspect/BlackEntityAspect.java b/contact-center/app/src/main/java/com/cskefu/cc/aspect/BlackEntityAspect.java index ed03e08b..223bc85f 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/aspect/BlackEntityAspect.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/aspect/BlackEntityAspect.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.aspect; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/aspect/OnlineUserAspect.java b/contact-center/app/src/main/java/com/cskefu/cc/aspect/OnlineUserAspect.java index a12effd1..7951f90b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/aspect/OnlineUserAspect.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/aspect/OnlineUserAspect.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.aspect; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/aspect/SyncDatabaseAspect.java b/contact-center/app/src/main/java/com/cskefu/cc/aspect/SyncDatabaseAspect.java index 9776ac3a..afa8afbe 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/aspect/SyncDatabaseAspect.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/aspect/SyncDatabaseAspect.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.aspect; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/basic/Constants.java b/contact-center/app/src/main/java/com/cskefu/cc/basic/Constants.java index 688dcfcf..6df47781 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/basic/Constants.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/basic/Constants.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.basic; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/basic/MainContext.java b/contact-center/app/src/main/java/com/cskefu/cc/basic/MainContext.java index a98523f6..753d6d74 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/basic/MainContext.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/basic/MainContext.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.basic; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/basic/MainUtils.java b/contact-center/app/src/main/java/com/cskefu/cc/basic/MainUtils.java index ced4eced..ccbd0b36 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/basic/MainUtils.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/basic/MainUtils.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.basic; @@ -25,7 +23,6 @@ import com.aliyuncs.profile.DefaultProfile; import com.aliyuncs.profile.IClientProfile; import com.cskefu.cc.model.*; import com.cskefu.cc.persistence.repository.*; -import com.cskefu.cc.util.WebIMReport; import com.cskefu.cc.util.*; import com.cskefu.cc.util.asr.AsrResult; import com.cskefu.cc.util.mail.MailSender; @@ -42,11 +39,12 @@ import de.neuland.pug4j.parser.node.Node; import de.neuland.pug4j.template.PugTemplate; import de.neuland.pug4j.template.ReaderTemplateLoader; import io.netty.handler.codec.http.HttpHeaders; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import net.coobird.thumbnailator.Thumbnails; import org.apache.commons.beanutils.BeanUtilsBean; import org.apache.commons.beanutils.ConversionException; import org.apache.commons.beanutils.ConvertUtils; -import org.apache.commons.beanutils.Converter; import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang3.StringUtils; import org.jasypt.util.text.BasicTextEncryptor; @@ -62,8 +60,6 @@ import org.springframework.beans.FatalBeanException; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; import java.awt.image.BufferedImage; import java.beans.BeanInfo; import java.beans.Introspector; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/basic/TerminateBean.java b/contact-center/app/src/main/java/com/cskefu/cc/basic/TerminateBean.java index 8e1335b8..e2b93c96 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/basic/TerminateBean.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/basic/TerminateBean.java @@ -1,12 +1,13 @@ -/* - * Copyright (C) 2022 Chatopera Inc, All rights reserved. - * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. +/** + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright Jun. 2023 Chatopera Inc. . All rights reserved. */ package com.cskefu.cc.basic; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/basic/Viewport.java b/contact-center/app/src/main/java/com/cskefu/cc/basic/Viewport.java index 8eba277b..446d15d4 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/basic/Viewport.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/basic/Viewport.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.basic; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/basic/auth/AuthRedisTemplate.java b/contact-center/app/src/main/java/com/cskefu/cc/basic/auth/AuthRedisTemplate.java index 4268ccc0..ed6171da 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/basic/auth/AuthRedisTemplate.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/basic/auth/AuthRedisTemplate.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.basic.auth; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/basic/auth/BasicTokenMgr.java b/contact-center/app/src/main/java/com/cskefu/cc/basic/auth/BasicTokenMgr.java index eee99bf8..613ce08d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/basic/auth/BasicTokenMgr.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/basic/auth/BasicTokenMgr.java @@ -1,11 +1,13 @@ /** - * Copyright 2023 Chatopera Inc. . All rights reserved. - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright Jun. 2023 Chatopera Inc. . All rights reserved. */ package com.cskefu.cc.basic.auth; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/basic/auth/BearerTokenMgr.java b/contact-center/app/src/main/java/com/cskefu/cc/basic/auth/BearerTokenMgr.java index 2cc4bb91..2c36e0d3 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/basic/auth/BearerTokenMgr.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/basic/auth/BearerTokenMgr.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.basic.auth; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/basic/plugins/AbstractPluginConfigurer.java b/contact-center/app/src/main/java/com/cskefu/cc/basic/plugins/AbstractPluginConfigurer.java index 5130570e..6378e513 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/basic/plugins/AbstractPluginConfigurer.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/basic/plugins/AbstractPluginConfigurer.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.basic.plugins; import java.util.HashMap; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/basic/plugins/IPluginConfigurer.java b/contact-center/app/src/main/java/com/cskefu/cc/basic/plugins/IPluginConfigurer.java index 74a07539..226b7469 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/basic/plugins/IPluginConfigurer.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/basic/plugins/IPluginConfigurer.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.basic.plugins; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/basic/plugins/PluginRegistry.java b/contact-center/app/src/main/java/com/cskefu/cc/basic/plugins/PluginRegistry.java index 7180a58c..91f0ddd6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/basic/plugins/PluginRegistry.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/basic/plugins/PluginRegistry.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.basic.plugins; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/basic/resource/OutputTextFormat.java b/contact-center/app/src/main/java/com/cskefu/cc/basic/resource/OutputTextFormat.java index a96f1349..fd2cbe96 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/basic/resource/OutputTextFormat.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/basic/resource/OutputTextFormat.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.basic.resource; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/basic/resource/Resource.java b/contact-center/app/src/main/java/com/cskefu/cc/basic/resource/Resource.java index 9e163833..cc66e66e 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/basic/resource/Resource.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/basic/resource/Resource.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.basic.resource; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/cache/Cache.java b/contact-center/app/src/main/java/com/cskefu/cc/cache/Cache.java index 599392d4..5e082b48 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/cache/Cache.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/cache/Cache.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.cache; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/cache/RedisCommand.java b/contact-center/app/src/main/java/com/cskefu/cc/cache/RedisCommand.java index 081bb1fb..68fb96c6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/cache/RedisCommand.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/cache/RedisCommand.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.cache; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/cache/RedisKey.java b/contact-center/app/src/main/java/com/cskefu/cc/cache/RedisKey.java index ef45c788..824b3351 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/cache/RedisKey.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/cache/RedisKey.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.cache; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/ActiveMQConfigure.java b/contact-center/app/src/main/java/com/cskefu/cc/config/ActiveMQConfigure.java index aa736372..05dd52e3 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/ActiveMQConfigure.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/ActiveMQConfigure.java @@ -1,12 +1,14 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/ApiRequestMatchingFilter.java b/contact-center/app/src/main/java/com/cskefu/cc/config/ApiRequestMatchingFilter.java index 071150e1..1b617742 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/ApiRequestMatchingFilter.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/ApiRequestMatchingFilter.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/AppCtxRefreshEventListener.java b/contact-center/app/src/main/java/com/cskefu/cc/config/AppCtxRefreshEventListener.java index fa629366..234abb1a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/AppCtxRefreshEventListener.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/AppCtxRefreshEventListener.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/ApplicationStartupListener.java b/contact-center/app/src/main/java/com/cskefu/cc/config/ApplicationStartupListener.java index c9bd6628..774b8164 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/ApplicationStartupListener.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/ApplicationStartupListener.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/CSKeFuExceptionHandler.java b/contact-center/app/src/main/java/com/cskefu/cc/config/CSKeFuExceptionHandler.java index 5617c2de..ace7402a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/CSKeFuExceptionHandler.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/CSKeFuExceptionHandler.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/CSKeFuWebAppConfigurer.java b/contact-center/app/src/main/java/com/cskefu/cc/config/CSKeFuWebAppConfigurer.java index 2567dd7a..7ec87210 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/CSKeFuWebAppConfigurer.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/CSKeFuWebAppConfigurer.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/DelegateRequestMatchingFilter.java b/contact-center/app/src/main/java/com/cskefu/cc/config/DelegateRequestMatchingFilter.java index 39cc1ee0..98644f0d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/DelegateRequestMatchingFilter.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/DelegateRequestMatchingFilter.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/ExecutorConfig.java b/contact-center/app/src/main/java/com/cskefu/cc/config/ExecutorConfig.java index 846fb09f..f02f9544 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/ExecutorConfig.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/ExecutorConfig.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/MessagingServerConfigure.java b/contact-center/app/src/main/java/com/cskefu/cc/config/MessagingServerConfigure.java index c5fa3f71..6d006684 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/MessagingServerConfigure.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/MessagingServerConfigure.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/PugConfig.java b/contact-center/app/src/main/java/com/cskefu/cc/config/PugConfig.java index 052eaebf..ef3467da 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/PugConfig.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/PugConfig.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2020 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/PugCskefuViewResolver.java b/contact-center/app/src/main/java/com/cskefu/cc/config/PugCskefuViewResolver.java index 17a34b73..e208bc43 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/PugCskefuViewResolver.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/PugCskefuViewResolver.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.config; import de.neuland.pug4j.spring.view.PugView; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/RedisConfigure.java b/contact-center/app/src/main/java/com/cskefu/cc/config/RedisConfigure.java index a0cfc635..6c3c607b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/RedisConfigure.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/RedisConfigure.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/ShutdownConfig.java b/contact-center/app/src/main/java/com/cskefu/cc/config/ShutdownConfig.java index 823d59a0..59fff8a5 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/ShutdownConfig.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/ShutdownConfig.java @@ -1,12 +1,13 @@ -/* - * Copyright (C) 2022 Chatopera Inc, All rights reserved. - * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. +/** + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright Jun. 2023 Chatopera Inc. . All rights reserved. */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/StringToDateConverter.java b/contact-center/app/src/main/java/com/cskefu/cc/config/StringToDateConverter.java index 627eb241..32ef2197 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/StringToDateConverter.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/StringToDateConverter.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/WebConfigBeans.java b/contact-center/app/src/main/java/com/cskefu/cc/config/WebConfigBeans.java index 3f3845ad..ef313b2b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/WebConfigBeans.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/WebConfigBeans.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/WebSecurityConfig.java b/contact-center/app/src/main/java/com/cskefu/cc/config/WebSecurityConfig.java index 31b5b3cc..ceaff2d8 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/WebSecurityConfig.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/WebSecurityConfig.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/WebServerContainerConfigure.java b/contact-center/app/src/main/java/com/cskefu/cc/config/WebServerContainerConfigure.java index 100f2b4b..34d5e135 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/WebServerContainerConfigure.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/WebServerContainerConfigure.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/config/WebServerSessionConfigure.java b/contact-center/app/src/main/java/com/cskefu/cc/config/WebServerSessionConfigure.java index 488ece15..3c9a93c0 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/config/WebServerSessionConfigure.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/config/WebServerSessionConfigure.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/ApplicationController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/ApplicationController.java index 1d9ded38..9640c1ad 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/ApplicationController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/ApplicationController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/Handler.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/Handler.java index 6c43dd1a..2c5becc2 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/Handler.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/Handler.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/LoginController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/LoginController.java index 6dc72069..ec07a7f7 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/LoginController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/LoginController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/AdminController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/AdminController.java index 63e1d086..ae21de94 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/AdminController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/AdminController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.admin; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/OrganController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/OrganController.java index 09ec72f7..5ef3ab7d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/OrganController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/OrganController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.admin; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/RoleController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/RoleController.java index 06f51501..936a4ae9 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/RoleController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/RoleController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.admin; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/UsersController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/UsersController.java index 94a64790..1f9255ee 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/UsersController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/UsersController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.admin; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/channel/ChannelController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/channel/ChannelController.java index dca26413..e2decfc7 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/channel/ChannelController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/channel/ChannelController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.admin.channel; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/channel/WebIMController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/channel/WebIMController.java index 480e20aa..f4970096 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/channel/WebIMController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/channel/WebIMController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.admin.channel; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/config/SystemConfigController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/config/SystemConfigController.java index f5546bad..8a46cfe0 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/config/SystemConfigController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/config/SystemConfigController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.admin.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/config/SystemMessageController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/config/SystemMessageController.java index 65a530e8..f6fca728 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/config/SystemMessageController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/config/SystemMessageController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.admin.config; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/system/MetadataController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/system/MetadataController.java index db5259f0..e6c20d90 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/system/MetadataController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/system/MetadataController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.admin.system; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/system/SysDicController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/system/SysDicController.java index 01c9cefb..e6e84d3f 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/system/SysDicController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/system/SysDicController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.admin.system; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/system/TemplateController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/system/TemplateController.java index 276e928b..a207fda5 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/system/TemplateController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/admin/system/TemplateController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.admin.system; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiAgentUserController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiAgentUserController.java index 364a315b..b8c7c374 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiAgentUserController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiAgentUserController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiAppsController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiAppsController.java index 2dc1b20d..d2bbd4b9 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiAppsController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiAppsController.java @@ -1,12 +1,13 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, All rights reserved. - * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. +/** + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright 2018-Jun. 2023 Chatopera Inc. . All rights reserved. */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiChatMessageController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiChatMessageController.java index 69afd8d1..6889401b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiChatMessageController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiChatMessageController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiContactNotesController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiContactNotesController.java index 3371b60c..aca9d756 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiContactNotesController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiContactNotesController.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiContactTagsController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiContactTagsController.java index 43037616..c2a12cb6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiContactTagsController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiContactTagsController.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiContactsController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiContactsController.java index 9e8fe7f4..8b73d153 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiContactsController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiContactsController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiLeavemsgController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiLeavemsgController.java index e52a9e7f..d36af561 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiLeavemsgController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiLeavemsgController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiOnlineUserController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiOnlineUserController.java index f609e60e..7aa09aee 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiOnlineUserController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiOnlineUserController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiOrganController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiOrganController.java index e0bd3f7a..c396b4ab 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiOrganController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiOrganController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiQualityController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiQualityController.java index 453511b6..0b958c30 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiQualityController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiQualityController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiServiceQueneController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiServiceQueneController.java index 8aa4df23..eecc6987 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiServiceQueneController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiServiceQueneController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiSysDicController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiSysDicController.java index 87ba3924..9b126623 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiSysDicController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiSysDicController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiTagsController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiTagsController.java index 372b45ed..cf03068f 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiTagsController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiTagsController.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiUserController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiUserController.java index 17fcd07b..ad530836 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiUserController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiUserController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiWebIMController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiWebIMController.java index a9291eb5..94306c77 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiWebIMController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/ApiWebIMController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/QueryParams.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/QueryParams.java index f4784779..f890fe2a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/QueryParams.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/QueryParams.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/RequestValues.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/RequestValues.java index ca74bf0d..20393ae1 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/RequestValues.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/RequestValues.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/UkefuApiTagsController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/UkefuApiTagsController.java index 6b5c5d96..fd38f965 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/api/UkefuApiTagsController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/api/UkefuApiTagsController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.api; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AccountController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AccountController.java index 40c1dd09..c8b96cdb 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AccountController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AccountController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.apps; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AgentAuditController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AgentAuditController.java index 4e312a00..82084479 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AgentAuditController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AgentAuditController.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.apps; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AgentController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AgentController.java index 50dce691..9d34af2b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AgentController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AgentController.java @@ -1,19 +1,17 @@ - /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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. - */ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright (C) 2018-Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + */ package com.cskefu.cc.controller.apps; import com.alibaba.fastjson.JSONObject; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AgentSettingsController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AgentSettingsController.java index 49d7faf4..ad604e5b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AgentSettingsController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AgentSettingsController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.apps; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AppsController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AppsController.java index 1780f468..27454c02 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AppsController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/AppsController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.apps; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/ContactsController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/ContactsController.java index 41f3aead..436fa79b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/ContactsController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/ContactsController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.apps; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/EntIMController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/EntIMController.java index 631d6f9c..fa1b41e6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/EntIMController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/EntIMController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.apps; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/IMController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/IMController.java index 07d93c94..74459ff1 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/IMController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/IMController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2020 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018-Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.apps; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/MessageController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/MessageController.java index 8e2d2a6a..a1c996c2 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/MessageController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/MessageController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.apps; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/AgentSummaryController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/AgentSummaryController.java index 4fc88e5c..8a2ddb9e 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/AgentSummaryController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/AgentSummaryController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.apps.service; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/ChatServiceController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/ChatServiceController.java index 6e7f3ca9..af438416 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/ChatServiceController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/ChatServiceController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.apps.service; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/CommentController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/CommentController.java index 56357877..11daae41 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/CommentController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/CommentController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.apps.service; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/OnlineUserController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/OnlineUserController.java index e06a154e..024e60f5 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/OnlineUserController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/OnlineUserController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.apps.service; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/ProcessedSummaryController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/ProcessedSummaryController.java index ff5d94ee..393deeb2 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/ProcessedSummaryController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/ProcessedSummaryController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.apps.service; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/StatsController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/StatsController.java index 1bfff2e0..689d3ece 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/StatsController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/apps/service/StatsController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.apps.service; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/auth/ApiAuthBearerController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/auth/ApiAuthBearerController.java index a06f0a21..ef6a5e0d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/auth/ApiAuthBearerController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/auth/ApiAuthBearerController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.auth; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/auth/ApiAuthErrorController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/auth/ApiAuthErrorController.java index db821954..ce31c03f 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/auth/ApiAuthErrorController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/auth/ApiAuthErrorController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.auth; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/CallAgentResourceController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/CallAgentResourceController.java index a19cc1c5..8c882b4d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/CallAgentResourceController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/CallAgentResourceController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.resource; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/ContactsResourceController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/ContactsResourceController.java index 9aef5230..376e0c66 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/ContactsResourceController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/ContactsResourceController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.resource; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/CssResourceController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/CssResourceController.java index c0bfeda7..846a4fe4 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/CssResourceController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/CssResourceController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.resource; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/MediaController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/MediaController.java index 86764d30..d329fc6d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/MediaController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/MediaController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.resource; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/SysDicResourceController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/SysDicResourceController.java index 2953a6e0..33d99742 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/SysDicResourceController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/SysDicResourceController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.resource; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/UsersResourceController.java b/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/UsersResourceController.java index d8c26f79..8fa9fcd2 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/UsersResourceController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/controller/resource/UsersResourceController.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.controller.resource; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/exception/CSKefuCacheException.java b/contact-center/app/src/main/java/com/cskefu/cc/exception/CSKefuCacheException.java index fc19f9f3..cf411ba3 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/exception/CSKefuCacheException.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/exception/CSKefuCacheException.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.exception; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/exception/CSKefuException.java b/contact-center/app/src/main/java/com/cskefu/cc/exception/CSKefuException.java index 8248a19a..e913a69c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/exception/CSKefuException.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/exception/CSKefuException.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.exception; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/exception/CSKefuRestException.java b/contact-center/app/src/main/java/com/cskefu/cc/exception/CSKefuRestException.java index f39e69eb..8509ab25 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/exception/CSKefuRestException.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/exception/CSKefuRestException.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.exception; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/exception/FreeSwitchException.java b/contact-center/app/src/main/java/com/cskefu/cc/exception/FreeSwitchException.java index 0a1de1ef..6d203441 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/exception/FreeSwitchException.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/exception/FreeSwitchException.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.exception; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/exception/InstantMessagingExceptionListener.java b/contact-center/app/src/main/java/com/cskefu/cc/exception/InstantMessagingExceptionListener.java index cd8e6ed6..43ed92a9 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/exception/InstantMessagingExceptionListener.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/exception/InstantMessagingExceptionListener.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.exception; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/interceptor/CrossInterceptorHandler.java b/contact-center/app/src/main/java/com/cskefu/cc/interceptor/CrossInterceptorHandler.java index 16d109fb..ced17550 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/interceptor/CrossInterceptorHandler.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/interceptor/CrossInterceptorHandler.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.interceptor; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/interceptor/RequestLogIntercreptorHandler.java b/contact-center/app/src/main/java/com/cskefu/cc/interceptor/RequestLogIntercreptorHandler.java index ce1dce60..d760a923 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/interceptor/RequestLogIntercreptorHandler.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/interceptor/RequestLogIntercreptorHandler.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.interceptor; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/interceptor/UserExperiencePlanInterceptorHandler.java b/contact-center/app/src/main/java/com/cskefu/cc/interceptor/UserExperiencePlanInterceptorHandler.java index 5d19e119..8febedca 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/interceptor/UserExperiencePlanInterceptorHandler.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/interceptor/UserExperiencePlanInterceptorHandler.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.interceptor; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/interceptor/UserInterceptorHandler.java b/contact-center/app/src/main/java/com/cskefu/cc/interceptor/UserInterceptorHandler.java index 863f249c..bf424f57 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/interceptor/UserInterceptorHandler.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/interceptor/UserInterceptorHandler.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.interceptor; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/interceptor/ViewsInterceptorHandler.java b/contact-center/app/src/main/java/com/cskefu/cc/interceptor/ViewsInterceptorHandler.java index dd736f2e..fe97781b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/interceptor/ViewsInterceptorHandler.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/interceptor/ViewsInterceptorHandler.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.interceptor; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Account.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Account.java index f8f7e7c3..f2bb1ef7 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Account.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Account.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Acl.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Acl.java index 5c48c07b..a9a546f3 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Acl.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Acl.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/AdType.java b/contact-center/app/src/main/java/com/cskefu/cc/model/AdType.java index 91936c48..7d226979 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/AdType.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/AdType.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentReport.java b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentReport.java index db75104d..0d4e80d6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentReport.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentReport.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentService.java b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentService.java index 59469971..d0755ac8 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentService.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentService.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentServiceSatis.java b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentServiceSatis.java index 004e9b93..f7466db7 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentServiceSatis.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentServiceSatis.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentServiceSummary.java b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentServiceSummary.java index ea18a5ae..9c398d5c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentServiceSummary.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentServiceSummary.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentStatus.java b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentStatus.java index 47d855eb..cd357d76 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentStatus.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentStatus.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUser.java b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUser.java index 85e0d4d7..c30ad35e 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUser.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUser.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUserAudit.java b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUserAudit.java index 7c4f3ca2..a1457590 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUserAudit.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUserAudit.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUserContacts.java b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUserContacts.java index 01b91eea..61d83572 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUserContacts.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUserContacts.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUserTask.java b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUserTask.java index 3b1395c6..34796f45 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUserTask.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/AgentUserTask.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/AreaType.java b/contact-center/app/src/main/java/com/cskefu/cc/model/AreaType.java index d78c60f3..3a4f4ad0 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/AreaType.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/AreaType.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/AttachmentFile.java b/contact-center/app/src/main/java/com/cskefu/cc/model/AttachmentFile.java index ad41f67e..2b52e9c3 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/AttachmentFile.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/AttachmentFile.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/BlackEntity.java b/contact-center/app/src/main/java/com/cskefu/cc/model/BlackEntity.java index 4249633e..f1cf7223 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/BlackEntity.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/BlackEntity.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/CallAgent.java b/contact-center/app/src/main/java/com/cskefu/cc/model/CallAgent.java index 1afae0bb..0a5f20da 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/CallAgent.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/CallAgent.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/CallCenterSkill.java b/contact-center/app/src/main/java/com/cskefu/cc/model/CallCenterSkill.java index 0550526e..3f0a0da4 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/CallCenterSkill.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/CallCenterSkill.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Channel.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Channel.java index 1a9eb5b6..7c79f3e1 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Channel.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Channel.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/ChartProperties.java b/contact-center/app/src/main/java/com/cskefu/cc/model/ChartProperties.java index 50164cf6..b00b6721 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/ChartProperties.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/ChartProperties.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Chatbot.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Chatbot.java index 0c8ef884..0053a05f 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Chatbot.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Chatbot.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/ColumnProperties.java b/contact-center/app/src/main/java/com/cskefu/cc/model/ColumnProperties.java index f683b00d..2e93789e 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/ColumnProperties.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/ColumnProperties.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/ContactNotes.java b/contact-center/app/src/main/java/com/cskefu/cc/model/ContactNotes.java index 7749294b..762e75a4 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/ContactNotes.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/ContactNotes.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2019 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Contacts.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Contacts.java index 385897f6..33d2a829 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Contacts.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Contacts.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/CousultInvite.java b/contact-center/app/src/main/java/com/cskefu/cc/model/CousultInvite.java index 10a24cd3..1b5b0b05 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/CousultInvite.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/CousultInvite.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/CubeLevel.java b/contact-center/app/src/main/java/com/cskefu/cc/model/CubeLevel.java index 8b4a8ff8..44681592 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/CubeLevel.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/CubeLevel.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/CubeMeasure.java b/contact-center/app/src/main/java/com/cskefu/cc/model/CubeMeasure.java index d6208009..c76c3939 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/CubeMeasure.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/CubeMeasure.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/CubeType.java b/contact-center/app/src/main/java/com/cskefu/cc/model/CubeType.java index 2035a456..8c0067a4 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/CubeType.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/CubeType.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/CustomerGroupForm.java b/contact-center/app/src/main/java/com/cskefu/cc/model/CustomerGroupForm.java index 56ed54c2..6f2bd6eb 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/CustomerGroupForm.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/CustomerGroupForm.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/DataDic.java b/contact-center/app/src/main/java/com/cskefu/cc/model/DataDic.java index 331af1a5..904fad59 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/DataDic.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/DataDic.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/DataEvent.java b/contact-center/app/src/main/java/com/cskefu/cc/model/DataEvent.java index d0082992..026a915d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/DataEvent.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/DataEvent.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Dict.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Dict.java index d175ea25..885ff885 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Dict.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Dict.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Dimension.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Dimension.java index 79e4e5c2..93c38b31 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Dimension.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Dimension.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/DrillDown.java b/contact-center/app/src/main/java/com/cskefu/cc/model/DrillDown.java index 0ebe0130..613946dd 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/DrillDown.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/DrillDown.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Extension.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Extension.java index 7f7e19a9..c2898dbb 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Extension.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Extension.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/FbMessenger.java b/contact-center/app/src/main/java/com/cskefu/cc/model/FbMessenger.java index a1efda9d..2991b34c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/FbMessenger.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/FbMessenger.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/FbOTN.java b/contact-center/app/src/main/java/com/cskefu/cc/model/FbOTN.java index a2484c1d..12e33674 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/FbOTN.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/FbOTN.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/FbOtnFollow.java b/contact-center/app/src/main/java/com/cskefu/cc/model/FbOtnFollow.java index 335ebe6c..f776aae7 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/FbOtnFollow.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/FbOtnFollow.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/FormFilter.java b/contact-center/app/src/main/java/com/cskefu/cc/model/FormFilter.java index 875a4ee2..9e8a34f3 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/FormFilter.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/FormFilter.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/FormFilterItem.java b/contact-center/app/src/main/java/com/cskefu/cc/model/FormFilterItem.java index 56570c38..f52e8ccf 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/FormFilterItem.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/FormFilterItem.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Generation.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Generation.java index fae6c924..7ff80d68 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Generation.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Generation.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/IMGroup.java b/contact-center/app/src/main/java/com/cskefu/cc/model/IMGroup.java index 88738379..74ecb921 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/IMGroup.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/IMGroup.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/IMGroupUser.java b/contact-center/app/src/main/java/com/cskefu/cc/model/IMGroupUser.java index af6b635e..ec97be0d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/IMGroupUser.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/IMGroupUser.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Instruction.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Instruction.java index f12d423c..b70bc584 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Instruction.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Instruction.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/InviteRecord.java b/contact-center/app/src/main/java/com/cskefu/cc/model/InviteRecord.java index 605d6f46..0772ed3f 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/InviteRecord.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/InviteRecord.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/JobDetail.java b/contact-center/app/src/main/java/com/cskefu/cc/model/JobDetail.java index 72d8da3a..ba3ae94d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/JobDetail.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/JobDetail.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/JobTask.java b/contact-center/app/src/main/java/com/cskefu/cc/model/JobTask.java index 894dc89e..4d21eaa5 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/JobTask.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/JobTask.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/LeaveMsg.java b/contact-center/app/src/main/java/com/cskefu/cc/model/LeaveMsg.java index dec115b3..fe7ab89b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/LeaveMsg.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/LeaveMsg.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Media.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Media.java index fa0e05b6..11478a4f 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Media.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Media.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/MetadataTable.java b/contact-center/app/src/main/java/com/cskefu/cc/model/MetadataTable.java index 50b0cdc0..1162e62c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/MetadataTable.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/MetadataTable.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Organ.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Organ.java index 3f67a312..87141013 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Organ.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Organ.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/OrganRole.java b/contact-center/app/src/main/java/com/cskefu/cc/model/OrganRole.java index 1366d3ed..62341716 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/OrganRole.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/OrganRole.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/OrganUser.java b/contact-center/app/src/main/java/com/cskefu/cc/model/OrganUser.java index 9a3f4ea9..e2b99bbd 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/OrganUser.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/OrganUser.java @@ -1,12 +1,14 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. */ diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/OrganUserId.java b/contact-center/app/src/main/java/com/cskefu/cc/model/OrganUserId.java index a9a7574d..b8549883 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/OrganUserId.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/OrganUserId.java @@ -1,12 +1,14 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. */ diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Organization.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Organization.java index d79873f3..99bdbad8 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Organization.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Organization.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/OrgiSkillRel.java b/contact-center/app/src/main/java/com/cskefu/cc/model/OrgiSkillRel.java index 8e2a29a5..d40ca129 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/OrgiSkillRel.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/OrgiSkillRel.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/PassportWebIMUser.java b/contact-center/app/src/main/java/com/cskefu/cc/model/PassportWebIMUser.java index 0a0a3e8e..5a321b89 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/PassportWebIMUser.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/PassportWebIMUser.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/PassportWebIMUserHist.java b/contact-center/app/src/main/java/com/cskefu/cc/model/PassportWebIMUserHist.java index dd3360ae..df285252 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/PassportWebIMUserHist.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/PassportWebIMUserHist.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/PassportWechatUser.java b/contact-center/app/src/main/java/com/cskefu/cc/model/PassportWechatUser.java index f705e109..d086411d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/PassportWechatUser.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/PassportWechatUser.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/PbxHost.java b/contact-center/app/src/main/java/com/cskefu/cc/model/PbxHost.java index 32e8eed8..8cff89b7 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/PbxHost.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/PbxHost.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Product.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Product.java index 6f6cc6a7..67e9ffca 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Product.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Product.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/PropertiesEvent.java b/contact-center/app/src/main/java/com/cskefu/cc/model/PropertiesEvent.java index 48db42dd..717d0141 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/PropertiesEvent.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/PropertiesEvent.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/RecentUser.java b/contact-center/app/src/main/java/com/cskefu/cc/model/RecentUser.java index c8d36a84..bffc66c3 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/RecentUser.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/RecentUser.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/ReportFilter.java b/contact-center/app/src/main/java/com/cskefu/cc/model/ReportFilter.java index 9df55470..e6d916d6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/ReportFilter.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/ReportFilter.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/ReportModel.java b/contact-center/app/src/main/java/com/cskefu/cc/model/ReportModel.java index 82813bc8..fce8622f 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/ReportModel.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/ReportModel.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Reporter.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Reporter.java index c840765a..813c4f62 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Reporter.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Reporter.java @@ -1,19 +1,15 @@ -/** - * Licensed to the Rivulet under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * webapps/LICENSE-Rivulet-1.0 - *

+/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2010 Rivulet, + * Licensed under the Apache License, Version 2.0, webapps/LICENSE-Rivulet-1.0 + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/RequestLog.java b/contact-center/app/src/main/java/com/cskefu/cc/model/RequestLog.java index 797dcca8..4227497d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/RequestLog.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/RequestLog.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Role.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Role.java index 98676e0f..d42d5e16 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Role.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Role.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/RoleAuth.java b/contact-center/app/src/main/java/com/cskefu/cc/model/RoleAuth.java index 95ad6d1a..a8a11f8f 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/RoleAuth.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/RoleAuth.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/RouterRules.java b/contact-center/app/src/main/java/com/cskefu/cc/model/RouterRules.java index 909feeb9..40050161 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/RouterRules.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/RouterRules.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/SaleStatus.java b/contact-center/app/src/main/java/com/cskefu/cc/model/SaleStatus.java index 42fa7c8d..23c9f6a5 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/SaleStatus.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/SaleStatus.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Secret.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Secret.java index 56d2729d..3d83ad89 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Secret.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Secret.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/ServiceAi.java b/contact-center/app/src/main/java/com/cskefu/cc/model/ServiceAi.java index fdb126ee..2acf18f9 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/ServiceAi.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/ServiceAi.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/SessionConfig.java b/contact-center/app/src/main/java/com/cskefu/cc/model/SessionConfig.java index 55ee243a..2dd1c685 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/SessionConfig.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/SessionConfig.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/SipTrunk.java b/contact-center/app/src/main/java/com/cskefu/cc/model/SipTrunk.java index bcefd700..1118e537 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/SipTrunk.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/SipTrunk.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/StatusEvent.java b/contact-center/app/src/main/java/com/cskefu/cc/model/StatusEvent.java index 5e031540..14b1a3f3 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/StatusEvent.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/StatusEvent.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/StatusEventSatisf.java b/contact-center/app/src/main/java/com/cskefu/cc/model/StatusEventSatisf.java index 60b184b0..dde20e3f 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/StatusEventSatisf.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/StatusEventSatisf.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/StreamingFile.java b/contact-center/app/src/main/java/com/cskefu/cc/model/StreamingFile.java index 56ab6c0c..760d0cda 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/StreamingFile.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/StreamingFile.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/SysDic.java b/contact-center/app/src/main/java/com/cskefu/cc/model/SysDic.java index b5992671..744abd4b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/SysDic.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/SysDic.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/SystemConfig.java b/contact-center/app/src/main/java/com/cskefu/cc/model/SystemConfig.java index 2df83c6a..e99802b6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/SystemConfig.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/SystemConfig.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/SystemMessage.java b/contact-center/app/src/main/java/com/cskefu/cc/model/SystemMessage.java index 83452914..8e5e882d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/SystemMessage.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/SystemMessage.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/TableProperties.java b/contact-center/app/src/main/java/com/cskefu/cc/model/TableProperties.java index 2a8fc906..998f10e7 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/TableProperties.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/TableProperties.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Tag.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Tag.java index aba06ef8..eb317710 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Tag.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Tag.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/TagRelation.java b/contact-center/app/src/main/java/com/cskefu/cc/model/TagRelation.java index 9cd80f50..49c24d89 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/TagRelation.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/TagRelation.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/Template.java b/contact-center/app/src/main/java/com/cskefu/cc/model/Template.java index dece5adf..496a7678 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/Template.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/Template.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/UKefuCallOutFilter.java b/contact-center/app/src/main/java/com/cskefu/cc/model/UKefuCallOutFilter.java index ea7b716e..f7bb4472 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/UKefuCallOutFilter.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/UKefuCallOutFilter.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/UKefuCallOutRole.java b/contact-center/app/src/main/java/com/cskefu/cc/model/UKefuCallOutRole.java index eb76d779..25a117fa 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/UKefuCallOutRole.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/UKefuCallOutRole.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/UKefuCallOutTask.java b/contact-center/app/src/main/java/com/cskefu/cc/model/UKefuCallOutTask.java index 1c612b2c..8a9dcf37 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/UKefuCallOutTask.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/UKefuCallOutTask.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/UploadStatus.java b/contact-center/app/src/main/java/com/cskefu/cc/model/UploadStatus.java index 6d3cf33c..01f09610 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/UploadStatus.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/UploadStatus.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/User.java b/contact-center/app/src/main/java/com/cskefu/cc/model/User.java index 07a7db89..f88ab9c5 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/User.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/User.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/UserHistory.java b/contact-center/app/src/main/java/com/cskefu/cc/model/UserHistory.java index 60e00773..dcb1a9f3 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/UserHistory.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/UserHistory.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/UserRole.java b/contact-center/app/src/main/java/com/cskefu/cc/model/UserRole.java index 89304be7..8f36793c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/UserRole.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/UserRole.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/UserTraceHistory.java b/contact-center/app/src/main/java/com/cskefu/cc/model/UserTraceHistory.java index f44ea9b6..e1f8dae2 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/UserTraceHistory.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/UserTraceHistory.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/WorkMonitor.java b/contact-center/app/src/main/java/com/cskefu/cc/model/WorkMonitor.java index 9a69e993..dee123b9 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/WorkMonitor.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/WorkMonitor.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/model/WorkSession.java b/contact-center/app/src/main/java/com/cskefu/cc/model/WorkSession.java index da36035d..dc6f339c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/model/WorkSession.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/model/WorkSession.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerContext.java b/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerContext.java index e21e7fb5..abf7e3ec 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerContext.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerContext.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.peer; import com.cskefu.cc.basic.MainContext; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerSyncEntIM.java b/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerSyncEntIM.java index daf8f323..efc31ad4 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerSyncEntIM.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerSyncEntIM.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.peer; import com.cskefu.cc.basic.MainContext; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerSyncIM.java b/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerSyncIM.java index 7ad21c58..945fed6c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerSyncIM.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerSyncIM.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.peer; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerUtils.java b/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerUtils.java index d3162fbb..2e1aaf85 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerUtils.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/peer/PeerUtils.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.peer; import com.cskefu.cc.basic.Constants; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/peer/im/ComposeMw1.java b/contact-center/app/src/main/java/com/cskefu/cc/peer/im/ComposeMw1.java index 80f18af1..0b83be38 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/peer/im/ComposeMw1.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/peer/im/ComposeMw1.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.peer.im; import com.chatopera.compose4j.Functional; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/peer/im/ComposeMw2.java b/contact-center/app/src/main/java/com/cskefu/cc/peer/im/ComposeMw2.java index 8eb195cc..102c8656 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/peer/im/ComposeMw2.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/peer/im/ComposeMw2.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.peer.im; import com.cskefu.cc.basic.MainContext; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/peer/im/ComposeMw3.java b/contact-center/app/src/main/java/com/cskefu/cc/peer/im/ComposeMw3.java index b81b8388..d259a04a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/peer/im/ComposeMw3.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/peer/im/ComposeMw3.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.peer.im; import com.cskefu.cc.basic.MainContext; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/blob/JpaBlobHelper.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/blob/JpaBlobHelper.java index cdb0cf6d..c5e21941 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/blob/JpaBlobHelper.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/blob/JpaBlobHelper.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.blob; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/hibernate/BaseService.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/hibernate/BaseService.java index 1b34fc76..ec5910b0 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/hibernate/BaseService.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/hibernate/BaseService.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.hibernate; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/OrganDataExchangeImpl.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/OrganDataExchangeImpl.java index c20a2f9e..ee775e24 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/OrganDataExchangeImpl.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/OrganDataExchangeImpl.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.impl; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/ServiceDataExchangeImpl.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/ServiceDataExchangeImpl.java index 5ff9f5dc..f46fc8bf 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/ServiceDataExchangeImpl.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/ServiceDataExchangeImpl.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.impl; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/TagDataExchangeImpl.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/TagDataExchangeImpl.java index 01ef7012..1dbec947 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/TagDataExchangeImpl.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/TagDataExchangeImpl.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.persistence.impl; import com.cskefu.cc.model.Tag; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/UserDataExchangeImpl.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/UserDataExchangeImpl.java index 4afb64b2..e426711a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/UserDataExchangeImpl.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/impl/UserDataExchangeImpl.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.impl; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/interfaces/DataExchangeInterface.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/interfaces/DataExchangeInterface.java index 278ef2e6..f0eabfcb 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/interfaces/DataExchangeInterface.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/interfaces/DataExchangeInterface.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.interfaces; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AccountRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AccountRepository.java index 48deab84..caa4a288 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AccountRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AccountRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AdTypeRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AdTypeRepository.java index 0ab46db8..d6de9819 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AdTypeRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AdTypeRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentReportRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentReportRepository.java index d6a8b068..fbc7b4a6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentReportRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentReportRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentServiceRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentServiceRepository.java index a3486c81..56dfd431 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentServiceRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentServiceRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentServiceSatisRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentServiceSatisRepository.java index 298b1323..b336078e 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentServiceSatisRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentServiceSatisRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentStatusRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentStatusRepository.java index 456b5893..9fe8e400 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentStatusRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentStatusRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentUserContactsRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentUserContactsRepository.java index db554dee..d3358161 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentUserContactsRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentUserContactsRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentUserRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentUserRepository.java index ab1b4ae9..8ccc0a46 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentUserRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentUserRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentUserTaskRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentUserTaskRepository.java index ff9d8949..f124f926 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentUserTaskRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AgentUserTaskRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AreaTypeRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AreaTypeRepository.java index 9370c072..0548d485 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AreaTypeRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AreaTypeRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AttachmentRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AttachmentRepository.java index 15286445..288ae3e0 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AttachmentRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/AttachmentRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/BaseRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/BaseRepository.java index 17d140d8..da77ac16 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/BaseRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/BaseRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/BlackListRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/BlackListRepository.java index 317d774f..b458cb6d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/BlackListRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/BlackListRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/CallAgentRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/CallAgentRepository.java index fb856375..d1881ff9 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/CallAgentRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/CallAgentRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ChannelRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ChannelRepository.java index c50220d6..4d8e0d38 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ChannelRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ChannelRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ChatMessageRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ChatMessageRepository.java index af770ca5..b4035828 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ChatMessageRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ChatMessageRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ChatbotRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ChatbotRepository.java index 222c9a62..0984a341 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ChatbotRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ChatbotRepository.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ConsultInviteRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ConsultInviteRepository.java index 8efb2ee3..8b1fc1ac 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ConsultInviteRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ConsultInviteRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ContactNotesRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ContactNotesRepository.java index 134f23fb..1f1707c8 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ContactNotesRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ContactNotesRepository.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2019 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ContactsRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ContactsRepository.java index 1aa38f24..dec00c22 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ContactsRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ContactsRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/CubeService.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/CubeService.java index 9f5d688f..19ad7f98 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/CubeService.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/CubeService.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/DataSourceService.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/DataSourceService.java index 425a61d7..958b21fa 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/DataSourceService.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/DataSourceService.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ExtensionRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ExtensionRepository.java index 806ddda1..2d9a5799 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ExtensionRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ExtensionRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FbMessengerRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FbMessengerRepository.java index 6f570140..4e66b804 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FbMessengerRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FbMessengerRepository.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FbOTNFollowRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FbOTNFollowRepository.java index 8771af39..730ac201 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FbOTNFollowRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FbOTNFollowRepository.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FbOTNRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FbOTNRepository.java index 0de5590f..1c925204 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FbOTNRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FbOTNRepository.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FormFilterRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FormFilterRepository.java index 08a342d6..c502dd48 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FormFilterRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/FormFilterRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/IMGroupRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/IMGroupRepository.java index 27a90131..a0b52ffa 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/IMGroupRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/IMGroupRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/IMGroupUserRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/IMGroupUserRepository.java index b2953a6a..40b9dca7 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/IMGroupUserRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/IMGroupUserRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/InviteRecordRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/InviteRecordRepository.java index b20f5a9b..a92fdf7b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/InviteRecordRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/InviteRecordRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/JobDetailRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/JobDetailRepository.java index ad9a07af..a5924b19 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/JobDetailRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/JobDetailRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/LeaveMsgRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/LeaveMsgRepository.java index 705d7fda..4b75719a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/LeaveMsgRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/LeaveMsgRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/MetadataRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/MetadataRepository.java index 657938de..6deb23ad 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/MetadataRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/MetadataRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrganRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrganRepository.java index c66096f9..36601a4b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrganRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrganRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrganRoleRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrganRoleRepository.java index 1f38cc1e..ba50f1fa 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrganRoleRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrganRoleRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrganUserRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrganUserRepository.java index 0adeacbe..c39e796f 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrganUserRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrganUserRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrgiSkillRelRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrgiSkillRelRepository.java index 0f43c876..c8f1f6c5 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrgiSkillRelRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/OrgiSkillRelRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PassportWebIMUserHistRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PassportWebIMUserHistRepository.java index 4983612c..1f402406 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PassportWebIMUserHistRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PassportWebIMUserHistRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PassportWebIMUserRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PassportWebIMUserRepository.java index e0756701..a293493d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PassportWebIMUserRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PassportWebIMUserRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PbxHostRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PbxHostRepository.java index ed5a7d65..36cdc4b6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PbxHostRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PbxHostRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PropertiesEventRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PropertiesEventRepository.java index 0be9f897..d2c0cecb 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PropertiesEventRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/PropertiesEventRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RecentUserRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RecentUserRepository.java index ef6e53df..f0d9a5d2 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RecentUserRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RecentUserRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ReporterRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ReporterRepository.java index f75202ce..1acac4d7 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ReporterRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ReporterRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RequestLogRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RequestLogRepository.java index 6c7a1f12..d7174def 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RequestLogRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RequestLogRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RoleAuthRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RoleAuthRepository.java index 52526507..ff2d8cae 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RoleAuthRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RoleAuthRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RoleRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RoleRepository.java index 5190ffd6..81905bbf 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RoleRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/RoleRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SaleStatusRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SaleStatusRepository.java index 885ee761..2f66ffea 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SaleStatusRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SaleStatusRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SecretRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SecretRepository.java index cb6dabf7..f5450df9 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SecretRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SecretRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ServiceAiRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ServiceAiRepository.java index 2042cf7a..4147ff7e 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ServiceAiRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ServiceAiRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ServiceSummaryRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ServiceSummaryRepository.java index f5c32494..064f7350 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ServiceSummaryRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/ServiceSummaryRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SessionConfigRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SessionConfigRepository.java index a7df52f3..df64f856 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SessionConfigRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SessionConfigRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SipTrunkRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SipTrunkRepository.java index 32f53a40..4837ecaa 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SipTrunkRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SipTrunkRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/StatusEventRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/StatusEventRepository.java index 8694d9d7..48da8f01 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/StatusEventRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/StatusEventRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/StreamingFileRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/StreamingFileRepository.java index 90e7bd5b..3d8b4062 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/StreamingFileRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/StreamingFileRepository.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SysDicRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SysDicRepository.java index d071ac69..d9b1d9a5 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SysDicRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SysDicRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SystemConfigRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SystemConfigRepository.java index 1b588dd2..2bfcdc12 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SystemConfigRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SystemConfigRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SystemMessageRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SystemMessageRepository.java index 209b0b36..f0516882 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SystemMessageRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/SystemMessageRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TablePropertiesRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TablePropertiesRepository.java index 2a242a62..fd75aab6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TablePropertiesRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TablePropertiesRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TagRelationRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TagRelationRepository.java index 75555301..c3eaa4f0 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TagRelationRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TagRelationRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TagRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TagRepository.java index 2fbfbc53..93a7128b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TagRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TagRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TemplateRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TemplateRepository.java index 7b2ac300..8864dc6c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TemplateRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/TemplateRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UKefuCallOutFilterRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UKefuCallOutFilterRepository.java index 086893d4..e1abe98b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UKefuCallOutFilterRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UKefuCallOutFilterRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UKefuCallOutRoleRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UKefuCallOutRoleRepository.java index dde0c6ce..1c789025 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UKefuCallOutRoleRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UKefuCallOutRoleRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UKefuCallOutTaskRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UKefuCallOutTaskRepository.java index 2ee3de2d..46045c93 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UKefuCallOutTaskRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UKefuCallOutTaskRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserEventRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserEventRepository.java index aa0c2b07..e4d37220 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserEventRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserEventRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserHistoryRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserHistoryRepository.java index 58c66b1a..b0c02556 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserHistoryRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserHistoryRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserRepository.java index 20e36912..c0479077 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserRoleRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserRoleRepository.java index f748dd8d..4f7e3e44 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserRoleRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserRoleRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserTraceRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserTraceRepository.java index 57166c2e..59f02f78 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserTraceRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/UserTraceRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/WeiXinUserRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/WeiXinUserRepository.java index ffbe0d47..57bea0d8 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/WeiXinUserRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/WeiXinUserRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/WorkMonitorRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/WorkMonitorRepository.java index b6829960..7f6acd5a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/WorkMonitorRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/WorkMonitorRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/WorkSessionRepository.java b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/WorkSessionRepository.java index 20a126eb..8edaf1f8 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/WorkSessionRepository.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/persistence/repository/WorkSessionRepository.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.persistence.repository; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ApiChatbotController.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ApiChatbotController.java index 7d21f644..d97e9aeb 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ApiChatbotController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ApiChatbotController.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.plugins.chatbot; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotComposer.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotComposer.java index dbf46441..73b68994 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotComposer.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotComposer.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.plugins.chatbot; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotConstants.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotConstants.java index 06e218d2..b6d33b62 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotConstants.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotConstants.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.plugins.chatbot; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotContext.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotContext.java index b5c935de..b55095e8 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotContext.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotContext.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.plugins.chatbot; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotController.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotController.java index 4e882d5f..8afcb9d5 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotController.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.plugins.chatbot; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotEventHandler.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotEventHandler.java index 7715c830..69270a6a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotEventHandler.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotEventHandler.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.plugins.chatbot; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotEventSubscription.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotEventSubscription.java index 6939d995..8e1cf25f 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotEventSubscription.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotEventSubscription.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.plugins.chatbot; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotPluginConfigurer.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotPluginConfigurer.java index 00093ab4..6f03a1f3 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotPluginConfigurer.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotPluginConfigurer.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.plugins.chatbot; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotProxy.java index 1206ae75..a3ae6a69 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotProxy.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.plugins.chatbot; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotSocketIOConfigurer.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotSocketIOConfigurer.java index 8508a685..e950c5c7 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotSocketIOConfigurer.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/chatbot/ChatbotSocketIOConfigurer.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.plugins.chatbot; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChannelController.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChannelController.java index b94707cc..d4e15d70 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChannelController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChannelController.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.plugins.messenger; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChannelMessager.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChannelMessager.java index 3da69fe4..67b4fe85 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChannelMessager.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChannelMessager.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.plugins.messenger; import com.cskefu.cc.basic.MainContext; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChatbot.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChatbot.java index a99f7ba8..f93d37f5 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChatbot.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChatbot.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.plugins.messenger; import com.chatopera.bot.exception.ChatbotException; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChatbotMessager.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChatbotMessager.java index 3f546f18..e02aad52 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChatbotMessager.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerChatbotMessager.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.plugins.messenger; import com.alibaba.fastjson.JSONObject; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerEventSubscription.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerEventSubscription.java index d145c7d1..481b9361 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerEventSubscription.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerEventSubscription.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.plugins.messenger; import com.alibaba.fastjson.JSONObject; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerMessageProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerMessageProxy.java index 4cafc8d6..c4f4e99b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerMessageProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerMessageProxy.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.plugins.messenger; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerOTNController.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerOTNController.java index 4bd7f856..df1af7b1 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerOTNController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerOTNController.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.plugins.messenger; import com.alibaba.fastjson.JSONObject; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerPluginConfigurer.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerPluginConfigurer.java index d3a52ad7..9d0bb303 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerPluginConfigurer.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerPluginConfigurer.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.plugins.messenger; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerWebhookChannelController.java b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerWebhookChannelController.java index 44cb9e96..305eee7e 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerWebhookChannelController.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/plugins/messenger/MessengerWebhookChannelController.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.plugins.messenger; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentAuditProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentAuditProxy.java index 94b0fcb7..b3c707ce 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentAuditProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentAuditProxy.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.proxy; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentProxy.java index e75daf36..dc6f823d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentProxy.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.proxy; import com.cskefu.cc.acd.ACDPolicyService; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentServiceProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentServiceProxy.java index 28f99e27..09a9062c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentServiceProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentServiceProxy.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.proxy; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentSessionProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentSessionProxy.java index e92504c0..c676e93b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentSessionProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentSessionProxy.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.proxy; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentStatusProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentStatusProxy.java index 9303cde7..bcbd9c38 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentStatusProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentStatusProxy.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.proxy; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentUserProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentUserProxy.java index 6f2746db..9b5bc06c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentUserProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/proxy/AgentUserProxy.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.proxy; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/proxy/AttachmentProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/proxy/AttachmentProxy.java index 0d1e7dab..7fc647b5 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/proxy/AttachmentProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/proxy/AttachmentProxy.java @@ -1,12 +1,14 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. */ package com.cskefu.cc.proxy; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/proxy/BlackEntityProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/proxy/BlackEntityProxy.java index 5dd40f72..ebe131bb 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/proxy/BlackEntityProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/proxy/BlackEntityProxy.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.proxy; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/proxy/CallcenterOutboundProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/proxy/CallcenterOutboundProxy.java index 02f4b00d..f77a727b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/proxy/CallcenterOutboundProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/proxy/CallcenterOutboundProxy.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.proxy; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/proxy/ContactsProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/proxy/ContactsProxy.java index d4ff9114..a36102a2 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/proxy/ContactsProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/proxy/ContactsProxy.java @@ -1,12 +1,14 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. */ package com.cskefu.cc.proxy; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/proxy/LeaveMsgProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/proxy/LeaveMsgProxy.java index a22742b9..2361d6fc 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/proxy/LeaveMsgProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/proxy/LeaveMsgProxy.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2020 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.proxy; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/proxy/OnlineUserProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/proxy/OnlineUserProxy.java index db7efc7a..e309bc57 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/proxy/OnlineUserProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/proxy/OnlineUserProxy.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.proxy; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/proxy/OrganProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/proxy/OrganProxy.java index 721129bf..4da3089a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/proxy/OrganProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/proxy/OrganProxy.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.proxy; import com.cskefu.cc.controller.admin.OrganController; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/proxy/UserProxy.java b/contact-center/app/src/main/java/com/cskefu/cc/proxy/UserProxy.java index 3a5b00ff..768d9af3 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/proxy/UserProxy.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/proxy/UserProxy.java @@ -1,12 +1,14 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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. + * Copyright (C) 2019-2022 Chatopera Inc, All rights reserved. * - * This software and related documentation are provided under a license agreement containing - * restrictions on use and disclosure and are protected by intellectual property laws. - * Except as expressly permitted in your license agreement or allowed by law, you may not use, - * copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, - * publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, - * or decompilation of this software, unless required by law for interoperability, is prohibited. */ package com.cskefu.cc.proxy; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/schedule/Fetcher.java b/contact-center/app/src/main/java/com/cskefu/cc/schedule/Fetcher.java index 85ba14df..05f56387 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/schedule/Fetcher.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/schedule/Fetcher.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.schedule; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/schedule/Task.java b/contact-center/app/src/main/java/com/cskefu/cc/schedule/Task.java index a5bce7f9..52edd5c6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/schedule/Task.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/schedule/Task.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.schedule; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/schedule/WebIMTask.java b/contact-center/app/src/main/java/com/cskefu/cc/schedule/WebIMTask.java index 227c27f3..8b4e0e63 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/schedule/WebIMTask.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/schedule/WebIMTask.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.schedule; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/SocketIOServing.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/SocketIOServing.java index d24ccac8..dc150b11 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/SocketIOServing.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/SocketIOServing.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyAgentClient.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyAgentClient.java index 3eaf78c8..a81816a4 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyAgentClient.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyAgentClient.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.client; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyCallCenterClient.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyCallCenterClient.java index 1d69d5c6..cd8777ea 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyCallCenterClient.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyCallCenterClient.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.client; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyCalloutClient.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyCalloutClient.java index 6f6b4deb..e482bab7 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyCalloutClient.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyCalloutClient.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.client; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyChatbotClient.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyChatbotClient.java index faa8edfc..f3e59d6b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyChatbotClient.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyChatbotClient.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.client; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyClient.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyClient.java index f4360cbf..c1bfd47a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyClient.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyClient.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.client; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyClients.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyClients.java index 09188a57..fd429293 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyClients.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyClients.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.client; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyIMClient.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyIMClient.java index 035b444c..a5701996 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyIMClient.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/NettyIMClient.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.client; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/UserClient.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/UserClient.java index 4c2a5757..b1edbb0e 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/UserClient.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/client/UserClient.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.client; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/handler/AgentEventHandler.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/handler/AgentEventHandler.java index 42d939af..2b0e366b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/handler/AgentEventHandler.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/handler/AgentEventHandler.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.handler; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/handler/EntIMEventHandler.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/handler/EntIMEventHandler.java index abc5b1cf..133b03ea 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/handler/EntIMEventHandler.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/handler/EntIMEventHandler.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.handler; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/handler/IMEventHandler.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/handler/IMEventHandler.java index 8ec172c9..c7a6851c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/handler/IMEventHandler.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/handler/IMEventHandler.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.handler; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/AgentStatusMessage.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/AgentStatusMessage.java index 1629b398..f436ee85 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/AgentStatusMessage.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/AgentStatusMessage.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.message; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/ChatMessage.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/ChatMessage.java index b4dcf526..98e0fad4 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/ChatMessage.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/ChatMessage.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018-Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.message; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/InterventMessage.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/InterventMessage.java index c896f6d8..6c5c15ab 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/InterventMessage.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/InterventMessage.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.message; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/Message.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/Message.java index 4c43cb66..9a8e01ff 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/Message.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/Message.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.message; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/OtherMessageItem.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/OtherMessageItem.java index ab32bcf0..a2da847a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/OtherMessageItem.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/message/OtherMessageItem.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.message; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/util/HumanUtils.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/util/HumanUtils.java index f4db1349..28baaa99 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/util/HumanUtils.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/util/HumanUtils.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/util/IMServiceUtils.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/util/IMServiceUtils.java index b8b2e724..833b952b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/util/IMServiceUtils.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/util/IMServiceUtils.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.socketio.util; import com.cskefu.cc.basic.MainContext; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/socketio/util/RichMediaUtils.java b/contact-center/app/src/main/java/com/cskefu/cc/socketio/util/RichMediaUtils.java index aa712329..00924212 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/socketio/util/RichMediaUtils.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/socketio/util/RichMediaUtils.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.socketio.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/AMRConvert.java b/contact-center/app/src/main/java/com/cskefu/cc/util/AMRConvert.java index 205f6a48..b8acd1fa 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/AMRConvert.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/AMRConvert.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/Base62.java b/contact-center/app/src/main/java/com/cskefu/cc/util/Base62.java index 6f0732b5..597c9150 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/Base62.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/Base62.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/BrowserClient.java b/contact-center/app/src/main/java/com/cskefu/cc/util/BrowserClient.java index 55a78182..e4b2525e 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/BrowserClient.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/BrowserClient.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/CallCenterUtils.java b/contact-center/app/src/main/java/com/cskefu/cc/util/CallCenterUtils.java index 5f4fe131..8beeceda 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/CallCenterUtils.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/CallCenterUtils.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/CronTools.java b/contact-center/app/src/main/java/com/cskefu/cc/util/CronTools.java index 3d33bd9f..678afd70 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/CronTools.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/CronTools.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/CskefuIdGenerator.java b/contact-center/app/src/main/java/com/cskefu/cc/util/CskefuIdGenerator.java index 520c7019..7f8db1fb 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/CskefuIdGenerator.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/CskefuIdGenerator.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/CskefuList.java b/contact-center/app/src/main/java/com/cskefu/cc/util/CskefuList.java index 3f869c53..551ee06d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/CskefuList.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/CskefuList.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/DateConverter.java b/contact-center/app/src/main/java/com/cskefu/cc/util/DateConverter.java index 729dc083..1a419fa4 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/DateConverter.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/DateConverter.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/FFmpegCmdExecuter.java b/contact-center/app/src/main/java/com/cskefu/cc/util/FFmpegCmdExecuter.java index 19a903ef..463bb380 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/FFmpegCmdExecuter.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/FFmpegCmdExecuter.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/HashMapUtils.java b/contact-center/app/src/main/java/com/cskefu/cc/util/HashMapUtils.java index 23f4215c..a0a34be2 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/HashMapUtils.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/HashMapUtils.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/HttpClientUtil.java b/contact-center/app/src/main/java/com/cskefu/cc/util/HttpClientUtil.java index 2fa0b2c6..a8b53b67 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/HttpClientUtil.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/HttpClientUtil.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/IP.java b/contact-center/app/src/main/java/com/cskefu/cc/util/IP.java index 93944850..08de9696 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/IP.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/IP.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/IPTools.java b/contact-center/app/src/main/java/com/cskefu/cc/util/IPTools.java index f85470fe..4478eddd 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/IPTools.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/IPTools.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/MD5.java b/contact-center/app/src/main/java/com/cskefu/cc/util/MD5.java index f90e9d9e..968e2661 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/MD5.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/MD5.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/MathHelper.java b/contact-center/app/src/main/java/com/cskefu/cc/util/MathHelper.java index 7b00b1fe..1d244bac 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/MathHelper.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/MathHelper.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/Menu.java b/contact-center/app/src/main/java/com/cskefu/cc/util/Menu.java index deb6b403..fca1b642 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/Menu.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/Menu.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/MobileDevice.java b/contact-center/app/src/main/java/com/cskefu/cc/util/MobileDevice.java index 8c2b8e1c..5fa80d3d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/MobileDevice.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/MobileDevice.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/OnlineUserUtils.java b/contact-center/app/src/main/java/com/cskefu/cc/util/OnlineUserUtils.java index 41d9adc4..ca0643e6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/OnlineUserUtils.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/OnlineUserUtils.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/PinYinTools.java b/contact-center/app/src/main/java/com/cskefu/cc/util/PinYinTools.java index 7c226e3a..67084d07 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/PinYinTools.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/PinYinTools.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/PropertiesEventUtil.java b/contact-center/app/src/main/java/com/cskefu/cc/util/PropertiesEventUtil.java index d2d863e4..78e757e7 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/PropertiesEventUtil.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/PropertiesEventUtil.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/PugHelper.java b/contact-center/app/src/main/java/com/cskefu/cc/util/PugHelper.java index e9401c87..f0b1d424 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/PugHelper.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/PugHelper.java @@ -1,3 +1,13 @@ +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html + * 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 com.cskefu.cc.util; import com.alibaba.fastjson.JSON; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/RestResult.java b/contact-center/app/src/main/java/com/cskefu/cc/util/RestResult.java index 1739e83b..10e7737b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/RestResult.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/RestResult.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/RestResultType.java b/contact-center/app/src/main/java/com/cskefu/cc/util/RestResultType.java index 74389104..0563089c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/RestResultType.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/RestResultType.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/SerializeUtil.java b/contact-center/app/src/main/java/com/cskefu/cc/util/SerializeUtil.java index 342ff8ec..1e8264c5 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/SerializeUtil.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/SerializeUtil.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/StreamingFileUtil.java b/contact-center/app/src/main/java/com/cskefu/cc/util/StreamingFileUtil.java index 3a6ceace..90463c9a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/StreamingFileUtil.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/StreamingFileUtil.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/SystemEnvHelper.java b/contact-center/app/src/main/java/com/cskefu/cc/util/SystemEnvHelper.java index 35a8f961..7ceee9b8 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/SystemEnvHelper.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/SystemEnvHelper.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/TaskTools.java b/contact-center/app/src/main/java/com/cskefu/cc/util/TaskTools.java index 515d14fe..5e2b0e5c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/TaskTools.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/TaskTools.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/Templet.java b/contact-center/app/src/main/java/com/cskefu/cc/util/Templet.java index 94d31c17..4c3d6ac4 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/Templet.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/Templet.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/WebIMClient.java b/contact-center/app/src/main/java/com/cskefu/cc/util/WebIMClient.java index a977404d..025e6f19 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/WebIMClient.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/WebIMClient.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/WebIMReport.java b/contact-center/app/src/main/java/com/cskefu/cc/util/WebIMReport.java index 25c5c038..aed705ae 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/WebIMReport.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/WebIMReport.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/WebSseEmitterClient.java b/contact-center/app/src/main/java/com/cskefu/cc/util/WebSseEmitterClient.java index fe79928d..22d6e7c6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/WebSseEmitterClient.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/WebSseEmitterClient.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018-Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/WechatUtil.java b/contact-center/app/src/main/java/com/cskefu/cc/util/WechatUtil.java index bdf795d1..c62ffc27 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/WechatUtil.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/WechatUtil.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/WeiXinReport.java b/contact-center/app/src/main/java/com/cskefu/cc/util/WeiXinReport.java index 2d750e5e..25cd717a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/WeiXinReport.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/WeiXinReport.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/asr/AsrResult.java b/contact-center/app/src/main/java/com/cskefu/cc/util/asr/AsrResult.java index 2b80afaa..a55e0b4e 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/asr/AsrResult.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/asr/AsrResult.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.asr; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/bi/CubeReportData.java b/contact-center/app/src/main/java/com/cskefu/cc/util/bi/CubeReportData.java index 752dae69..e65a1ddb 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/bi/CubeReportData.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/bi/CubeReportData.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.bi; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/bi/ReportData.java b/contact-center/app/src/main/java/com/cskefu/cc/util/bi/ReportData.java index 28476284..1437d5e9 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/bi/ReportData.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/bi/ReportData.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.bi; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/bi/UKExcelUtil.java b/contact-center/app/src/main/java/com/cskefu/cc/util/bi/UKExcelUtil.java index 7920031f..7e22800c 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/bi/UKExcelUtil.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/bi/UKExcelUtil.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.bi; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/FirstTitle.java b/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/FirstTitle.java index 82f110e6..cb42794a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/FirstTitle.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/FirstTitle.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.bi.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/Level.java b/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/Level.java index 7a0058aa..983df90a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/Level.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/Level.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.bi.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/RequestData.java b/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/RequestData.java index bd9bf1e1..91b12bee 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/RequestData.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/RequestData.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.bi.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/ValueData.java b/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/ValueData.java index 153e8e1b..f46adff0 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/ValueData.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/bi/model/ValueData.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.bi.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/DSData.java b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/DSData.java index 9f5fb60c..e905e8dd 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/DSData.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/DSData.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.dsdata; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/DSDataEvent.java b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/DSDataEvent.java index bb2c6450..744bb068 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/DSDataEvent.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/DSDataEvent.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.dsdata; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/DataProcess.java b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/DataProcess.java index 4b8ce837..59abbdd1 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/DataProcess.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/DataProcess.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.dsdata; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/ExcelImportProecess.java b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/ExcelImportProecess.java index 61a68966..446449af 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/ExcelImportProecess.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/ExcelImportProecess.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.dsdata; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/ExcelImportUtils.java b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/ExcelImportUtils.java index ae8926b9..68f59152 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/ExcelImportUtils.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/ExcelImportUtils.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.dsdata; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/export/ExcelExporterProcess.java b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/export/ExcelExporterProcess.java index 503255fa..fcddaede 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/export/ExcelExporterProcess.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/export/ExcelExporterProcess.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.dsdata.export; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/export/ExportData.java b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/export/ExportData.java index 33e2c2d3..4abbd30a 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/export/ExportData.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/export/ExportData.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.dsdata.export; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/process/AccountProcess.java b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/process/AccountProcess.java index 09d0f066..0ea6b8ec 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/process/AccountProcess.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/process/AccountProcess.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.dsdata.process; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/process/ContactsProcess.java b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/process/ContactsProcess.java index 556c9ffc..e25668b2 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/process/ContactsProcess.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/process/ContactsProcess.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.dsdata.process; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/process/JPAProcess.java b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/process/JPAProcess.java index d0e7e510..9e8291a6 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/process/JPAProcess.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/dsdata/process/JPAProcess.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.dsdata.process; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/es/UKDataBean.java b/contact-center/app/src/main/java/com/cskefu/cc/util/es/UKDataBean.java index 219d33d5..8faba91b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/es/UKDataBean.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/es/UKDataBean.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.es; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/freeswitch/model/CallCenterAgent.java b/contact-center/app/src/main/java/com/cskefu/cc/util/freeswitch/model/CallCenterAgent.java index a4d1c4a7..e552b003 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/freeswitch/model/CallCenterAgent.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/freeswitch/model/CallCenterAgent.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.freeswitch.model; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/json/GsonTools.java b/contact-center/app/src/main/java/com/cskefu/cc/util/json/GsonTools.java index c5c32b13..fa4216d9 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/json/GsonTools.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/json/GsonTools.java @@ -1,19 +1,17 @@ -package com.cskefu.cc.util.json; /* - * Copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-Jun. 2023 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ +package com.cskefu.cc.util.json; import com.google.gson.*; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/mail/Mail.java b/contact-center/app/src/main/java/com/cskefu/cc/util/mail/Mail.java index ac60cb94..12b6cb77 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/mail/Mail.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/mail/Mail.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.mail; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/mail/MailAuthenticator.java b/contact-center/app/src/main/java/com/cskefu/cc/util/mail/MailAuthenticator.java index 22f34785..8130a4fa 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/mail/MailAuthenticator.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/mail/MailAuthenticator.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.mail; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/mail/MailInfo.java b/contact-center/app/src/main/java/com/cskefu/cc/util/mail/MailInfo.java index 57c59f01..b6bbe810 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/mail/MailInfo.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/mail/MailInfo.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.mail; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/mail/MailSender.java b/contact-center/app/src/main/java/com/cskefu/cc/util/mail/MailSender.java index 848c47af..99177718 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/mail/MailSender.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/mail/MailSender.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.mail; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/DatabaseMetaDataHandler.java b/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/DatabaseMetaDataHandler.java index 513a6059..6d138987 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/DatabaseMetaDataHandler.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/DatabaseMetaDataHandler.java @@ -1,20 +1,17 @@ -/** - * Licensed to the Rivulet under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * webapps/LICENSE-Rivulet-1.0 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2010 Rivulet, + * Licensed under the Apache License, Version 2.0, webapps/LICENSE-Rivulet-1.0 + * http://www.apache.org/licenses/LICENSE-2.0 */ + package com.cskefu.cc.util.metadata; import java.sql.Connection; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/UKColumnMetadata.java b/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/UKColumnMetadata.java index bebbbb6e..483ddf64 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/UKColumnMetadata.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/UKColumnMetadata.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.metadata; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/UKDatabaseMetadata.java b/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/UKDatabaseMetadata.java index c356a4f4..cb9e438b 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/UKDatabaseMetadata.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/UKDatabaseMetadata.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.metadata; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/UKTableMetaData.java b/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/UKTableMetaData.java index d026a1a4..3ab3db1d 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/UKTableMetaData.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/metadata/UKTableMetaData.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.metadata; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/mobile/MobileAddress.java b/contact-center/app/src/main/java/com/cskefu/cc/util/mobile/MobileAddress.java index bcd84431..77b7c8bf 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/mobile/MobileAddress.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/mobile/MobileAddress.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.mobile; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/mobile/MobileNumberUtils.java b/contact-center/app/src/main/java/com/cskefu/cc/util/mobile/MobileNumberUtils.java index 09fbf9f7..e58dca96 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/mobile/MobileNumberUtils.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/mobile/MobileNumberUtils.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.mobile; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/restapi/QueryParams.java b/contact-center/app/src/main/java/com/cskefu/cc/util/restapi/QueryParams.java index bf3c3bcc..b54a5d98 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/restapi/QueryParams.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/restapi/QueryParams.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.restapi; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/restapi/RequestValues.java b/contact-center/app/src/main/java/com/cskefu/cc/util/restapi/RequestValues.java index 8a2a8e58..af77a852 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/restapi/RequestValues.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/restapi/RequestValues.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.restapi; diff --git a/contact-center/app/src/main/java/com/cskefu/cc/util/restapi/RestUtils.java b/contact-center/app/src/main/java/com/cskefu/cc/util/restapi/RestUtils.java index 8bc4d846..a2a3fb87 100644 --- a/contact-center/app/src/main/java/com/cskefu/cc/util/restapi/RestUtils.java +++ b/contact-center/app/src/main/java/com/cskefu/cc/util/restapi/RestUtils.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.cskefu.cc.util.restapi; diff --git a/contact-center/app/src/main/java/mondrian/calc/TupleList.java b/contact-center/app/src/main/java/mondrian/calc/TupleList.java deleted file mode 100644 index f026a623..00000000 --- a/contact-center/app/src/main/java/mondrian/calc/TupleList.java +++ /dev/null @@ -1,109 +0,0 @@ -/* -* This software is subject to the terms of the Eclipse Public License v1.0 -* Agreement, available at the following URL: -* http://www.eclipse.org/legal/epl-v10.html. -* You must accept the terms of that agreement to use this software. -* -* Copyright (c) 2002-2013 Pentaho Corporation.. All rights reserved. -*/ - -package mondrian.calc; - -import mondrian.olap.Member; - -import java.util.List; - -/** - * List of tuples. - * - *

Design notes

- * - *
    - * - *
  • Consider changing - * {@link TupleCalc#evaluateTuple(mondrian.olap.Evaluator)} - * and {@link mondrian.olap.Evaluator.NamedSetEvaluator#currentTuple()} - * to List<Member>
  • - * - *
  • Search for potential uses of {@link TupleList#get(int, int)}
  • - * - *
  • Worth creating {@link TupleList}.addAll(TupleIterator)?
  • - * - *
- * - * @author jhyde - */ -public interface TupleList - extends List>, TupleIterable -{ - /** - * Returns a particular column of a particular row. - * - *

Note that {@code list.get(row, column)} - * is equivalent to {@code list.slice(column).get(row)} - * and {@code list.get(row).get(column)} - * but is more efficient for most implementations of TupleList. - * - * @param slice Column ordinal - * @param index Row ordinal - * @return Member at given row and column - */ - Member get(int slice, int index); - - /** - * Returns a list of the members at a given column. - * - *

The list is modifiable if and only if this TupleList is modifiable. - * Adding an element to a slice will create a tuple whose members in other - * columns are null. - * Removing an element from a slicer will remove a tuple. - * - * @param column Ordinal of the member in each tuple to project - * @return List of members - * @throws IllegalArgumentException if column is not less than arity - */ - List slice(int column); - - /** - * Creates a copy of this list that has the same type and has a given - * capacity. - * - *

If capacity is negative, populates the list. A deep copy is made, - * so that it the contents of the list are not affected to changes to any - * backing collections. - * - * @param capacity Capacity - * @return Copy of list, empty if capacity is non-negative - */ - TupleList cloneList(int capacity); - - void addTuple(Member... members); - - TupleList project(int[] destIndices); - - void addCurrent(TupleCursor tupleIter); - - // override, refining return type - TupleList subList(int fromIndex, int toIndex); - - TupleList withPositionCallback(PositionCallback positionCallback); - - /** - * Fixes the tuples of this list, so that their contents will not change - * even if elements of the list are reordered or removed. Returns this - * list if possible. - * - * @return List whose tuples are invariant if the list is sorted or filtered - */ - TupleList fix(); - - interface PositionCallback { - void onPosition(int index); - } - - void setCount(int count); - - int getCount(); -} - -// End TupleList.java diff --git a/contact-center/app/src/main/java/mondrian/calc/impl/ArrayTupleList.java b/contact-center/app/src/main/java/mondrian/calc/impl/ArrayTupleList.java deleted file mode 100644 index 2d915c9e..00000000 --- a/contact-center/app/src/main/java/mondrian/calc/impl/ArrayTupleList.java +++ /dev/null @@ -1,268 +0,0 @@ -/* -* This software is subject to the terms of the Eclipse Public License v1.0 -* Agreement, available at the following URL: -* http://www.eclipse.org/legal/epl-v10.html. -* You must accept the terms of that agreement to use this software. -* -* Copyright (c) 2002-2013 Pentaho Corporation.. All rights reserved. -*/ - -package mondrian.calc.impl; - -import mondrian.calc.*; -import mondrian.olap.*; - -import java.util.*; - -/** - * Implementation of {@link TupleList} that stores tuples end-to-end in an - * array. - * - * @author jhyde -*/ -public class ArrayTupleList extends AbstractEndToEndTupleList -{ - private transient Member[] objectData; - private int size; - private int count; - - /** - * Creates an empty ArrayTupleList with an initial capacity of 10 tuples. - * - * @param arity Arity - */ - public ArrayTupleList(int arity) { - this(arity, 10 * arity); - assert arity > 1 : "Probably better to use a UnaryTupleList"; - } - - /** - * Creates an empty ArrayTupleList. - * - * @param arity Arity - * @param initialCapacity Initial capacity - */ - public ArrayTupleList(int arity, int initialCapacity) { - this(arity, new Member[initialCapacity * arity], 0); - } - - private ArrayTupleList(int arity, Member[] members, int size) { - super(arity); - assert members.length % arity == 0; - this.objectData = members; - this.size = size; - } - - @Override - protected List backingList() { - return new AbstractList() { - @Override - public Member get(int index) { - return objectData[index]; - } - - @Override - public int size() { - return size * arity; - } - }; - } - - @Override - public Member get(int slice, int index) { - return objectData[index * arity + slice]; - } - - @Override - public List get(int index) { - final int startIndex = index * arity; - final List list = - new AbstractList() { - public Member get(int index) { - return objectData[startIndex + index]; - } - - public int size() { - return arity; - } - }; - if (mutable) { - return Util.flatList(list); - } - return list; - } - - @Override - public List set(int index, List element) { - assert mutable; - for (int i = 0, startIndex = index * arity; i < arity; i++) { - objectData[startIndex + i] = element.get(i); - } - return null; // not compliant with List contract - } - - @Override - public void addCurrent(TupleCursor tupleIter) { - assert mutable; - int n = size * arity; - ensureCapacity(n + arity); - tupleIter.currentToArray(objectData, n); - ++size; - } - - public int size() { - return size; - } - - @Override - public boolean add(List members) { - assert mutable; - if (members.size() != arity) { - throw new IllegalArgumentException( - "Tuple length does not match arity"); - } - int n = size * arity; - ensureCapacity(n + arity); - for (Member member : members) { - objectData[n++] = member; - } - ++size; - return true; - } - - @Override - public void add(int index, List members) { - assert mutable; - if (members.size() != arity) { - throw new IllegalArgumentException( - "Tuple length does not match arity"); - } - int n = index * arity; - ensureCapacity((size + 1) + arity); - System.arraycopy(objectData, n, objectData, n + arity, arity); - for (Member member : members) { - objectData[n++] = member; - } - ++size; - } - - @Override - public boolean addAll(int index, Collection> c) { - assert mutable; - final int size1 = c.size(); - ensureCapacity(size * arity + size1 * arity); - int n = index * arity; - System.arraycopy( - objectData, n, objectData, n + size1 * arity, size * arity - n); - for (List members : c) { - for (Member member : members) { - objectData[n++] = member; - } - } - size += size1; - return size1 > 0; - } - - public void addTuple(Member... members) { - assert mutable; - if (members.length != arity) { - throw new IllegalArgumentException( - "Tuple length does not match arity"); - } - ensureCapacity(size * arity + arity); - System.arraycopy(members, 0, objectData, size * arity, arity); - ++size; - } - - @Override - public List remove(int index) { - assert mutable; - final int n = index * arity; - // Strict compliance with List API: - // List previous = get(index); - System.arraycopy(objectData, n + arity, objectData, n, arity); - --size; - return null; // previous; - } - - public List slice(final int column) { - if (column < 0 || column >= arity) { - throw new IllegalArgumentException(); - } - return new AbstractList() { - @Override - public Member get(int index) { - return objectData[index * arity + column]; - } - - @Override - public int size() { - return size; - } - }; - } - - public TupleList cloneList(int capacity) { - if (capacity < 0) { - // copy of this list with the same contents - return new ArrayTupleList(arity, objectData.clone(), size()); - } else { - // empty copy of this list with given capacity - return new ArrayTupleList(arity, capacity); - } - } - - public TupleIterator tupleIteratorInternal() { - // Improve the base class implementation of setContext. It is cheaper - // to call evaluator.setContext several times than to create a - // temporary list or array. - return new AbstractTupleListIterator() { - public void setContext(Evaluator evaluator) { - for (int i = 0, x = lastRet * arity; i < arity; i++) { - evaluator.setContext(objectData[x + i]); - } - } - - public Member member(int column) { - return objectData[lastRet * arity + column]; - } - - public void currentToArray(Member[] members, int offset) { - System.arraycopy( - objectData, - lastRet * arity, - members, - offset, - arity); - } - }; - } - - private void ensureCapacity(int minCapacity) { - int oldCapacity = objectData.length; - if (minCapacity > oldCapacity) { - int newCapacity = (oldCapacity * 3) / 2 + 1; - if (newCapacity < minCapacity) { - newCapacity = minCapacity; - } - // Up to next multiple of arity. - final int rem = newCapacity % arity; - newCapacity += (arity - rem); - objectData = Util.copyOf(objectData, newCapacity); - } - } - - @Override - public int getCount() { - // TODO Auto-generated method stub - return count; - } - - @Override - public void setCount(int count) { - // TODO Auto-generated method stub - this.count = count; - } -} - -// End ArrayTupleList.java diff --git a/contact-center/app/src/main/java/mondrian/calc/impl/DelegatingTupleList.java b/contact-center/app/src/main/java/mondrian/calc/impl/DelegatingTupleList.java deleted file mode 100644 index 7511c28b..00000000 --- a/contact-center/app/src/main/java/mondrian/calc/impl/DelegatingTupleList.java +++ /dev/null @@ -1,194 +0,0 @@ -/* -* This software is subject to the terms of the Eclipse Public License v1.0 -* Agreement, available at the following URL: -* http://www.eclipse.org/legal/epl-v10.html. -* You must accept the terms of that agreement to use this software. -* -* Copyright (c) 2002-2013 Pentaho Corporation.. All rights reserved. -*/ - -package mondrian.calc.impl; - -import mondrian.calc.TupleIterator; -import mondrian.calc.TupleList; -import mondrian.olap.Member; -import mondrian.olap.Util; - -import java.util.*; - -/** - * Implementation of {@link mondrian.calc.TupleList} based on a list of - * {@code List} tuples. - * - * @author jhyde -*/ -public class DelegatingTupleList extends AbstractTupleList -{ - private final List> list; - private int count; - /** - * Creates a DelegatingTupleList. - * - * @param arity Arity - * @param list Backing list - */ - public DelegatingTupleList(int arity, List> list) { - super(arity); - this.list = list; - assert list.isEmpty() - || (list.get(0) instanceof List - && (list.get(0).isEmpty() - || list.get(0).get(0) == null - || list.get(0).get(0) instanceof Member)) - : "sanity check failed: " + list; - } - - @Override - protected TupleIterator tupleIteratorInternal() { - return new AbstractTupleListIterator(); - } - - @Override - public TupleList subList(int fromIndex, int toIndex) { - return new DelegatingTupleList(arity, list.subList(fromIndex, toIndex)); - } - - @Override - public List get(int index) { - return list.get(index); - } - - @Override - public int size() { - return list.size(); - } - - public List slice(final int column) { - return new AbstractList() { - @Override - public Member get(int index) { - return list.get(index).get(column); - } - @Override - public int size() { - return list.size(); - } - public Member set(int index, Member element) { - List subList = list.get(index); - if (subList.size() == 1) { - // The sub list is probably a singleton list. - // calling set() on it will callOutFail. We have to - // create a new singleton list. - return list.set(index, Collections.singletonList(element)) - .get(0); - } - return subList.set(column, element); - }; - }; - } - - public TupleList cloneList(int capacity) { - return new DelegatingTupleList( - arity, - capacity < 0 - ? new ArrayList<>(list) - : new ArrayList<>(capacity)); - } - - @Override - public List set(int index, List element) { - return list.set(index, element); - } - - @Override - public void add(int index, List element) { - list.add(index, element); - } - - public void addTuple(Member... members) { - list.add(Util.flatList(members)); - } - - public TupleList project(final int[] destIndices) { - return new DelegatingTupleList( - destIndices.length, - new AbstractList>() { - public List get(final int index) { - return new AbstractList() { - public Member get(int column) { - return list.get(index).get(destIndices[column]); - } - - public int size() { - return destIndices.length; - } - - public Member set(int column, Member element) { - return list.get(index).set(index, element); - }; - }; - } - - public List set(int index, List element) { - return list.set(index, element); - }; - - public int size() { - return list.size(); - } - } - ); - } - - public TupleList withPositionCallback( - final PositionCallback positionCallback) - { - return new DelegatingTupleList( - arity, - new AbstractList>() { - @Override - public List get(int index) { - positionCallback.onPosition(index); - return list.get(index); - } - - @Override - public int size() { - return list.size(); - } - - @Override - public List set(int index, List element) { - positionCallback.onPosition(index); - return list.set(index, element); - } - - @Override - public void add(int index, List element) { - positionCallback.onPosition(index); - list.add(index, element); - } - - @Override - public List remove(int index) { - positionCallback.onPosition(index); - return list.remove(index); - } - } - ); - } - - @Override - public void setCount(int count) { - // TODO Auto-generated method stub - this.count = count; - } - - @Override - public int getCount() { - // TODO Auto-generated method stub - return count; - } -} - -// End DelegatingTupleList.java diff --git a/contact-center/app/src/main/java/mondrian/calc/impl/ListTupleList.java b/contact-center/app/src/main/java/mondrian/calc/impl/ListTupleList.java deleted file mode 100644 index e411db2f..00000000 --- a/contact-center/app/src/main/java/mondrian/calc/impl/ListTupleList.java +++ /dev/null @@ -1,161 +0,0 @@ -/* -* This software is subject to the terms of the Eclipse Public License v1.0 -* Agreement, available at the following URL: -* http://www.eclipse.org/legal/epl-v10.html. -* You must accept the terms of that agreement to use this software. -* -* Copyright (c) 2002-2013 Pentaho Corporation.. All rights reserved. -*/ - -package mondrian.calc.impl; - -import mondrian.calc.TupleIterator; -import mondrian.calc.TupleList; -import mondrian.olap.Member; -import mondrian.olap.Util; - -import java.util.*; - -/** - * Implementation of {@link mondrian.calc.TupleList} that stores tuples - * end-to-end in a backing list. - * - *

- * l1: {A,B,C},{D,E,F}
- * l2: {a,b},{c,d},{e,f}
- *
- * externally looks like:
- *  [] <- {A,B,C,a,b}
- *  [] <- {A,B,C,c,d}
- *  [] <- {A,B,C,e,f}
- *  [] <- {D,E,F,a,b}
- *  [] <- {D,E,F,c,d}
- *  [] <- {D,E,F,e,d}
- *
- * but internally is:
- *  A,B,C,a,b,A,B,C,c,d,A,B,C,e,f,D,E,F,a,b,D,E,F,c,d,D,E,F,e,d
- * 
- * - * @author jhyde - */ -public class ListTupleList extends AbstractEndToEndTupleList -{ - private final List list; - private int count; - /** - * Creates a ListTupleList. - * - * @param arity Arity - * @param list Backing list - */ - public ListTupleList(int arity, List list) { - super(arity); - this.list = list; - } - - protected List backingList() { - return list; - } - - public Member get(int slice, int index) { - return list.get(index * arity + slice); - } - - public List get(int index) { - final int startIndex = index * arity; - final List list1 = - new AbstractList() { - public Member get(int index) { - return list.get(startIndex + index); - } - - public int size() { - return arity; - } - }; - if (mutable) { - return Util.flatList(list1); - } - return list1; - } - - public void add(int index, List element) { - assert mutable; - list.addAll(index * arity, element); - } - - public void addTuple(Member... members) { - assert mutable; - list.addAll(Arrays.asList(members)); - } - - @Override - public void clear() { - assert mutable; - list.clear(); - } - - @Override - public List remove(int index) { - assert mutable; - for (int i = 0, n = index * arity; i < arity; i++) { - list.remove(n); - } - return null; // breach of List contract - } - - @Override - protected void removeRange(int fromIndex, int toIndex) { - assert mutable; - list.subList(fromIndex * arity, toIndex * arity).clear(); - } - - public int size() { - return list.size() / arity; - } - - public List slice(final int column) { - if (column < 0 || column >= arity) { - throw new IllegalArgumentException(); - } - return new AbstractList() { - @Override - public Member get(int index) { - return ListTupleList.this.get(column, index); - } - - @Override - public int size() { - return ListTupleList.this.size(); - } - }; - } - - public TupleList cloneList(int capacity) { - return new ListTupleList( - arity, - capacity < 0 - ? new ArrayList<>(list) - : new ArrayList<>(capacity * arity)); - } - - public TupleIterator tupleIteratorInternal() { - return new AbstractTupleListIterator(); - } - - @Override - public void setCount(int count) { - // TODO Auto-generated method stub - this.count = count; - } - - @Override - public int getCount() { - // TODO Auto-generated method stub - return count; - } - - -} - -// End ListTupleList.java diff --git a/contact-center/app/src/main/java/mondrian/calc/impl/UnaryTupleList.java b/contact-center/app/src/main/java/mondrian/calc/impl/UnaryTupleList.java deleted file mode 100644 index 3cc51507..00000000 --- a/contact-center/app/src/main/java/mondrian/calc/impl/UnaryTupleList.java +++ /dev/null @@ -1,273 +0,0 @@ -/* -* This software is subject to the terms of the Eclipse Public License v1.0 -* Agreement, available at the following URL: -* http://www.eclipse.org/legal/epl-v10.html. -* You must accept the terms of that agreement to use this software. -* -* Copyright (c) 2002-2013 Pentaho Corporation.. All rights reserved. -*/ - -package mondrian.calc.impl; - -import mondrian.calc.*; -import mondrian.olap.Evaluator; -import mondrian.olap.Member; - -import java.util.*; - -/** - * Implementation of {@link TupleList} where the tuples are unary (each tuple - * consists of just one {@link Member}). - * - *

It is implemented as a straightforward wrapper on a backing list. You - * can provide the backing list explicitly using the - * {@link #UnaryTupleList(java.util.List)} constructor, and you can access the - * backing list by calling {@link #slice}(0). - * - * @author jhyde -*/ -public class UnaryTupleList - extends AbstractList> - implements TupleList -{ - final List list; - private int count; - /** - * Creates an empty UnaryTupleList. - */ - public UnaryTupleList() { - this(new ArrayList<>()); - } - - /** - * Creates a UnaryTupleList with a given backing list. - * - * @param list Backing list - */ - public UnaryTupleList(List list) { - this.list = list; - } - - public Member get(int slice, int index) { - assert slice == 0; - return list.get(index); - } - - @Override - public List get(int index) { - return Collections.singletonList(list.get(index)); - } - - @Override - public void add(int index, List element) { - list.add(index, element.get(0)); - } - - @Override - public boolean add(List element) { - return list.add(element.get(0)); - } - - public TupleList fix() { - return this; - } - - @Override - public List set(int index, List element) { - final Member member = list.set(index, element.get(0)); - return member == null - ? null - : Collections.singletonList(member); - } - - @Override - public List remove(int index) { - final Member member = list.remove(index); - return member == null - ? null - : Collections.singletonList(member); - } - - @Override - public void clear() { - list.clear(); - } - - @Override - public int size() { - return list.size(); - } - - public int getArity() { - return 1; - } - - public List slice(int column) { - return list; - } - - public TupleList cloneList(int capacity) { - return new UnaryTupleList( - capacity < 0 - ? new ArrayList<>(list) - : new ArrayList<>(capacity)); - } - - public TupleCursor tupleCursor() { - return tupleIterator(); - } - - public TupleIterator tupleIterator() { - return new UnaryIterator(); - } - - public final Iterator> iterator() { - return tupleIterator(); - } - - public TupleList project(int[] destIndices) { - // REVIEW: Is 0-ary valid? - assert destIndices.length == 1; - assert destIndices[0] == 0; - return this; - } - - public void addTuple(Member... members) { - assert members.length == 1; - list.add(members[0]); - } - - public void addCurrent(TupleCursor tupleIter) { - list.add(tupleIter.member(0)); - } - - @Override - public TupleList subList(int fromIndex, int toIndex) { - return new ListTupleList( - 1, - list.subList(fromIndex, toIndex)); - } - - public TupleList withPositionCallback( - final PositionCallback positionCallback) - { - return new UnaryTupleList( - new AbstractList() { - public Member get(int index) { - positionCallback.onPosition(index); - return list.get(index); - } - - public int size() { - return list.size(); - } - - public Member set(int index, Member element) { - positionCallback.onPosition(index); - return list.set(index, element); - } - - public void add(int index, Member element) { - positionCallback.onPosition(index); - list.add(index, element); - } - - public Member remove(int index) { - positionCallback.onPosition(index); - return list.remove(index); - } - } - ); - } - - /** - * Implementation of {@link mondrian.calc.TupleIterator} for {@link UnaryTupleList}. - * Based upon AbstractList.Itr, but with concurrent modification checking - * removed. - */ - private class UnaryIterator implements TupleIterator { - /** - * Index of element to be returned by subsequent call to next. - */ - int cursor = 0; - - /** - * Index of element returned by most recent call to next or - * previous. Reset to -1 if this element is deleted by a call - * to remove. - */ - int lastRet = -1; - - public boolean hasNext() { - return cursor != size(); - } - - public List next() { - try { - List next = get(cursor); - lastRet = cursor++; - return next; - } catch (IndexOutOfBoundsException e) { - throw new NoSuchElementException(); - } - } - - public void currentToArray(Member[] members, int offset) { - members[offset] = list.get(lastRet); - } - - public boolean forward() { - if (cursor == size()) { - return false; - } - lastRet = cursor++; - return true; - } - - public List current() { - return get(lastRet); - } - - public int getArity() { - return 1; - } - - public void remove() { - if (lastRet == -1) { - throw new IllegalStateException(); - } - try { - UnaryTupleList.this.remove(lastRet); - if (lastRet < cursor) { - cursor--; - } - lastRet = -1; - } catch (IndexOutOfBoundsException e) { - throw new ConcurrentModificationException(); - } - } - - public void setContext(Evaluator evaluator) { - evaluator.setContext(list.get(lastRet)); - } - - public Member member(int column) { - assert column == 0; - return list.get(lastRet); - } - } - - @Override - public int getCount() { - // TODO Auto-generated method stub - return count; - } - - @Override - public void setCount(int count) { - // TODO Auto-generated method stub - this.count = count; - } -} - -// End UnaryTupleList.java diff --git a/contact-center/app/src/main/java/mondrian/olap/Axis.java b/contact-center/app/src/main/java/mondrian/olap/Axis.java deleted file mode 100644 index 1d66f71b..00000000 --- a/contact-center/app/src/main/java/mondrian/olap/Axis.java +++ /dev/null @@ -1,27 +0,0 @@ -/* -// This software is subject to the terms of the Eclipse Public License v1.0 -// Agreement, available at the following URL: -// http://www.eclipse.org/legal/epl-v10.html. -// You must accept the terms of that agreement to use this software. -// -// Copyright (C) 2001-2005 Julian Hyde -// Copyright (C) 2005-2007 Pentaho and others -// All Rights Reserved. -*/ - -package mondrian.olap; - -import java.util.List; - -/** - * A Axis is a component of a {@link Result}. - * It contains a list of {@link Position}s. - * - * @author jhyde - * @since 6 August, 2001 - */ -public interface Axis { - int getDataSize(); - List getPositions(); -} -// End Axis.java diff --git a/contact-center/app/src/main/java/mondrian/olap/Util.java b/contact-center/app/src/main/java/mondrian/olap/Util.java deleted file mode 100644 index c128071f..00000000 --- a/contact-center/app/src/main/java/mondrian/olap/Util.java +++ /dev/null @@ -1,4472 +0,0 @@ -/* -// This software is subject to the terms of the Eclipse Public License v1.0 -// Agreement, available at the following URL: -// http://www.eclipse.org/legal/epl-v10.html. -// You must accept the terms of that agreement to use this software. -// -// Copyright (C) 2001-2005 Julian Hyde -// Copyright (C) 2005-2013 Pentaho and others -// All Rights Reserved. -*/ -package mondrian.olap; - -import mondrian.mdx.*; -import mondrian.olap.fun.FunUtil; -import mondrian.olap.fun.Resolver; -import mondrian.olap.type.Type; -import mondrian.resource.MondrianResource; -import mondrian.rolap.*; -import mondrian.spi.UserDefinedFunction; -import mondrian.util.*; - -import org.apache.commons.collections.keyvalue.AbstractMapEntry; -import org.apache.commons.vfs.*; -import org.apache.commons.vfs.provider.http.HttpFileObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.eigenbase.xom.XOMUtil; - -import org.olap4j.impl.Olap4jUtil; -import org.olap4j.mdx.*; - -import java.io.*; -import java.lang.ref.Reference; -import java.lang.reflect.*; -import java.lang.reflect.Array; -import java.math.BigDecimal; -import java.net.MalformedURLException; -import java.net.URL; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.sql.*; -import java.sql.Connection; -import java.util.*; -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Utility functions used throughout mondrian. All methods are static. - * - * @author jhyde - * @since 6 August, 2001 - */ -public class Util extends XOMUtil { - - public static final String nl = System.getProperty("line.separator"); - - private static final Logger LOGGER = LoggerFactory.getLogger(Util.class); - - /** - * Placeholder which indicates a value NULL. - */ - public static final Object nullValue = FunUtil.DoubleNull; - - /** - * Placeholder which indicates an EMPTY value. - */ - public static final Object EmptyValue = FunUtil.DoubleEmpty; - - /** - * Cumulative time spent accessing the database. - */ - private static long databaseMillis = 0; - - /** - * Random number generator to provide seed for other random number - * generators. - */ - private static final Random metaRandom = - createRandom(MondrianProperties.instance().TestSeed.get()); - - /** Unique id for this JVM instance. Part of a key that ensures that if - * two JVMs in the same cluster have a data-source with the same - * identity-hash-code, they will be treated as different data-sources, - * and therefore caches will not be incorrectly shared. */ - public static final UUID JVM_INSTANCE_UUID = UUID.randomUUID(); - - /** - * Whether we are running a version of Java before 1.5. - * - *

If (but not only if) this variable is true, {@link #Retrowoven} will - * also be true. - */ - public static final boolean PreJdk15 = - System.getProperty("java.version").startsWith("1.4"); - - /** - * Whether we are running a version of Java before 1.6. - */ - public static final boolean PreJdk16 = - PreJdk15 - || System.getProperty("java.version").startsWith("1.5"); - - /** - * Whether this is an IBM JVM. - */ - public static final boolean IBM_JVM = - System.getProperties().getProperty("java.vendor").equals( - "IBM Corporation"); - - /** - * What version of JDBC? - * Returns:

    - *
  • 0x0401 in JDK 1.7 and higher
  • - *
  • 0x0400 in JDK 1.6
  • - *
  • 0x0300 otherwise
  • - *
- */ - public static final int JdbcVersion = - System.getProperty("java.version").compareTo("1.7") >= 0 - ? 0x0401 - : System.getProperty("java.version").compareTo("1.6") >= 0 - ? 0x0400 - : 0x0300; - - /** - * Whether the code base has re-engineered using retroweaver. - * If this is the case, some functionality is not available, but a lot of - * things are available via {@link mondrian.util.UtilCompatible}. - * Retroweaver has some problems involving {@link java.util.EnumSet}. - */ - public static final boolean Retrowoven = - Access.class.getSuperclass().getName().equals( - "net.sourceforge.retroweaver.runtime.java.lang.Enum"); - - private static final UtilCompatible compatible; - - /** - * Flag to control expensive debugging. (More expensive than merely - * enabling assertions: as we know, a lot of people run with assertions - * enabled.) - */ - public static final boolean DEBUG = false; - - static { - String className; - if (PreJdk15 || Retrowoven) { - className = "mondrian.util.UtilCompatibleJdk14"; - } else if (PreJdk16) { - className = "mondrian.util.UtilCompatibleJdk15"; - } else { - className = "mondrian.util.UtilCompatibleJdk16"; - } - compatible = ClassResolver.INSTANCE.instantiateSafe(className); - } - - public static boolean isNull(Object o) { - return o == null || o == nullValue; - } - - /** - * Returns whether a list is strictly sorted. - * - * @param list List - * @return whether list is sorted - */ - public static boolean isSorted(List list) { - T prev = null; - for (T t : list) { - if (prev != null - && ((Comparable) prev).compareTo(t) >= 0) - { - return false; - } - prev = t; - } - return true; - } - - /** - * Parses a string and returns a SHA-256 checksum of it. - * - * @param value The source string to parse. - * @return A checksum of the source string. - */ - public static byte[] digestSha256(String value) { - final MessageDigest algorithm; - try { - algorithm = MessageDigest.getInstance("SHA-256"); - } catch (NoSuchAlgorithmException e) { - throw new RuntimeException(e); - } - return algorithm.digest(value.getBytes()); - } - - /** - * Creates an MD5 hash of a String. - * - * @param value String to create one way hash upon. - * @return MD5 hash. - */ - public static byte[] digestMd5(final String value) { - final MessageDigest algorithm; - try { - algorithm = MessageDigest.getInstance("MD5"); - } catch (NoSuchAlgorithmException e) { - throw new RuntimeException(e); - } - return algorithm.digest(value.getBytes()); - } - - /** - * Creates an {@link ExecutorService} object backed by a thread pool. - * @param maximumPoolSize Maximum number of concurrent - * threads. - * @param corePoolSize Minimum number of concurrent - * threads to maintain in the pool, even if they are - * idle. - * @param keepAliveTime Time, in seconds, for which to - * keep alive unused threads. - * @param name The name of the threads. - * @param rejectionPolicy The rejection policy to enforce. - * @return An executor service preconfigured. - */ - public static ExecutorService getExecutorService( - int maximumPoolSize, - int corePoolSize, - long keepAliveTime, - final String name, - RejectedExecutionHandler rejectionPolicy) - { - if (Util.PreJdk16) { - // On JDK1.5, if you specify corePoolSize=0, nothing gets executed. - // Bummer. - corePoolSize = Math.max(corePoolSize, 1); - } - - // We must create a factory where the threads - // have the right name and are marked as daemon threads. - final ThreadFactory factory = - new ThreadFactory() { - private final AtomicInteger counter = new AtomicInteger(0); - public Thread newThread(Runnable r) { - final Thread t = - Executors.defaultThreadFactory().newThread(r); - t.setDaemon(true); - t.setName(name + '_' + counter.incrementAndGet()); - return t; - } - }; - - // Ok, create the executor - final ThreadPoolExecutor executor = - new ThreadPoolExecutor( - corePoolSize, - maximumPoolSize > 0 - ? maximumPoolSize - : Integer.MAX_VALUE, - keepAliveTime, - TimeUnit.SECONDS, - // we use a sync queue. any other type of queue - // will prevent the tasks from running concurrently - // because the executors API requires blocking queues. - // Important to pass true here. This makes the - // order of tasks deterministic. - // TODO Write a non-blocking queue which implements - // the blocking queue API so we can pass that to the - // executor. - new SynchronousQueue<>(true), - factory); - - // Set the rejection policy if required. - if (rejectionPolicy != null) { - executor.setRejectedExecutionHandler( - rejectionPolicy); - } - - // Done - return executor; - } - - /** - * Creates an {@link ScheduledExecutorService} object backed by a - * thread pool with a fixed number of threads.. - * @param maxNbThreads Maximum number of concurrent - * threads. - * @param name The name of the threads. - * @return An scheduled executor service preconfigured. - */ - public static ScheduledExecutorService getScheduledExecutorService( - final int maxNbThreads, - final String name) - { - return Executors.newScheduledThreadPool( - maxNbThreads, - new ThreadFactory() { - final AtomicInteger counter = new AtomicInteger(0); - public Thread newThread(Runnable r) { - final Thread thread = - Executors.defaultThreadFactory().newThread(r); - thread.setDaemon(true); - thread.setName(name + '_' + counter.incrementAndGet()); - return thread; - } - } - ); - } - - /** - * Encodes string for MDX (escapes ] as ]] inside a name). - * - * @deprecated Will be removed in 4.0 - */ - public static String mdxEncodeString(String st) { - StringBuilder retString = new StringBuilder(st.length() + 20); - for (int i = 0; i < st.length(); i++) { - char c = st.charAt(i); - if ((c == ']') - && ((i + 1) < st.length()) - && (st.charAt(i + 1) != '.')) - { - retString.append(']'); // escaping character - } - retString.append(c); - } - return retString.toString(); - } - - /** - * Converts a string into a double-quoted string. - */ - public static String quoteForMdx(String val) { - StringBuilder buf = new StringBuilder(val.length() + 20); - quoteForMdx(buf, val); - return buf.toString(); - } - - /** - * Appends a double-quoted string to a string builder. - */ - public static void quoteForMdx(StringBuilder buf, String val) { - buf.append("\""); - String s0 = replace(val, "\"", "\"\""); - buf.append(s0); - buf.append("\""); - } - - /** - * Return string quoted in [...]. For example, "San Francisco" becomes - * "[San Francisco]"; "a [bracketed] string" becomes - * "[a [bracketed]] string]". - */ - public static String quoteMdxIdentifier(String id) { - StringBuilder buf = new StringBuilder(id.length() + 20); - quoteMdxIdentifier(id, buf); - return buf.toString(); - } - - public static void quoteMdxIdentifier(String id, StringBuilder buf) { - buf.append('['); - int start = buf.length(); - buf.append(id); - replace(buf, start, "]", "]]"); - buf.append(']'); - } - - /** - * Return identifiers quoted in [...].[...]. For example, {"Store", "USA", - * "California"} becomes "[Store].[USA].[California]". - */ - public static String quoteMdxIdentifier(List ids) { - StringBuilder sb = new StringBuilder(64); - quoteMdxIdentifier(ids, sb); - return sb.toString(); - } - - public static void quoteMdxIdentifier( - List ids, - StringBuilder sb) - { - for (int i = 0; i < ids.size(); i++) { - if (i > 0) { - sb.append('.'); - } - ids.get(i).toString(sb); - } - } - - /** - * Quotes a string literal for Java or JavaScript. - * - * @param s Unquoted literal - * @return Quoted string literal - */ - public static String quoteJavaString(String s) { - return s == null - ? "null" - : "\"" - + s.replaceAll("\\\\", "\\\\\\\\") - .replaceAll("\\\"", "\\\\\"") - + "\""; - } - - /** - * Returns true if two objects are equal, or are both null. - * - * @param s First object - * @param t Second object - * @return Whether objects are equal or both null - */ - public static boolean equals(Object s, Object t) { - if (s == t) { - return true; - } - if (s == null || t == null) { - return false; - } - return s.equals(t); - } - - /** - * Returns true if two strings are equal, or are both null. - * - *

The result is not affected by - * {@link MondrianProperties#CaseSensitive the case sensitive option}; if - * you wish to compare names, use {@link #equalName(String, String)}. - */ - public static boolean equals(String s, String t) { - return equals((Object) s, (Object) t); - } - - /** - * Returns whether two names are equal. - * Takes into account the - * {@link MondrianProperties#CaseSensitive case sensitive option}. - * Names may be null. - */ - public static boolean equalName(String s, String t) { - if (s == null) { - return t == null; - } - boolean caseSensitive = - MondrianProperties.instance().CaseSensitive.get(); - return caseSensitive ? s.equals(t) : s.equalsIgnoreCase(t); - } - - /** - * Tests two strings for equality, optionally ignoring case. - * - * @param s First string - * @param t Second string - * @param matchCase Whether to perform case-sensitive match - * @return Whether strings are equal - */ - public static boolean equal(String s, String t, boolean matchCase) { - return matchCase ? s.equals(t) : s.equalsIgnoreCase(t); - } - - /** - * Compares two names. if case sensitive flag is false, - * apply finer grain difference with case sensitive - * Takes into account the {@link MondrianProperties#CaseSensitive case - * sensitive option}. - * Names must not be null. - */ - public static int caseSensitiveCompareName(String s, String t) { - boolean caseSensitive = - MondrianProperties.instance().CaseSensitive.get(); - if (caseSensitive) { - return s.compareTo(t); - } else { - int v = s.compareToIgnoreCase(t); - // if ignore case returns 0 compare in a case sensitive manner - // this was introduced to solve an issue with Member.equals() - // and Member.compareTo() not agreeing with each other - return v == 0 ? s.compareTo(t) : v; - } - } - - /** - * Compares two names. - * Takes into account the {@link MondrianProperties#CaseSensitive case - * sensitive option}. - * Names must not be null. - */ - public static int compareName(String s, String t) { - boolean caseSensitive = - MondrianProperties.instance().CaseSensitive.get(); - return caseSensitive ? s.compareTo(t) : s.compareToIgnoreCase(t); - } - - /** - * Generates a normalized form of a name, for use as a key into a map. - * Returns the upper case name if - * {@link MondrianProperties#CaseSensitive} is true, the name unchanged - * otherwise. - */ - public static String normalizeName(String s) { - return MondrianProperties.instance().CaseSensitive.get() - ? s - : s.toUpperCase(); - } - - /** - * Returns the result of ((Comparable) k1).compareTo(k2), with - * special-casing for the fact that Boolean only became - * comparable in JDK 1.5. - * - * @see Comparable#compareTo - */ - public static int compareKey(Object k1, Object k2) { - if (k1 instanceof Boolean) { - // Luckily, "F" comes before "T" in the alphabet. - k1 = k1.toString(); - k2 = k2.toString(); - } - return ((Comparable) k1).compareTo(k2); - } - - /** - * Compares integer values. - * - * @param i0 First integer - * @param i1 Second integer - * @return Comparison of integers - */ - public static int compare(int i0, int i1) { - return i0 < i1 ? -1 : (i0 == i1 ? 0 : 1); - } - - /** - * Returns a string with every occurrence of a seek string replaced with - * another. - */ - public static String replace(String s, String find, String replace) { - // let's be optimistic - if(s==null) return s; - int found = s.indexOf(find); - if (found == -1) { - return s; - } - StringBuilder sb = new StringBuilder(s.length() + 20); - int start = 0; - char[] chars = s.toCharArray(); - final int step = find.length(); - if (step == 0) { - // Special case where find is "". - sb.append(s); - replace(sb, 0, find, replace); - } else { - for (;;) { - sb.append(chars, start, found - start); - if (found == s.length()) { - break; - } - sb.append(replace); - start = found + step; - found = s.indexOf(find, start); - if (found == -1) { - found = s.length(); - } - } - } - return sb.toString(); - } - - /** - * Replaces all occurrences of a string in a buffer with another. - * - * @param buf String buffer to act on - * @param start Ordinal within find to start searching - * @param find String to find - * @param replace String to replace it with - */ - public static void replace( - StringBuilder buf, - int start, - String find, - String replace) - { - // Search and replace from the end towards the start, to avoid O(n ^ 2) - // copying if the string occurs very commonly. - int findLength = find.length(); - if (findLength == 0) { - // Special case where the seek string is empty. - for (int j = buf.length(); j >= 0; --j) { - buf.insert(j, replace); - } - return; - } - int k = buf.length(); - while (k > 0) { - int i = buf.lastIndexOf(find, k); - if (i < start) { - break; - } - buf.replace(i, i + find.length(), replace); - // Step back far enough to ensure that the beginning of the section - // we just replaced does not cause a match. - k = i - findLength; - } - } - - /** - * Parses an MDX identifier such as [Foo].[Bar].Baz.&Key&Key2 - * and returns the result as a list of segments. - * - * @param s MDX identifier - * @return List of segments - */ - public static List parseIdentifier(String s) { - return convert( - org.olap4j.impl.IdentifierParser.parseIdentifier(s)); - } - - /** - * Converts an array of name parts {"part1", "part2"} into a single string - * "[part1].[part2]". If the names contain "]" they are escaped as "]]". - */ - public static String implode(List names) { - StringBuilder sb = new StringBuilder(64); - for (int i = 0; i < names.size(); i++) { - if (i > 0) { - sb.append("."); - } - // FIXME: should be: - // names.get(i).toString(sb); - // but that causes some tests to callOutFail - Id.Segment segment = names.get(i); - switch (segment.getQuoting()) { - case UNQUOTED: - segment = new Id.NameSegment(((Id.NameSegment) segment).name); - } - segment.toString(sb); - } - return sb.toString(); - } - - public static String makeFqName(String name) { - return quoteMdxIdentifier(name); - } - - public static String makeFqName(OlapElement parent, String name) { - if (parent == null) { - return Util.quoteMdxIdentifier(name); - } else { - StringBuilder buf = new StringBuilder(64); - buf.append(parent.getUniqueName()); - buf.append('.'); - Util.quoteMdxIdentifier(name, buf); - return buf.toString(); - } - } - - public static String makeFqName(String parentUniqueName, String name) { - if (parentUniqueName == null) { - return quoteMdxIdentifier(name); - } else { - StringBuilder buf = new StringBuilder(64); - buf.append(parentUniqueName); - buf.append('.'); - Util.quoteMdxIdentifier(name, buf); - return buf.toString(); - } - } - - public static OlapElement lookupCompound( - SchemaReader schemaReader, - OlapElement parent, - List names, - boolean failIfNotFound, - int category) - { - return lookupCompound( - schemaReader, parent, names, failIfNotFound, category, - MatchType.EXACT); - } - - /** - * Resolves a name such as - * '[Products].[Product Department].[Produce]' by resolving the - * components ('Products', and so forth) one at a time. - * - * @param schemaReader Schema reader, supplies access-control context - * @param parent Parent element to search in - * @param names Exploded compound name, such as {"Products", - * "Product Department", "Produce"} - * @param failIfNotFound If the element is not found, determines whether - * to return null or throw an error - * @param category Type of returned element, a {@link Category} value; - * {@link Category#Unknown} if it doesn't matter. - * - * @pre parent != null - * @post !(failIfNotFound && return == null) - * - * @see #parseIdentifier(String) - */ - public static OlapElement lookupCompound( - SchemaReader schemaReader, - OlapElement parent, - List names, - boolean failIfNotFound, - int category, - MatchType matchType) - { - Util.assertPrecondition(parent != null, "parent != null"); - - if (LOGGER.isDebugEnabled()) { - StringBuilder buf = new StringBuilder(64); - buf.append("Util.lookupCompound: "); - buf.append("parent.name="); - buf.append(parent.getName()); - buf.append(", category="); - buf.append(Category.instance.getName(category)); - buf.append(", names="); - quoteMdxIdentifier(names, buf); - LOGGER.debug(buf.toString()); - } - - // First look up a member from the cache of calculated members - // (cubes and queries both have them). - switch (category) { - case Category.Member: - case Category.Unknown: - Member member = schemaReader.getCalculatedMember(names); - if (member != null) { - return member; - } - } - // Likewise named set. - switch (category) { - case Category.Set: - case Category.Unknown: - NamedSet namedSet = schemaReader.getNamedSet(names); - if (namedSet != null) { - return namedSet; - } - } - - // Now resolve the name one part at a time. - for (int i = 0; i < names.size(); i++) { - OlapElement child; - Id.NameSegment name; - if (names.get(i) instanceof Id.NameSegment) { - name = (Id.NameSegment) names.get(i); - child = schemaReader.getElementChild(parent, name, matchType); - } else if (parent instanceof RolapLevel - && names.get(i) instanceof Id.KeySegment - && names.get(i).getKeyParts().size() == 1) - { - // The following code is for SsasCompatibleNaming=false. - // Continues the very limited support for key segments in - // mondrian-3.x. To be removed in mondrian-4, when - // SsasCompatibleNaming=true is the only option. - final Id.KeySegment keySegment = (Id.KeySegment) names.get(i); - name = keySegment.getKeyParts().get(0); - final List levelMembers = - schemaReader.getLevelMembers( - (Level) parent, false); - child = null; - for (Member member : levelMembers) { - if (((RolapMember) member).getKey().toString().equals( - name.getName())) - { - child = member; - break; - } - } - } else { - name = null; - child = schemaReader.getElementChild(parent, name, matchType); - } - // if we're doing a non-exact match, and we find a non-exact - // match, then for an after match, return the first child - // of each subsequent level; for a before match, return the - // last child - if (child instanceof Member - && !matchType.isExact() - && !Util.equalName(child.getName(), name.getName())) - { - Member bestChild = (Member) child; - for (int j = i + 1; j < names.size(); j++) { - List childrenList = - schemaReader.getMemberChildren(bestChild); - FunUtil.hierarchizeMemberList(childrenList, false); - if (matchType == MatchType.AFTER) { - bestChild = childrenList.get(0); - } else { - bestChild = - childrenList.get(childrenList.size() - 1); - } - if (bestChild == null) { - child = null; - break; - } - } - parent = bestChild; - break; - } - if (child == null) { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug( - "Util.lookupCompound: " - + "parent.name=" - + parent.getName() - + " has no child with name=" - + name); - } - - if (!failIfNotFound) { - return null; - } else if (category == Category.Member) { - throw MondrianResource.instance().MemberNotFound.ex( - quoteMdxIdentifier(names)); - } else { - throw MondrianResource.instance().MdxChildObjectNotFound - .ex(name.toString(), parent.getQualifiedName()); - } - } - parent = child; - if (matchType == MatchType.EXACT_SCHEMA) { - matchType = MatchType.EXACT; - } - } - if (LOGGER.isDebugEnabled()) { - LOGGER.debug( - "Util.lookupCompound: " - + "found child.name=" - + parent.getName() - + ", child.class=" - + parent.getClass().getName()); - } - - switch (category) { - case Category.Dimension: - if (parent instanceof Dimension) { - return parent; - } else if (parent instanceof Hierarchy) { - return parent.getDimension(); - } else if (failIfNotFound) { - throw Util.newError( - "Can not find dimension '" + implode(names) + "'"); - } else { - return null; - } - case Category.Hierarchy: - if (parent instanceof Hierarchy) { - return parent; - } else if (parent instanceof Dimension) { - return parent.getHierarchy(); - } else if (failIfNotFound) { - throw Util.newError( - "Can not find hierarchy '" + implode(names) + "'"); - } else { - return null; - } - case Category.Level: - if (parent instanceof Level) { - return parent; - } else if (failIfNotFound) { - throw Util.newError( - "Can not find level '" + implode(names) + "'"); - } else { - return null; - } - case Category.Member: - if (parent instanceof Member) { - return parent; - } else if (failIfNotFound) { - throw MondrianResource.instance().MdxCantFindMember.ex( - implode(names)); - } else { - return null; - } - case Category.Unknown: - assertPostcondition(parent != null, "return != null"); - return parent; - default: - throw newInternal("Bad switch " + category); - } - } - - public static OlapElement lookup(Query q, List nameParts) { - final Exp exp = lookup(q, nameParts, false); - if (exp instanceof MemberExpr) { - MemberExpr memberExpr = (MemberExpr) exp; - return memberExpr.getMember(); - } else if (exp instanceof LevelExpr) { - LevelExpr levelExpr = (LevelExpr) exp; - return levelExpr.getLevel(); - } else if (exp instanceof HierarchyExpr) { - HierarchyExpr hierarchyExpr = (HierarchyExpr) exp; - return hierarchyExpr.getHierarchy(); - } else if (exp instanceof DimensionExpr) { - DimensionExpr dimensionExpr = (DimensionExpr) exp; - return dimensionExpr.getDimension(); - } else { - throw Util.newInternal("Not an olap element: " + exp); - } - } - - /** - * Converts an identifier into an expression by resolving its parts into - * an OLAP object (dimension, hierarchy, level or member) within the - * context of a query. - * - *

If allowProp is true, also allows property references - * from valid members, for example - * [Measures].[Unit Sales].FORMATTED_VALUE. - * In this case, the result will be a {@link mondrian.mdx.ResolvedFunCall}. - * - * @param q Query expression belongs to - * @param nameParts Parts of the identifier - * @param allowProp Whether to allow property references - * @return OLAP object or property reference - */ - public static Exp lookup( - Query q, - List nameParts, - boolean allowProp) - { - return lookup(q, q.getSchemaReader(true), nameParts, allowProp); - } - - /** - * Converts an identifier into an expression by resolving its parts into - * an OLAP object (dimension, hierarchy, level or member) within the - * context of a query. - * - *

If allowProp is true, also allows property references - * from valid members, for example - * [Measures].[Unit Sales].FORMATTED_VALUE. - * In this case, the result will be a {@link ResolvedFunCall}. - * - * @param q Query expression belongs to - * @param schemaReader Schema reader - * @param segments Parts of the identifier - * @param allowProp Whether to allow property references - * @return OLAP object or property reference - */ - public static Exp lookup( - Query q, - SchemaReader schemaReader, - List segments, - boolean allowProp) - { - // First, look for a calculated member defined in the query. - final String fullName = quoteMdxIdentifier(segments); - // Look for any kind of object (member, level, hierarchy, - // dimension) in the cube. Use a schema reader without restrictions. - final SchemaReader schemaReaderSansAc = - schemaReader.withoutAccessControl().withLocus(); - final Cube cube = q.getCube(); - OlapElement olapElement = - schemaReaderSansAc.lookupCompound( - cube, segments, false, Category.Unknown); - if (olapElement != null) { - Role role = schemaReader.getRole(); - if (!role.canAccess(olapElement)) { - olapElement = null; - } - if (olapElement instanceof Member) { - olapElement = - schemaReader.substitute((Member) olapElement); - } - } - if (olapElement == null) { - if (allowProp && segments.size() > 1) { - List segmentsButOne = - segments.subList(0, segments.size() - 1); - final Id.Segment lastSegment = last(segments); - final String propertyName = - lastSegment instanceof Id.NameSegment - ? ((Id.NameSegment) lastSegment).getName() - : null; - final Member member = - (Member) schemaReaderSansAc.lookupCompound( - cube, segmentsButOne, false, Category.Member); - if (member != null - && propertyName != null - && isValidProperty(propertyName, member.getLevel())) - { - return new UnresolvedFunCall( - propertyName, Syntax.Property, new Exp[] { - createExpr(member)}); - } - final Level level = - (Level) schemaReaderSansAc.lookupCompound( - cube, segmentsButOne, false, Category.Level); - if (level != null - && propertyName != null - && isValidProperty(propertyName, level)) - { - return new UnresolvedFunCall( - propertyName, Syntax.Property, new Exp[] { - createExpr(level)}); - } - } - // if we're in the middle of loading the schema, the property has - // been set to ignore invalid members, and the member is - // non-existent, return the null member corresponding to the - // hierarchy of the element we're looking for; locate the - // hierarchy by incrementally truncating the name of the element - if (q.ignoreInvalidMembers()) { - int nameLen = segments.size() - 1; - olapElement = null; - while (nameLen > 0 && olapElement == null) { - List partialName = - segments.subList(0, nameLen); - olapElement = schemaReaderSansAc.lookupCompound( - cube, partialName, false, Category.Unknown); - nameLen--; - } - if (olapElement != null) { - olapElement = olapElement.getHierarchy().getNullMember(); - } else { - throw MondrianResource.instance().MdxChildObjectNotFound.ex( - fullName, cube.getQualifiedName()); - } - } else { - throw MondrianResource.instance().MdxChildObjectNotFound.ex( - fullName, cube.getQualifiedName()); - } - } - // keep track of any measure members referenced; these will be used - // later to determine if cross joins on virtual cubes can be - // processed natively - q.addMeasuresMembers(olapElement); - return createExpr(olapElement); - } - - /** - * Looks up a cube in a schema reader. - * - * @param cubeName Cube name - * @param fail Whether to callOutFail if not found. - * @return Cube, or null if not found - */ - static Cube lookupCube( - SchemaReader schemaReader, - String cubeName, - boolean fail) - { - for (Cube cube : schemaReader.getCubes()) { - if (Util.compareName(cube.getName(), cubeName) == 0) { - return cube; - } - } - if (fail) { - throw MondrianResource.instance().MdxCubeNotFound.ex(cubeName); - } - return null; - } - - /** - * Converts an olap element (dimension, hierarchy, level or member) into - * an expression representing a usage of that element in an MDX statement. - */ - public static Exp createExpr(OlapElement element) - { - if (element instanceof Member) { - Member member = (Member) element; - return new MemberExpr(member); - } else if (element instanceof Level) { - Level level = (Level) element; - return new LevelExpr(level); - } else if (element instanceof Hierarchy) { - Hierarchy hierarchy = (Hierarchy) element; - return new HierarchyExpr(hierarchy); - } else if (element instanceof Dimension) { - Dimension dimension = (Dimension) element; - return new DimensionExpr(dimension); - } else if (element instanceof NamedSet) { - NamedSet namedSet = (NamedSet) element; - return new NamedSetExpr(namedSet); - } else { - throw Util.newInternal("Unexpected element type: " + element); - } - } - - public static Member lookupHierarchyRootMember( - SchemaReader reader, Hierarchy hierarchy, Id.NameSegment memberName) - { - return lookupHierarchyRootMember( - reader, hierarchy, memberName, MatchType.EXACT); - } - - /** - * Finds a root member of a hierarchy with a given name. - * - * @param hierarchy Hierarchy - * @param memberName Name of root member - * @return Member, or null if not found - */ - public static Member lookupHierarchyRootMember( - SchemaReader reader, - Hierarchy hierarchy, - Id.NameSegment memberName, - MatchType matchType) - { - // Lookup member at first level. - // - // Don't use access control. Suppose we cannot see the 'nation' level, - // we still want to be able to resolve '[Customer].[USA].[CA]'. - List rootMembers = reader.getHierarchyRootMembers(hierarchy); - - // if doing an inexact search on a non-all hierarchy, create - // a member corresponding to the name we're searching for so - // we can use it in a hierarchical search - Member searchMember = null; - if (!matchType.isExact() - && !hierarchy.hasAll() - && !rootMembers.isEmpty()) - { - searchMember = - hierarchy.createMember( - null, - rootMembers.get(0).getLevel(), - memberName.name, - null); - } - - int bestMatch = -1; - int k = -1; - for (Member rootMember : rootMembers) { - ++k; - int rc; - // when searching on the ALL hierarchy, match must be exact - if (matchType.isExact() || hierarchy.hasAll()) { - rc = rootMember.getName().compareToIgnoreCase(memberName.name); - } else { - rc = FunUtil.compareSiblingMembers( - rootMember, - searchMember); - } - if (rc == 0) { - return rootMember; - } - if (!hierarchy.hasAll()) { - if (matchType == MatchType.BEFORE) { - if (rc < 0 - && (bestMatch == -1 - || FunUtil.compareSiblingMembers( - rootMember, - rootMembers.get(bestMatch)) > 0)) - { - bestMatch = k; - } - } else if (matchType == MatchType.AFTER) { - if (rc > 0 - && (bestMatch == -1 - || FunUtil.compareSiblingMembers( - rootMember, - rootMembers.get(bestMatch)) < 0)) - { - bestMatch = k; - } - } - } - } - - if (matchType == MatchType.EXACT_SCHEMA) { - return null; - } - - if (matchType != MatchType.EXACT && bestMatch != -1) { - return rootMembers.get(bestMatch); - } - // If the first level is 'all', lookup member at second level. For - // example, they could say '[USA]' instead of '[(All - // Customers)].[USA]'. - return (rootMembers.size() > 0 && rootMembers.get(0).isAll()) - ? reader.lookupMemberChildByName( - rootMembers.get(0), - memberName, - matchType) - : null; - } - - /** - * Finds a named level in this hierarchy. Returns null if there is no - * such level. - */ - public static Level lookupHierarchyLevel(Hierarchy hierarchy, String s) { - final Level[] levels = hierarchy.getLevels(); - for (Level level : levels) { - if (level.getName().equalsIgnoreCase(s)) { - return level; - } - } - return null; - } - - - - /** - * Finds the zero based ordinal of a Member among its siblings. - */ - public static int getMemberOrdinalInParent( - SchemaReader reader, - Member member) - { - Member parent = member.getParentMember(); - List siblings = - (parent == null) - ? reader.getHierarchyRootMembers(member.getHierarchy()) - : reader.getMemberChildren(parent); - - for (int i = 0; i < siblings.size(); i++) { - if (siblings.get(i).equals(member)) { - return i; - } - } - throw Util.newInternal( - "could not find member " + member + " amongst its siblings"); - } - - /** - * returns the first descendant on the level underneath parent. - * If parent = [Time].[1997] and level = [Time].[Month], then - * the member [Time].[1997].[Q1].[1] will be returned - */ - public static Member getFirstDescendantOnLevel( - SchemaReader reader, - Member parent, - Level level) - { - Member m = parent; - while (m.getLevel() != level) { - List children = reader.getMemberChildren(m); - m = children.get(0); - } - return m; - } - - /** - * Returns whether a string is null or empty. - */ - public static boolean isEmpty(String s) { - return (s == null) || (s.length() == 0); - } - - /** - * Encloses a value in single-quotes, to make a SQL string value. Examples: - * singleQuoteForSql(null) yields NULL; - * singleQuoteForSql("don't") yields 'don''t'. - */ - public static String singleQuoteString(String val) { - StringBuilder buf = new StringBuilder(64); - singleQuoteString(val, buf); - return buf.toString(); - } - - /** - * Encloses a value in single-quotes, to make a SQL string value. Examples: - * singleQuoteForSql(null) yields NULL; - * singleQuoteForSql("don't") yields 'don''t'. - */ - public static void singleQuoteString(String val, StringBuilder buf) { - buf.append('\''); - - String s0 = replace(val, "'", "''"); - buf.append(s0); - - buf.append('\''); - } - - /** - * Creates a random number generator. - * - * @param seed Seed for random number generator. - * If 0, generate a seed from the system clock and print the value - * chosen. (This is effectively non-deterministic.) - * If -1, generate a seed from an internal random number generator. - * (This is deterministic, but ensures that different tests have - * different seeds.) - * - * @return A random number generator. - */ - public static Random createRandom(long seed) { - if (seed == 0) { - seed = new Random().nextLong(); - System.out.println("random: seed=" + seed); - } else if (seed == -1 && metaRandom != null) { - seed = metaRandom.nextLong(); - } - return new Random(seed); - } - - /** - * Returns whether a property is valid for a member of a given level. - * It is valid if the property is defined at the level or at - * an ancestor level, or if the property is a standard property such as - * "FORMATTED_VALUE". - * - * @param propertyName Property name - * @param level Level - * @return Whether property is valid - */ - public static boolean isValidProperty( - String propertyName, - Level level) - { - return lookupProperty(level, propertyName) != null; - } - - /** - * Finds a member property called propertyName at, or above, - * level. - */ - public static Property lookupProperty( - Level level, - String propertyName) - { - do { - Property[] properties = level.getProperties(); - for (Property property : properties) { - if (property.getName().equals(propertyName)) { - return property; - } - } - level = level.getParentLevel(); - } while (level != null); - // Now try a standard property. - boolean caseSensitive = - MondrianProperties.instance().CaseSensitive.get(); - final Property property = Property.lookup(propertyName, caseSensitive); - if (property != null - && property.isMemberProperty() - && property.isStandard()) - { - return property; - } - return null; - } - - /** - * Insert a call to this method if you want to flag a piece of - * undesirable code. - * - * @deprecated - */ - public static T deprecated(T reason) { - throw new UnsupportedOperationException(reason.toString()); - } - - /** - * Insert a call to this method if you want to flag a piece of - * undesirable code. - * - * @deprecated - */ - public static T deprecated(T reason, boolean fail) { - if (fail) { - throw new UnsupportedOperationException(reason.toString()); - } else { - return reason; - } - } - - public static List addLevelCalculatedMembers( - SchemaReader reader, - Level level, - List members) - { - List calcMembers = - reader.getCalculatedMembers(level.getHierarchy()); - List calcMembersInThisLevel = new ArrayList<>(); - for (Member calcMember : calcMembers) { - if (calcMember.getLevel().equals(level)) { - calcMembersInThisLevel.add(calcMember); - } - } - if (!calcMembersInThisLevel.isEmpty()) { - List newMemberList = - new ConcatenableList<>(); - newMemberList.addAll(members); - newMemberList.addAll(calcMembersInThisLevel); - return newMemberList; - } - return members; - } - - /** - * Returns an exception which indicates that a particular piece of - * functionality should work, but a developer has not implemented it yet. - */ - public static RuntimeException needToImplement(Object o) { - throw new UnsupportedOperationException("need to implement " + o); - } - - /** - * Returns an exception indicating that we didn't expect to find this value - * here. - */ - public static > RuntimeException badValue( - Enum anEnum) - { - return Util.newInternal( - "Was not expecting value '" + anEnum - + "' for enumeration '" + anEnum.getDeclaringClass().getName() - + "' in this context"); - } - - /** - * Converts a list of SQL-style patterns into a Java regular expression. - * - *

For example, {"Foo_", "Bar%BAZ"} becomes "Foo.|Bar.*BAZ". - * - * @param wildcards List of SQL-style wildcard expressions - * @return Regular expression - */ - public static String wildcardToRegexp(List wildcards) { - StringBuilder buf = new StringBuilder(); - for (String value : wildcards) { - if (buf.length() > 0) { - buf.append('|'); - } - int i = 0; - while (true) { - int percent = value.indexOf('%', i); - int underscore = value.indexOf('_', i); - if (percent == -1 && underscore == -1) { - if (i < value.length()) { - buf.append(quotePattern(value.substring(i))); - } - break; - } - if (underscore >= 0 && (underscore < percent || percent < 0)) { - if (i < underscore) { - buf.append( - quotePattern(value.substring(i, underscore))); - } - buf.append('.'); - i = underscore + 1; - } else if (percent >= 0 - && (percent < underscore || underscore < 0)) - { - if (i < percent) { - buf.append( - quotePattern(value.substring(i, percent))); - } - buf.append(".*"); - i = percent + 1; - } else { - throw new IllegalArgumentException(); - } - } - } - return buf.toString(); - } - - /** - * Converts a camel-case name to an upper-case name with underscores. - * - *

For example, camelToUpper("FooBar") returns "FOO_BAR". - * - * @param s Camel-case string - * @return Upper-case string - */ - public static String camelToUpper(String s) { - StringBuilder buf = new StringBuilder(s.length() + 10); - int prevUpper = -1; - for (int i = 0; i < s.length(); ++i) { - char c = s.charAt(i); - if (Character.isUpperCase(c)) { - if (i > prevUpper + 1) { - buf.append('_'); - } - prevUpper = i; - } else { - c = Character.toUpperCase(c); - } - buf.append(c); - } - return buf.toString(); - } - - /** - * Parses a comma-separated list. - * - *

If a value contains a comma, escape it with a second comma. For - * example, parseCommaList("x,y,,z") returns - * {"x", "y,z"}. - * - * @param nameCommaList List of names separated by commas - * @return List of names - */ - public static List parseCommaList(String nameCommaList) { - if (nameCommaList.equals("")) { - return Collections.emptyList(); - } - if (nameCommaList.endsWith(",")) { - // Special treatment for list ending in ",", because split ignores - // entries after separator. - final String zzz = "zzz"; - final List list = parseCommaList(nameCommaList + zzz); - String last = list.get(list.size() - 1); - if (last.equals(zzz)) { - list.remove(list.size() - 1); - } else { - list.set( - list.size() - 1, - last.substring(0, last.length() - zzz.length())); - } - return list; - } - List names = new ArrayList<>(); - final String[] strings = nameCommaList.split(","); - for (String string : strings) { - final int count = names.size(); - if (count > 0 - && names.get(count - 1).equals("")) - { - if (count == 1) { - if (string.equals("")) { - names.add(""); - } else { - names.set( - 0, - "," + string); - } - } else { - names.set( - count - 2, - names.get(count - 2) + "," + string); - names.remove(count - 1); - } - } else { - names.add(string); - } - } - return names; - } - - /** - * Returns an annotation of a particular class on a method. Returns the - * default value if the annotation is not present, or in JDK 1.4. - * - * @param method Method containing annotation - * @param annotationClassName Name of annotation class to find - * @param defaultValue Value to return if annotation is not present - * @return value of annotation - */ - public static T getAnnotation( - Method method, - String annotationClassName, - T defaultValue) - { - return compatible.getAnnotation( - method, annotationClassName, defaultValue); - } - - /** - * Closes and cancels a {@link Statement} using the correct methods - * available on the current Java runtime. - *

If errors are encountered while canceling a statement, - * the message is logged in {@link Util}. - * @param stmt The statement to cancel. - */ - public static void cancelStatement(Statement stmt) { - compatible.cancelStatement(stmt); - } - - public static MemoryInfo getMemoryInfo() { - return compatible.getMemoryInfo(); - } - - /** - * Converts a list of a string. - * - * For example, - * commaList("foo", Arrays.asList({"a", "b"})) - * returns "foo(a, b)". - * - * @param s Prefix - * @param list List - * @return String representation of string - */ - public static String commaList( - String s, - List list) - { - final StringBuilder buf = new StringBuilder(s); - buf.append("("); - int k = -1; - for (T t : list) { - if (++k > 0) { - buf.append(", "); - } - buf.append(t); - } - buf.append(")"); - return buf.toString(); - } - - /** - * Makes a name distinct from other names which have already been used - * and shorter than a length limit, adds it to the list, and returns it. - * - * @param name Suggested name, may not be unique - * @param maxLength Maximum length of generated name - * @param nameList Collection of names already used - * - * @return Unique name - */ - public static String uniquify( - String name, - int maxLength, - Collection nameList) - { - assert name != null; - if (name.length() > maxLength) { - name = name.substring(0, maxLength); - } - if (nameList.contains(name)) { - String aliasBase = name; - int j = 0; - while (true) { - name = aliasBase + j; - if (name.length() > maxLength) { - aliasBase = aliasBase.substring(0, aliasBase.length() - 1); - continue; - } - if (!nameList.contains(name)) { - break; - } - j++; - } - } - nameList.add(name); - return name; - } - - /** - * Returns whether a collection contains precisely one distinct element. - * Returns false if the collection is empty, or if it contains elements - * that are not the same as each other. - * - * @param collection Collection - * @return boolean true if all values are same - */ - public static boolean areOccurencesEqual( - Collection collection) - { - Iterator it = collection.iterator(); - if (!it.hasNext()) { - // Collection is empty - return false; - } - T first = it.next(); - while (it.hasNext()) { - T t = it.next(); - if (!t.equals(first)) { - return false; - } - } - return true; - } - - /** - * Creates a memory-, CPU- and cache-efficient immutable list. - * - * @param t Array of members of list - * @param Element type - * @return List containing the given members - */ - public static List flatList(T... t) { - return _flatList(t, false); - } - - /** - * Creates a memory-, CPU- and cache-efficient immutable list, - * always copying the contents. - * - * @param t Array of members of list - * @param Element type - * @return List containing the given members - */ - public static List flatListCopy(T... t) { - return _flatList(t, true); - } - - /** - * Creates a memory-, CPU- and cache-efficient immutable list, optionally - * copying the list. - * - * @param copy Whether to always copy the list - * @param t Array of members of list - * @return List containing the given members - */ - private static List _flatList(T[] t, boolean copy) { - switch (t.length) { - case 0: - return Collections.emptyList(); - case 1: - return Collections.singletonList(t[0]); - case 2: - return new Flat2List<>(t[0], t[1]); - case 3: - return new Flat3List<>(t[0], t[1], t[2]); - default: - // REVIEW: AbstractList contains a modCount field; we could - // write our own implementation and reduce creation overhead a - // bit. - if (copy) { - return Arrays.asList(t.clone()); - } else { - return Arrays.asList(t); - } - } - } - - /** - * Creates a memory-, CPU- and cache-efficient immutable list from an - * existing list. The list is always copied. - * - * @param t Array of members of list - * @param Element type - * @return List containing the given members - */ - public static List flatList(List t) { - switch (t.size()) { - case 0: - return Collections.emptyList(); - case 1: - return Collections.singletonList(t.get(0)); - case 2: - return new Flat2List<>(t.get(0), t.get(1)); - case 3: - return new Flat3List<>(t.get(0), t.get(1), t.get(2)); - default: - // REVIEW: AbstractList contains a modCount field; we could - // write our own implementation and reduce creation overhead a - // bit. - //noinspection unchecked - return (List) Arrays.asList(t.toArray()); - } - } - - /** - * Parses a locale string. - * - *

The inverse operation of {@link java.util.Locale#toString()}. - * - * @param localeString Locale string, e.g. "en" or "en_US" - * @return Java locale object - */ - public static Locale parseLocale(String localeString) { - String[] strings = localeString.split("_"); - switch (strings.length) { - case 1: - return new Locale(strings[0]); - case 2: - return new Locale(strings[0], strings[1]); - case 3: - return new Locale(strings[0], strings[1], strings[2]); - default: - throw newInternal( - "bad locale string '" + localeString + "'"); - } - } - - private static final Map TIME_UNITS = - Olap4jUtil.mapOf( - "ns", "NANOSECONDS", - "us", "MICROSECONDS", - "ms", "MILLISECONDS", - "s", "SECONDS", - "m", "MINUTES", - "h", "HOURS", - "d", "DAYS"); - - /** - * Parses an interval. - * - *

For example, "30s" becomes (30, {@link TimeUnit#SECONDS}); - * "2us" becomes (2, {@link TimeUnit#MICROSECONDS}).

- * - *

Units m (minutes), h (hours) and d (days) are only available - * in JDK 1.6 or later, because the corresponding constants are missing - * from {@link TimeUnit} in JDK 1.5.

- * - * @param s String to parse - * @param unit Default time unit; may be null - * - * @return Pair of value and time unit. Neither pair or its components are - * null - * - * @throws NumberFormatException if unit is not present and there is no - * default, or if number is not valid - */ - public static Pair parseInterval( - String s, - TimeUnit unit) - throws NumberFormatException - { - final String original = s; - for (Map.Entry entry : TIME_UNITS.entrySet()) { - final String abbrev = entry.getKey(); - if (s.endsWith(abbrev)) { - final String full = entry.getValue(); - try { - unit = TimeUnit.valueOf(full); - s = s.substring(0, s.length() - abbrev.length()); - break; - } catch (IllegalArgumentException e) { - // ignore - MINUTES, HOURS, DAYS are not defined in JDK1.5 - } - } - } - if (unit == null) { - throw new NumberFormatException( - "Invalid time interval '" + original + "'. Does not contain a " - + "time unit. (Suffix may be ns (nanoseconds), " - + "us (microseconds), ms (milliseconds), s (seconds), " - + "h (hours), d (days). For example, '20s' means 20 seconds.)"); - } - try { - return Pair.of(new BigDecimal(s).longValue(), unit); - } catch (NumberFormatException e) { - throw new NumberFormatException( - "Invalid time interval '" + original + "'"); - } - } - - /** - * Converts a list of olap4j-style segments to a list of mondrian-style - * segments. - * - * @param olap4jSegmentList List of olap4j segments - * @return List of mondrian segments - */ - public static List convert( - List olap4jSegmentList) - { - final List list = new ArrayList<>(); - for (IdentifierSegment olap4jSegment : olap4jSegmentList) { - list.add(convert(olap4jSegment)); - } - return list; - } - - /** - * Converts an olap4j-style segment to a mondrian-style segment. - * - * @param olap4jSegment olap4j segment - * @return mondrian segment - */ - public static Id.Segment convert(IdentifierSegment olap4jSegment) { - if (olap4jSegment instanceof NameSegment) { - return convert((NameSegment) olap4jSegment); - } else { - return convert((KeySegment) olap4jSegment); - } - } - - private static Id.KeySegment convert(final KeySegment keySegment) { - return new Id.KeySegment( - new AbstractList() { - public Id.NameSegment get(int index) { - return convert(keySegment.getKeyParts().get(index)); - } - - public int size() { - return keySegment.getKeyParts().size(); - } - }); - } - - private static Id.NameSegment convert(NameSegment nameSegment) { - return new Id.NameSegment( - nameSegment.getName(), - convert(nameSegment.getQuoting())); - } - - private static Id.Quoting convert(Quoting quoting) { - switch (quoting) { - case QUOTED: - return Id.Quoting.QUOTED; - case UNQUOTED: - return Id.Quoting.UNQUOTED; - case KEY: - return Id.Quoting.KEY; - default: - throw Util.unexpected(quoting); - } - } - - /** - * Applies a collection of filters to an iterable. - * - * @param iterable Iterable - * @param conds Zero or more conditions - * @param - * @return Iterable that returns only members of underlying iterable for - * for which all conditions evaluate to true - */ - public static Iterable filter( - final Iterable iterable, - final Functor1... conds) - { - final Functor1[] conds2 = optimizeConditions(conds); - if (conds2.length == 0) { - return iterable; - } - return () -> new Iterator() { - final Iterator iterator = iterable.iterator(); - T next; - boolean hasNext = moveToNext(); - - private boolean moveToNext() { - outer: - while (iterator.hasNext()) { - next = iterator.next(); - for (Functor1 cond : conds2) { - if (!cond.apply(next)) { - continue outer; - } - } - return true; - } - return false; - } - - public boolean hasNext() { - return hasNext; - } - - public T next() { - T t = next; - hasNext = moveToNext(); - return t; - } - - public void remove() { - throw new UnsupportedOperationException(); - } - }; - } - - private static Functor1[] optimizeConditions( - Functor1[] conds) - { - final List> functor1List = - new ArrayList<>(Arrays.asList(conds)); - for (Iterator> funcIter = - functor1List.iterator(); funcIter.hasNext();) - { - Functor1 booleanTFunctor1 = funcIter.next(); - if (booleanTFunctor1 == trueFunctor()) { - funcIter.remove(); - } - } - if (functor1List.size() < conds.length) { - //noinspection unchecked - return functor1List.toArray(new Functor1[functor1List.size()]); - } else { - return conds; - } - } - - /** - * Sorts a collection of {@link Comparable} objects and returns a list. - * - * @param collection Collection - * @param Element type - * @return Sorted list - */ - public static List sort( - Collection collection) - { - Object[] a = collection.toArray(new Object[collection.size()]); - Arrays.sort(a); - return cast(Arrays.asList(a)); - } - - /** - * Sorts a collection of objects using a {@link java.util.Comparator} and returns a - * list. - * - * @param collection Collection - * @param comparator Comparator - * @param Element type - * @return Sorted list - */ - public static List sort( - Collection collection, - Comparator comparator) - { - Object[] a = collection.toArray(new Object[collection.size()]); - //noinspection unchecked - Arrays.sort(a, comparator); - return cast(Arrays.asList(a)); - } - - public static List toOlap4j( - final List segments) - { - return new AbstractList() { - public IdentifierSegment get(int index) { - return toOlap4j(segments.get(index)); - } - - public int size() { - return segments.size(); - } - }; - } - - public static IdentifierSegment toOlap4j(Id.Segment segment) { - switch (segment.quoting) { - case KEY: - return toOlap4j((Id.KeySegment) segment); - default: - return toOlap4j((Id.NameSegment) segment); - } - } - - private static KeySegment toOlap4j(final Id.KeySegment keySegment) { - return new KeySegment( - new AbstractList() { - public NameSegment get(int index) { - return toOlap4j(keySegment.subSegmentList.get(index)); - } - - public int size() { - return keySegment.subSegmentList.size(); - } - }); - } - - private static NameSegment toOlap4j(Id.NameSegment nameSegment) { - return new NameSegment( - null, - nameSegment.name, - toOlap4j(nameSegment.quoting)); - } - - public static Quoting toOlap4j(Id.Quoting quoting) { - return Quoting.valueOf(quoting.name()); - } - - // TODO: move to IdentifierSegment - public static boolean matches(IdentifierSegment segment, String name) { - switch (segment.getQuoting()) { - case KEY: - return false; // FIXME - case QUOTED: - return equalName(segment.getName(), name); - case UNQUOTED: - return segment.getName().equalsIgnoreCase(name); - default: - throw unexpected(segment.getQuoting()); - } - } - - public static RuntimeException newElementNotFoundException( - int category, - IdentifierNode identifierNode) - { - String type; - switch (category) { - case Category.Member: - return MondrianResource.instance().MemberNotFound.ex( - identifierNode.toString()); - case Category.Unknown: - type = "Element"; - break; - default: - type = Category.instance().getDescription(category); - } - return newError(type + " '" + identifierNode + "' not found"); - } - - /** - * Calls {@link java.util.concurrent.Future#get()} and converts any - * throwable into a non-checked exception. - * - * @param future Future - * @param message Message to qualify wrapped exception - * @param Result type - * @return Result - */ - public static T safeGet(Future future, String message) { - try { - return future.get(); - } catch (InterruptedException e) { - throw newError(e, message); - } catch (ExecutionException e) { - final Throwable cause = e.getCause(); - if (cause instanceof RuntimeException) { - throw (RuntimeException) cause; - } else if (cause instanceof Error) { - throw (Error) cause; - } else { - throw newError(cause, message); - } - } - } - - public static Set newIdentityHashSetFake() { - final HashMap map = new HashMap<>(); - return new Set() { - public int size() { - return map.size(); - } - - public boolean isEmpty() { - return map.isEmpty(); - } - - public boolean contains(Object o) { - return map.containsKey(o); - } - - public Iterator iterator() { - return map.keySet().iterator(); - } - - public Object[] toArray() { - return map.keySet().toArray(); - } - - public T[] toArray(T[] a) { - return map.keySet().toArray(a); - } - - public boolean add(T t) { - return map.put(t, Boolean.TRUE) == null; - } - - public boolean remove(Object o) { - return map.remove(o) == Boolean.TRUE; - } - - public boolean containsAll(Collection c) { - return map.keySet().containsAll(c); - } - - public boolean addAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean removeAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public void clear() { - map.clear(); - } - }; - } - - /** - * Equivalent to {@link Timer#Timer(String, boolean)}. - * (Introduced in JDK 1.5.) - * - * @param name the name of the associated thread - * @param isDaemon true if the associated thread should run as a daemon - * @return timer - */ - public static Timer newTimer(String name, boolean isDaemon) { - return compatible.newTimer(name, isDaemon); - } - - /** - * As Arrays#binarySearch(Object[], int, int, Object), but - * available pre-JDK 1.6. - */ - public static > int binarySearch( - T[] ts, int start, int end, T t) - { - return compatible.binarySearch(ts, start, end, t); - } - - /** - * Returns the intersection of two sorted sets. Does not modify either set. - * - *

Optimized for the case that both sets are {@link ArraySortedSet}.

- * - * @param set1 First set - * @param set2 Second set - * @return Intersection of the sets - */ - public static SortedSet intersect( - SortedSet set1, - SortedSet set2) - { - if (set1.isEmpty()) { - return set1; - } - if (set2.isEmpty()) { - return set2; - } - if (!(set1 instanceof ArraySortedSet) - || !(set2 instanceof ArraySortedSet)) - { - final TreeSet set = new TreeSet<>(set1); - set.retainAll(set2); - return set; - } - final Comparable[] result = - new Comparable[Math.min(set1.size(), set2.size())]; - final Iterator it1 = set1.iterator(); - final Iterator it2 = set2.iterator(); - int i = 0; - E e1 = it1.next(); - E e2 = it2.next(); - for (;;) { - final int compare = e1.compareTo(e2); - if (compare == 0) { - result[i++] = e1; - if (!it1.hasNext() || !it2.hasNext()) { - break; - } - e1 = it1.next(); - e2 = it2.next(); - } else if (compare == 1) { - if (!it2.hasNext()) { - break; - } - e2 = it2.next(); - } else { - if (!it1.hasNext()) { - break; - } - e1 = it1.next(); - } - } - return new ArraySortedSet(result, 0, i); - } - - /** - * Compares two integers using the same algorithm as - * {@link Integer#compareTo(Integer)}. - * - * @param i0 First integer - * @param i1 Second integer - * @return Comparison - */ - public static int compareIntegers(int i0, int i1) { - return (i0 < i1 ? -1 : (i0 == i1 ? 0 : 1)); - } - - /** - * Returns the last item in a list. - * - * @param list List - * @param Element type - * @return Last item in the list - * @throws IndexOutOfBoundsException if list is empty - */ - public static T last(List list) { - return list.get(list.size() - 1); - } - - /** - * Returns the sole item in a list. - * - *

If the list has 0 or more than one element, throws.

- * - * @param list List - * @param Element type - * @return Sole item in the list - * @throws IndexOutOfBoundsException if list is empty or has more than 1 elt - */ - public static T only(List list) { - if (list.size() != 1) { - throw new IndexOutOfBoundsException( - "list " + list + " has " + list.size() - + " elements, expected 1"); - } - return list.get(0); - } - - /** - * Closes a JDBC result set, statement, and connection, ignoring any errors. - * If any of them are null, that's fine. - * - *

If any of them throws a {@link SQLException}, returns the first - * such exception, but always executes all closes.

- * - * @param resultSet Result set - * @param statement Statement - * @param connection Connection - */ - public static SQLException close( - ResultSet resultSet, - Statement statement, - Connection connection) - { - SQLException firstException = null; - if (resultSet != null) { - try { - if (statement == null) { - statement = resultSet.getStatement(); - } - resultSet.close(); - } catch (Throwable t) { - firstException = new SQLException(); - firstException.initCause(t); - } - } - if (statement != null) { - try { - statement.close(); - } catch (Throwable t) { - if (firstException == null) { - firstException = new SQLException(); - firstException.initCause(t); - } - } - } - if (connection != null) { - try { - connection.close(); - } catch (Throwable t) { - if (firstException == null) { - firstException = new SQLException(); - firstException.initCause(t); - } - } - } - return firstException; - } - - /** - * Creates a bitset with bits from {@code fromIndex} (inclusive) to - * specified {@code toIndex} (exclusive) set to {@code true}. - * - *

For example, {@code bitSetBetween(0, 3)} returns a bit set with bits - * {0, 1, 2} set. - * - * @param fromIndex Index of the first bit to be set. - * @param toIndex Index after the last bit to be set. - * @return Bit set - */ - public static BitSet bitSetBetween(int fromIndex, int toIndex) { - final BitSet bitSet = new BitSet(); - if (toIndex > fromIndex) { - // Avoid http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6222207 - // "BitSet internal invariants may be violated" - bitSet.set(fromIndex, toIndex); - } - return bitSet; - } - - public static class ErrorCellValue { - public String toString() { - return "#ERR"; - } - } - - @SuppressWarnings({"unchecked"}) - public static T[] genericArray(Class clazz, int size) { - return (T[]) Array.newInstance(clazz, size); - } - - /** - * Throws an internal error if condition is not true. It would be called - * assert, but that is a keyword as of JDK 1.4. - */ - public static void assertTrue(boolean b) { - if (!b) { - throw newInternal("assert failed"); - } - } - - /** - * Throws an internal error with the given messagee if condition is not - * true. It would be called assert, but that is a keyword as - * of JDK 1.4. - */ - public static void assertTrue(boolean b, String message) { - if (!b) { - throw newInternal("assert failed: " + message); - } - } - - /** - * Creates an internal error with a given message. - */ - public static RuntimeException newInternal(String message) { - return MondrianResource.instance().Internal.ex(message); - } - - /** - * Creates an internal error with a given message and cause. - */ - public static RuntimeException newInternal(Throwable e, String message) { - return MondrianResource.instance().Internal.ex(message, e); - } - - /** - * Creates a non-internal error. Currently implemented in terms of - * internal errors, but later we will create resourced messages. - */ - public static RuntimeException newError(String message) { - return newInternal(message); - } - - /** - * Creates a non-internal error. Currently implemented in terms of - * internal errors, but later we will create resourced messages. - */ - public static RuntimeException newError(Throwable e, String message) { - return newInternal(e, message); - } - - /** - * Returns an exception indicating that we didn't expect to find this value - * here. - * - * @param value Value - */ - public static RuntimeException unexpected(Enum value) { - return Util.newInternal( - "Was not expecting value '" + value - + "' for enumeration '" + value.getClass().getName() - + "' in this context"); - } - - /** - * Checks that a precondition (declared using the javadoc @pre - * tag) is satisfied. - * - * @param b The value of executing the condition - */ - public static void assertPrecondition(boolean b) { - assertTrue(b); - } - - /** - * Checks that a precondition (declared using the javadoc @pre - * tag) is satisfied. For example, - * - *

void f(String s) {
-     *    Util.assertPrecondition(s != null, "s != null");
-     *    ...
-     * }
- * - * @param b The value of executing the condition - * @param condition The text of the condition - */ - public static void assertPrecondition(boolean b, String condition) { - assertTrue(b, condition); - } - - /** - * Checks that a postcondition (declared using the javadoc - * @post tag) is satisfied. - * - * @param b The value of executing the condition - */ - public static void assertPostcondition(boolean b) { - assertTrue(b); - } - - /** - * Checks that a postcondition (declared using the javadoc - * @post tag) is satisfied. - * - * @param b The value of executing the condition - */ - public static void assertPostcondition(boolean b, String condition) { - assertTrue(b, condition); - } - - /** - * Converts an error into an array of strings, the most recent error first. - * - * @param e the error; may be null. Errors are chained according to their - * {@link Throwable#getCause cause}. - */ - public static String[] convertStackToString(Throwable e) { - List list = new ArrayList<>(); - while (e != null) { - String sMsg = getErrorMessage(e); - list.add(sMsg); - e = e.getCause(); - } - return list.toArray(new String[list.size()]); - } - - /** - * Constructs the message associated with an arbitrary Java error, making - * up one based on the stack trace if there is none. As - * {@link #getErrorMessage(Throwable,boolean)}, but does not print the - * class name if the exception is derived from {@link java.sql.SQLException} - * or is exactly a {@link java.lang.Exception}. - */ - public static String getErrorMessage(Throwable err) { - boolean prependClassName = - !(err instanceof java.sql.SQLException - || err.getClass() == java.lang.Exception.class); - return getErrorMessage(err, prependClassName); - } - - /** - * Constructs the message associated with an arbitrary Java error, making - * up one based on the stack trace if there is none. - * - * @param err the error - * @param prependClassName should the error be preceded by the - * class name of the Java exception? defaults to false, unless the error - * is derived from {@link java.sql.SQLException} or is exactly a {@link - * java.lang.Exception} - */ - public static String getErrorMessage( - Throwable err, - boolean prependClassName) - { - String errMsg = err.getMessage(); - if ((errMsg == null) || (err instanceof RuntimeException)) { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - err.printStackTrace(pw); - return sw.toString(); - } else { - return (prependClassName) - ? err.getClass().getName() + ": " + errMsg - : errMsg; - } - } - - /** - * If one of the causes of an exception is of a particular class, returns - * that cause. Otherwise returns null. - * - * @param e Exception - * @param clazz Desired class - * @param Class - * @return Cause of given class, or null - */ - public static - T getMatchingCause(Throwable e, Class clazz) { - for (;;) { - if (clazz.isInstance(e)) { - return clazz.cast(e); - } - final Throwable cause = e.getCause(); - if (cause == null || cause == e) { - return null; - } - e = cause; - } - } - - /** - * Converts an expression to a string. - */ - public static String unparse(Exp exp) { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - exp.unparse(pw); - return sw.toString(); - } - - /** - * Converts an query to a string. - */ - public static String unparse(Query query) { - StringWriter sw = new StringWriter(); - PrintWriter pw = new QueryPrintWriter(sw); - query.unparse(pw); - return sw.toString(); - } - - /** - * Creates a file-protocol URL for the given file. - */ - public static URL toURL(File file) throws MalformedURLException { - String path = file.getAbsolutePath(); - // This is a bunch of weird code that is required to - // make a valid URL on the Windows platform, due - // to inconsistencies in what getAbsolutePath returns. - String fs = System.getProperty("file.separator"); - if (fs.length() == 1) { - char sep = fs.charAt(0); - if (sep != '/') { - path = path.replace(sep, '/'); - } - if (path.charAt(0) != '/') { - path = '/' + path; - } - } - path = "file://" + path; - return new URL(path); - } - - /** - * PropertyList is an order-preserving list of key-value - * pairs. Lookup is case-insensitive, but the case of keys is preserved. - */ - public static class PropertyList - implements Iterable>, Serializable - { - List> list = - new ArrayList<>(); - - public PropertyList() { - this.list = new ArrayList<>(); - } - - private PropertyList(List> list) { - this.list = list; - } - - @SuppressWarnings({"CloneDoesntCallSuperClone"}) - @Override - public PropertyList clone() { - return new PropertyList(new ArrayList<>(list)); - } - - public String get(String key) { - return get(key, null); - } - - public String get(String key, String defaultValue) { - for (Pair pair : list) { - if (pair.left.equalsIgnoreCase(key)) { - return pair.right; - } - } - return defaultValue; - } - - public void put(String key, String value) { - for (Pair pair : list) { - if (pair.left.equalsIgnoreCase(key)) { - String old = pair.right; - if (key.equalsIgnoreCase("Provider")) { - // Unlike all other properties, later values of - // "Provider" do not supersede - } else { - pair.right = value; - } - return; - } - } - list.add(new Pair<>(key, value)); - } - - public boolean remove(String key) { - boolean found = false; - for (int i = 0; i < list.size(); i++) { - Pair pair = list.get(i); - if (pair.getKey().equalsIgnoreCase(key)) { - list.remove(i); - found = true; - --i; - } - } - return found; - } - - public String toString() { - StringBuilder sb = new StringBuilder(64); - for (int i = 0, n = list.size(); i < n; i++) { - Pair pair = list.get(i); - if (i > 0) { - sb.append("; "); - } - sb.append(pair.left); - sb.append('='); - - final String right = pair.right; - if (right == null) { - sb.append("'null'"); - } else { - // Quote a property value if is has a semi colon in it - // 'xxx;yyy'. Escape any single-quotes by doubling them. - final int needsQuote = right.indexOf(';'); - if (needsQuote >= 0) { - // REVIEW: This logic leaves off the leading/trailing - // quote if the property value already has a - // leading/trailing quote. Doesn't seem right to me. - if (right.charAt(0) != '\'') { - sb.append("'"); - } - sb.append(replace(right, "'", "''")); - if (right.charAt(right.length() - 1) != '\'') { - sb.append("'"); - } - } else { - sb.append(right); - } - } - } - return sb.toString(); - } - - public Iterator> iterator() { - return list.iterator(); - } - } - - /** - * Converts an OLE DB callOutConnect string into a {@link PropertyList}. - * - *

For example, "Provider=MSOLAP; DataSource=LOCALHOST;" - * becomes the set of (key, value) pairs {("Provider","MSOLAP"), - * ("DataSource", "LOCALHOST")}. Another example is - * Provider='sqloledb';Data Source='MySqlServer';Initial - * Catalog='Pubs';Integrated Security='SSPI';. - * - *

This method implements as much as possible of the OLE DB callOutConnect string syntax - * specification. To find what it actually does, take - * a look at the mondrian.olap.UtilTestCase test case. - */ - public static PropertyList parseConnectString(String s) { - return new ConnectStringParser(s).parse(); - } - - private static class ConnectStringParser { - private final String s; - private final int n; - private int i; - private final StringBuilder nameBuf; - private final StringBuilder valueBuf; - - private ConnectStringParser(String s) { - this.s = s; - this.i = 0; - this.n = s.length(); - this.nameBuf = new StringBuilder(64); - this.valueBuf = new StringBuilder(64); - } - - PropertyList parse() { - PropertyList list = new PropertyList(); - while (i < n) { - parsePair(list); - } - return list; - } - /** - * Reads "name=value;" or "name=value". - */ - void parsePair(PropertyList list) { - String name = parseName(); - if (name == null) { - return; - } - String value; - if (i >= n) { - value = ""; - } else if (s.charAt(i) == ';') { - i++; - value = ""; - } else { - value = parseValue(); - } - list.put(name, value); - } - - /** - * Reads "name=". Name can contain equals sign if equals sign is - * doubled. Returns null if there is no name to read. - */ - String parseName() { - nameBuf.setLength(0); - while (true) { - char c = s.charAt(i); - switch (c) { - case '=': - i++; - if (i < n && (c = s.charAt(i)) == '=') { - // doubled equals sign; take one of them, and carry on - i++; - nameBuf.append(c); - break; - } - String name = nameBuf.toString(); - name = name.trim(); - return name; - case ' ': - if (nameBuf.length() == 0) { - // ignore preceding spaces - i++; - if (i >= n) { - // there is no name, e.g. trailing spaces after - // semicolon, 'x=1; y=2; ' - return null; - } - break; - } else { - // fall through - } - default: - nameBuf.append(c); - i++; - if (i >= n) { - return nameBuf.toString().trim(); - } - } - } - } - - /** - * Reads "value;" or "value" - */ - String parseValue() { - char c; - // skip over leading white space - while ((c = s.charAt(i)) == ' ') { - i++; - if (i >= n) { - return ""; - } - } - if (c == '"' || c == '\'') { - String value = parseQuoted(c); - // skip over trailing white space - while (i < n && (c = s.charAt(i)) == ' ') { - i++; - } - if (i >= n) { - return value; - } else if (s.charAt(i) == ';') { - i++; - return value; - } else { - throw new RuntimeException( - "quoted value ended too soon, at position " + i - + " in '" + s + "'"); - } - } else { - String value; - int semi = s.indexOf(';', i); - if (semi >= 0) { - value = s.substring(i, semi); - i = semi + 1; - } else { - value = s.substring(i); - i = n; - } - return value.trim(); - } - } - /** - * Reads a string quoted by a given character. Occurrences of the - * quoting character must be doubled. For example, - * parseQuoted('"') reads "a ""new"" string" - * and returns a "new" string. - */ - String parseQuoted(char q) { - char c = s.charAt(i++); - Util.assertTrue(c == q); - valueBuf.setLength(0); - while (i < n) { - c = s.charAt(i); - if (c == q) { - i++; - if (i < n) { - c = s.charAt(i); - if (c == q) { - valueBuf.append(c); - i++; - continue; - } - } - return valueBuf.toString(); - } else { - valueBuf.append(c); - i++; - } - } - throw new RuntimeException( - "Connect string '" + s - + "' contains unterminated quoted value '" + valueBuf.toString() - + "'"); - } - } - - /** - * Combines two integers into a hash code. - */ - public static int hash(int i, int j) { - return (i << 4) ^ j; - } - - /** - * Computes a hash code from an existing hash code and an object (which - * may be null). - */ - public static int hash(int h, Object o) { - int k = (o == null) ? 0 : o.hashCode(); - return ((h << 4) | h) ^ k; - } - - /** - * Computes a hash code from an existing hash code and an array of objects - * (which may be null). - */ - public static int hashArray(int h, Object [] a) { - // The hashcode for a null array and an empty array should be different - // than h, so use magic numbers. - if (a == null) { - return hash(h, 19690429); - } - if (a.length == 0) { - return hash(h, 19690721); - } - for (Object anA : a) { - h = hash(h, anA); - } - return h; - } - - /** - * Concatenates one or more arrays. - * - *

Resulting array has same element type as first array. Each arrays may - * be empty, but must not be null. - * - * @param a0 First array - * @param as Zero or more subsequent arrays - * @return Array containing all elements - */ - public static T[] appendArrays( - T[] a0, - T[]... as) - { - int n = a0.length; - for (T[] a : as) { - n += a.length; - } - T[] copy = Util.copyOf(a0, n); - n = a0.length; - for (T[] a : as) { - System.arraycopy(a, 0, copy, n, a.length); - n += a.length; - } - return copy; - } - - /** - * Adds an object to the end of an array. The resulting array is of the - * same type (e.g. String[]) as the input array. - * - * @param a Array - * @param o Element - * @return New array containing original array plus element - * - * @see #appendArrays - */ - public static T[] append(T[] a, T o) { - T[] a2 = Util.copyOf(a, a.length + 1); - a2[a.length] = o; - return a2; - } - - /** - * Like {@link java.util.Arrays}.copyOf(double[], int), but - * exists prior to JDK 1.6. - * - * @param original the array to be copied - * @param newLength the length of the copy to be returned - * @return a copy of the original array, truncated or padded with zeros - * to obtain the specified length - */ - public static double[] copyOf(double[] original, int newLength) { - double[] copy = new double[newLength]; - System.arraycopy( - original, 0, copy, 0, Math.min(original.length, newLength)); - return copy; - } - - /** - * Like {@link java.util.Arrays}.copyOf(int[], int), but - * exists prior to JDK 1.6. - * - * @param original the array to be copied - * @param newLength the length of the copy to be returned - * @return a copy of the original array, truncated or padded with zeros - * to obtain the specified length - */ - public static int[] copyOf(int[] original, int newLength) { - int[] copy = new int[newLength]; - System.arraycopy( - original, 0, copy, 0, Math.min(original.length, newLength)); - return copy; - } - - /** - * Like {@link java.util.Arrays}.copyOf(long[], int), but - * exists prior to JDK 1.6. - * - * @param original the array to be copied - * @param newLength the length of the copy to be returned - * @return a copy of the original array, truncated or padded with zeros - * to obtain the specified length - */ - public static long[] copyOf(long[] original, int newLength) { - long[] copy = new long[newLength]; - System.arraycopy( - original, 0, copy, 0, Math.min(original.length, newLength)); - return copy; - } - - /** - * Like {@link java.util.Arrays}.copyOf(Object[], int), but - * exists prior to JDK 1.6. - * - * @param original the array to be copied - * @param newLength the length of the copy to be returned - * @return a copy of the original array, truncated or padded with zeros - * to obtain the specified length - */ - public static T[] copyOf(T[] original, int newLength) { - //noinspection unchecked - return (T[]) copyOf(original, newLength, original.getClass()); - } - - /** - * Copies the specified array. - * - * @param original the array to be copied - * @param newLength the length of the copy to be returned - * @param newType the class of the copy to be returned - * @return a copy of the original array, truncated or padded with nulls - * to obtain the specified length - */ - public static T[] copyOf( - U[] original, int newLength, Class newType) - { - @SuppressWarnings({"unchecked", "RedundantCast"}) - T[] copy = ((Object)newType == (Object)Object[].class) - ? (T[]) new Object[newLength] - : (T[]) Array.newInstance(newType.getComponentType(), newLength); - //noinspection SuspiciousSystemArraycopy - System.arraycopy( - original, 0, copy, 0, - Math.min(original.length, newLength)); - return copy; - } - - /** - * Returns the cumulative amount of time spent accessing the database. - * - * @deprecated Use {@link mondrian.server.monitor.Monitor#getServer()} and - * {@link mondrian.server.monitor.ServerInfo#sqlStatementExecuteNanos}; - * will be removed in 4.0. - */ - public static long dbTimeMillis() { - return databaseMillis; - } - - /** - * Adds to the cumulative amount of time spent accessing the database. - * - * @deprecated Will be removed in 4.0. - */ - public static void addDatabaseTime(long millis) { - databaseMillis += millis; - } - - /** - * Returns the system time less the time spent accessing the database. - * Use this method to figure out how long an operation took: call this - * method before an operation and after an operation, and the difference - * is the amount of non-database time spent. - * - * @deprecated Will be removed in 4.0. - */ - public static long nonDbTimeMillis() { - final long systemMillis = System.currentTimeMillis(); - return systemMillis - databaseMillis; - } - - /** - * Creates a very simple implementation of {@link Validator}. (Only - * useful for resolving trivial expressions.) - */ - public static Validator createSimpleValidator(final FunTable funTable) { - return new Validator() { - public Query getQuery() { - return null; - } - - public SchemaReader getSchemaReader() { - throw new UnsupportedOperationException(); - } - - public Exp validate(Exp exp, boolean scalar) { - return exp; - } - - public void validate(ParameterExpr parameterExpr) { - } - - public void validate(MemberProperty memberProperty) { - } - - public void validate(QueryAxis axis) { - } - - public void validate(Formula formula) { - } - - public FunDef getDef(Exp[] args, String name, Syntax syntax) { - // Very simple resolution. Assumes that there is precisely - // one resolver (i.e. no overloading) and no argument - // conversions are necessary. - List resolvers = funTable.getResolvers(name, syntax); - final Resolver resolver = resolvers.get(0); - final List conversionList = - new ArrayList<>(); - final FunDef def = - resolver.resolve(args, this, conversionList); - assert conversionList.isEmpty(); - return def; - } - - public boolean alwaysResolveFunDef() { - return false; - } - - public boolean canConvert( - int ordinal, Exp fromExp, - int to, - List conversions) - { - return true; - } - - public boolean requiresExpression() { - return false; - } - - public FunTable getFunTable() { - return funTable; - } - - public Parameter createOrLookupParam( - boolean definition, - String name, - Type type, - Exp defaultExp, - String description) - { - return null; - } - }; - } - - /** - * Reads a Reader until it returns EOF and returns the contents as a String. - * - * @param rdr Reader to Read. - * @param bufferSize size of buffer to allocate for reading. - * @return content of Reader as String - * @throws IOException on I/O error - */ - public static String readFully(final Reader rdr, final int bufferSize) - throws IOException - { - if (bufferSize <= 0) { - throw new IllegalArgumentException( - "Buffer size must be greater than 0"); - } - - final char[] buffer = new char[bufferSize]; - final StringBuilder buf = new StringBuilder(bufferSize); - - int len; - while ((len = rdr.read(buffer)) != -1) { - buf.append(buffer, 0, len); - } - return buf.toString(); - } - - /** - * Reads an input stream until it returns EOF and returns the contents as an - * array of bytes. - * - * @param in Input stream - * @param bufferSize size of buffer to allocate for reading. - * @return content of stream as an array of bytes - * @throws IOException on I/O error - */ - public static byte[] readFully(final InputStream in, final int bufferSize) - throws IOException - { - if (bufferSize <= 0) { - throw new IllegalArgumentException( - "Buffer size must be greater than 0"); - } - - final byte[] buffer = new byte[bufferSize]; - final ByteArrayOutputStream baos = - new ByteArrayOutputStream(bufferSize); - - int len; - while ((len = in.read(buffer)) != -1) { - baos.write(buffer, 0, len); - } - return baos.toByteArray(); - } - - /** - * Returns the contents of a URL, substituting tokens. - * - *

Replaces the tokens "${key}" if the map is not null and "key" occurs - * in the key-value map. - * - *

If the URL string starts with "inline:" the contents are the - * rest of the URL. - * - * @param urlStr URL string - * @param map Key/value map - * @return Contents of URL with tokens substituted - * @throws IOException on I/O error - */ - public static String readURL(final String urlStr, Map map) - throws IOException - { - if (urlStr.startsWith("inline:")) { - String content = urlStr.substring("inline:".length()); - if (map != null) { - content = Util.replaceProperties(content, map); - } - return content; - } else { - final URL url = new URL(urlStr); - return readURL(url, map); - } - } - - /** - * Returns the contents of a URL. - * - * @param url URL - * @return Contents of URL - * @throws IOException on I/O error - */ - public static String readURL(final URL url) throws IOException { - return readURL(url, null); - } - - /** - * Returns the contents of a URL, substituting tokens. - * - *

Replaces the tokens "${key}" if the map is not null and "key" occurs - * in the key-value map. - * - * @param url URL - * @param map Key/value map - * @return Contents of URL with tokens substituted - * @throws IOException on I/O error - */ - public static String readURL( - final URL url, - Map map) - throws IOException - { - final Reader r = - new BufferedReader(new InputStreamReader(url.openStream())); - final int BUF_SIZE = 8096; - try { - String xmlCatalog = readFully(r, BUF_SIZE); - xmlCatalog = Util.replaceProperties(xmlCatalog, map); - return xmlCatalog; - } finally { - r.close(); - } - } - - /** - * Gets content via Apache VFS. File must exist and have content - * - * @param url String - * @return Apache VFS FileContent for further processing - * @throws FileSystemException on error - */ - public static InputStream readVirtualFile(String url) - throws FileSystemException - { - // Treat catalogUrl as an Apache VFS (Virtual File System) URL. - // VFS handles all of the usual protocols (http:, file:) - // and then some. - FileSystemManager fsManager = VFS.getManager(); - if (fsManager == null) { - throw newError("Cannot get virtual file system manager"); - } - - // Workaround VFS bug. - if (url.startsWith("file://localhost")) { - url = url.substring("file://localhost".length()); - } - if (url.startsWith("file:")) { - url = url.substring("file:".length()); - } - - // work around for VFS bug not closing http sockets - // (Mondrian-585) - if (url.startsWith("http")) { - try { - return new URL(url).openStream(); - } catch (IOException e) { - throw newError( - "Could not read URL: " + url); - } - } - - File userDir = new File("").getAbsoluteFile(); - FileObject file = fsManager.resolveFile(userDir, url); - FileContent fileContent = null; - try { - // Because of VFS caching, make sure we refresh to get the latest - // file content. This refresh may possibly solve the following - // workaround for defect MONDRIAN-508, but cannot be tested, so we - // will leave the work around for now. - file.refresh(); - - // Workaround to defect MONDRIAN-508. For HttpFileObjects, verifies - // the URL of the file retrieved matches the URL passed in. A VFS - // cache bug can cause it to treat URLs with different parameters - // as the same file (e.g. http://blah.com?param=A, - // http://blah.com?param=B) - if (file instanceof HttpFileObject - && !file.getName().getURI().equals(url)) - { - fsManager.getFilesCache().removeFile( - file.getFileSystem(), file.getName()); - - file = fsManager.resolveFile(userDir, url); - } - - if (!file.isReadable()) { - throw newError( - "Virtual file is not readable: " + url); - } - - fileContent = file.getContent(); - } finally { - file.close(); - } - - if (fileContent == null) { - throw newError( - "Cannot get virtual file content: " + url); - } - - return fileContent.getInputStream(); - } - - public static String readVirtualFileAsString( - String catalogUrl) - throws IOException - { - InputStream in = readVirtualFile(catalogUrl); - try { - final byte[] bytes = Util.readFully(in, 1024); - return new String(bytes,"utf-8"); - } finally { - if (in != null) { - in.close(); - } - } - } - - /** - * Converts a {@link Properties} object to a string-to-string {@link Map}. - * - * @param properties Properties - * @return String-to-string map - */ - public static Map toMap(final Properties properties) { - return new AbstractMap() { - @SuppressWarnings({"unchecked"}) - public Set> entrySet() { - return (Set) properties.entrySet(); - } - }; - } - /** - * Replaces tokens in a string. - * - *

Replaces the tokens "${key}" if "key" occurs in the key-value map. - * Otherwise "${key}" is left in the string unchanged. - * - * @param text Source string - * @param env Map of key-value pairs - * @return String with tokens substituted - */ - public static String replaceProperties( - String text, - Map env) - { - // As of JDK 1.5, cannot use StringBuilder - appendReplacement requires - // the antediluvian StringBuffer. - StringBuffer buf = new StringBuffer(text.length() + 200); - - Pattern pattern = Pattern.compile("\\$\\{([^${}]+)\\}"); - Matcher matcher = pattern.matcher(text); - while (matcher.find()) { - String varName = matcher.group(1); - String varValue = env.get(varName); - if (varValue != null) { - matcher.appendReplacement(buf, varValue); - } else { - matcher.appendReplacement(buf, "\\${$1}"); - } - } - matcher.appendTail(buf); - - return buf.toString(); - } - - public static String printMemory() { - return printMemory(null); - } - - public static String printMemory(String msg) { - final Runtime rt = Runtime.getRuntime(); - final long freeMemory = rt.freeMemory(); - final long totalMemory = rt.totalMemory(); - final StringBuilder buf = new StringBuilder(64); - - buf.append("FREE_MEMORY:"); - if (msg != null) { - buf.append(msg); - buf.append(':'); - } - buf.append(' '); - buf.append(freeMemory / 1024); - buf.append("kb "); - - long hundredths = (freeMemory * 10000) / totalMemory; - - buf.append(hundredths / 100); - hundredths %= 100; - if (hundredths >= 10) { - buf.append('.'); - } else { - buf.append(".0"); - } - buf.append(hundredths); - buf.append('%'); - - return buf.toString(); - } - - /** - * Casts a Set to a Set with a different element type. - * - * @param set Set - * @return Set of desired type - */ - @SuppressWarnings({"unchecked"}) - public static Set cast(Set set) { - return (Set) set; - } - - /** - * Casts a List to a List with a different element type. - * - * @param list List - * @return List of desired type - */ - @SuppressWarnings({"unchecked"}) - public static List cast(List list) { - return (List) list; - } - - /** - * Returns whether it is safe to cast a collection to a collection with a - * given element type. - * - * @param collection Collection - * @param clazz Target element type - * @param Element type - * @return Whether all not-null elements of the collection are instances of - * element type - */ - public static boolean canCast( - Collection collection, - Class clazz) - { - for (Object o : collection) { - if (o != null && !clazz.isInstance(o)) { - return false; - } - } - return true; - } - - /** - * Casts a collection to iterable. - * - * Under JDK 1.4, {@link Collection} objects do not implement - * {@link Iterable}, so this method inserts a casting wrapper. (Since - * Iterable does not exist under JDK 1.4, they will have been compiled - * under JDK 1.5 or later, then retrowoven to 1.4 class format. References - * to Iterable will have been replaced with references to - * com.rc.retroweaver.runtime.Retroweaver_. - * - *

Under later JDKs this method is trivial. This method can be deleted - * when we discontinue support for JDK 1.4. - * - * @param iterable Object which ought to be iterable - * @param Element type - * @return Object cast to Iterable - */ - public static Iterable castToIterable( - final Object iterable) - { - if (Util.Retrowoven - && !(iterable instanceof Iterable)) - { - return () -> ((Collection) iterable).iterator(); - } - return (Iterable) iterable; - } - - /** - * Looks up an enumeration by name, returning null if null or not valid. - * - * @param clazz Enumerated type - * @param name Name of constant - */ - public static > E lookup(Class clazz, String name) { - return lookup(clazz, name, null); - } - - /** - * Looks up an enumeration by name, returning a given default value if null - * or not valid. - * - * @param clazz Enumerated type - * @param name Name of constant - * @param defaultValue Default value if constant is not found - * @return Value, or null if name is null or value does not exist - */ - public static > E lookup( - Class clazz, String name, E defaultValue) - { - if (name == null) { - return defaultValue; - } - try { - return Enum.valueOf(clazz, name); - } catch (IllegalArgumentException e) { - return defaultValue; - } - } - - /** - * Make a BigDecimal from a double. On JDK 1.5 or later, the BigDecimal - * precision reflects the precision of the double while with JDK 1.4 - * this is not the case. - * - * @param d the input double - * @return the BigDecimal - */ - public static BigDecimal makeBigDecimalFromDouble(double d) { - return compatible.makeBigDecimalFromDouble(d); - } - - /** - * Returns a literal pattern String for the specified String. - * - *

Specification as for {@link Pattern#quote(String)}, which was - * introduced in JDK 1.5. - * - * @param s The string to be literalized - * @return A literal string replacement - */ - public static String quotePattern(String s) { - return compatible.quotePattern(s); - } - - /** - * Generates a unique id. - * - *

From JDK 1.5 onwards, uses a {@code UUID}. - * - * @return A unique id - */ - public static String generateUuidString() { - return compatible.generateUuidString(); - } - - /** - * Compiles a script to yield a Java interface. - * - *

Only valid JDK 1.6 and higher; fails on JDK 1.5 and earlier.

- * - * @param iface Interface script should implement - * @param script Script code - * @param engineName Name of engine (e.g. "JavaScript") - * @param Interface - * @return Object that implements given interface - */ - public static T compileScript( - Class iface, - String script, - String engineName) - { - return compatible.compileScript(iface, script, engineName); - } - - /** - * Removes a thread local from the current thread. - * - *

From JDK 1.5 onwards, calls {@link ThreadLocal#remove()}; before - * that, no-ops.

- * - * @param threadLocal Thread local - * @param Type - */ - public static void threadLocalRemove(ThreadLocal threadLocal) { - compatible.threadLocalRemove(threadLocal); - } - - /** - * Creates a hash set that, like {@link java.util.IdentityHashMap}, - * compares keys using identity. - * - * @param Element type - * @return Set - */ - public static Set newIdentityHashSet() { - return compatible.newIdentityHashSet(); - } - - /** - * Creates a new udf instance from the given udf class. - * - * @param udfClass the class to create new instance for - * @param functionName Function name, or null - * @return an instance of UserDefinedFunction - */ - public static UserDefinedFunction createUdf( - Class udfClass, - String functionName) - { - // Instantiate class with default constructor. - UserDefinedFunction udf; - String className = udfClass.getName(); - String functionNameOrEmpty = - functionName == null - ? "" - : functionName; - - // Find a constructor. - Constructor constructor; - Object[] args = {}; - - // 0. Check that class is public and top-level or static. - // Before JDK 1.5, inner classes are impossible; retroweaver cannot - // handle the getEnclosingClass method, so skip the check. - if (!Modifier.isPublic(udfClass.getModifiers()) - || (!PreJdk15 - && udfClass.getEnclosingClass() != null - && !Modifier.isStatic(udfClass.getModifiers()))) - { - throw MondrianResource.instance().UdfClassMustBePublicAndStatic.ex( - functionName, - className); - } - - // 1. Look for a constructor "public Udf(String name)". - try { - constructor = udfClass.getConstructor(String.class); - if (Modifier.isPublic(constructor.getModifiers())) { - args = new Object[] {functionName}; - } else { - constructor = null; - } - } catch (NoSuchMethodException e) { - constructor = null; - } - // 2. Otherwise, look for a constructor "public Udf()". - if (constructor == null) { - try { - constructor = udfClass.getConstructor(); - if (Modifier.isPublic(constructor.getModifiers())) { - args = new Object[] {}; - } else { - constructor = null; - } - } catch (NoSuchMethodException e) { - constructor = null; - } - } - // 3. Else, no constructor suitable. - if (constructor == null) { - throw MondrianResource.instance().UdfClassWrongIface.ex( - functionNameOrEmpty, - className, - UserDefinedFunction.class.getName()); - } - // Instantiate class. - try { - udf = (UserDefinedFunction) constructor.newInstance(args); - } catch (InstantiationException e) { - throw MondrianResource.instance().UdfClassWrongIface.ex( - functionNameOrEmpty, - className, UserDefinedFunction.class.getName()); - } catch (IllegalAccessException e) { - throw MondrianResource.instance().UdfClassWrongIface.ex( - functionName, - className, - UserDefinedFunction.class.getName()); - } catch (ClassCastException e) { - throw MondrianResource.instance().UdfClassWrongIface.ex( - functionNameOrEmpty, - className, - UserDefinedFunction.class.getName()); - } catch (InvocationTargetException e) { - throw MondrianResource.instance().UdfClassWrongIface.ex( - functionName, - className, - UserDefinedFunction.class.getName()); - } - - return udf; - } - - /** - * Check the resultSize against the result limit setting. Throws - * LimitExceededDuringCrossjoin exception if limit exceeded. - * - * When it is called from RolapNativeSet.checkCrossJoin(), it is only - * possible to check the known input size, because the final CJ result - * will come from the DB(and will be checked against the limit when - * fetching from the JDBC result set, in SqlTupleReader.prepareTuples()) - * - * @param resultSize Result limit - * @throws ResourceLimitExceededException - */ - public static void checkCJResultLimit(long resultSize) { - int resultLimit = MondrianProperties.instance().ResultLimit.get(); - - // Throw an exeption, if the size of the crossjoin exceeds the result - // limit. - if (resultLimit > 0 && resultLimit < resultSize) { - throw MondrianResource.instance().LimitExceededDuringCrossjoin.ex( - resultSize, resultLimit); - } - - // Throw an exception if the crossjoin exceeds a reasonable limit. - // (Yes, 4 billion is a reasonable limit.) - if (resultSize > Integer.MAX_VALUE) { - throw MondrianResource.instance().LimitExceededDuringCrossjoin.ex( - resultSize, Integer.MAX_VALUE); - } - } - - /** - * Converts an olap4j callOutConnect string into a legacy mondrian callOutConnect string. - * - *

For example, - * "jdbc:mondrian:Datasource=jdbc/SampleData;Catalog=foodmart/FoodMart.xml;" - * becomes - * "Provider=Mondrian; - * Datasource=jdbc/SampleData;Catalog=foodmart/FoodMart.xml;" - * - *

This method is intended to allow legacy applications (such as JPivot - * and Mondrian's XMLA server) to continue to create connections using - * Mondrian's legacy connection API even when they are handed an olap4j - * callOutConnect string. - * - * @param url olap4j callOutConnect string - * @return mondrian callOutConnect string, or null if cannot be converted - */ - public static String convertOlap4jConnectStringToNativeMondrian( - String url) - { - if (url.startsWith("jdbc:mondrian:")) { - return "Provider=Mondrian; " - + url.substring("jdbc:mondrian:".length()); - } - return null; - } - - /** - * Checks if a String is whitespace, empty ("") or null.

- * - *
-     * StringUtils.isBlank(null) = true
-     * StringUtils.isBlank("") = true
-     * StringUtils.isBlank(" ") = true
-     * StringUtils.isBlank("bob") = false
-     * StringUtils.isBlank(" bob ") = false
-     * 
- * - *

(Copied from commons-lang.) - * - * @param str the String to check, may be null - * @return true if the String is null, empty or whitespace - */ - public static boolean isBlank(String str) { - final int strLen; - if (str == null || (strLen = str.length()) == 0) { - return true; - } - for (int i = 0; i < strLen; i++) { - if (!Character.isWhitespace(str.charAt(i))) { - return false; - } - } - return true; - } - - /** - * Returns a role which has access to everything. - * @param schema A schema to bind this role to. - * @return A role with root access to the schema. - */ - public static Role createRootRole(Schema schema) { - RoleImpl role = new RoleImpl(); - role.grant(schema, Access.ALL); - role.makeImmutable(); - return role; - } - - /** - * Tries to find the cube from which a dimension is taken. - * It considers private dimensions, shared dimensions and virtual - * dimensions. If it can't determine with certitude the origin - * of the dimension, it returns null. - */ - public static Cube getDimensionCube(Dimension dimension) { - final Cube[] cubes = dimension.getSchema().getCubes(); - for (Cube cube : cubes) { - for (Dimension dimension1 : cube.getDimensions()) { - // If the dimensions have the same identity, - // we found an access rule. - if (dimension == dimension1) { - return cube; - } - // If the passed dimension argument is of class - // RolapCubeDimension, we must validate the cube - // assignment and make sure the cubes are the same. - // If not, skip to the next grant. - if (dimension instanceof RolapCubeDimension - && dimension.equals(dimension1) - && !((RolapCubeDimension)dimension1) - .getCube() - .equals(cube)) - { - continue; - } - // Last thing is to allow for equality correspondences - // to work with virtual cubes. - if (cube instanceof RolapCube - && ((RolapCube)cube).isVirtual() - && dimension.equals(dimension1)) - { - return cube; - } - } - } - return null; - } - - /** - * Similar to {@link ClassLoader#getResource(String)}, except the lookup - * is in reverse order.
- * i.e. returns the resource from the supplied classLoader or the - * one closest to it in the hierarchy, instead of the closest to the root - * class loader - * @param classLoader The class loader to fetch from - * @param name The resource name - * @return A URL object for reading the resource, or null if the resource - * could not be found or the invoker doesn't have adequate privileges to get - * the resource. - * @see ClassLoader#getResource(String) - * @see ClassLoader#getResources(String) - */ - public static URL getClosestResource(ClassLoader classLoader, String name) { - URL resource = null; - try { - // The last resource will be from the nearest ClassLoader. - Enumeration resourceCandidates = - classLoader.getResources(name); - while (resourceCandidates.hasMoreElements()) { - resource = resourceCandidates.nextElement(); - } - } catch (IOException ioe) { - // ignore exception - it's OK if file is not found - // just keep getResource contract and return null - Util.discard(ioe); - } - return resource; - } - - public static abstract class AbstractFlatList - implements List, RandomAccess - { - protected final List asArrayList() { - //noinspection unchecked - return Arrays.asList((T[]) toArray()); - } - - public Iterator iterator() { - return asArrayList().iterator(); - } - - public ListIterator listIterator() { - return asArrayList().listIterator(); - } - - public boolean isEmpty() { - return false; - } - - public boolean add(Object t) { - throw new UnsupportedOperationException(); - } - - public boolean addAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean addAll(int index, Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean removeAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException(); - } - - public void clear() { - throw new UnsupportedOperationException(); - } - - public T set(int index, Object element) { - throw new UnsupportedOperationException(); - } - - public void add(int index, Object element) { - throw new UnsupportedOperationException(); - } - - public T remove(int index) { - throw new UnsupportedOperationException(); - } - - public ListIterator listIterator(int index) { - return asArrayList().listIterator(index); - } - - public List subList(int fromIndex, int toIndex) { - return asArrayList().subList(fromIndex, toIndex); - } - - public boolean contains(Object o) { - return indexOf(o) >= 0; - } - - public boolean containsAll(Collection c) { - for (Object o : c) { - if (!contains(o)) { - return false; - } - } - return true; - } - - public boolean remove(Object o) { - throw new UnsupportedOperationException(); - } - } - - /** - * List that stores its two elements in the two members of the class. - * Unlike {@link java.util.ArrayList} or - * {@link java.util.Arrays#asList(Object[])} there is - * no array, only one piece of memory allocated, therefore is very compact - * and cache and CPU efficient. - * - *

The list is read-only, cannot be modified or resized, and neither - * of the elements can be null. - * - *

The list is created via {@link Util#flatList(Object[])}. - * - * @see mondrian.olap.Util.Flat3List - * @param - */ - protected static class Flat2List extends AbstractFlatList { - private final T t0; - private final T t1; - - Flat2List(T t0, T t1) { - this.t0 = t0; - this.t1 = t1; - assert t0 != null; - assert t1 != null; - } - - public String toString() { - return "[" + t0 + ", " + t1 + "]"; - } - - public T get(int index) { - switch (index) { - case 0: - return t0; - case 1: - return t1; - default: - throw new IndexOutOfBoundsException("index " + index); - } - } - - public int size() { - return 2; - } - - public boolean equals(Object o) { - if (o instanceof Flat2List) { - Flat2List that = (Flat2List) o; - return Util.equals(this.t0, that.t0) - && Util.equals(this.t1, that.t1); - } - return Arrays.asList(t0, t1).equals(o); - } - - public int hashCode() { - int h = 1; - h = h * 31 + t0.hashCode(); - h = h * 31 + t1.hashCode(); - return h; - } - - public int indexOf(Object o) { - if (t0.equals(o)) { - return 0; - } - if (t1.equals(o)) { - return 1; - } - return -1; - } - - public int lastIndexOf(Object o) { - if (t1.equals(o)) { - return 1; - } - if (t0.equals(o)) { - return 0; - } - return -1; - } - - @SuppressWarnings({"unchecked"}) - public T2[] toArray(T2[] a) { - a[0] = (T2) t0; - a[1] = (T2) t1; - return a; - } - - public Object[] toArray() { - return new Object[] {t0, t1}; - } - } - - /** - * List that stores its three elements in the three members of the class. - * Unlike {@link java.util.ArrayList} or - * {@link java.util.Arrays#asList(Object[])} there is - * no array, only one piece of memory allocated, therefore is very compact - * and cache and CPU efficient. - * - *

The list is read-only, cannot be modified or resized, and none - * of the elements can be null. - * - *

The list is created via {@link Util#flatList(Object[])}. - * - * @see mondrian.olap.Util.Flat2List - * @param - */ - protected static class Flat3List extends AbstractFlatList { - private final T t0; - private final T t1; - private final T t2; - - Flat3List(T t0, T t1, T t2) { - this.t0 = t0; - this.t1 = t1; - this.t2 = t2; - assert t0 != null; - assert t1 != null; - assert t2 != null; - } - - public String toString() { - return "[" + t0 + ", " + t1 + ", " + t2 + "]"; - } - - public T get(int index) { - switch (index) { - case 0: - return t0; - case 1: - return t1; - case 2: - return t2; - default: - throw new IndexOutOfBoundsException("index " + index); - } - } - - public int size() { - return 3; - } - - public boolean equals(Object o) { - if (o instanceof Flat3List) { - Flat3List that = (Flat3List) o; - return Util.equals(this.t0, that.t0) - && Util.equals(this.t1, that.t1) - && Util.equals(this.t2, that.t2); - } - return o.equals(this); - } - - public int hashCode() { - int h = 1; - h = h * 31 + t0.hashCode(); - h = h * 31 + t1.hashCode(); - h = h * 31 + t2.hashCode(); - return h; - } - - public int indexOf(Object o) { - if (t0.equals(o)) { - return 0; - } - if (t1.equals(o)) { - return 1; - } - if (t2.equals(o)) { - return 2; - } - return -1; - } - - public int lastIndexOf(Object o) { - if (t2.equals(o)) { - return 2; - } - if (t1.equals(o)) { - return 1; - } - if (t0.equals(o)) { - return 0; - } - return -1; - } - - @SuppressWarnings({"unchecked"}) - public T2[] toArray(T2[] a) { - a[0] = (T2) t0; - a[1] = (T2) t1; - a[2] = (T2) t2; - return a; - } - - public Object[] toArray() { - return new Object[] {t0, t1, t2}; - } - } - - /** - * Garbage-collecting iterator. Iterates over a collection of references, - * and if any of the references has been garbage-collected, removes it from - * the collection. - * - * @param Element type - */ - public static class GcIterator implements Iterator { - private final Iterator> iterator; - private boolean hasNext; - private T next; - - public GcIterator(Iterator> iterator) { - this.iterator = iterator; - this.hasNext = true; - moveToNext(); - } - - /** - * Creates an iterator over a collection of references. - * - * @param referenceIterable Collection of references - * @param element type - * @return iterable over collection - */ - public static Iterable over( - final Iterable> referenceIterable) - { - return () -> new GcIterator<>(referenceIterable.iterator()); - } - - private void moveToNext() { - while (iterator.hasNext()) { - final Reference ref = iterator.next(); - next = ref.get(); - if (next != null) { - return; - } - iterator.remove(); - } - hasNext = false; - } - - public boolean hasNext() { - return hasNext; - } - - public T next() { - final T next1 = next; - moveToNext(); - return next1; - } - - public void remove() { - throw new UnsupportedOperationException(); - } - } - - public static interface Functor1 { - RT apply(PT param); - } - - public static Functor1 identityFunctor() { - //noinspection unchecked - return (Functor1) IDENTITY_FUNCTOR; - } - - private static final Functor1 IDENTITY_FUNCTOR = - (Functor1) param -> param; - - public static Functor1 trueFunctor() { - //noinspection unchecked - return (Functor1) TRUE_FUNCTOR; - } - - public static Functor1 falseFunctor() { - //noinspection unchecked - return (Functor1) FALSE_FUNCTOR; - } - - private static final Functor1 TRUE_FUNCTOR = - (Functor1) param -> true; - - private static final Functor1 FALSE_FUNCTOR = - (Functor1) param -> false; - - /** - * Information about memory usage. - * - * @see mondrian.olap.Util#getMemoryInfo() - */ - public interface MemoryInfo { - Usage get(); - - public interface Usage { - long getUsed(); - long getCommitted(); - long getMax(); - } - } - - /** - * A {@link Comparator} implementation which can deal - * correctly with {@link RolapUtil#sqlNullValue}. - */ - public static class SqlNullSafeComparator - implements Comparator - { - public static final SqlNullSafeComparator instance = - new SqlNullSafeComparator(); - - private SqlNullSafeComparator() { - } - - public int compare(Comparable o1, Comparable o2) { - if (o1 == RolapUtil.sqlNullValue) { - return -1; - } - if (o2 == RolapUtil.sqlNullValue) { - return 1; - } - return o1.compareTo(o2); - } - } - - /** - * This class implements the Knuth-Morris-Pratt algorithm - * to search within a byte array for a token byte array. - */ - public static class ByteMatcher { - private final int[] matcher; - public final byte[] key; - public ByteMatcher(byte[] key) { - this.key = key; - this.matcher = compile(key); - } - /** - * Matches the pre-compiled byte array token against a - * byte array variable and returns the index of the key - * within the array. - * @param a An array of bytes to search for. - * @return -1 if not found, or the index (0 based) of the match. - */ - public int match(byte[] a) { - int j = 0; - for (int i = 0; i < a.length; i++) { - while (j > 0 && key[j] != a[i]) { - j = matcher[j - 1]; - } - if (a[i] == key[j]) { - j++; - } - if (key.length == j) { - return - i - key.length + 1; - } - } - return -1; - } - private int[] compile(byte[] key) { - int[] matcher = new int[key.length]; - int j = 0; - for (int i = 1; i < key.length; i++) { - while (j > 0 && key[j] != key[i]) { - j = matcher[j - 1]; - } - if (key[i] == key[j]) { - j++; - } - matcher[i] = j; - } - return matcher; - } - } - - /** - * Transforms a list into a map for which all the keys return - * a null value associated to it. - * - *

The list passed as an argument will be used to back - * the map returned and as many methods are overridden as - * possible to make sure that we don't iterate over the backing - * list when creating it and when performing operations like - * .size(), entrySet() and contains(). - * - *

The returned map is to be considered immutable. It will - * throw an {@link UnsupportedOperationException} if attempts to - * modify it are made. - */ - public static Map toNullValuesMap(List list) { - return new NullValuesMap<>(list); - } - - private static class NullValuesMap extends AbstractMap { - private final List list; - private NullValuesMap(List list) { - super(); - this.list = Collections.unmodifiableList(list); - } - public Set> entrySet() { - return new AbstractSet>() { - public Iterator> - iterator() - { - return new Iterator>() { - private int pt = -1; - public void remove() { - throw new UnsupportedOperationException(); - } - @SuppressWarnings("unchecked") - public Entry next() { - return new AbstractMapEntry( - list.get(++pt), null) {}; - } - public boolean hasNext() { - return pt < list.size(); - } - }; - } - public int size() { - return list.size(); - } - public boolean contains(Object o) { - if (o instanceof Entry) { - if (list.contains(((Entry) o).getKey())) { - return true; - } - } - return false; - } - }; - } - public Set keySet() { - return new AbstractSet() { - public Iterator iterator() { - return new Iterator() { - private int pt = -1; - public void remove() { - throw new UnsupportedOperationException(); - } - public K next() { - return list.get(++pt); - } - public boolean hasNext() { - return pt < list.size(); - } - }; - } - public int size() { - return list.size(); - } - public boolean contains(Object o) { - return list.contains(o); - } - }; - } - public Collection values() { - return new AbstractList() { - public V get(int index) { - return null; - } - public int size() { - return list.size(); - } - public boolean contains(Object o) { - if (o == null && size() > 0) { - return true; - } else { - return false; - } - } - }; - } - public V get(Object key) { - return null; - } - public boolean containsKey(Object key) { - return list.contains(key); - } - public boolean containsValue(Object o) { - if (o == null && size() > 0) { - return true; - } else { - return false; - } - } - } -} - -// End Util.java diff --git a/contact-center/app/src/main/java/mondrian/olap/fun/CountFunDef.java b/contact-center/app/src/main/java/mondrian/olap/fun/CountFunDef.java deleted file mode 100644 index e835fcd5..00000000 --- a/contact-center/app/src/main/java/mondrian/olap/fun/CountFunDef.java +++ /dev/null @@ -1,131 +0,0 @@ -/* -* This software is subject to the terms of the Eclipse Public License v1.0 -* Agreement, available at the following URL: -* http://www.eclipse.org/legal/epl-v10.html. -* You must accept the terms of that agreement to use this software. -* -* Copyright (c) 2002-2013 Pentaho Corporation.. All rights reserved. -*/ - -package mondrian.olap.fun; - -import mondrian.calc.*; -import mondrian.calc.impl.AbstractIntegerCalc; -import mondrian.mdx.ResolvedFunCall; -import mondrian.olap.*; - -/** - * Definition of the Count MDX function. - * - * @author jhyde - * @since Mar 23, 2006 - */ -class CountFunDef extends AbstractAggregateFunDef { - static final String[] ReservedWords = - new String[] {"INCLUDEEMPTY", "EXCLUDEEMPTY"}; - - static final ReflectiveMultiResolver Resolver = - new ReflectiveMultiResolver( - "Count", - "Count([, EXCLUDEEMPTY | INCLUDEEMPTY])", - "Returns the number of tuples in a set, empty cells included unless the optional EXCLUDEEMPTY flag is used.", - new String[]{"fnx", "fnxy"}, - CountFunDef.class, - ReservedWords); - - public CountFunDef(FunDef dummyFunDef) { - super(dummyFunDef); - } - - public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) { - final Calc calc = - compiler.compileAs( - call.getArg(0), null, ResultStyle.ITERABLE_ANY); - final boolean includeEmpty = - call.getArgCount() < 2 - || ((Literal) call.getArg(1)).getValue().equals( - "INCLUDEEMPTY"); - return new AbstractIntegerCalc( - call, - new Calc[] {calc}) - { - public int evaluateInteger(Evaluator evaluator) { - final int savepoint = evaluator.savepoint(); - try { - evaluator.setNonEmpty(false); - final int count; - if (calc instanceof IterCalc) { - IterCalc iterCalc = (IterCalc) calc; - TupleIterable iterable = - evaluateCurrentIterable(iterCalc, evaluator); - count = count(evaluator, iterable, includeEmpty); - } else { - // must be ListCalc - ListCalc listCalc = (ListCalc) calc; - TupleList list = - evaluateCurrentList(listCalc, evaluator); - count = count(evaluator, list, includeEmpty); - } - return count; - } finally { - evaluator.restore(savepoint); - } - } - - public boolean dependsOn(Hierarchy hierarchy) { - // COUNT(, INCLUDEEMPTY) is straightforward -- it - // depends only on the dimensions that depends - // on. - if (super.dependsOn(hierarchy)) { - return true; - } - if (includeEmpty) { - return false; - } - // COUNT(, EXCLUDEEMPTY) depends only on the - // dimensions that depends on, plus all - // dimensions not masked by the set. - return ! calc.getType().usesHierarchy(hierarchy, true); - } - }; - -/* - RME OLD STUFF - final ListCalc memberListCalc = - compiler.compileList(call.getArg(0)); - final boolean includeEmpty = - call.getArgCount() < 2 || - ((Literal) call.getArg(1)).getValue().equals( - "INCLUDEEMPTY"); - return new AbstractIntegerCalc( - call, new Calc[] {memberListCalc}) { - public int evaluateInteger(Evaluator evaluator) { - List memberList = - evaluateCurrentList(memberListCalc, evaluator); - return count(evaluator, memberList, includeEmpty); - } - - public boolean dependsOn(Dimension dimension) { - // COUNT(, INCLUDEEMPTY) is straightforward -- it - // depends only on the dimensions that depends - // on. - if (super.dependsOn(dimension)) { - return true; - } - if (includeEmpty) { - return false; - } - // COUNT(, EXCLUDEEMPTY) depends only on the - // dimensions that depends on, plus all - // dimensions not masked by the set. - if (memberListCalc.getType().usesDimension(dimension, true)) { - return false; - } - return true; - } - }; -*/ - } -} - -// End CountFunDef.java diff --git a/contact-center/app/src/main/java/mondrian/olap/fun/FunUtil.java b/contact-center/app/src/main/java/mondrian/olap/fun/FunUtil.java deleted file mode 100644 index 596982da..00000000 --- a/contact-center/app/src/main/java/mondrian/olap/fun/FunUtil.java +++ /dev/null @@ -1,3621 +0,0 @@ -/* -// This software is subject to the terms of the Eclipse Public License v1.0 -// Agreement, available at the following URL: -// http://www.eclipse.org/legal/epl-v10.html. -// You must accept the terms of that agreement to use this software. -// -// Copyright (C) 2002-2005 Julian Hyde -// Copyright (C) 2005-2014 Pentaho and others -// All Rights Reserved. -*/ -package mondrian.olap.fun; - -import mondrian.calc.*; -import mondrian.calc.impl.*; -import mondrian.mdx.*; -import mondrian.olap.*; -import mondrian.olap.type.*; -import mondrian.resource.MondrianResource; -import mondrian.rolap.*; -import mondrian.util.*; - -import org.apache.commons.collections.ComparatorUtils; -import org.apache.commons.collections.comparators.ComparatorChain; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.*; - -/** - * {@code FunUtil} contains a set of methods useful within the {@code - * mondrian.olap.fun} package. - * - * @author jhyde - * @since 1.0 - */ -public class FunUtil extends Util { - private static final Logger LOGGER = - LoggerFactory.getLogger(FunUtil.class); - private static final String SORT_TIMING_NAME = "Sort"; - private static final String SORT_EVAL_TIMING_NAME = "EvalForSort"; - - static final String[] emptyStringArray = new String[0]; - private static final boolean debug = false; - public static final NullMember NullMember = new NullMember(); - - /** - * Special value which indicates that a {@code double} computation - * has returned the MDX null value. See {@link DoubleCalc}. - */ - public static final double DoubleNull = 0.000000012345; - - /** - * Special value which indicates that a {@code double} computation - * has returned the MDX EMPTY value. See {@link DoubleCalc}. - */ - public static final double DoubleEmpty = -0.000000012345; - - /** - * Special value which indicates that an {@code int} computation - * has returned the MDX null value. See {@link mondrian.calc.IntegerCalc}. - */ - public static final int IntegerNull = Integer.MIN_VALUE + 1; - - /** - * Null value in three-valued boolean logic. - * Actually, a placeholder until we actually implement 3VL. - */ - public static final boolean BooleanNull = false; - - /** - * Creates an exception which indicates that an error has occurred while - * executing a given function. - * - * @param funDef Function being executed - * @param message Explanatory message - * @return Exception that can be used as a cell result - */ - public static RuntimeException newEvalException( - FunDef funDef, - String message) - { - Util.discard(funDef); // TODO: use this - return new MondrianEvaluationException(message); - } - - /** - * Creates an exception which indicates that an error has occurred while - * executing a given function. - * - * @param throwable Exception - * @return Exception that can be used as a cell result - */ - public static RuntimeException newEvalException(Throwable throwable) { - return new MondrianEvaluationException( - throwable.getClass().getName() + ": " + throwable.getMessage()); - } - - /** - * Creates an exception which indicates that an error has occurred while - * executing a given function. - * - * @param message Explanatory message - * @param throwable Exception - * @return Exception that can be used as a cell result - */ - public static RuntimeException newEvalException( - String message, - Throwable throwable) - { - return new MondrianEvaluationException( - message - + ": " + Util.getErrorMessage(throwable)); - } - - public static void checkIterListResultStyles(Calc calc) { - switch (calc.getResultStyle()) { - case ITERABLE: - case LIST: - case MUTABLE_LIST: - break; - default: - throw ResultStyleException.generateBadType( - ResultStyle.ITERABLE_LIST_MUTABLELIST, - calc.getResultStyle()); - } - } - - public static void checkListResultStyles(Calc calc) { - switch (calc.getResultStyle()) { - case LIST: - case MUTABLE_LIST: - break; - default: - throw ResultStyleException.generateBadType( - ResultStyle.LIST_MUTABLELIST, - calc.getResultStyle()); - } - } - - /** - * Returns an argument whose value is a literal. - */ - static String getLiteralArg( - ResolvedFunCall call, - int i, - String defaultValue, - String[] allowedValues) - { - if (i >= call.getArgCount()) { - if (defaultValue == null) { - throw newEvalException( - call.getFunDef(), - "Required argument is missing"); - } else { - return defaultValue; - } - } - Exp arg = call.getArg(i); - if (!(arg instanceof Literal) - || arg.getCategory() != Category.Symbol) - { - throw newEvalException( - call.getFunDef(), - "Expected a symbol, found '" + arg + "'"); - } - String s = (String) ((Literal) arg).getValue(); - StringBuilder sb = new StringBuilder(64); - for (int j = 0; j < allowedValues.length; j++) { - String allowedValue = allowedValues[j]; - if (allowedValue.equalsIgnoreCase(s)) { - return allowedValue; - } - if (j > 0) { - sb.append(", "); - } - sb.append(allowedValue); - } - throw newEvalException( - call.getFunDef(), - "Allowed values are: {" + sb + "}"); - } - - /** - * Returns the ordinal of a literal argument. If the argument does not - * belong to the supplied enumeration, returns -1. - */ - static > E getLiteralArg( - ResolvedFunCall call, - int i, - E defaultValue, - Class allowedValues) - { - if (i >= call.getArgCount()) { - if (defaultValue == null) { - throw newEvalException( - call.getFunDef(), - "Required argument is missing"); - } else { - return defaultValue; - } - } - Exp arg = call.getArg(i); - if (!(arg instanceof Literal) - || arg.getCategory() != Category.Symbol) - { - throw newEvalException( - call.getFunDef(), - "Expected a symbol, found '" + arg + "'"); - } - String s = (String) ((Literal) arg).getValue(); - for (E e : allowedValues.getEnumConstants()) { - if (e.name().equalsIgnoreCase(s)) { - return e; - } - } - StringBuilder buf = new StringBuilder(64); - int k = 0; - for (E e : allowedValues.getEnumConstants()) { - if (k++ > 0) { - buf.append(", "); - } - buf.append(e.name()); - } - throw newEvalException( - call.getFunDef(), - "Allowed values are: {" + buf + "}"); - } - - /** - * Throws an error if the expressions don't have the same hierarchy. - * @throws MondrianEvaluationException if expressions don't have the same - * hierarchy - */ - static void checkCompatible(Exp left, Exp right, FunDef funDef) { - final Type leftType = TypeUtil.stripSetType(left.getType()); - final Type rightType = TypeUtil.stripSetType(right.getType()); - if (!TypeUtil.isUnionCompatible(leftType, rightType)) { - throw newEvalException( - funDef, "Expressions must have the same hierarchy"); - } - } - - /** - * Adds every element of {@code right} which is not in {@code set} - * to both {@code set} and {@code left}. - */ - static void addUnique( - TupleList left, - TupleList right, - Set> set) - { - assert left != null; - assert right != null; - if (right.isEmpty()) { - return; - } - for (List o : right) { - if (set.add(o)) { - left.add(o); - } - } - } - - /** - * Returns the default hierarchy of a dimension, or null if there is no - * default. - * - * @see MondrianResource#CannotImplicitlyConvertDimensionToHierarchy - * - * @param dimension Dimension - * @return Default hierarchy, or null - */ - public static Hierarchy getDimensionDefaultHierarchy(Dimension dimension) { - final Hierarchy[] hierarchies = dimension.getHierarchies(); - if (hierarchies.length == 1) { - return hierarchies[0]; - } - if (MondrianProperties.instance().SsasCompatibleNaming.get()) { - // In SSAS 2005, dimensions with more than one hierarchy do not have - // a default hierarchy. - return null; - } - for (Hierarchy hierarchy : hierarchies) { - if (hierarchy.getName() == null - || hierarchy.getUniqueName().equals(dimension.getUniqueName())) - { - return hierarchy; - } - } - return null; - } - - static List addMembers( - final SchemaReader schemaReader, - final List members, - final Hierarchy hierarchy) - { - // only add accessible levels - for (Level level : schemaReader.getHierarchyLevels(hierarchy)) { - addMembers(schemaReader, members, level); - } - return members; - } - - static void addMembers( - SchemaReader schemaReader, - List members, - Level level) - { - List levelMembers = schemaReader.getLevelMembers(level, true); - members.addAll(levelMembers); - } - - /** - * Removes every member from a list which is calculated. - * The list must not be null, and must consist only of members. - * - * @param memberList Member list - * @return List of non-calculated members - */ - static List removeCalculatedMembers(List memberList) - { - List clone = new ArrayList<>(); - for (Member member : memberList) { - if (member.isCalculated()) { - continue; - } - clone.add(member); - } - return clone; - } - - /** - * Removes every tuple from a list which is calculated. - * The list must not be null, and must consist only of members. - * - * @param memberList Member list - * @return List of non-calculated members - */ - static TupleList removeCalculatedMembers(TupleList memberList) - { - if (memberList.getArity() == 1) { - return new UnaryTupleList( - removeCalculatedMembers( - memberList.slice(0))); - } else { - final TupleList clone = memberList.cloneList(memberList.size()); - outer: - for (List members : memberList) { - for (Member member : members) { - if (member.isCalculated()) { - continue outer; - } - } - clone.add(members); - } - return clone; - } - } - - /** - * Returns whether {@code m0} is an ancestor of {@code m1}. - * - * @param strict if true, a member is not an ancestor of itself - */ - static boolean isAncestorOf(Member m0, Member m1, boolean strict) { - if (strict) { - if (m1 == null) { - return false; - } - m1 = m1.getParentMember(); - } - while (m1 != null) { - if (m1.equals(m0)) { - return true; - } - m1 = m1.getParentMember(); - } - return false; - } - - /** - * For each member in a list, evaluates an expression and creates a map - * from members to values. - * - *

If the list contains tuples, use - * {@link #evaluateTuples(mondrian.olap.Evaluator, mondrian.calc.Calc, mondrian.calc.TupleList)}. - * - * @param evaluator Evaluation context - * @param exp Expression to evaluate - * @param memberIter Iterable over the collection of members - * @param memberList List to be populated with members, or null - * @param parentsToo If true, evaluate the expression for all ancestors - * of the members as well - * - * @pre exp != null - * @pre exp.getType() instanceof ScalarType - */ - static Map evaluateMembers( - Evaluator evaluator, - Calc exp, - Iterable memberIter, - List memberList, - boolean parentsToo) - { - final int savepoint = evaluator.savepoint(); - try { - assert exp.getType() instanceof ScalarType; - Map mapMemberToValue = - new HashMap<>(); - for (Member member : memberIter) { - if (memberList != null) { - memberList.add(member); - } - while (true) { - evaluator.setContext(member); - Object result = exp.evaluate(evaluator); - if (result == null) { - result = Util.nullValue; - } - mapMemberToValue.put(member, result); - if (!parentsToo) { - break; - } - member = member.getParentMember(); - if (member == null) { - break; - } - if (mapMemberToValue.containsKey(member)) { - break; - } - } - } - return mapMemberToValue; - } finally { - evaluator.restore(savepoint); - } - } - - /** - * For each tuple in a list, evaluates an expression and creates a map - * from tuples to values. - * - * @param evaluator Evaluation context - * @param exp Expression to evaluate - * @param tuples List of tuples - * - * @pre exp != null - * @pre exp.getType() instanceof ScalarType - */ - static Map, Object> evaluateTuples( - Evaluator evaluator, - Calc exp, - TupleList tuples) - { - final int savepoint = evaluator.savepoint(); - - try { - assert exp.getType() instanceof ScalarType; - final Map, Object> mapMemberToValue = - new HashMap<>(); - for (List tuple : tuples) { - evaluator.setContext(tuple); - Object result = exp.evaluate(evaluator); - if (result == null) { - result = Util.nullValue; - } - mapMemberToValue.put(tuple, result); - } - return mapMemberToValue; - } finally { - evaluator.restore(savepoint); - } - } - - /** - * Helper function to sort a list of members according to an expression. - * - *

NOTE: This function does not preserve the contents of the validator. - * - *

If you do not specify {@code memberList}, the method - * will build its own member list as it iterates over {@code memberIter}. - * It is acceptable if {@code memberList} and {@code memberIter} are the - * same list object. - * - *

If you specify {@code memberList}, the list is sorted in place, and - * memberList is returned. - * - * @param evaluator Evaluator - * @param memberIter Iterable over members - * @param memberList List of members - * @param exp Expression to sort on - * @param desc Whether to sort descending - * @param brk Whether to break - * @return sorted list (never null) - */ - static List sortMembers( - Evaluator evaluator, - Iterable memberIter, - List memberList, - Calc exp, - boolean desc, - boolean brk) - { - if ((memberList != null) && (memberList.size() <= 1)) { - return memberList; - } - - evaluator.getTiming().markStart(SORT_EVAL_TIMING_NAME); - boolean timingEval = true; - boolean timingSort = false; - try { - // REVIEW mberkowitz 1/09: test whether precomputing - // values saves time. - Map mapMemberToValue; - final boolean parentsToo = !brk; - if (memberList == null) { - memberList = new ArrayList<>(); - mapMemberToValue = evaluateMembers( - evaluator, exp, memberIter, memberList, parentsToo); - } else { - mapMemberToValue = evaluateMembers( - evaluator, exp, memberIter, null, parentsToo); - } - - MemberComparator comp; - if (brk) { - comp = new BreakMemberComparator(evaluator, exp, desc); - } else { - comp = new HierarchicalMemberComparator(evaluator, exp, desc); - } - comp.preloadValues(mapMemberToValue); - evaluator.getTiming().markEnd(SORT_EVAL_TIMING_NAME); - timingEval = false; - evaluator.getTiming().markStart(SORT_TIMING_NAME); - timingSort = true; - Collections.sort(memberList, comp.wrap()); - return memberList; - } finally { - if (timingEval) { - evaluator.getTiming().markEnd(SORT_EVAL_TIMING_NAME); - } else if (timingSort) { - evaluator.getTiming().markEnd(SORT_TIMING_NAME); - } - } - } - - /** - * Sorts a list of members according to a list of SortKeySpecs. - * An in-place, Stable sort. - * Helper function for MDX OrderSet function. - * - *

NOTE: Does not preserve the contents of the validator. - */ - static List sortMembers( - Evaluator evaluator, - Iterable memberIter, - List memberList, - List keySpecList) - { - if ((memberList != null) && (memberList.size() <= 1)) { - return memberList; - } - if (memberList == null) { - memberList = new ArrayList<>(); - for (Member member : memberIter) { - memberList.add(member); - } - if (memberList.size() <= 1) { - return memberList; - } - } - - ComparatorChain chain = new ComparatorChain(); - for (SortKeySpec key : keySpecList) { - boolean brk = key.direction.brk; - MemberComparator comp; - if (brk) { - comp = new BreakMemberComparator( - evaluator, key.key, key.direction.descending); - } else { - comp = new HierarchicalMemberComparator( - evaluator, key.key, key.direction.descending); - } - comp.preloadValues(memberList); - chain.addComparator(comp.wrap(), false); - } - - Collections.sort(memberList, chain); - return memberList; - } - - /** - * Sorts a list of Tuples by the value of an applied expression. Stable - * sort. - * - *

Helper function for MDX functions TopCount, TopSum, TopPercent, - * BottomCount, BottomSum, BottomPercent, but not the MDX function Order. - * - *

NOTE: This function does not preserve the contents of the validator. - * - *

If you specify {@code tupleList}, the list is sorted in place, and - * tupleList is returned. - * - * @param evaluator Evaluator - * @param tupleIterable Iterator over tuples - * @param tupleList List of tuples, if known, otherwise null - * @param exp Expression to sort on - * @param desc Whether to sort descending - * @param brk Whether to break - * @param arity Number of members in each tuple - * @return sorted list (never null) - */ - public static TupleList sortTuples( - Evaluator evaluator, - TupleIterable tupleIterable, - TupleList tupleList, - Calc exp, - boolean desc, - boolean brk, - int arity) - { - // NOTE: This method does not implement the iterable/list concept - // as fully as sortMembers. This is because sortMembers evaluates all - // sort expressions up front. There, it is efficient to unravel the - // iterator and evaluate the sort expressions at the same time. - List> tupleArrayList; - if (tupleList == null) { - tupleArrayList = new ArrayList<>(); - final TupleCursor cursor = tupleIterable.tupleCursor(); - while (cursor.forward()) { - tupleArrayList.add(cursor.current()); - } - if (tupleArrayList.size() <= 1) { - return new DelegatingTupleList( - tupleIterable.getArity(), - tupleArrayList); - } - } else { - if (tupleList.size() <= 1) { - return tupleList; - } - tupleArrayList = tupleList; - } - - @SuppressWarnings({"unchecked"}) - List[] tuples = - tupleArrayList.toArray(new List[tupleArrayList.size()]); - final DelegatingTupleList result = - new DelegatingTupleList( - tupleIterable.getArity(), - Arrays.asList(tuples)); - - Comparator> comparator; - if (brk) { - comparator = - new BreakTupleComparator(evaluator, exp, arity); - if (desc) { - comparator = Collections.reverseOrder(comparator); - } - } else { - comparator = - new HierarchicalTupleComparator(evaluator, exp, arity, desc); - } - - Arrays.sort(tuples, comparator); - - if (LOGGER.isDebugEnabled()) { - StringBuilder sb = - new StringBuilder("FunUtil.sortTuples returned:"); - for (List tuple : tuples) { - sb.append("\n"); - sb.append(tuple.toString()); - } - LOGGER.debug(sb.toString()); - } - - return result; - } - - /** - * Partially sorts a list of Members by the value of an applied expression. - * - *

Avoids sorting the whole list, finds only the ntop (or bottom) - * valued Members, and returns them as a new List. Helper function for MDX - * functions TopCount and BottomCount.

- * - *

NOTE: Does not preserve the contents of the validator.

- * - * @param list a list of members - * @param exp a Calc applied to each member to find its sort-key - * @param evaluator Evaluator - * @param limit maximum count of members to return. - * @param desc true to sort descending (and find TopCount), false to sort - * ascending (and find BottomCount). - * @return the top or bottom members, as a new list. - */ - public static List partiallySortMembers( - Evaluator evaluator, - List list, - Calc exp, - int limit, - boolean desc) - { - assert list.size() > 0; - assert limit <= list.size(); - evaluator.getTiming().markStart(SORT_EVAL_TIMING_NAME); - boolean timingEval = true; - boolean timingSort = false; - try { - MemberComparator comp = - new BreakMemberComparator(evaluator, exp, desc); - Map valueMap = - evaluateMembers(evaluator, exp, list, null, false); - evaluator.getTiming().markEnd(SORT_EVAL_TIMING_NAME); - timingEval = false; - evaluator.getTiming().markStart(SORT_TIMING_NAME); - timingSort = true; - comp.preloadValues(valueMap); - return stablePartialSort(list, comp.wrap(), limit); - } finally { - if (timingEval) { - evaluator.getTiming().markEnd(SORT_EVAL_TIMING_NAME); - } else if (timingSort) { - evaluator.getTiming().markEnd(SORT_TIMING_NAME); - } - } - } - - /** - * Helper function to sort a list of tuples according to a list - * of expressions and a list of sorting flags. - * - *

NOTE: This function does not preserve the contents of the validator. - */ - static TupleList sortTuples( - Evaluator evaluator, - TupleIterable tupleIter, - TupleList tupleList, - List keySpecList, - int arity) - { - if (tupleList == null) { - tupleList = TupleCollections.createList(arity); - TupleCursor cursor = tupleIter.tupleCursor(); - while (cursor.forward()) { - tupleList.addCurrent(cursor); - } - } - if (tupleList.size() <= 1) { - return tupleList; - } - - ComparatorChain chain = new ComparatorChain(); - for (SortKeySpec key : keySpecList) { - boolean brk = key.direction.brk; - boolean orderByKey = - key.key.isWrapperFor(MemberOrderKeyFunDef.CalcImpl.class); - if (brk) { - TupleExpMemoComparator comp = - new BreakTupleComparator(evaluator, key.key, arity); - comp.preloadValues(tupleList); - chain.addComparator(comp, key.direction.descending); - } else if (orderByKey) { - TupleExpMemoComparator comp = - new HierarchicalTupleKeyComparator( - evaluator, key.key, arity); - comp.preloadValues(tupleList); - chain.addComparator(comp, key.direction.descending); - } else { - TupleExpComparator comp = - new HierarchicalTupleComparator( - evaluator, key.key, arity, key.direction.descending); - chain.addComparator(comp, false); - } - } - - Collections.sort(tupleList, chain); - - if (LOGGER.isDebugEnabled()) { - StringBuilder sb = - new StringBuilder("FunUtil.sortTuples returned:"); - for (List tuple : tupleList) { - sb.append("\n"); - sb.append(tuple.toString()); - } - LOGGER.debug(sb.toString()); - } - - return tupleList; - } - - /** - * Partially sorts a list of Tuples by the value of an applied expression. - * - *

Avoids sorting the whole list, finds only the n top (or bottom) - * valued Tuples, and returns them as a new List. Helper function for MDX - * functions TopCount and BottomCount. - * - *

NOTE: Does not preserve the contents of the validator. The returned - * list is immutable. - * - * @param evaluator Evaluator - * @param list a list of tuples - * @param exp a Calc applied to each tuple to find its sort-key - * @param limit maximum count of tuples to return. - * @param desc true to sort descending (and find TopCount), - * false to sort ascending (and find BottomCount). - * @return the top or bottom tuples, as a new list. - */ - public static List> partiallySortTuples( - Evaluator evaluator, - TupleList list, - Calc exp, - int limit, - boolean desc) - { - assert list.size() > 0; - assert limit <= list.size(); - Comparator> comp = - new BreakTupleComparator(evaluator, exp, list.getArity()); - if (desc) { - comp = Collections.reverseOrder(comp); - } - return stablePartialSort(list, comp, limit); - } - - /** - * Sorts a list of members into hierarchical order. The members must belong - * to the same dimension. - * - * @param memberList List of members - * @param post Whether to sort in post order; if false, sorts in pre order - * - * @see #hierarchizeTupleList(mondrian.calc.TupleList, boolean) - */ - public static void hierarchizeMemberList( - List memberList, - boolean post) - { - if (memberList.size() <= 1) { - return; - } - if (memberList.get(0).getDimension().isHighCardinality()) { - return; - } - Comparator comparator = new HierarchizeComparator(post); - Collections.sort(memberList, comparator); - } - - /** - * Sorts a list of tuples into hierarchical order. - * - * @param tupleList List of tuples - * @param post Whether to sort in post order; if false, sorts in pre order - * - * @see #hierarchizeMemberList(java.util.List, boolean) - */ - public static TupleList hierarchizeTupleList( - TupleList tupleList, - boolean post) - { - if (tupleList.isEmpty()) { - TupleCollections.emptyList(tupleList.getArity()); - } - final TupleList fixedList = tupleList.fix(); - if (tupleList.getArity() == 1) { - hierarchizeMemberList(fixedList.slice(0), post); - return fixedList; - } - Comparator> comparator = - new HierarchizeTupleComparator(fixedList.getArity(), post); - - Collections.sort(fixedList, comparator); - - if (LOGGER.isDebugEnabled()) { - StringBuilder sb = - new StringBuilder("FunUtil.hierarchizeTupleList returned:"); - for (List tuple : fixedList) { - sb.append("\n"); - sb.append(tuple.toString()); - } - } - - return fixedList; - } - - /** - * Compares double-precision values according to MDX semantics. - * - *

MDX requires a total order: - *

- * -inf < NULL < ... < -1 < ... < 0 < ... < NaN < - * +inf - *
- * but this is different than Java semantics, specifically with regard - * to {@link Double#NaN}. - */ - public static int compareValues(double d1, double d2) { - if (Double.isNaN(d1)) { - if (d2 == Double.POSITIVE_INFINITY) { - return -1; - } else if (Double.isNaN(d2)) { - return 0; - } else { - return 1; - } - } else if (Double.isNaN(d2)) { - if (d1 == Double.POSITIVE_INFINITY) { - return 1; - } else { - return -1; - } - } else if (d1 == d2) { - return 0; - } else if (d1 == FunUtil.DoubleNull) { - if (d2 == Double.NEGATIVE_INFINITY) { - return 1; - } else { - return -1; - } - } else if (d2 == FunUtil.DoubleNull) { - if (d1 == Double.NEGATIVE_INFINITY) { - return -1; - } else { - return 1; - } - } else if (d1 < d2) { - return -1; - } else { - return 1; - } - } - - /** - * Compares two cell values. - * - *

Nulls compare last, exceptions (including the - * object which indicates the the cell is not in the cache yet) next, - * then numbers and strings are compared by value. - * - * @param value0 First cell value - * @param value1 Second cell value - * @return -1, 0, or 1, depending upon whether first cell value is less - * than, equal to, or greater than the second - */ - public static int compareValues(Object value0, Object value1) { - if (value0 == value1) { - return 0; - } - // null is less than anything else - if (value0 == null) { - return -1; - } - if (value1 == null) { - return 1; - } - - if (value0 == RolapUtil.valueNotReadyException) { - // the left value is not in cache; continue as best as we can - return -1; - } else if (value1 == RolapUtil.valueNotReadyException) { - // the right value is not in cache; continue as best as we can - return 1; - } else if (value0 == Util.nullValue) { - return -1; // null == -infinity - } else if (value1 == Util.nullValue) { - return 1; // null == -infinity - } else if (value0 instanceof String) { - return ((String) value0).compareToIgnoreCase((String) value1); - } else if (value0 instanceof Number) { - return FunUtil.compareValues( - ((Number) value0).doubleValue(), - ((Number) value1).doubleValue()); - } else if (value0 instanceof Date) { - return ((Date) value0).compareTo((Date) value1); - } else if (value0 instanceof OrderKey) { - return ((OrderKey) value0).compareTo(value1); - } else { - throw Util.newInternal("cannot compare " + value0); - } - } - - /** - * Turns the mapped values into relative values (percentages) for easy - * use by the general topOrBottom function. This might also be a useful - * function in itself. - */ - static void toPercent( - TupleList members, - Map, Object> mapMemberToValue) - { - double total = 0; - int memberCount = members.size(); - for (final List key : members) { - final Object o = mapMemberToValue.get(key); - if (o instanceof Number) { - total += ((Number) o).doubleValue(); - } - } - for (final List key : members) { - final Object o = mapMemberToValue.get(key); - if (o instanceof Number) { - double d = ((Number) o).doubleValue(); - mapMemberToValue.put( - key, - d / total * (double) 100); - } - } - } - - - /** - * Decodes the syntactic type of an operator. - * - * @param flags A encoded string which represents an operator signature, - * as used by the {@code flags} parameter used to construct a - * {@link FunDefBase}. - * - * @return A {@link Syntax} - */ - public static Syntax decodeSyntacticType(String flags) { - char c = flags.charAt(0); - switch (c) { - case 'p': - return Syntax.Property; - case 'f': - return Syntax.Function; - case 'm': - return Syntax.Method; - case 'i': - return Syntax.Infix; - case 'P': - return Syntax.Prefix; - case 'Q': - return Syntax.Postfix; - case 'I': - return Syntax.Internal; - default: - throw newInternal( - "unknown syntax code '" + c + "' in string '" + flags + "'"); - } - } - - /** - * Decodes the signature of a function into a category code which describes - * the return type of the operator. - * - *

For example, decodeReturnType("fnx") returns - * {@link Category#Numeric}, indicating this function has a - * numeric return value. - * - * @param flags The signature of an operator, - * as used by the {@code flags} parameter used to construct a - * {@link FunDefBase}. - * - * @return An array {@link Category} codes. - */ - public static int decodeReturnCategory(String flags) { - final int returnCategory = decodeCategory(flags, 1); - if ((returnCategory & Category.Mask) != returnCategory) { - throw newInternal("bad return code flag in flags '" + flags + "'"); - } - return returnCategory; - } - - /** - * Decodes the {@code offset}th character of an encoded method - * signature into a type category. - * - *

The codes are: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
a{@link Category#Array}
d{@link Category#Dimension}
h{@link Category#Hierarchy}
l{@link Category#Level}
b{@link Category#Logical}
m{@link Category#Member}
NConstant {@link Category#Numeric}
n{@link Category#Numeric}
x{@link Category#Set}
#Constant {@link Category#String}
S{@link Category#String}
t{@link Category#Tuple}
v{@link Category#Value}
y{@link Category#Symbol}
- * - * @param flags Encoded signature string - * @param offset 0-based offset of character within string - * @return A {@link Category} - */ - public static int decodeCategory(String flags, int offset) { - char c = flags.charAt(offset); - switch (c) { - case 'a': - return Category.Array; - case 'd': - return Category.Dimension; - case 'h': - return Category.Hierarchy; - case 'l': - return Category.Level; - case 'b': - return Category.Logical; - case 'm': - return Category.Member; - case 'N': - return Category.Numeric | Category.Constant; - case 'n': - return Category.Numeric; - case 'I': - return Category.Numeric | Category.Integer | Category.Constant; - case 'i': - return Category.Numeric | Category.Integer; - case 'x': - return Category.Set; - case '#': - return Category.String | Category.Constant; - case 'S': - return Category.String; - case 't': - return Category.Tuple; - case 'v': - return Category.Value; - case 'y': - return Category.Symbol; - case 'U': - return Category.Null; - case 'e': - return Category.Empty; - case 'D': - return Category.DateTime; - default: - throw newInternal( - "unknown type code '" + c + "' in string '" + flags + "'"); - } - } - - /** - * Decodes a string of parameter types into an array of type codes. - * - *

Each character is decoded using {@link #decodeCategory(String, int)}. - * For example, decodeParameterTypes("nx") returns - * {{@link Category#Numeric}, {@link Category#Set}}. - * - * @param flags The signature of an operator, - * as used by the {@code flags} parameter used to construct a - * {@link FunDefBase}. - * - * @return An array {@link Category} codes. - */ - public static int[] decodeParameterCategories(String flags) { - int[] parameterCategories = new int[flags.length() - 2]; - for (int i = 0; i < parameterCategories.length; i++) { - parameterCategories[i] = decodeCategory(flags, i + 2); - } - return parameterCategories; - } - - /** - * Converts a double (primitive) value to a Double. {@link #DoubleNull} - * becomes null. - */ - public static Double box(double d) { - return d == DoubleNull - ? null - : d; - } - - /** - * Converts an int (primitive) value to an Integer. {@link #IntegerNull} - * becomes null. - */ - public static Integer box(int n) { - return n == IntegerNull - ? null - : n; - } - - static double percentile( - Evaluator evaluator, - TupleList members, - Calc exp, - double p) - { - SetWrapper sw = evaluateSet(evaluator, members, exp); - if (sw.errorCount > 0) { - return Double.NaN; - } else if (sw.v.size() == 0) { - return FunUtil.DoubleNull; - } - double[] asArray = new double[sw.v.size()]; - for (int i = 0; i < asArray.length; i++) { - asArray[i] = (Double) sw.v.get(i); - } - Arrays.sort(asArray); - - // The median is defined as the value that has exactly the same - // number of entries before it in the sorted list as after. - // So, if the number of entries in the list is odd, the - // median is the entry at (length-1)/2 (using zero-based indexes). - // If the number of entries is even, the median is defined as the - // arithmetic mean of the two numbers in the middle of the list, or - // (entries[length/2 - 1] + entries[length/2]) / 2. - int length = asArray.length; - if (p <= 0.0) { - return asArray[0]; - } else if (p >= 1.0) { - return asArray[length - 1]; - } else if (length == 1) { - return asArray[0]; - } else if (p == 0.5) { - // Special case for median. - if ((length & 1) == 1) { - // The length is odd. Note that length/2 is an integer - // expression, and it's positive so we save ourselves a divide. - return asArray[length >> 1]; - } else { - return (asArray[(length >> 1) - 1] + asArray[length >> 1]) - / 2.0; - } - } else { - final double jD = Math.floor(length * p); - int j = jD > 0 ? (int) jD - 1 : (int) jD; - double alpha = (p * length) - jD; - assert alpha >= 0; - assert alpha <= 1; - return asArray[j] + ((asArray[j + 1] - asArray[j]) * alpha); - } - } - - /** - * Returns the member which lies upon a particular quartile according to a - * given expression. - * - * @param evaluator Evaluator - * @param members List of members - * @param exp Expression to rank members - * @param range Quartile (1, 2 or 3) - * - * @pre range >= 1 && range <= 3 - */ - protected static double quartile( - Evaluator evaluator, - TupleList members, - Calc exp, - int range) - { - assert range >= 1 && range <= 3; - - SetWrapper sw = evaluateSet(evaluator, members, exp); - if (sw.errorCount > 0) { - return Double.NaN; - } else if (sw.v.size() == 0) { - return DoubleNull; - } - - double[] asArray = new double[sw.v.size()]; - for (int i = 0; i < asArray.length; i++) { - asArray[i] = ((Double) sw.v.get(i)).doubleValue(); - } - - Arrays.sort(asArray); - // get a quartile, median is a second q - double dm = 0.25 * asArray.length * range; - int median = (int) Math.floor(dm); - return dm == median && median < asArray.length - 1 - ? (asArray[median] + asArray[median + 1]) / 2 - : asArray[median]; - } - - public static Object min( - Evaluator evaluator, - TupleList members, - Calc calc) - { - SetWrapper sw = evaluateSet(evaluator, members, calc); - if (sw.errorCount > 0) { - return Double.NaN; - } else { - final int size = sw.v.size(); - if (size == 0) { - return Util.nullValue; - } else { - Double min = ((Number) sw.v.get(0)).doubleValue(); - for (int i = 1; i < size; i++) { - Double iValue = ((Number) sw.v.get(i)).doubleValue(); - if (iValue < min) { - min = iValue; - } - } - return min; - } - } - } - - public static Object max( - Evaluator evaluator, - TupleList members, - Calc exp) - { - SetWrapper sw = evaluateSet(evaluator, members, exp); - if (sw.errorCount > 0) { - return Double.NaN; - } else { - final int size = sw.v.size(); - if (size == 0) { - return Util.nullValue; - } else { - Double max = ((Number) sw.v.get(0)).doubleValue(); - for (int i = 1; i < size; i++) { - Double iValue = ((Number) sw.v.get(i)).doubleValue(); - if (iValue > max) { - max = iValue; - } - } - return max; - } - } - } - - static Object var( - Evaluator evaluator, - TupleList members, - Calc exp, - boolean biased) - { - SetWrapper sw = evaluateSet(evaluator, members, exp); - return _var(sw, biased); - } - - private static Object _var(SetWrapper sw, boolean biased) { - if (sw.errorCount > 0) { - return Double.NaN; - } else if (sw.v.size() == 0) { - return Util.nullValue; - } else { - double stdev = 0.0; - double avg = _avg(sw); - for (int i = 0; i < sw.v.size(); i++) { - stdev += - Math.pow((((Number) sw.v.get(i)).doubleValue() - avg), 2); - } - int n = sw.v.size(); - if (!biased) { - n--; - } - return stdev / (double) n; - } - } - - static double correlation( - Evaluator evaluator, - TupleList memberList, - Calc exp1, - Calc exp2) - { - SetWrapper sw1 = evaluateSet(evaluator, memberList, exp1); - SetWrapper sw2 = evaluateSet(evaluator, memberList, exp2); - Object covar = _covariance(sw1, sw2, false); - Object var1 = _var(sw1, false); // this should be false, yes? - Object var2 = _var(sw2, false); - - return ((Number) covar).doubleValue() - / Math.sqrt( - ((Number) var1).doubleValue() - * ((Number) var2).doubleValue()); - } - - static Object covariance( - Evaluator evaluator, - TupleList members, - Calc exp1, - Calc exp2, - boolean biased) - { - final int savepoint = evaluator.savepoint(); - SetWrapper sw1; - try { - sw1 = evaluateSet(evaluator, members, exp1); - } finally { - evaluator.restore(savepoint); - } - SetWrapper sw2; - try { - sw2 = evaluateSet(evaluator, members, exp2); - } finally { - evaluator.restore(savepoint); - } - // todo: because evaluateSet does not add nulls to the SetWrapper, this - // solution may lead to mismatched lists and is therefore not robust - return _covariance(sw1, sw2, biased); - } - - - private static Object _covariance( - SetWrapper sw1, - SetWrapper sw2, - boolean biased) - { - if (sw1.v.size() != sw2.v.size()) { - return Util.nullValue; - } - double avg1 = _avg(sw1); - double avg2 = _avg(sw2); - double covar = 0.0; - for (int i = 0; i < sw1.v.size(); i++) { - // all of this casting seems inefficient - can we make SetWrapper - // contain an array of double instead? - double diff1 = (((Number) sw1.v.get(i)).doubleValue() - avg1); - double diff2 = (((Number) sw2.v.get(i)).doubleValue() - avg2); - covar += (diff1 * diff2); - } - int n = sw1.v.size(); - if (!biased) { - n--; - } - return covar / (double) n; - } - - static Object stdev( - Evaluator evaluator, - TupleList members, - Calc exp, - boolean biased) - { - Object o = var(evaluator, members, exp, biased); - return (o instanceof Double) - ? new Double(Math.sqrt(((Number) o).doubleValue())) - : o; - } - - public static Object avg( - Evaluator evaluator, - TupleList members, - Calc calc) - { - SetWrapper sw = evaluateSet(evaluator, members, calc); - return (sw.errorCount > 0) - ? new Double(Double.NaN) - : (sw.v.size() == 0) - ? Util.nullValue - : new Double(_avg(sw)); - } - - // TODO: parameterize inclusion of nulls; also, maybe make _avg a method of - // setwrapper, so we can cache the result (i.e. for correl) - private static double _avg(SetWrapper sw) { - double sum = 0.0; - for (int i = 0; i < sw.v.size(); i++) { - sum += ((Number) sw.v.get(i)).doubleValue(); - } - // TODO: should look at context and optionally include nulls - return sum / (double) sw.v.size(); - } - - public static Object sum( - Evaluator evaluator, - TupleList members, - Calc exp) - { - double d = sumDouble(evaluator, members, exp); - return d == DoubleNull ? Util.nullValue : new Double(d); - } - - public static double sumDouble( - Evaluator evaluator, - TupleList members, - Calc exp) - { - SetWrapper sw = evaluateSet(evaluator, members, exp); - if (sw.errorCount > 0) { - return Double.NaN; - } else if (sw.v.size() == 0) { - return DoubleNull; - } else { - double sum = 0.0; - for (int i = 0; i < sw.v.size(); i++) { - sum += ((Number) sw.v.get(i)).doubleValue(); - } - return sum; - } - } - - public static double sumDouble( - Evaluator evaluator, - TupleIterable iterable, - Calc exp) - { - SetWrapper sw = evaluateSet(evaluator, iterable, exp); - if (sw.errorCount > 0) { - return Double.NaN; - } else if (sw.v.size() == 0) { - return DoubleNull; - } else { - double sum = 0.0; - for (int i = 0; i < sw.v.size(); i++) { - sum += ((Number) sw.v.get(i)).doubleValue(); - } - return sum; - } - } - - public static int count( - Evaluator evaluator, - TupleIterable iterable, - boolean includeEmpty) - { - if (iterable == null) { - return 0; - } - if (includeEmpty) { - if (iterable instanceof TupleList) { - return ((TupleList) iterable).size(); - } else { - int retval = 0; - TupleCursor cursor = iterable.tupleCursor(); - while (cursor.forward()) { - retval++; - } - return retval; - } - } else { - int retval = 0; - TupleCursor cursor = iterable.tupleCursor(); - while (cursor.forward()) { - cursor.setContext(evaluator); - if (!evaluator.currentIsEmpty()) { - retval++; - } - } - return retval; - } - } - - /** - * Evaluates {@code exp} (if defined) over {@code members} to - * generate a {@link List} of {@link SetWrapper} objects, which contains - * a {@link Double} value and meta information, unlike - * {@link #evaluateMembers}, which only produces values. - * - * @pre exp != null - */ - static SetWrapper evaluateSet( - Evaluator evaluator, - TupleIterable members, - Calc calc) - { - assert members != null; - assert calc != null; - assert calc.getType() instanceof ScalarType; - - // todo: treat constant exps as evaluateMembers() does - SetWrapper retval = new SetWrapper(); - final TupleCursor cursor = members.tupleCursor(); - while (cursor.forward()) { - cursor.setContext(evaluator); - Object o = calc.evaluate(evaluator); - if (o == null || o == Util.nullValue) { - retval.nullCount++; - } else if (o == RolapUtil.valueNotReadyException) { - // Carry on summing, so that if we are running in a - // BatchingCellReader, we find out all the dependent cells we - // need - retval.errorCount++; - } else if (o instanceof Number) { - retval.v.add(((Number) o).doubleValue()); - } else { - retval.v.add(o); - } - } - return retval; - } - - /** - * Evaluates one or more expressions against the member list returning - * a SetWrapper array. Where this differs very significantly from the - * above evaluateSet methods is how it count null values and Throwables; - * this method adds nulls to the SetWrapper Vector rather than not adding - * anything - as the above method does. The impact of this is that if, for - * example, one was creating a list of x,y values then each list will have - * the same number of values (though some might be null) - this allows - * higher level code to determine how to handle the lack of data rather than - * having a non-equal number (if one is plotting x,y values it helps to - * have the same number and know where a potential gap is the data is. - */ - static SetWrapper[] evaluateSet( - Evaluator evaluator, - TupleList list, - DoubleCalc[] calcs) - { - Util.assertPrecondition(calcs != null, "calcs != null"); - - // todo: treat constant exps as evaluateMembers() does - SetWrapper[] retvals = new SetWrapper[calcs.length]; - for (int i = 0; i < calcs.length; i++) { - retvals[i] = new SetWrapper(); - } - final TupleCursor cursor = list.tupleCursor(); - while (cursor.forward()) { - cursor.setContext(evaluator); - for (int i = 0; i < calcs.length; i++) { - DoubleCalc calc = calcs[i]; - SetWrapper retval = retvals[i]; - double o = calc.evaluateDouble(evaluator); - if (o == FunUtil.DoubleNull) { - retval.nullCount++; - retval.v.add(null); - } else { - retval.v.add(o); - } - // TODO: If the expression yielded an error, carry on - // summing, so that if we are running in a - // BatchingCellReader, we find out all the dependent cells - // we need - } - } - return retvals; - } - - static List periodsToDate( - Evaluator evaluator, - Level level, - Member member) - { - if (member == null) { - member = evaluator.getContext(level.getHierarchy()); - } - Member m = member; - while (m != null) { - if (m.getLevel() == level) { - break; - } - m = m.getParentMember(); - } - // If m == null, then "level" was lower than member's level. - // periodsToDate([Time].[Quarter], [Time].[1997] is valid, - // but will return an empty List - List members = new ArrayList<>(); - if (m != null) { - // e.g. m is [Time].[1997] and member is [Time].[1997].[Q1].[3] - // we now have to make m to be the first member of the range, - // so m becomes [Time].[1997].[Q1].[1] - SchemaReader reader = evaluator.getSchemaReader(); - m = Util.getFirstDescendantOnLevel(reader, m, member.getLevel()); - reader.getMemberRange(level, m, member, members); - } - return members; - } - - static List memberRange( - Evaluator evaluator, - Member startMember, - Member endMember) - { - final Level level = startMember.getLevel(); - assertTrue(level == endMember.getLevel()); - List members = new ArrayList<>(); - evaluator.getSchemaReader().getMemberRange( - level, startMember, endMember, members); - - if (members.isEmpty()) { - // The result is empty, so maybe the members are reversed. This is - // cheaper than comparing the members before we call getMemberRange. - evaluator.getSchemaReader().getMemberRange( - level, endMember, startMember, members); - } - return members; - } - - /** - * Returns the member under ancestorMember having the same relative position - * under member's parent. - *

For exmaple, cousin([Feb 2001], [Q3 2001]) is [August 2001]. - * @param schemaReader The reader to use - * @param member The member for which we'll find the cousin. - * @param ancestorMember The cousin's ancestor. - * - * @return The child of {@code ancestorMember} in the same position - * under {@code ancestorMember} as {@code member} is under its - * parent. - */ - static Member cousin( - SchemaReader schemaReader, - Member member, - Member ancestorMember) - { - if (ancestorMember.isNull()) { - return ancestorMember; - } - if (member.getHierarchy() != ancestorMember.getHierarchy()) { - throw MondrianResource.instance().CousinHierarchyMismatch.ex( - member.getUniqueName(), ancestorMember.getUniqueName()); - } - if (member.getLevel().getDepth() - < ancestorMember.getLevel().getDepth()) - { - return member.getHierarchy().getNullMember(); - } - - Member cousin = cousin2(schemaReader, member, ancestorMember); - if (cousin == null) { - cousin = member.getHierarchy().getNullMember(); - } - - return cousin; - } - - private static Member cousin2( - SchemaReader schemaReader, - Member member1, - Member member2) - { - if (member1.getLevel() == member2.getLevel()) { - return member2; - } - Member uncle = - cousin2(schemaReader, member1.getParentMember(), member2); - if (uncle == null) { - return null; - } - int ordinal = Util.getMemberOrdinalInParent(schemaReader, member1); - List cousins = schemaReader.getMemberChildren(uncle); - if (cousins.size() <= ordinal) { - return null; - } - return cousins.get(ordinal); - } - - /** - * Returns the ancestor of {@code member} at the given level - * or distance. It is assumed that any error checking required - * has been done prior to calling this function. - * - *

This method takes into consideration the fact that there - * may be intervening hidden members between {@code member} - * and the ancestor. If {@code targetLevel} is not null, then - * the method will only return a member if the level at - * {@code distance} from the member is actually the - * {@code targetLevel} specified. - * - * @param evaluator The evaluation context - * @param member The member for which the ancestor is to be found - * @param distance The distance up the chain the ancestor is to - * be found. - * - * @param targetLevel The desired targetLevel of the ancestor. If - * {@code null}, then the distance completely determines the desired - * ancestor. - * - * @return The ancestor member, or {@code null} if no such - * ancestor exists. - */ - static Member ancestor( - Evaluator evaluator, - Member member, - int distance, - Level targetLevel) - { - if ((targetLevel != null) - && (member.getHierarchy() != targetLevel.getHierarchy())) - { - throw MondrianResource.instance().MemberNotInLevelHierarchy.ex( - member.getUniqueName(), targetLevel.getUniqueName()); - } - - if (distance == 0) { - // Shortcut if there's nowhere to go. - return member; - } else if (distance < 0) { - // Can't go backwards. - return member.getHierarchy().getNullMember(); - } - - final List ancestors = new ArrayList<>(); - final SchemaReader schemaReader = evaluator.getSchemaReader(); - schemaReader.getMemberAncestors(member, ancestors); - - Member result = member.getHierarchy().getNullMember(); - - searchLoop: - for (final Member ancestorMember : ancestors) { - if (targetLevel != null) { - if (ancestorMember.getLevel() == targetLevel) { - if (schemaReader.isVisible(ancestorMember)) { - result = ancestorMember; - break; - } else { - result = member.getHierarchy().getNullMember(); - break; - } - } - } else { - if (schemaReader.isVisible(ancestorMember)) { - distance--; - - // Make sure that this ancestor is really on the right - // targetLevel. If a targetLevel was specified and at least - // one of the ancestors was hidden, this this algorithm goes - // too far up the ancestor list. It's not a problem, except - // that we need to check if it's happened and return the - // hierarchy's null member instead. - // - // For example, consider what happens with - // Ancestor([Store].[Israel].[Haifa], [Store].[Store - // State]). The distance from [Haifa] to [Store State] is - // 1, but that lands us at the country targetLevel, which is - // clearly wrong. - if (distance == 0) { - result = ancestorMember; - break; - } - } - } - } - - return result; - } - - /** - * Compares a pair of members according to their positions in a - * prefix-order (or postfix-order, if {@code post} is true) walk - * over a hierarchy. - * - * @param m1 First member - * @param m2 Second member - * - * @param post Whether to sortMembers in postfix order. If true, a parent - * will sortMembers immediately after its last child. If false, a parent - * will sortMembers immediately before its first child. - * - * @return -1 if m1 collates before m2, - * 0 if m1 equals m2, - * 1 if m1 collates after m2 - */ - public static int compareHierarchically( - Member m1, - Member m2, - boolean post) - { - // Strip away the LimitedRollupMember wrapper, if it exists. The - // wrapper does not implement equals and comparisons correctly. This - // is safe this method has no side-effects: it just returns an int. - m1 = unwrapLimitedRollupMember(m1); - m2 = unwrapLimitedRollupMember(m2); - - if (equals(m1, m2)) { - return 0; - } - - while (true) { - int depth1 = m1.getDepth(); - int depth2 = m2.getDepth(); - if (depth1 < depth2) { - m2 = m2.getParentMember(); - if (equals(m1, m2)) { - return post ? 1 : -1; - } - } else if (depth1 > depth2) { - m1 = m1.getParentMember(); - if (equals(m1, m2)) { - return post ? -1 : 1; - } - } else { - Member prev1 = m1; - Member prev2 = m2; - m1 = unwrapLimitedRollupMember(m1.getParentMember()); - m2 = unwrapLimitedRollupMember(m2.getParentMember()); - if (equals(m1, m2)) { - final int c = compareSiblingMembers(prev1, prev2); - // compareHierarchically needs to impose a total order; - // cannot return 0 for non-equal members - assert c != 0 - : "Members " + prev1 + ", " + prev2 - + " are not equal, but compare returned 0."; - return c; - } - } - } - } - - private static Member unwrapLimitedRollupMember(Member m) { - if (m instanceof RolapHierarchy.LimitedRollupMember) { - return ((RolapHierarchy.LimitedRollupMember) m).member; - } - return m; - } - /** - * Compares two members which are known to have the same parent. - * - * First, compare by ordinal. - * This is only valid now we know they're siblings, because - * ordinals are only unique within a parent. - * If the dimension does not use ordinals, both ordinals - * will be -1. - * - *

If the ordinals do not differ, compare using regular member - * comparison. - * - * @param m1 First member - * @param m2 Second member - * @return -1 if m1 collates less than m2, - * 1 if m1 collates after m2, - * 0 if m1 == m2. - */ - public static int compareSiblingMembers(Member m1, Member m2) { - // calculated members collate after non-calculated - final boolean calculated1 = m1.isCalculatedInQuery(); - final boolean calculated2 = m2.isCalculatedInQuery(); - if (calculated1) { - if (!calculated2) { - return 1; - } - } else { - if (calculated2) { - return -1; - } - } - final Comparable k1 = m1.getOrderKey(); - final Comparable k2 = m2.getOrderKey(); - if ((k1 != null) && (k2 != null)) { - return k1.compareTo(k2); - } else { - final int ordinal1 = m1.getOrdinal(); - final int ordinal2 = m2.getOrdinal(); - return (ordinal1 == ordinal2) - ? m1.compareTo(m2) - : (ordinal1 < ordinal2) - ? -1 - : 1; - } - } - - /** - * Returns whether one of the members in a tuple is null. - */ - public static boolean tupleContainsNullMember(Member[] tuple) { - for (Member member : tuple) { - if (member.isNull()) { - return true; - } - } - return false; - } - - /** - * Returns whether one of the members in a tuple is null. - */ - public static boolean tupleContainsNullMember(List tuple) { - for (Member member : tuple) { - if (member.isNull()) { - return true; - } - } - return false; - } - - public static Member[] makeNullTuple(final TupleType tupleType) { - final Type[] elementTypes = tupleType.elementTypes; - Member[] members = new Member[elementTypes.length]; - for (int i = 0; i < elementTypes.length; i++) { - MemberType type = (MemberType) elementTypes[i]; - members[i] = makeNullMember(type); - } - return members; - } - - static Member makeNullMember(MemberType memberType) { - Hierarchy hierarchy = memberType.getHierarchy(); - if (hierarchy == null) { - return NullMember; - } - return hierarchy.getNullMember(); - } - - /** - * Validates the arguments to a function and resolves the function. - * - * @param validator Validator used to validate function arguments and - * resolve the function - * @param funDef Function definition, or null to deduce definition from - * name, syntax and argument types - * @param args Arguments to the function - * @param newArgs Output parameter for the resolved arguments - * @param name Function name - * @param syntax Syntax style used to invoke function - * @return resolved function definition - */ - public static FunDef resolveFunArgs( - Validator validator, - FunDef funDef, - Exp[] args, - Exp[] newArgs, - String name, - Syntax syntax) - { - for (int i = 0; i < args.length; i++) { - newArgs[i] = validator.validate(args[i], false); - } - if (funDef == null || validator.alwaysResolveFunDef()) { - funDef = validator.getDef(newArgs, name, syntax); - } - checkNativeCompatible(validator, funDef, newArgs); - return funDef; - } - - /** - * Functions that dynamically return one or more members of the measures - * dimension prevent us from using native evaluation. - * - * @param validator Validator used to validate function arguments and - * resolve the function - * @param funDef Function definition, or null to deduce definition from - * name, syntax and argument types - * @param args Arguments to the function - */ - private static void checkNativeCompatible( - Validator validator, - FunDef funDef, - Exp[] args) - { - // If the first argument to a function is either: - // 1) the measures dimension or - // 2) a measures member where the function returns another member or - // a set, - // then these are functions that dynamically return one or more - // members of the measures dimension. In that case, we cannot use - // native cross joins because the functions need to be executed to - // determine the resultant measures. - // - // As a result, we disallow functions like AllMembers applied on the - // Measures dimension as well as functions like the range operator, - // siblings, and lag, when the argument is a measure member. - // However, we do allow functions like isEmpty, rank, and topPercent. - // - // Also, the Set and Parentheses functions are ok since they're - // essentially just containers. - Query query = validator.getQuery(); - if (!(funDef instanceof SetFunDef) - && !(funDef instanceof ParenthesesFunDef) - && query != null - && query.nativeCrossJoinVirtualCube()) - { - int[] paramCategories = funDef.getParameterCategories(); - if (paramCategories.length > 0) { - final int cat0 = paramCategories[0]; - final Exp arg0 = args[0]; - switch (cat0) { - case Category.Dimension: - case Category.Hierarchy: - if (arg0 instanceof DimensionExpr - && ((DimensionExpr) arg0).getDimension().isMeasures() - && !(funDef instanceof HierarchyCurrentMemberFunDef)) - { - query.setVirtualCubeNonNativeCrossJoin(); - } - break; - case Category.Member: - if (arg0 instanceof MemberExpr - && ((MemberExpr) arg0).getMember().isMeasure() - && isMemberOrSet(funDef.getReturnCategory())) - { - query.setVirtualCubeNonNativeCrossJoin(); - } - break; - } - } - } - } - - private static boolean isMemberOrSet(int category) { - return category == Category.Member || category == Category.Set; - } - - static void appendTuple(StringBuilder buf, Member[] members) { - buf.append("("); - for (int j = 0; j < members.length; j++) { - if (j > 0) { - buf.append(", "); - } - Member member = members[j]; - buf.append(member.getUniqueName()); - } - buf.append(")"); - } - - /** - * Returns whether two tuples are equal. - * - *

The members are allowed to be in different positions. For example, - * ([Gender].[M], [Store].[USA]) IS ([Store].[USA], - * [Gender].[M]) returns {@code true}. - */ - static boolean equalTuple(Member[] members0, Member[] members1) { - final int count = members0.length; - if (count != members1.length) { - return false; - } - outer: - for (int i = 0; i < count; i++) { - // First check the member at the corresponding ordinal. It is more - // likely to be there. - final Member member0 = members0[i]; - if (member0.equals(members1[i])) { - continue; - } - // Look for this member in other positions. - // We can assume that the members in members0 are distinct (because - // they belong to different dimensions), so this test is valid. - for (int j = 0; j < count; j++) { - if (i != j && member0.equals(members1[j])) { - continue outer; - } - } - // This member of members0 does not occur in any position of - // members1. The tuples are not equal. - return false; - } - return true; - } - - static FunDef createDummyFunDef( - Resolver resolver, - int returnCategory, - Exp[] args) - { - final int[] argCategories = ExpBase.getTypes(args); - return new FunDefBase(resolver, returnCategory, argCategories) { - }; - } - - public static List getNonEmptyMemberChildren( - Evaluator evaluator, - Member member) - { - SchemaReader sr = evaluator.getSchemaReader(); - if (evaluator.isNonEmpty()) { - return sr.getMemberChildren(member, evaluator); - } else { - return sr.getMemberChildren(member); - } - } - - public static Map - getNonEmptyMemberChildrenWithDetails( - Evaluator evaluator, Member member) - { - SchemaReader sr = evaluator.getSchemaReader(); - if (evaluator.isNonEmpty()) { - return (Map) - sr.getMemberChildrenWithDetails(member, evaluator); - } else { - return (Map) - sr.getMemberChildrenWithDetails(member, null); - } - } - - /** - * Returns members of a level which are not empty (according to the - * criteria expressed by the evaluator). - * - * @param evaluator Evaluator, determines non-empty criteria - * @param level Level - * @param includeCalcMembers Whether to include calculated members - */ - static List getNonEmptyLevelMembers( - final Evaluator evaluator, - final Level level, - final boolean includeCalcMembers) - { - SchemaReader sr = evaluator.getSchemaReader(); - if (evaluator.isNonEmpty()) { - List members = sr.getLevelMembers(level, evaluator); - if (includeCalcMembers) { - return addLevelCalculatedMembers(sr, level, members); - } - return members; - } - return sr.getLevelMembers(level, includeCalcMembers); - } - - static TupleList levelMembers( - final Level level, - final Evaluator evaluator, - final boolean includeCalcMembers) - { - List memberList = - getNonEmptyLevelMembers(evaluator, level, includeCalcMembers); - TupleList tupleList; - if (!includeCalcMembers) { - memberList = removeCalculatedMembers(memberList); - } - final List memberListClone = new ArrayList<>(memberList); - tupleList = new UnaryTupleList(memberListClone); - return hierarchizeTupleList(tupleList, false); - } - - static TupleList hierarchyMembers( - Hierarchy hierarchy, - Evaluator evaluator, - final boolean includeCalcMembers) - { - TupleList tupleList = new UnaryTupleList(); - final List memberList = tupleList.slice(0); - if (evaluator.isNonEmpty()) { - // Allow the SQL generator to generate optimized SQL since we know - // we're only interested in non-empty members of this level. - for (Level level : hierarchy.getLevels()) { - List members = - getNonEmptyLevelMembers( - evaluator, level, includeCalcMembers); - memberList.addAll(members); - } - } else { - final List memberList1 = addMembers( - evaluator.getSchemaReader(), - new ConcatenableList<>(), - hierarchy); - if (includeCalcMembers) { - memberList.addAll(memberList1); - } else { - // Same effect as calling removeCalculatedMembers(tupleList) - // but one fewer copy of the list. - for (Member member1 : memberList1) { - if (!member1.isCalculated()) { - memberList.add(member1); - } - } - } - } - return hierarchizeTupleList(tupleList, false); - } - - /** - * Partial Sort: sorts in place an array of Objects using a given Comparator, - * but only enough so that the N biggest (or smallest) items are at the start - * of the array. Not a stable sort, unless the Comparator is so contrived. - * - * @param items will be partially-sorted in place - * @param comp a Comparator; null means use natural comparison - */ - static void partialSort(T[] items, Comparator comp, int limit) - { - if (comp == null) { - //noinspection unchecked - comp = (Comparator) ComparatorUtils.naturalComparator(); - } - new Quicksorter(items, comp).partialSort(limit); - } - - /** - * Stable partial sort of a list. Returns the desired head of the list. - */ - public static List stablePartialSort( - final List list, final Comparator comp, int limit) - { - return stablePartialSort(list, comp, limit, 0); - } - - /** - * Stable partial sort of a list, using a specified algorithm. - */ - public static List stablePartialSort( - final List list, final Comparator comp, int limit, int algorithm) - { - assert limit <= list.size(); - assert list.size() > 0; - for (;;) { - switch (algorithm) { - case 0: - float ratio = (float) limit / (float) list.size(); - if (ratio <= .05) { - algorithm = 4; // julian's acd - } else if (ratio <= .35) { - algorithm = 2; // marc's acd - } else { - algorithm = 1; // array sort - } - break; - case 1: - return stablePartialSortArray(list, comp, limit); - case 2: - return stablePartialSortMarc(list, comp, limit); - case 3: - return stablePartialSortPedro(list, comp, limit); - case 4: - return stablePartialSortJulian(list, comp, limit); - default: - throw new RuntimeException(); - } - } - } - - /** - * Partial sort an array by sorting it and returning the first {@code limit} - * elements. Fastest approach if limit is a significant fraction of the - * list. - */ - public static List stablePartialSortArray( - final List list, final Comparator comp, int limit) - { - ArrayList list2 = new ArrayList<>(list); - Collections.sort(list2, comp); - return list2.subList(0, limit); - } - - /** - * Marc's original acd for stable partial sort of a list. - * Now superseded by {@link #stablePartialSortJulian}. - */ - public static List stablePartialSortMarc( - final List list, final Comparator comp, int limit) - { - assert limit >= 0; - - // Load an array of pairs {list-item, list-index}. - // List-index is a secondary sort key, to give a stable sort. - // REVIEW Can we use a simple T[], with the index implied? - // REVIEW When limit is big relative to list size, faster to - // mergesort. Test for this. - int n = list.size(); // O(n) to scan list - @SuppressWarnings({"unchecked"}) - final ObjIntPair[] pairs = new ObjIntPair[n]; - - int i = 0; - for (T item : list) { // O(n) to scan list - pairs[i] = new ObjIntPair<>(item, i); - ++i; - } - - Comparator> pairComp = - (x, y) -> { - int val = comp.compare(x.t, y.t); - if (val == 0) { - val = x.i - y.i; - } - return val; - }; - - final int length = Math.min(limit, n); - // O(n + limit * log(limit)) to quicksort - partialSort(pairs, pairComp, length); - - // Use an abstract list to avoid doing a copy. The result is immutable. - return new AbstractList() { - @Override - public T get(int index) { - return pairs[index].t; - } - - @Override - public int size() { - return length; - } - }; - } - - /** - * Pedro's acd for stably sorting the top {@code limit} items in - * a list. - */ - public static List stablePartialSortPedro( - final List list, final Comparator comp, int limit) - { - final ObjIntPair[] pairs = new ObjIntPair[limit]; - Comparator> pairComp = - (x, y) -> { - int val = comp.compare(x.t, y.t); - if (val == 0) { - val = x.i - y.i; - } - return val; - }; - - int filled = 0; - T maximum = null; - int maximumIndex = 0; - int originalIndex = 0; - for (T item : list) { // O(n) to scan list - switch (filled) { - case 0: - maximum = item; - pairs[0] = new ObjIntPair<>(item, originalIndex); - filled++; - break; - default: - if (filled < limit) { - pairs[filled] = new ObjIntPair<>(item, originalIndex); - - if (comp.compare(item, maximum) > 0) { - maximum = item; - maximumIndex = filled; - } - filled++; - } else { - if (comp.compare(item, maximum) < 0) { - pairs[maximumIndex] = - new ObjIntPair<>(item, originalIndex); - maximum = pairs[0].t; - maximumIndex = 0; - for (int i = 0; i < filled; i++) { - if (comp.compare(pairs[i].t, maximum) > 0) { - maximum = pairs[i].t; - maximumIndex = i; - } - } - } - } - } - originalIndex++; - } - - Arrays.sort(pairs, pairComp); - - if (false) - for (int i = 0; i < limit; i++) { - T item = pairs[i].t; - T originalItem = list.get(i); - int itemIndex = pairs[i].i; - if (itemIndex < i) { - if (pairs[itemIndex].i > i) { - list.set(pairs[itemIndex].i, originalItem); - } - } else { - list.set(itemIndex, originalItem); - } - list.set(i, item); - } - - List result = new ArrayList<>(limit); - for (int i = 0; i < limit; i++) { - result.add(list.get(pairs[i].i)); - } - return result; - } - - /** - * Julian's acd for stable partial sort. Improves Pedro's acd - * by using a heap (priority queue) for the top {@code limit} items seen. - * The items on the priority queue have an ordinal field, so the queue - * can be used to generate a list of stably sorted items. (Heap sort is - * not normally stable.) - * - * @param list List to sort - * @param comp Comparator - * @param limit Maximum number of items to return - * @param Element type - * @return Sorted list, containing at most limit items - */ - public static List stablePartialSortJulian( - final List list, final Comparator comp, int limit) - { - final Comparator> comp2 = - (o1, o2) -> { - int c = comp.compare(o1.t, o2.t); - if (c == 0) { - c = compare(o1.i, o2.i); - } - return -c; - }; - int filled = 0; - final PriorityQueue> queue = - new PriorityQueue<>(limit, comp2); - for (T element : list) { - if (filled < limit) { - queue.offer(new ObjIntPair<>(element, filled++)); - } else { - ObjIntPair head = queue.element(); - if (comp.compare(element, head.t) <= 0) { - ObjIntPair item = new ObjIntPair<>(element, filled++); - if (comp2.compare(item, head) >= 0) { - ObjIntPair poll = queue.remove(); - Util.discard(poll); - queue.offer(item); - } - } - } - } - - int n = queue.size(); - final Object[] elements = new Object[n]; - while (n > 0) { - elements[--n] = queue.poll().t; - } - assert queue.isEmpty(); - //noinspection unchecked - return Arrays.asList((T[]) elements); - } - - static TupleList parseTupleList( - Evaluator evaluator, - String string, - List hierarchies) - { - final IdentifierParser.TupleListBuilder builder = - new IdentifierParser.TupleListBuilder( - evaluator.getSchemaReader(), - evaluator.getCube(), - hierarchies); - IdentifierParser.parseTupleList(builder, string); - return builder.tupleList; - } - - /** - * Parses a tuple, of the form '(member, member, ...)'. - * There must be precisely one member for each hierarchy. - * - * - * @param evaluator Evaluator, provides a {@link mondrian.olap.SchemaReader} - * and {@link mondrian.olap.Cube} - * @param string String to parse - * @param i Position to start parsing in string - * @param members Output array of members - * @param hierarchies Hierarchies of the members - * @return Position where parsing ended in string - */ - private static int parseTuple( - final Evaluator evaluator, - String string, - int i, - final Member[] members, - List hierarchies) - { - final IdentifierParser.Builder builder = - new IdentifierParser.TupleBuilder( - evaluator.getSchemaReader(), - evaluator.getCube(), - hierarchies) - { - public void tupleComplete() { - super.tupleComplete(); - memberList.toArray(members); - } - }; - return IdentifierParser.parseTuple(builder, string, i); - } - - /** - * Parses a tuple, such as "([Gender].[M], [Marital Status].[S])". - * - * @param evaluator Evaluator, provides a {@link mondrian.olap.SchemaReader} - * and {@link mondrian.olap.Cube} - * @param string String to parse - * @param hierarchies Hierarchies of the members - * @return Tuple represented as array of members - */ - static Member[] parseTuple( - Evaluator evaluator, - String string, - List hierarchies) - { - final Member[] members = new Member[hierarchies.size()]; - int i = parseTuple(evaluator, string, 0, members, hierarchies); - // todo: check for garbage at end of string - if (FunUtil.tupleContainsNullMember(members)) { - return null; - } - return members; - } - - static List parseMemberList( - Evaluator evaluator, - String string, - Hierarchy hierarchy) - { - IdentifierParser.MemberListBuilder builder = - new IdentifierParser.MemberListBuilder( - evaluator.getSchemaReader(), - evaluator.getCube(), - hierarchy); - IdentifierParser.parseMemberList(builder, string); - return builder.memberList; - } - - private static int parseMember( - Evaluator evaluator, - String string, - int i, - final Member[] members, - Hierarchy hierarchy) - { - IdentifierParser.MemberListBuilder builder = - new IdentifierParser.MemberListBuilder( - evaluator.getSchemaReader(), evaluator.getCube(), hierarchy) - { - @Override - public void memberComplete() { - members[0] = resolveMember(hierarchyList.get(0)); - segmentList.clear(); - } - }; - return IdentifierParser.parseMember(builder, string, i); - } - - static Member parseMember( - Evaluator evaluator, String string, Hierarchy hierarchy) - { - Member[] members = {null}; - int i = parseMember(evaluator, string, 0, members, hierarchy); - // todo: check for garbage at end of string - final Member member = members[0]; - if (member == null) { - throw MondrianResource.instance().MdxChildObjectNotFound.ex( - string, evaluator.getCube().getQualifiedName()); - } - return member; - } - - /** - * Returns whether an expression is worth wrapping in "Cache( ... )". - * - * @param exp Expression - * @return Whether worth caching - */ - public static boolean worthCaching(Exp exp) { - // Literal is not worth caching. - if (exp instanceof Literal) { - return false; - } - // Member, hierarchy, level, or dimension expression is not worth - // caching. - if (exp instanceof MemberExpr - || exp instanceof LevelExpr - || exp instanceof HierarchyExpr - || exp instanceof DimensionExpr) - { - return false; - } - if (exp instanceof ResolvedFunCall) { - ResolvedFunCall call = (ResolvedFunCall) exp; - - // A set of literals is not worth caching. - if (call.getFunDef() instanceof SetFunDef) { - for (Exp setArg : call.getArgs()) { - if (worthCaching(setArg)) { - return true; - } - } - return false; - } - } - return true; - } - - // ~ Inner classes --------------------------------------------------------- - - /** - * A functional for {@link FunUtil#partialSort}. - * Sorts or partially sorts an array in ascending order, using a Comparator. - * - *

Algorithm: quicksort, or partial quicksort (alias - * "quickselect"), Hoare/Singleton. Partial quicksort is - * quicksort that recurs only on one side, which is thus - * tail-recursion. Picks pivot as median of three; falls back on - * insertion sort for small "subfiles". Partial quicksort is O(n - * + m log m), instead of O(n log n), where n is the input size, - * and m is the desired output size. - * - *

See D Knuth, Art of Computer Programming, 5.2.2 (Algorithm - * Q); R. Sedgewick, Algorithms in C, ch 5. Good summary in - * http://en.wikipedia.org/wiki/Selection_algorithm - * - *

TODO: What is the time-cost of this functor and of the nested - * Comparators? - */ - static class Quicksorter { - // size of smallest set worth a quicksort - public final int TOO_SMALL = 8; - - private static final Logger LOGGER = - LoggerFactory.getLogger(Quicksorter.class); - private final T[] vec; - private final Comparator comp; - private final boolean traced; - private long partitions, comparisons, exchanges; // stats - - public Quicksorter(T[] vec, Comparator comp) { - this.vec = vec; - this.comp = comp; - partitions = comparisons = exchanges = 0; - traced = LOGGER.isDebugEnabled(); - } - - private void traceStats(String prefix) { - StringBuilder sb = new StringBuilder(prefix); - sb.append(": "); - sb.append(partitions).append(" partitions, "); - sb.append(comparisons).append(" comparisons, "); - sb.append(exchanges).append(" exchanges."); - LOGGER.debug(sb.toString()); - } - - // equivalent to operator < - private boolean less(T x, T y) { - comparisons++; - return comp.compare(x, y) < 0; - } - - // equivalent to operator > - private boolean more(T x, T y) { - comparisons++; - return comp.compare(x, y) > 0; - } - // equivalent to operator > - private boolean equal(T x, T y) { - comparisons++; - return comp.compare(x, y) == 0; - } - - // swaps two items (identified by index in vec[]) - private void swap(int i, int j) { - exchanges++; - T temp = vec[i]; - vec[i] = vec[j]; - vec[j] = temp; - } - - // puts into ascending order three items - // (identified by index in vec[]) - // REVIEW: use only 2 comparisons?? - private void order3(int i, int j, int k) { - if (more(vec[i], vec[j])) { - swap(i, j); - } - if (more(vec[i], vec[k])) { - swap(i, k); - } - if (more(vec[j], vec[k])) { - swap(j, k); - } - } - - // runs a selection sort on the array segment VEC[START .. END] - private void selectionSort(int start, int end) { - for (int i = start; i < end; ++i) { - // pick the min of vec[i, end] - int pmin = i; - for (int j = i + 1; j <= end; ++j) { - if (less(vec[j], vec[pmin])) { - pmin = j; - } - } - if (pmin != i) { - swap(i, pmin); - } - } - } - - /** - * Runs one pass of quicksort on array segment VEC[START .. END], - * dividing it into two parts, the left side VEC[START .. P] none - * greater than the pivot value VEC[P], and the right side VEC[P+1 - * .. END] none less than the pivot value. Returns P, the index of the - * pivot element in VEC[]. - */ - private int partition(int start, int end) { - partitions++; - assert start <= end; - - // Find median of three (both ends and the middle). - // TODO: use pseudo-median of nine when array segment is big enough. - int mid = (start + end) / 2; - order3(start, mid, end); - if (end - start <= 2) { - return mid; // sorted! - } - - // Now the left and right ends are in place (ie in the correct - // partition), and will serve as sentinels for scanning. Pick middle - // as pivot and set it aside, in penultimate position. - final T pivot = vec[mid]; - swap(mid, end - 1); - - // Scan inward from both ends, swapping misplaced items. - int left = start + 1; // vec[start] is in place - int right = end - 2; // vec[end - 1] is pivot - while (left < right) { - // scan past items in correct place, but stop at a pivot value - // (Sedgewick's idea). - while (less(vec[left], pivot)) { - ++left; - } - while (less(pivot, vec[right])) { - --right; - } - if (debug) { - assert (left <= end) && (right >= start); - } - if (left < right) { // found a misplaced pair - swap(left, right); - ++left; --right; - } - } - if ((left == right) && less(vec[left], pivot)) { - ++left; - } - - // All scanned. Restore pivot to its rightful place. - swap(left, end - 1); - - if (debug) { - for (int i = start; i < left; i++) { - assert !more(vec[i], pivot); - } - assert equal(vec[left], pivot); - for (int i = left + 1; i <= end; i++) { - assert !less(vec[i], pivot); - } - } - return left; - } - - - // Runs quicksort on VEC[START, END]. Recursive version, - // TODO: exploit tail recursion - private void sort(int start, int end) { - if (end - start < TOO_SMALL) { - selectionSort(start, end); - return; - } - - // Split data, so that left side dominates the right side - // (but neither is sorted): - int mid = partition(start, end); - sort(start, mid - 1); - sort(mid + 1, end); - } - - // Runs quickselect(LIMIT) on VEC[START, END]. Recursive version, - // TODO: exploit tail recursion, unfold. - private void select(int limit, int start, int end) { - if (limit == 0) { - return; - } - if (end - start < TOO_SMALL) { - selectionSort(start, end); - return; - } - int mid = partition(start, end); - int leftSize = mid - start + 1; - if (limit < leftSize) { - // work on the left side, and ignore the right side - select(limit, start, mid); - } else { - limit -= leftSize; - // work on the right side, but keep the left side - select(limit, mid + 1, end); - } - } - - public void sort() { - int n = vec.length - 1; - sort(0, n); - if (traced) { - traceStats("quicksort on " + n + "items"); - } - } - - /** puts the LIMIT biggest items at the head, not sorted */ - public void select(int limit) { - int n = vec.length - 1; - select(limit, 0, n); - if (traced) { - traceStats("quickselect for " + limit + " from" + n + "items"); - } - } - - public void partialSort(int limit) { - int n = vec.length - 1; - select(limit, 0, n); - if (traced) { - traceStats( - "partial sort: quickselect phase for " - + limit + "from " + n + "items"); - } - sort(0, limit - 1); - if (traced) { - traceStats("partial sort: quicksort phase on " + n + "items"); - } - } - } - - /** - * Comparator for members. - * - *

Could genericize this to class<T> MemorizingComparator - * implements Comparator<T>, but not if it adds a run time - * cost, since the comparator is at the heart of the sort algorithms. - */ - private static abstract class MemberComparator implements Comparator - { - private static final Logger LOGGER = - LoggerFactory.getLogger(MemberComparator.class); - final Evaluator evaluator; - final Calc exp; - - private final int descMask; - private final Map valueMap; - - MemberComparator(Evaluator evaluator, Calc exp, boolean desc) - { - this.evaluator = evaluator; - this.exp = exp; - this.descMask = desc ? -1 : 1; - this.valueMap = new HashMap<>(); - } - - private int maybeNegate(int c) { - return descMask * c; - } - - // applies the Calc to a member, memorizing results - protected Object eval(Member m) - { - Object val = valueMap.get(m); - if (val == null) { - evaluator.setContext(m); - val = exp.evaluate(evaluator); - if (val == null) { - val = Util.nullValue; - } - valueMap.put(m, val); - } - return val; - } - - // wraps comparison with tracing - Comparator wrap() { - final MemberComparator comparator = this; - if (LOGGER.isDebugEnabled()) { - return (m1, m2) -> { - final int c = comparator.compare(m1, m2); - // here guaranteed that eval(m) finds a memorized value - LOGGER.debug( - "compare " - + m1.getUniqueName() + "(" + eval(m1) + "), " - + m2.getUniqueName() + "(" + eval(m2) + ")" - + " yields " + c); - return c; - }; - } else { - return this; - } - } - - // Preloads the value map with precomputed members (supplied as a map). - void preloadValues(Map map) { - valueMap.putAll(map); - } - - // Preloads the value map by applying the expression to a Collection of - // members. - void preloadValues(Collection members) { - for (Member m : members) { - eval(m); - } - } - - protected final int compareByValue(Member m1, Member m2) { - final int c = FunUtil.compareValues(eval(m1), eval(m2)); - return maybeNegate(c); - } - - protected final int compareHierarchicallyButSiblingsByValue( - Member m1, Member m2) - { - if (FunUtil.equals(m1, m2)) { - return 0; - } - while (true) { - int depth1 = m1.getDepth(), - depth2 = m2.getDepth(); - if (depth1 < depth2) { - m2 = m2.getParentMember(); - if (Util.equals(m1, m2)) { - return -1; - } - } else if (depth1 > depth2) { - m1 = m1.getParentMember(); - if (Util.equals(m1, m2)) { - return 1; - } - } else { - Member prev1 = m1, prev2 = m2; - m1 = m1.getParentMember(); - m2 = m2.getParentMember(); - if (Util.equals(m1, m2)) { - // including case where both parents are null - int c = compareByValue(prev1, prev2); - if (c != 0) { - return c; - } - // prev1 and prev2 are siblings. Order according to - // hierarchy, if the values do not differ. Needed to - // have a consistent sortMembers if members with equal - // (null!) values are compared. - c = FunUtil.compareSiblingMembers(prev1, prev2); - - // Do not negate c, even if we are sorting descending. - // This comparison is to achieve the 'natural order'. - return c; - } - } - } - } - } - - private static class HierarchicalMemberComparator - extends MemberComparator - { - HierarchicalMemberComparator( - Evaluator evaluator, Calc exp, boolean desc) - { - super(evaluator, exp, desc); - } - - public int compare(Member m1, Member m2) { - return compareHierarchicallyButSiblingsByValue(m1, m2); - } - } - - private static class BreakMemberComparator extends MemberComparator { - BreakMemberComparator(Evaluator evaluator, Calc exp, boolean desc) - { - super(evaluator, exp, desc); - } - - public final int compare(Member m1, Member m2) { - return compareByValue(m1, m2); - } - } - - /** - * Compares tuples, which are represented as lists of {@link Member}s. - */ - private static abstract class TupleComparator - implements Comparator> - { - final int arity; - TupleComparator(int arity) { - this.arity = arity; - } - } - - /** - * Extension to {@link TupleComparator} which compares tuples by evaluating - * an expression. - */ - private static abstract class TupleExpComparator extends TupleComparator { - final Evaluator evaluator; - final Calc calc; - - TupleExpComparator(Evaluator evaluator, Calc calc, int arity) { - super(arity); - this.evaluator = evaluator; - this.calc = calc; - } - } - - private static class HierarchicalTupleComparator - extends TupleExpComparator - { - private final boolean desc; - - HierarchicalTupleComparator( - Evaluator evaluator, Calc calc, int arity, boolean desc) - { - super(evaluator, calc, arity); - this.desc = desc; - } - - public int compare(List a1, List a2) { - int c = 0; - final int savepoint = evaluator.savepoint(); - try { - for (int i = 0; i < arity; i++) { - Member m1 = a1.get(i), m2 = a2.get(i); - c = compareHierarchicallyButSiblingsByValue(m1, m2); - if (c != 0) { - break; - } - // compareHierarchicallyButSiblingsByValue imposes a - // total order - assert m1.equals(m2); - evaluator.setContext(m1); - } - } finally { - evaluator.restore(savepoint); - } - return c; - } - - protected int compareHierarchicallyButSiblingsByValue( - Member m1, - Member m2) - { - if (FunUtil.equals(m1, m2)) { - return 0; - } - while (true) { - int depth1 = m1.getDepth(), - depth2 = m2.getDepth(); - if (depth1 < depth2) { - m2 = m2.getParentMember(); - if (FunUtil.equals(m1, m2)) { - return -1; - } - } else if (depth1 > depth2) { - m1 = m1.getParentMember(); - if (FunUtil.equals(m1, m2)) { - return 1; - } - } else { - Member prev1 = m1, prev2 = m2; - m1 = m1.getParentMember(); - m2 = m2.getParentMember(); - if (FunUtil.equals(m1, m2)) { - // including case where both parents are null - int c = compareByValue(prev1, prev2); - if (c == 0) { - c = FunUtil.compareSiblingMembers(prev1, prev2); - } - return desc ? -c : c; - } - } - } - } - - private int compareByValue(Member m1, Member m2) { - int c; - final int savepoint = evaluator.savepoint(); - try { - evaluator.setContext(m1); - Object v1 = calc.evaluate(evaluator); - evaluator.setContext(m2); - Object v2 = calc.evaluate(evaluator); - c = FunUtil.compareValues(v1, v2); - return c; - } finally { - // important to restore the evaluator state - evaluator.restore(savepoint); - } - } - } - - // almost the same as MemberComparator - static abstract class TupleExpMemoComparator extends TupleExpComparator { - private final Map, Object> valueMap = - new HashMap<>(); - - TupleExpMemoComparator(Evaluator e, Calc calc, int arity) - { - super(e, calc, arity); - } - - // applies the Calc to a tuple, memorizing results - protected Object eval(List t) - { - Object val = valueMap.get(t); - if (val != null) { - return val; - } - return compute(t); - } - - private Object compute(List key) { - evaluator.setContext(key); - Object val = calc.evaluate(evaluator); - if (val == null) { - val = Util.nullValue; - } - valueMap.put(key, val); - return val; - } - - // Preloads the value map by applying the expression to a Collection of - // members. - void preloadValues(TupleList tuples) { - for (List t : tuples) { - compute(t); - } - } - } - - private static class BreakTupleComparator extends TupleExpMemoComparator { - BreakTupleComparator(Evaluator e, Calc calc, int arity) { - super(e, calc, arity); - } - - public int compare(List a1, List a2) { - return FunUtil.compareValues(eval(a1), eval(a2)); - } - } - - private static class HierarchicalTupleKeyComparator - extends TupleExpMemoComparator - { - - HierarchicalTupleKeyComparator(Evaluator e, Calc calc, int arity) { - super(e, calc, arity); - } - - public int compare(List a1, List a2) { - OrderKey k1 = (OrderKey) eval(a1); - OrderKey k2 = (OrderKey) eval(a2); - return compareMemberOrderKeysHierarchically(k1, k2); - } - - private int compareMemberOrderKeysHierarchically( - OrderKey k1, OrderKey k2) - { - // null is less than anything else - if (k1 == Util.nullValue) { - return -1; - } - if (k2 == Util.nullValue) { - return 1; - } - Member m1 = k1.member; - Member m2 = k2.member; - if (FunUtil.equals(m1, m2)) { - return 0; - } - while (true) { - int depth1 = m1.getDepth(), - depth2 = m2.getDepth(); - if (depth1 < depth2) { - m2 = m2.getParentMember(); - if (FunUtil.equals(m1, m2)) { - return -1; - } - } else if (depth1 > depth2) { - m1 = m1.getParentMember(); - if (FunUtil.equals(m1, m2)) { - return 1; - } - } else { - Member prev1 = m1, prev2 = m2; - m1 = m1.getParentMember(); - m2 = m2.getParentMember(); - if (FunUtil.equals(m1, m2)) { - OrderKey pk1 = new OrderKey(prev1); - OrderKey pk2 = new OrderKey(prev2); - return FunUtil.compareValues(pk1, pk2); - } - } - } - } - } - - /** - * Compares lists of {@link Member}s so as to convert them into hierarchical - * order. Applies lexicographic order to the array. - */ - private static class HierarchizeTupleComparator extends TupleComparator { - private final boolean post; - - HierarchizeTupleComparator(int arity, boolean post) { - super(arity); - this.post = post; - } - - public int compare(List a1, List a2) { - for (int i = 0; i < arity; i++) { - Member m1 = a1.get(i), m2 = a2.get(i); - int c = FunUtil.compareHierarchically(m1, m2, post); - if (c != 0) { - return c; - } - } - return 0; - } - } - - /** - * Compares {@link Member}s so as to arrage them in prefix or postfix - * hierarchical order. - */ - private static class HierarchizeComparator implements Comparator { - private final boolean post; - - HierarchizeComparator(boolean post) { - this.post = post; - } - public int compare(Member m1, Member m2) { - return FunUtil.compareHierarchically(m1, m2, post); - } - } - - static class SetWrapper { - final List v = new ArrayList(); - public int errorCount = 0, nullCount = 0; - - // private double avg = Double.NaN; - // TODO: parameterize inclusion of nulls - // by making this a method of the SetWrapper, we can cache the result - // this allows its reuse in Correlation - // public double getAverage() { - // if (avg == Double.NaN) { - // double sum = 0.0; - // for (int i = 0; i < resolvers.size(); i++) { - // sum += ((Number) resolvers.elementAt(i)).doubleValue(); - // } - // // TODO: should look at context and optionally include nulls - // avg = sum / (double) resolvers.size(); - // } - // return avg; - // } - } - - /** - * Compares cell values, so that larger values compare first. - * - *

Nulls compare last, exceptions (including the - * object which indicates the the cell is not in the cache yet) next, - * then numbers and strings are compared by value. - */ - public static class DescendingValueComparator implements Comparator { - /** - * The singleton. - */ - static final DescendingValueComparator instance = - new DescendingValueComparator(); - - public int compare(Object o1, Object o2) { - return - compareValues(o1, o2); - } - } - - /** - * Null member of unknown hierarchy. - */ - private static class NullMember implements Member { - public Member getParentMember() { - throw new UnsupportedOperationException(); - } - - public Level getLevel() { - throw new UnsupportedOperationException(); - } - - public Hierarchy getHierarchy() { - throw new UnsupportedOperationException(); - } - - public String getParentUniqueName() { - throw new UnsupportedOperationException(); - } - - public MemberType getMemberType() { - throw new UnsupportedOperationException(); - } - - public boolean isParentChildLeaf() { - return false; - } - - public void setName(String name) { - throw new UnsupportedOperationException(); - } - - public boolean isAll() { - return false; - } - - public boolean isMeasure() { - throw new UnsupportedOperationException(); - } - - public boolean isNull() { - return true; - } - - public boolean isChildOrEqualTo(Member member) { - throw new UnsupportedOperationException(); - } - - public boolean isCalculated() { - throw new UnsupportedOperationException(); - } - - public boolean isEvaluated() { - throw new UnsupportedOperationException(); - } - - public int getSolveOrder() { - throw new UnsupportedOperationException(); - } - - public Exp getExpression() { - throw new UnsupportedOperationException(); - } - - public List getAncestorMembers() { - throw new UnsupportedOperationException(); - } - - public boolean isCalculatedInQuery() { - throw new UnsupportedOperationException(); - } - - public Object getPropertyValue(String propertyName) { - throw new UnsupportedOperationException(); - } - - public Object getPropertyValue(String propertyName, boolean matchCase) { - throw new UnsupportedOperationException(); - } - - public String getPropertyFormattedValue(String propertyName) { - throw new UnsupportedOperationException(); - } - - public void setProperty(String name, Object value) { - throw new UnsupportedOperationException(); - } - - public Property[] getProperties() { - throw new UnsupportedOperationException(); - } - - public int getOrdinal() { - throw new UnsupportedOperationException(); - } - - public Comparable getOrderKey() { - throw new UnsupportedOperationException(); - } - - public boolean isHidden() { - throw new UnsupportedOperationException(); - } - - public int getDepth() { - throw new UnsupportedOperationException(); - } - - public Member getDataMember() { - throw new UnsupportedOperationException(); - } - - public String getUniqueName() { - throw new UnsupportedOperationException(); - } - - public String getName() { - throw new UnsupportedOperationException(); - } - - public String getDescription() { - throw new UnsupportedOperationException(); - } - - public OlapElement lookupChild( - SchemaReader schemaReader, Id.Segment s, MatchType matchType) - { - throw new UnsupportedOperationException(); - } - - public String getQualifiedName() { - throw new UnsupportedOperationException(); - } - - public String getCaption() { - throw new UnsupportedOperationException(); - } - - public String getLocalized(LocalizedProperty prop, Locale locale) { - throw new UnsupportedOperationException(); - } - - public boolean isVisible() { - throw new UnsupportedOperationException(); - } - - public Dimension getDimension() { - throw new UnsupportedOperationException(); - } - - public Map getAnnotationMap() { - throw new UnsupportedOperationException(); - } - - public int compareTo(Object o) { - throw new UnsupportedOperationException(); - } - - public boolean equals(Object obj) { - throw new UnsupportedOperationException(); - } - - public int hashCode() { - throw new UnsupportedOperationException(); - } - } - - /** - * Enumeration of the flags allowed to the {@code ORDER} MDX function. - */ - enum Flag { - ASC(false, false), - DESC(true, false), - BASC(false, true), - BDESC(true, true); - - final boolean descending; - final boolean brk; - - Flag(boolean descending, boolean brk) { - this.descending = descending; - this.brk = brk; - } - - public static String[] getNames() { - List names = new ArrayList<>(); - for (Flag flags : Flag.class.getEnumConstants()) { - names.add(flags.name()); - } - return names.toArray(new String[names.size()]); - } - } - - static class SortKeySpec { - private final Calc key; - private final Flag direction; - - SortKeySpec(Calc key, Flag dir) { - this.key = key; - this.direction = dir; - } - - Calc getKey() { - return this.key; - } - - Flag getDirection() { - return this.direction; - } - } - - public static class OrderKey implements Comparable { - private final Member member; - - public OrderKey(Member member) { - super(); - this.member = member; - } - - public int compareTo(Object o) { - assert o instanceof OrderKey; - Member otherMember = ((OrderKey) o).member; - final boolean thisCalculated = this.member.isCalculatedInQuery(); - final boolean otherCalculated = otherMember.isCalculatedInQuery(); - if (thisCalculated) { - if (!otherCalculated) { - return 1; - } - } else { - if (otherCalculated) { - return -1; - } - } - final Comparable thisKey = this.member.getOrderKey(); - final Comparable otherKey = otherMember.getOrderKey(); - if ((thisKey != null) && (otherKey != null)) { - return thisKey.compareTo(otherKey); - } else { - return this.member.compareTo(otherMember); - } - } - } - - /** - * Tuple consisting of an object and an integer. - * - *

Similar to {@link Pair}, but saves boxing overhead of converting - * {@code int} to {@link Integer}. - */ - public static class ObjIntPair { - final T t; - final int i; - - public ObjIntPair(T t, int i) { - this.t = t; - this.i = i; - } - - public int hashCode() { - return Util.hash(i, t); - } - - public boolean equals(Object obj) { - return this == obj - || obj instanceof ObjIntPair - && this.i == ((ObjIntPair) obj).i - && Util.equals(this.t, ((ObjIntPair) obj).t); - } - - public String toString() { - return "<" + t + ", " + i + ">"; - } - } -} - -// End FunUtil.java diff --git a/contact-center/app/src/main/java/mondrian/olap/fun/SubsetFunDef.java b/contact-center/app/src/main/java/mondrian/olap/fun/SubsetFunDef.java deleted file mode 100644 index c8fae792..00000000 --- a/contact-center/app/src/main/java/mondrian/olap/fun/SubsetFunDef.java +++ /dev/null @@ -1,112 +0,0 @@ -/* -* This software is subject to the terms of the Eclipse Public License v1.0 -* Agreement, available at the following URL: -* http://www.eclipse.org/legal/epl-v10.html. -* You must accept the terms of that agreement to use this software. -* -* Copyright (c) 2002-2013 Pentaho Corporation.. All rights reserved. -*/ - -package mondrian.olap.fun; - -import mondrian.calc.*; -import mondrian.calc.impl.AbstractListCalc; -import mondrian.mdx.ResolvedFunCall; -import mondrian.olap.Evaluator; -import mondrian.olap.FunDef; - -/** - * Definition of the Subset MDX function. - * - * @author jhyde - * @since Mar 23, 2006 - */ -class SubsetFunDef extends FunDefBase { - static final ReflectiveMultiResolver Resolver = - new ReflectiveMultiResolver( - "Subset", - "Subset(, [, ])", - "Returns a subset of elements from a set.", - new String[] {"fxxn", "fxxnn"}, - SubsetFunDef.class); - - public SubsetFunDef(FunDef dummyFunDef) { - super(dummyFunDef); - } - - public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) { - final ListCalc listCalc = - compiler.compileList(call.getArg(0)); - final IntegerCalc startCalc = - compiler.compileInteger(call.getArg(1)); - final IntegerCalc countCalc = - call.getArgCount() > 2 - ? compiler.compileInteger(call.getArg(2)) - : null; - return new AbstractListCalc( - call, new Calc[] {listCalc, startCalc, countCalc}) - { - public TupleList evaluateList(Evaluator evaluator) { - final int savepoint = evaluator.savepoint(); - try { - evaluator.setNonEmpty(false); - final TupleList list = listCalc.evaluateList(evaluator); - final int start = startCalc.evaluateInteger(evaluator); - int size = list.size(); - int end; - if (countCalc != null) { - final int count = countCalc.evaluateInteger(evaluator); - end = start + count; - } else { - end = list.size(); - } - if (end > list.size()) { - end = list.size(); - } - if (start >= end || start < 0) { - TupleList li = TupleCollections.emptyList(list.getArity()); - li.setCount(size); - return li; - } - if (start == 0 && end == list.size()) { - list.setCount(size); - return list; - } - assert 0 <= start; - assert start < end; - assert end <= list.size(); - /*** - * 需要特殊處理,如果有 合计,需要把合计的成员加入进来 - */ -// final TupleList retTList = list.subList(start, end); -// Map tempMembersMap = new HashMap(); -// final List> tempArrayList = new ArrayList>(); -// for(List tempTupList : retTList){ -// for(Member levelMember : tempTupList){ -// for(int i=list.size()-1 ; i>0 ; i--){ -// List members = list.get(i) ; -// for(Member member : members){ -// Member parentMember = levelMember; -// while((parentMember = parentMember.getParentMember())!=null){ -// if(parentMember.isChildOrEqualTo(member) && tempMembersMap.get(member.getName()) == null){ -// tempArrayList.add(members) ; -// tempMembersMap.put(member.getName(), member) ; -// break ; -// } -// } -// } -// } -// } -// } - TupleList li = list.subList(start, end); - li.setCount(size); - return li; - } finally { - evaluator.restore(savepoint); - } - } - }; - } -} - -// End SubsetFunDef.java diff --git a/contact-center/app/src/main/java/mondrian/rolap/RolapAxis.java b/contact-center/app/src/main/java/mondrian/rolap/RolapAxis.java deleted file mode 100644 index 187417eb..00000000 --- a/contact-center/app/src/main/java/mondrian/rolap/RolapAxis.java +++ /dev/null @@ -1,120 +0,0 @@ -/* -// This software is subject to the terms of the Eclipse Public License v1.0 -// Agreement, available at the following URL: -// http://www.eclipse.org/legal/epl-v10.html. -// You must accept the terms of that agreement to use this software. -// -// Copyright (C) 2005-2005 Julian Hyde -// Copyright (C) 2005-2011 Pentaho -// All Rights Reserved. -*/ - -package mondrian.rolap; - -import mondrian.calc.TupleList; -import mondrian.olap.*; - -import java.util.AbstractList; -import java.util.List; - -/** - * Implementation of the Axis interface. - * - * @author Richard M. Emberson - * @author Julian Hyde - */ -public class RolapAxis implements Axis { - private final TupleList list; - - public RolapAxis(TupleList list) { - this.list = list; - } - - public TupleList getTupleList() { - return list; - } - - public List getPositions() { - return new PositionList(list); - } - - public static String toString(Axis axis) { - List pl = axis.getPositions(); - return toString(pl); - } - - public static String toString(List pl) { - StringBuilder buf = new StringBuilder(); - for (Position p : pl) { - buf.append('{'); - boolean firstTime = true; - for (Member m : p) { - if (! firstTime) { - buf.append(", "); - } - buf.append(m.getUniqueName()); - firstTime = false; - } - buf.append('}'); - buf.append('\n'); - } - return buf.toString(); - } - - /** - * List of positions. - */ - private static class PositionList extends AbstractList { - private final TupleList list; - - PositionList(TupleList list) { - this.list = list; - } - - public boolean isEmpty() { - // may be considerably cheaper than computing size - return list.isEmpty(); - } - - public int size() { - return list.size(); - } - - public Position get(int index) { - return new PositionImpl(list, index); - } - } - - /** - * Implementation of {@link Position} that reads from a given location in - * a {@link TupleList}. - */ - private static class PositionImpl - extends AbstractList - implements Position - { - private final TupleList tupleList; - private final int offset; - - PositionImpl(TupleList tupleList, int offset) { - this.tupleList = tupleList; - this.offset = offset; - } - - public Member get(int index) { - return tupleList.get(index, offset); - } - - public int size() { - return tupleList.getArity(); - } - } - - @Override - public int getDataSize() { - // TODO Auto-generated method stub - return list.getCount(); - } -} - -// End RolapAxis.java diff --git a/contact-center/app/src/main/java/mondrian/rolap/RolapStar.java b/contact-center/app/src/main/java/mondrian/rolap/RolapStar.java deleted file mode 100644 index 186302e4..00000000 --- a/contact-center/app/src/main/java/mondrian/rolap/RolapStar.java +++ /dev/null @@ -1,2041 +0,0 @@ -/* -// This software is subject to the terms of the Eclipse Public License v1.0 -// Agreement, available at the following URL: -// http://www.eclipse.org/legal/epl-v10.html. -// You must accept the terms of that agreement to use this software. -// -// Copyright (C) 2001-2005 Julian Hyde -// Copyright (C) 2005-2013 Pentaho and others -// All Rights Reserved. -// -// jhyde, 12 August, 2001 -*/ -package mondrian.rolap; - -import mondrian.olap.*; -import mondrian.resource.MondrianResource; -import mondrian.rolap.agg.*; -import mondrian.rolap.aggmatcher.AggStar; -import mondrian.rolap.sql.SqlQuery; -import mondrian.server.Locus; -import mondrian.spi.*; -import mondrian.util.Bug; - -import org.apache.commons.collections.map.ReferenceMap; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.lang.ref.SoftReference; -import java.sql.Connection; -import java.sql.*; -import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; - -import javax.sql.DataSource; - -/** - * A RolapStar is a star schema. It is the means to read cell - * values. - * - *

todo: Move this class into a package that specializes in relational - * aggregation, doesn't know anything about hierarchies etc. - * - * @author jhyde - * @since 12 August, 2001 - */ -public class RolapStar { - private static final Logger LOGGER = LoggerFactory.getLogger(RolapStar.class); - - private final RolapSchema schema; - - // not final for test purposes - private DataSource dataSource; - - private final Table factTable; - - /** - * Number of columns (column and columnName). - */ - private int columnCount; - - /** - * Keeps track of the columns across all tables. Should have - * a number of elements equal to columnCount. - */ - private final List columnList = new ArrayList<>(); - - private final Dialect sqlQueryDialect; - - /** - * If true, then database aggregation information is cached, otherwise - * it is flushed after each query. - */ - private boolean cacheAggregations; - - /** - * Partially ordered list of AggStars associated with this RolapStar's fact - * table. - */ - private final List aggStars = new LinkedList<>(); - - private DataSourceChangeListener changeListener; - - // temporary model, should eventually use RolapStar.Table and - // RolapStar.Column - private final StarNetworkNode factNode; - private final Map nodeLookup = - new HashMap<>(); - - private final RolapStatisticsCache statisticsCache; - - /** - * Creates a RolapStar. Please use - * {@link RolapSchema.RolapStarRegistry#getOrCreateStar} to create a - * {@link RolapStar}. - */ - RolapStar( - final RolapSchema schema, - final DataSource dataSource, - final MondrianDef.Relation fact) - { - this.cacheAggregations = true; - this.schema = schema; - this.dataSource = dataSource; - this.factTable = new RolapStar.Table(this, fact, null, null); - - // phase out and replace with Table, Column network - this.factNode = - new StarNetworkNode(null, factTable.alias, null, null, null); - - this.sqlQueryDialect = schema.getDialect(); - this.changeListener = schema.getDataSourceChangeListener(); - this.statisticsCache = new RolapStatisticsCache(this); - } - - /** - * Retrieves the value of the cell identified by a cell request, if it - * can be found in the local cache of the current statement (thread). - * - *

If it is not in the local cache, returns null. The client's next - * step will presumably be to request a segment that contains the cell - * from the global cache, external cache, or by issuing a SQL statement. - * - *

Returns {@link Util#nullValue} if a segment contains the cell and the - * cell's value is null. - * - *

If pinSet is not null, pins the segment that holds it - * into the local cache. pinSet ensures that a segment is - * only pinned once. - * - * @param request Cell request - * - * @param pinSet Set into which to pin the segment; or null - * - * @return Cell value, or {@link Util#nullValue} if the cell value is null, - * or null if the cell is not in any segment in the local cache. - */ - public Object getCellFromCache( - CellRequest request, - RolapAggregationManager.PinSet pinSet) - { - // REVIEW: Is it possible to optimize this so not every cell lookup - // causes an AggregationKey to be created? - AggregationKey aggregationKey = new AggregationKey(request); - - final Bar bar = localBars.get(); - for (SegmentWithData segment : Util.GcIterator.over(bar.segmentRefs)) { - if (!segment.getConstrainedColumnsBitKey().equals( - request.getConstrainedColumnsBitKey())) - { - continue; - } - - if (!segment.matches(aggregationKey, request.getMeasure())) { - continue; - } - - Object o = segment.getCellValue(request.getSingleValues()); - if (o != null) { - if (pinSet != null) { - ((AggregationManager.PinSetImpl) pinSet).add(segment); - } - return o; - } - } - // No segment contains the requested cell. - return null; - } - - public Object getCellFromAllCaches(final CellRequest request) { - // First, try the local/thread cache. - Object result = getCellFromCache(request, null); - if (result != null) { - return result; - } - // Now ask the segment cache manager. - return getCellFromExternalCache(request); - } - - private Object getCellFromExternalCache(CellRequest request) { - final SegmentWithData segment = - Locus.peek().getServer().getAggregationManager() - .cacheMgr.peek(request); - if (segment == null) { - return null; - } - return segment.getCellValue(request.getSingleValues()); - } - - public void register(SegmentWithData segment) { - localBars.get().segmentRefs.add( - new SoftReference<>(segment)); - } - - public RolapStatisticsCache getStatisticsCache() { - return statisticsCache; - } - - /** - * Temporary. Contains the local cache for a particular thread. Because - * it is accessed via a thread-local, the data structures can be accessed - * without acquiring locks. - * - * @see Util#deprecated(Object) - */ - public static class Bar { - /** Holds all thread-local aggregations of this star. */ - private final Map aggregations = - new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK); - - private final List> segmentRefs = - new ArrayList<>(); - } - - private final ThreadLocal localBars = - new ThreadLocal() { - protected Bar initialValue() { - return new Bar(); - } - }; - - private static class StarNetworkNode { - private final StarNetworkNode parent; - private final MondrianDef.Relation origRel; - private final String foreignKey; - private final String joinKey; - - private StarNetworkNode( - StarNetworkNode parent, - String alias, - MondrianDef.Relation origRel, - String foreignKey, - String joinKey) - { - this.parent = parent; - this.origRel = origRel; - this.foreignKey = foreignKey; - this.joinKey = joinKey; - } - - private boolean isCompatible( - StarNetworkNode compatibleParent, - MondrianDef.Relation rel, - String compatibleForeignKey, - String compatibleJoinKey) - { - return parent == compatibleParent - && origRel.getClass().equals(rel.getClass()) - && foreignKey.equals(compatibleForeignKey) - && joinKey.equals(compatibleJoinKey); - } - } - - protected MondrianDef.RelationOrJoin cloneRelation( - MondrianDef.Relation rel, - String possibleName) - { - if (rel instanceof MondrianDef.Table) { - MondrianDef.Table tbl = (MondrianDef.Table)rel; - return new MondrianDef.Table( - tbl, - possibleName); - } else if (rel instanceof MondrianDef.View) { - MondrianDef.View view = (MondrianDef.View)rel; - MondrianDef.View newView = new MondrianDef.View(view); - newView.alias = possibleName; - return newView; - } else if (rel instanceof MondrianDef.InlineTable) { - MondrianDef.InlineTable inlineTable = - (MondrianDef.InlineTable) rel; - MondrianDef.InlineTable newInlineTable = - new MondrianDef.InlineTable(inlineTable); - newInlineTable.alias = possibleName; - return newInlineTable; - } else { - throw new UnsupportedOperationException(); - } - } - - /** - * Generates a unique relational join to the fact table via re-aliasing - * MondrianDef.Relations - * - * currently called in the RolapCubeHierarchy constructor. This should - * eventually be phased out and replaced with RolapStar.Table and - * RolapStar.Column references - * - * @param rel the relation needing uniqueness - * @param factForeignKey the foreign key of the fact table - * @param primaryKey the join key of the relation - * @param primaryKeyTable the join table of the relation - * @return if necessary a new relation that has been re-aliased - */ - public MondrianDef.RelationOrJoin getUniqueRelation( - MondrianDef.RelationOrJoin rel, - String factForeignKey, - String primaryKey, - String primaryKeyTable) - { - return getUniqueRelation( - factNode, rel, factForeignKey, primaryKey, primaryKeyTable); - } - - private MondrianDef.RelationOrJoin getUniqueRelation( - StarNetworkNode parent, - MondrianDef.RelationOrJoin relOrJoin, - String foreignKey, - String joinKey, - String joinKeyTable) - { - if (relOrJoin == null) { - return null; - } else if (relOrJoin instanceof MondrianDef.Relation) { - int val = 0; - MondrianDef.Relation rel = - (MondrianDef.Relation) relOrJoin; - String newAlias = - joinKeyTable != null ? joinKeyTable : rel.getAlias(); - while (true) { - StarNetworkNode node = nodeLookup.get(newAlias); - if (node == null) { - if (val != 0) { - rel = (MondrianDef.Relation) - cloneRelation(rel, newAlias); - } - node = - new StarNetworkNode( - parent, newAlias, rel, foreignKey, joinKey); - nodeLookup.put(newAlias, node); - return rel; - } else if (node.isCompatible( - parent, rel, foreignKey, joinKey)) - { - return node.origRel; - } - newAlias = rel.getAlias() + "_" + (++val); - } - } else if (relOrJoin instanceof MondrianDef.Join) { - // determine if the join starts from the left or right side - MondrianDef.Join join = (MondrianDef.Join)relOrJoin; - if (join.left instanceof MondrianDef.Join) { - throw MondrianResource.instance().IllegalLeftDeepJoin.ex(); - } - final MondrianDef.RelationOrJoin left; - final MondrianDef.RelationOrJoin right; - if (join.getLeftAlias().equals(joinKeyTable)) { - // first manage left then right - left = - getUniqueRelation( - parent, join.left, foreignKey, - joinKey, joinKeyTable); - parent = nodeLookup.get( - ((MondrianDef.Relation) left).getAlias()); - right = - getUniqueRelation( - parent, join.right, join.leftKey, - join.rightKey, join.getRightAlias()); - } else if (join.getRightAlias().equals(joinKeyTable)) { - // right side must equal - right = - getUniqueRelation( - parent, join.right, foreignKey, - joinKey, joinKeyTable); - parent = nodeLookup.get( - ((MondrianDef.Relation) right).getAlias()); - left = - getUniqueRelation( - parent, join.left, join.rightKey, - join.leftKey, join.getLeftAlias()); - } else { - throw new MondrianException( - "failed to match primary key table to join tables"); - } - - if (join.left != left || join.right != right) { - join = - new MondrianDef.Join( - left instanceof MondrianDef.Relation - ? ((MondrianDef.Relation) left).getAlias() - : null, - join.leftKey, - left, - right instanceof MondrianDef.Relation - ? ((MondrianDef.Relation) right).getAlias() - : null, - join.rightKey, - right); - } - return join; - } - return null; - } - - /** - * Returns this RolapStar's column count. After a star has been created with - * all of its columns, this is the number of columns in the star. - */ - public int getColumnCount() { - return columnCount; - } - - /** - * This is used by the {@link Column} constructor to get a unique id (per - * its parent {@link RolapStar}). - */ - private int nextColumnCount() { - return columnCount++; - } - - /** - * Decrements the column counter; used if a newly - * created column is found to already exist. - */ - private void decrementColumnCount() { - columnCount--; - } - - /** - * Place holder in case in the future we wish to be able to - * reload aggregates. In that case, if aggregates had already been loaded, - * i.e., this star has some aggstars, then those aggstars are cleared. - */ - public void prepareToLoadAggregates() { - aggStars.clear(); - } - - /** - * Adds an {@link AggStar} to this star. - * - *

Internally the AggStars are added in sort order, smallest row count - * to biggest, so that the most efficient AggStar is encountered first; - * ties do not matter. - */ - public void addAggStar(AggStar aggStar) { - // Add it before the first AggStar which is larger, if there is one. - int size = aggStar.getSize(); - ListIterator lit = aggStars.listIterator(); - while (lit.hasNext()) { - AggStar as = lit.next(); - if (as.getSize() >= size) { - lit.previous(); - lit.add(aggStar); - return; - } - } - - // There is no larger star. Add at the end of the list. - aggStars.add(aggStar); - } - - /** - * Clears the list of agg stars. - */ - void clearAggStarList() { - aggStars.clear(); - } - - /** - * Reorder the list of aggregate stars. This should be called if the - * algorithm used to order the AggStars has been changed. - */ - public void reOrderAggStarList() { - List oldList = new ArrayList<>(aggStars); - aggStars.clear(); - for (AggStar aggStar : oldList) { - addAggStar(aggStar); - } - } - - /** - * Returns this RolapStar's aggregate table AggStars, ordered in ascending - * order of size. - */ - public List getAggStars() { - return aggStars; - } - - /** - * Returns the fact table at the center of this RolapStar. - * - * @return fact table - */ - public Table getFactTable() { - return factTable; - } - - /** - * Clones an existing SqlQuery to create a new one (this cloning creates one - * with an empty sql query). - */ - public SqlQuery getSqlQuery() { - return new SqlQuery(getSqlQueryDialect()); - } - - /** - * Returns this RolapStar's SQL dialect. - */ - public Dialect getSqlQueryDialect() { - return sqlQueryDialect; - } - - /** - * Sets whether to cache database aggregation information; if false, cache - * is flushed after each query. - * - *

This method is called only by the RolapCube and is only called if - * caching is to be turned off. Note that the same RolapStar can be - * associated with more than on RolapCube. If any one of those cubes has - * caching turned off, then caching is turned off for all of them. - * - * @param cacheAggregations Whether to cache database aggregation - */ - void setCacheAggregations(boolean cacheAggregations) { - // this can only change from true to false - this.cacheAggregations = cacheAggregations; - clearCachedAggregations(false); - } - - /** - * Returns whether the this RolapStar cache aggregates. - * - * @see #setCacheAggregations(boolean) - */ - boolean isCacheAggregations() { - return this.cacheAggregations; - } - - boolean isCacheDisabled() { - return MondrianProperties.instance().DisableCaching.get(); - } - - /** - * Clears the aggregate cache. This only does something if aggregate caching - * is disabled (see {@link #setCacheAggregations(boolean)}). - * - * @param forced If true, clears cached aggregations regardless of any other - * settings. If false, clears only cache from the current thread - */ - void clearCachedAggregations(boolean forced) { - if (forced || !cacheAggregations || isCacheDisabled()) { - if (LOGGER.isDebugEnabled()) { - StringBuilder buf = new StringBuilder(100); - buf.append("RolapStar.clearCachedAggregations: schema="); - buf.append(schema.getName()); - buf.append(", star="); - buf.append(getFactTable().getAlias()); - LOGGER.debug(buf.toString()); - } - - // Clear aggregation cache for the current thread context. - localBars.get().aggregations.clear(); - localBars.get().segmentRefs.clear(); - } - } - - /** - * Looks up an aggregation or creates one if it does not exist in an - * atomic (synchronized) operation. - * - *

When a new aggregation is created, it is marked as thread local. - * - * @param aggregationKey this is the constrained column bitkey - */ - public Aggregation lookupOrCreateAggregation( - AggregationKey aggregationKey) - { - Aggregation aggregation = lookupSegment(aggregationKey); - if (aggregation != null) { - return aggregation; - } - - aggregation = - new Aggregation( - aggregationKey); - - localBars.get().aggregations.put( - aggregationKey, aggregation); - - // Let the change listener get the opportunity to register the - // first time the aggregation is used - if (this.cacheAggregations - && !isCacheDisabled() - && changeListener != null) - { - Util.discard( - changeListener.isAggregationChanged(aggregationKey)); - } - return aggregation; - } - - /** - * Looks for an existing aggregation over a given set of columns, in the - * local segment cache, returning null if there is none. - * - *

Must be called from synchronized context. - * - * @see Util#deprecated(Object) currently always returns null -- remove - */ - public Aggregation lookupSegment(AggregationKey aggregationKey) { - return localBars.get().aggregations.get(aggregationKey); - } - - /** For testing purposes only. */ - public void setDataSource(DataSource dataSource) { - this.dataSource = dataSource; - } - - /** - * Returns the DataSource used to callOutConnect to the underlying DBMS. - * - * @return DataSource - */ - public DataSource getDataSource() { - return dataSource; - } - - /** - * Retrieves the {@link RolapStar.Measure} in which a measure is stored. - */ - public static Measure getStarMeasure(Member member) { - return (Measure) ((RolapStoredMeasure) member).getStarMeasure(); - } - - /** - * Retrieves a named column, returns null if not found. - */ - public Column[] lookupColumns(String tableAlias, String columnName) { - final Table table = factTable.findDescendant(tableAlias); - return (table == null) ? null : table.lookupColumns(columnName); - } - - /** - * This is used by TestAggregationManager only. - */ - public Column lookupColumn(String tableAlias, String columnName) { - final Table table = factTable.findDescendant(tableAlias); - return (table == null) ? null : table.lookupColumn(columnName); - } - - public BitKey getBitKey(String[] tableAlias, String[] columnName) { - BitKey bitKey = BitKey.Factory.makeBitKey(getColumnCount()); - Column starColumn; - for (int i = 0; i < tableAlias.length; i ++) { - starColumn = lookupColumn(tableAlias[i], columnName[i]); - if (starColumn != null) { - bitKey.set(starColumn.getBitPosition()); - } - } - return bitKey; - } - - /** - * Returns a list of all aliases used in this star. - */ - public List getAliasList() { - List aliasList = new ArrayList<>(); - if (factTable != null) { - collectAliases(aliasList, factTable); - } - return aliasList; - } - - /** - * Finds all of the table aliases in a table and its children. - */ - private static void collectAliases(List aliasList, Table table) { - aliasList.add(table.getAlias()); - for (Table child : table.children) { - collectAliases(aliasList, child); - } - } - - /** - * Collects all columns in this table and its children. - * If joinColumn is specified, only considers child tables - * joined by the given column. - */ - public static void collectColumns( - Collection columnList, - Table table, - MondrianDef.Column joinColumn) - { - if (joinColumn == null) { - columnList.addAll(table.columnList); - } - for (Table child : table.children) { - if (joinColumn == null - || child.getJoinCondition().left.equals(joinColumn)) - { - collectColumns(columnList, child, null); - } - } - } - - private boolean containsColumn(String tableName, String columnName) { - Connection jdbcConnection; - try { - jdbcConnection = dataSource.getConnection(); - } catch (SQLException e1) { - throw Util.newInternal( - e1, "Error while creating connection from data source"); - } - try { - final DatabaseMetaData metaData = jdbcConnection.getMetaData(); - final ResultSet columns = - metaData.getColumns(null, null, tableName, columnName); - return columns.next(); - } catch (SQLException e) { - throw Util.newInternal( - "Error while retrieving metadata for table '" + tableName - + "', column '" + columnName + "'"); - } finally { - try { - jdbcConnection.close(); - } catch (SQLException e) { - // ignore - } - } - } - - /** - * Adds a column to the star's list of all columns across all tables. - * - * @param c the column to add - */ - private void addColumn(Column c) { - columnList.add(c.getBitPosition(), c); - } - - /** - * Look up the column at the given bit position. - * - * @param bitPos bit position to look up - * @return column at the given position - */ - public Column getColumn(int bitPos) { - return columnList.get(bitPos); - } - - public RolapSchema getSchema() { - return schema; - } - - /** - * Generates a SQL statement to read all instances of the given attributes. - * - *

The SQL statement is of the form {@code SELECT ... FROM ... JOIN ... - * GROUP BY ...}. It is useful for populating an aggregate table. - * - * @param columnList List of columns (attributes and measures) - * @param columnNameList List of column names (must have same cardinality - * as {@code columnList}) - * @return SQL SELECT statement - */ - public String generateSql( - List columnList, - List columnNameList) - { - final SqlQuery query = new SqlQuery(sqlQueryDialect, true); - query.addFrom( - factTable.relation, - factTable.relation.getAlias(), - false); - int k = -1; - for (Column column : columnList) { - ++k; - column.table.addToFrom(query, false, true); - String columnExpr = column.generateExprString(query); - if (column instanceof Measure) { - Measure measure = (Measure) column; - columnExpr = measure.getAggregator().getExpression(columnExpr); - } - final String columnName = columnNameList.get(k); - String alias = query.addSelect(columnExpr, null, columnName); - if (!(column instanceof Measure)) { - query.addGroupBy(columnExpr, alias); - } - } - // remove whitespace from query - in particular, the trailing newline - return query.toString().trim(); - } - - public String toString() { - StringWriter sw = new StringWriter(256); - PrintWriter pw = new PrintWriter(sw); - print(pw, "", true); - pw.flush(); - return sw.toString(); - } - - /** - * Prints the state of this RolapStar - * - * @param pw Writer - * @param prefix Prefix to print at the start of each line - * @param structure Whether to print the structure of the star - */ - public void print(PrintWriter pw, String prefix, boolean structure) { - if (structure) { - pw.print(prefix); - pw.println("RolapStar:"); - String subprefix = prefix + " "; - factTable.print(pw, subprefix); - - for (AggStar aggStar : getAggStars()) { - aggStar.print(pw, subprefix); - } - } - } - - /** - * Returns the listener for changes to this star's underlying database. - * - * @return Returns the Data source change listener. - */ - public DataSourceChangeListener getChangeListener() { - return changeListener; - } - - /** - * Sets the listener for changes to this star's underlying database. - * - * @param changeListener The Data source change listener to set - */ - public void setChangeListener(DataSourceChangeListener changeListener) { - this.changeListener = changeListener; - } - - // -- Inner classes -------------------------------------------------------- - - /** - * A column in a star schema. - */ - public static class Column { - public static final Comparator COMPARATOR = - (object1, object2) -> Util.compare( - object1.getBitPosition(), - object2.getBitPosition()); - - private final Table table; - private final MondrianDef.Expression expression; - private final Dialect.Datatype datatype; - private final SqlStatement.Type internalType; - private final String name; - - /** - * When a Column is a column, and not a Measure, the parent column - * is the coloumn associated with next highest Level. - */ - private final Column parentColumn; - - /** - * This is used during both aggregate table recognition and aggregate - * table generation. For multiple dimension usages, multiple shared - * dimension or unshared dimension with the same column names, - * this is used to disambiguate aggregate column names. - */ - private final String usagePrefix; - /** - * This is only used in RolapAggregationManager and adds - * non-constraining columns making the drill-through queries easier for - * humans to understand. - */ - private final Column nameColumn; - - private boolean isNameColumn; - - /** this has a unique value per star */ - private final int bitPosition; - /** - * The estimated cardinality of the column. - * {@link Integer#MIN_VALUE} means unknown. - */ - private final AtomicInteger approxCardinality = new AtomicInteger( - Integer.MIN_VALUE); - - private Column( - String name, - Table table, - MondrianDef.Expression expression, - Dialect.Datatype datatype) - { - this( - name, table, expression, datatype, null, null, - null, null, Integer.MIN_VALUE, table.star.nextColumnCount()); - } - - private Column( - String name, - Table table, - MondrianDef.Expression expression, - Dialect.Datatype datatype, - SqlStatement.Type internalType, - Column nameColumn, - Column parentColumn, - String usagePrefix, - int approxCardinality, - int bitPosition) - { - this.name = name; - this.table = table; - this.expression = expression; - assert expression == null - || expression.getGenericExpression() != null; - this.datatype = datatype; - this.internalType = internalType; - this.bitPosition = bitPosition; - this.nameColumn = nameColumn; - this.parentColumn = parentColumn; - this.usagePrefix = usagePrefix; - this.approxCardinality.set(approxCardinality); - if (nameColumn != null) { - nameColumn.isNameColumn = true; - } - if (table != null) { - table.star.addColumn(this); - } - } - - /** - * Fake column. - * - * @param datatype Datatype - */ - protected Column(Dialect.Datatype datatype) - { - this( - null, - null, - null, - datatype, - null, - null, - null, - null, - Integer.MIN_VALUE, - 0); - } - - public boolean equals(Object obj) { - if (! (obj instanceof RolapStar.Column)) { - return false; - } - RolapStar.Column other = (RolapStar.Column) obj; - // Note: both columns have to be from the same table - return - other.table == this.table - && Util.equals(other.expression, this.expression) - && other.datatype == this.datatype - && other.name.equals(this.name); - } - - public int hashCode() { - int h = name.hashCode(); - h = Util.hash(h, table); - return h; - } - - public String getName() { - return name; - } - - public int getBitPosition() { - return bitPosition; - } - - public RolapStar getStar() { - return table.star; - } - - public RolapStar.Table getTable() { - return table; - } - - public SqlQuery getSqlQuery() { - return getTable().getStar().getSqlQuery(); - } - - public RolapStar.Column getNameColumn() { - return nameColumn; - } - - public RolapStar.Column getParentColumn() { - return parentColumn; - } - - public String getUsagePrefix() { - return usagePrefix; - } - - public boolean isNameColumn() { - return isNameColumn; - } - - public MondrianDef.Expression getExpression() { - return expression; - } - - /** - * Generates a SQL expression, which typically this looks like - * this: tableName.columnName. - */ - public String generateExprString(SqlQuery query) { - return getExpression()!=null ? getExpression().getExpression(query) : ""; - } - - /** - * Get column cardinality from the schema cache if possible; - * otherwise issue a select count(distinct) query to retrieve - * the cardinality and stores it in the cache. - * - * @return the column cardinality. - */ - public int getCardinality() { - if (approxCardinality.get() < 0) { - approxCardinality.set( - table.star.getStatisticsCache().getColumnCardinality( - table.relation, expression, approxCardinality.get())); - } - return approxCardinality.get(); - } - - /** - * Generates a predicate that a column matches one of a list of values. - * - *

- * Several possible outputs, depending upon whether the there are - * nulls:

    - * - *
  • One not-null value: foo.bar = 1 - * - *
  • All values not null: foo.bar in (1, 2, 3)
  • Null and not null values: - * (foo.bar is null or foo.bar in (1, 2)) - * - *
  • Only null values: - * foo.bar is null
  • - * - *
  • String values: foo.bar in ('a', 'b', 'c')
  • - * - *
- */ - public static String createInExpr( - final String expr, - StarColumnPredicate predicate, - Dialect.Datatype datatype, - SqlQuery sqlQuery) - { - // Sometimes a column predicate is created without a column. This - // is unfortunate, and we will fix it some day. For now, create - // a fake column with all of the information needed by the toSql - // method, and a copy of the predicate wrapping that fake column. - if (!Bug.BugMondrian313Fixed - || !Bug.BugMondrian314Fixed - && predicate.getConstrainedColumn() == null) - { - Column column = new Column(datatype) { - public String generateExprString(SqlQuery query) { - return expr; - } - }; - predicate = predicate.cloneWithColumn(column); - } - - StringBuilder buf = new StringBuilder(64); - predicate.toSql(sqlQuery, buf); - return buf.toString(); - } - - public String toString() { - StringWriter sw = new StringWriter(256); - PrintWriter pw = new PrintWriter(sw); - print(pw, ""); - pw.flush(); - return sw.toString(); - } - - /** - * Prints this column. - * - * @param pw Print writer - * @param prefix Prefix to print first, such as spaces for indentation - */ - public void print(PrintWriter pw, String prefix) { - SqlQuery sqlQuery = getSqlQuery(); - pw.print(prefix); - pw.print(getName()); - pw.print(" ("); - pw.print(getBitPosition()); - pw.print("): "); - pw.print(generateExprString(sqlQuery)); - } - - public Dialect.Datatype getDatatype() { - return datatype; - } - - /** - * Returns a string representation of the datatype of this column, in - * the dialect specified. For example, 'DECIMAL(10, 2) NOT NULL'. - * - * @param dialect Dialect - * @return String representation of column's datatype - */ - public String getDatatypeString(Dialect dialect) { - final SqlQuery query = new SqlQuery(dialect); - query.addFrom( - table.star.factTable.relation, table.star.factTable.alias, - false); - query.addFrom(table.relation, table.alias, false); - query.addSelect(expression.getExpression(query), null); - final String sql = query.toString(); - Connection jdbcConnection = null; - try { - jdbcConnection = table.star.dataSource.getConnection(); - final PreparedStatement pstmt = - jdbcConnection.prepareStatement(sql); - final ResultSetMetaData resultSetMetaData = - pstmt.getMetaData(); - assert resultSetMetaData.getColumnCount() == 1; - final String type = resultSetMetaData.getColumnTypeName(1); - int precision = resultSetMetaData.getPrecision(1); - final int scale = resultSetMetaData.getScale(1); - if (type.equals("DOUBLE")) { - precision = 0; - } - String typeString; - if (precision == 0) { - typeString = type; - } else if (scale == 0) { - typeString = type + "(" + precision + ")"; - } else { - typeString = type + "(" + precision + ", " + scale + ")"; - } - pstmt.close(); - jdbcConnection.close(); - jdbcConnection = null; - return typeString; - } catch (SQLException e) { - throw Util.newError( - e, - "Error while deriving type of column " + toString()); - } finally { - if (jdbcConnection != null) { - try { - jdbcConnection.close(); - } catch (SQLException e) { - // ignore - } - } - } - } - - public SqlStatement.Type getInternalType() { - return internalType; - } - } - - /** - * Definition of a measure in a star schema. - * - *

A measure is basically just a column; except that its - * {@link #aggregator} defines how it is to be rolled up. - */ - public static class Measure extends Column { - private final String cubeName; - private final RolapAggregator aggregator; - - public Measure( - String name, - String cubeName, - RolapAggregator aggregator, - Table table, - MondrianDef.Expression expression, - Dialect.Datatype datatype) - { - super(name, table, expression, datatype); - this.cubeName = cubeName; - this.aggregator = aggregator; - } - - public RolapAggregator getAggregator() { - return aggregator; - } - - public boolean equals(Object o) { - if (! (o instanceof RolapStar.Measure)) { - return false; - } - RolapStar.Measure that = (RolapStar.Measure) o; - if (!super.equals(that)) { - return false; - } - // Measure names are only unique within their cube - and remember - // that a given RolapStar can support multiple cubes if they have - // the same fact table. - if (!cubeName.equals(that.cubeName)) { - return false; - } - // Note: both measure have to have the same aggregator - return (that.aggregator == this.aggregator); - } - - public int hashCode() { - int h = super.hashCode(); - h = Util.hash(h, aggregator); - return h; - } - - public void print(PrintWriter pw, String prefix) { - SqlQuery sqlQuery = getSqlQuery(); - pw.print(prefix); - pw.print(getName()); - pw.print(" ("); - pw.print(getBitPosition()); - pw.print("): "); - pw.print( - aggregator.getExpression( - getExpression() == null - ? null - : generateExprString(sqlQuery))); - } - - public String getCubeName() { - return cubeName; - } - } - - /** - * Definition of a table in a star schema. - * - *

A 'table' is defined by a - * {@link mondrian.olap.MondrianDef.RelationOrJoin} so may, in fact, be a - * view. - * - *

Every table in the star schema except the fact table has a parent - * table, and a condition which specifies how it is joined to its parent. - * So the star schema is, in effect, a hierarchy with the fact table at - * its root. - */ - public static class Table { - private final RolapStar star; - private final MondrianDef.Relation relation; - private final List columnList; - private final Table parent; - private List children; - private final Condition joinCondition; - private final String alias; - - private Table( - RolapStar star, - MondrianDef.Relation relation, - Table parent, - Condition joinCondition) - { - this.star = star; - this.relation = relation; - this.alias = chooseAlias(); - this.parent = parent; - final AliasReplacer aliasReplacer = - new AliasReplacer(relation.getAlias(), this.alias); - this.joinCondition = aliasReplacer.visit(joinCondition); - if (this.joinCondition != null) { - this.joinCondition.table = this; - } - this.columnList = new ArrayList<>(); - this.children = Collections.emptyList(); - Util.assertTrue((parent == null) == (joinCondition == null)); - } - - /** - * Returns the condition by which a dimension table is connected to its - * {@link #getParentTable() parent}; or null if this is the fact table. - */ - public Condition getJoinCondition() { - return joinCondition; - } - - /** - * Returns this table's parent table, or null if this is the fact table - * (which is at the center of the star). - */ - public Table getParentTable() { - return parent; - } - - private void addColumn(Column column) { - columnList.add(column); - } - - /** - * Adds to a list all columns of this table or a child table - * which are present in a given bitKey. - * - *

Note: This method is slow, but that's acceptable because it is - * only used for tracing. It would be more efficient to store an - * array in the {@link RolapStar} mapping column ordinals to columns. - */ - private void collectColumns(BitKey bitKey, List list) { - for (Column column : getColumns()) { - if (bitKey.get(column.getBitPosition())) { - list.add(column); - } - } - for (Table table : getChildren()) { - table.collectColumns(bitKey, list); - } - } - - /** - * Returns an array of all columns in this star with a given name. - */ - public Column[] lookupColumns(String columnName) { - List l = new ArrayList<>(); - for (Column column : getColumns()) { - if (column.getExpression() instanceof MondrianDef.Column) { - MondrianDef.Column columnExpr = - (MondrianDef.Column) column.getExpression(); - if (columnExpr.name.equals(columnName)) { - l.add(column); - } - } else if (column.getExpression() - instanceof MondrianDef.KeyExpression) - { - MondrianDef.KeyExpression columnExpr = - (MondrianDef.KeyExpression) column.getExpression(); - if (columnExpr.toString().equals(columnName)) { - l.add(column); - } - } - } - return l.toArray(new Column[l.size()]); - } - - public Column lookupColumn(String columnName) { - for (Column column : getColumns()) { - if (column.getExpression() instanceof MondrianDef.Column) { - MondrianDef.Column columnExpr = - (MondrianDef.Column) column.getExpression(); - if (columnExpr.name.equals(columnName)) { - return column; - } - } else if (column.getExpression() - instanceof MondrianDef.KeyExpression) - { - MondrianDef.KeyExpression columnExpr = - (MondrianDef.KeyExpression) column.getExpression(); - if (columnExpr.toString().equals(columnName)) { - return column; - } - } else if (column.getName().equals(columnName)) { - return column; - } - } - return null; - } - - /** - * Given a MondrianDef.Expression return a column with that expression - * or null. - */ - public Column lookupColumnByExpression(MondrianDef.Expression xmlExpr) { - for (Column column : getColumns()) { - if (column instanceof Measure) { - continue; - } - if (column.getExpression().equals(xmlExpr)) { - return column; - } - } - return null; - } - - public boolean containsColumn(Column column) { - return getColumns().contains(column); - } - - /** - * Look up a {@link Measure} by its name. - * Returns null if not found. - */ - public Measure lookupMeasureByName(String cubeName, String name) { - for (Column column : getColumns()) { - if (column instanceof Measure) { - Measure measure = (Measure) column; - if (measure.getName().equals(name) - && measure.getCubeName().equals(cubeName)) - { - return measure; - } - } - } - return null; - } - - RolapStar getStar() { - return star; - } - private SqlQuery getSqlQuery() { - return getStar().getSqlQuery(); - } - public MondrianDef.Relation getRelation() { - return relation; - } - - /** Chooses an alias which is unique within the star. */ - private String chooseAlias() { - List aliasList = star.getAliasList(); - for (int i = 0;; ++i) { - String candidateAlias = relation.getAlias(); - if (i > 0) { - candidateAlias += "_" + i; - } - if (!aliasList.contains(candidateAlias)) { - return candidateAlias; - } - } - } - - public String getAlias() { - return alias; - } - - /** - * Sometimes one need to get to the "real" name when the table has - * been given an alias. - */ - public String getTableName() { - if (relation instanceof MondrianDef.Table) { - MondrianDef.Table t = (MondrianDef.Table) relation; - return t.name; - } else { - return null; - } - } - - synchronized void makeMeasure(RolapBaseCubeMeasure measure) { - // Remove assertion to allow cube to be recreated - // assert lookupMeasureByName( - // measure.getCube().getName(), measure.getName()) == null; - RolapStar.Measure starMeasure = new RolapStar.Measure( - measure.getName(), - measure.getCube().getName(), - measure.getAggregator(), - this, - measure.getMondrianDefExpression(), - measure.getDatatype()); - - measure.setStarMeasure(starMeasure); // reverse mapping - - if (containsColumn(starMeasure)) { - star.decrementColumnCount(); - } else { - addColumn(starMeasure); - } - } - - /** - * This is only called by RolapCube. If the RolapLevel has a non-null - * name expression then two columns will be made, otherwise only one. - * Updates the RolapLevel to RolapStar.Column mapping associated with - * this cube. - * - * @param cube Cube - * @param level Level - * @param parentColumn Parent column - */ - synchronized Column makeColumns( - RolapCube cube, - RolapCubeLevel level, - Column parentColumn, - String usagePrefix) - { - Column nameColumn = null; - if (level.getNameExp() != null) { - // make a column for the name expression - nameColumn = makeColumnForLevelExpr( - cube, - level, - level.getName(), - level.getNameExp(), - Dialect.Datatype.String, - null, - null, - null, - null); - } - - // select the column's name depending upon whether or not a - // "named" column, above, has been created. - String name = (level.getNameExp() == null) - ? level.getName() - : level.getName() + " (Key)"; - - // If the nameColumn is not null, then it is associated with this - // column. - Column column = makeColumnForLevelExpr( - cube, - level, - name, - level.getKeyExp(), - level.getDatatype(), - level.getInternalType(), - nameColumn, - parentColumn, - usagePrefix); - - if (column != null) { - level.setStarKeyColumn(column); - } - - return column; - } - - private Column makeColumnForLevelExpr( - RolapCube cube, - RolapLevel level, - String name, - MondrianDef.Expression xmlExpr, - Dialect.Datatype datatype, - SqlStatement.Type internalType, - Column nameColumn, - Column parentColumn, - String usagePrefix) - { - Table table = this; - if (xmlExpr instanceof MondrianDef.Column) { - final MondrianDef.Column xmlColumn = - (MondrianDef.Column) xmlExpr; - - String tableName = xmlColumn.table; - table = findAncestor(tableName); - if (table == null) { - throw Util.newError( - "Level '" + level.getUniqueName() - + "' of cube '" - + this - + "' is invalid: table '" + tableName - + "' is not found in current scope" - + Util.nl - + ", star:" - + Util.nl - + getStar()); - } - RolapStar.AliasReplacer aliasReplacer = - new RolapStar.AliasReplacer(tableName, table.getAlias()); - xmlExpr = aliasReplacer.visit(xmlExpr); - } - // does the column already exist?? - Column c = lookupColumnByExpression(xmlExpr); - - RolapStar.Column column; - // Verify Column is not null and not the same as the - // nameColumn created previously (bug 1438285) - if (c != null && !c.equals(nameColumn)) { - // Yes, well just reuse it - // You might wonder why the column need be returned if it - // already exists. Well, it might have been created for one - // cube, but for another cube using the same fact table, it - // still needs to be put into the cube level to column map. - // Trust me, return null and a junit test fails. - column = c; - } else { - // Make a new column and add it - column = new RolapStar.Column( - name, - table, - xmlExpr, - datatype, - internalType, - nameColumn, - parentColumn, - usagePrefix, - level.getApproxRowCount(), - star.nextColumnCount()); - addColumn(column); - } - return column; - } - - /** - * Extends this 'leg' of the star by adding relation - * joined by joinCondition. If the same expression is - * already present, does not create it again. Stores the unaliased - * table names to RolapStar.Table mapping associated with the - * input cube. - */ - synchronized Table addJoin( - RolapCube cube, - MondrianDef.RelationOrJoin relationOrJoin, - RolapStar.Condition joinCondition) - { - if (relationOrJoin instanceof MondrianDef.Relation) { - final MondrianDef.Relation relation = - (MondrianDef.Relation) relationOrJoin; - RolapStar.Table starTable = - findChild(relation, joinCondition); - if (starTable == null) { - starTable = new RolapStar.Table( - star, relation, this, joinCondition); - if (this.children.isEmpty()) { - this.children = new ArrayList<>(); - } - this.children.add(starTable); - } - return starTable; - } else if (relationOrJoin instanceof MondrianDef.Join) { - MondrianDef.Join join = (MondrianDef.Join) relationOrJoin; - RolapStar.Table leftTable = - addJoin(cube, join.left, joinCondition); - String leftAlias = join.leftAlias; - if (leftAlias == null) { - // REVIEW: is cast to Relation valid? - leftAlias = ((MondrianDef.Relation) join.left).getAlias(); - if (leftAlias == null) { - throw Util.newError( - "missing leftKeyAlias in " + relationOrJoin); - } - } - assert leftTable.findAncestor(leftAlias) == leftTable; - // switch to uniquified alias - leftAlias = leftTable.getAlias(); - - String rightAlias = join.rightAlias; - if (rightAlias == null) { - // the right relation of a join may be a join - // if so, we need to use the right relation join's - // left relation's alias. - if (join.right instanceof MondrianDef.Join) { - MondrianDef.Join joinright = - (MondrianDef.Join) join.right; - // REVIEW: is cast to Relation valid? - rightAlias = - ((MondrianDef.Relation) joinright.left) - .getAlias(); - } else { - // REVIEW: is cast to Relation valid? - rightAlias = - ((MondrianDef.Relation) join.right) - .getAlias(); - } - if (rightAlias == null) { - throw Util.newError( - "missing rightKeyAlias in " + relationOrJoin); - } - } - joinCondition = new RolapStar.Condition( - new MondrianDef.Column(leftAlias, join.leftKey), - new MondrianDef.Column(rightAlias, join.rightKey)); - RolapStar.Table rightTable = leftTable.addJoin( - cube, join.right, joinCondition); - return rightTable; - - } else { - throw Util.newInternal("bad relation type " + relationOrJoin); - } - } - - /** - * Returns a child relation which maps onto a given relation, or null - * if there is none. - */ - public Table findChild( - MondrianDef.Relation relation, - Condition joinCondition) - { - for (Table child : getChildren()) { - if (child.relation.equals(relation)) { - Condition condition = joinCondition; - if (!Util.equalName(relation.getAlias(), child.alias)) { - // Make the two conditions comparable, by replacing - // occurrence of this table's alias with occurrences - // of the child's alias. - AliasReplacer aliasReplacer = new AliasReplacer( - relation.getAlias(), child.alias); - condition = aliasReplacer.visit(joinCondition); - } - if (child.joinCondition.equals(condition)) { - return child; - } - } - } - return null; - } - - /** - * Returns a descendant with a given alias, or null if none found. - */ - public Table findDescendant(String seekAlias) { - if (getAlias().equals(seekAlias)) { - return this; - } - for (Table child : getChildren()) { - Table found = child.findDescendant(seekAlias); - if (found != null) { - return found; - } - } - return null; - } - - /** - * Returns an ancestor with a given alias, or null if not found. - */ - public Table findAncestor(String tableName) { - for (Table t = this; t != null; t = t.parent) { - if (t.relation.getAlias().equals(tableName)) { - return t; - } - } - return null; - } - - public boolean equalsTableName(String tableName) { - if (this.relation instanceof MondrianDef.Table) { - MondrianDef.Table mt = (MondrianDef.Table) this.relation; - if (mt.name.equals(tableName)) { - return true; - } - } - return false; - } - - /** - * Adds this table to the FROM clause of a query, and also, if - * joinToParent, any join condition. - * - * @param query Query to add to - * @param failIfExists Pass in false if you might have already added - * the table before and if that happens you want to do nothing. - * @param joinToParent Pass in true if you are constraining a cell - * calculation, false if you are retrieving members. - */ - public void addToFrom( - SqlQuery query, - boolean failIfExists, - boolean joinToParent) - { - query.addFrom(relation, alias, failIfExists); - Util.assertTrue((parent == null) == (joinCondition == null)); - if (joinToParent) { - if (parent != null) { - parent.addToFrom(query, failIfExists, joinToParent); - } - if (joinCondition != null) { - query.addWhere(joinCondition.toString(query)); - } - } - } - - /** - * Returns a list of child {@link Table}s. - */ - public List

getChildren() { - return children; - } - - /** - * Returns a list of this table's {@link Column}s. - */ - public List getColumns() { - return columnList; - } - - /** - * Finds the child table of the fact table with the given columnName - * used in its left join condition. This is used by the AggTableManager - * while characterizing the fact table columns. - */ - public RolapStar.Table findTableWithLeftJoinCondition( - final String columnName) - { - for (Table child : getChildren()) { - Condition condition = child.joinCondition; - if (condition != null) { - if (condition.left instanceof MondrianDef.Column) { - MondrianDef.Column mcolumn = - (MondrianDef.Column) condition.left; - if (mcolumn.name.equals(columnName)) { - return child; - } - } - } - } - return null; - } - - /** - * This is used during aggregate table validation to make sure that the - * mapping from for the aggregate join condition is valid. It returns - * the child table with the matching left join condition. - */ - public RolapStar.Table findTableWithLeftCondition( - final MondrianDef.Expression left) - { - for (Table child : getChildren()) { - Condition condition = child.joinCondition; - if (condition != null) { - if (condition.left instanceof MondrianDef.Column) { - MondrianDef.Column mcolumn = - (MondrianDef.Column) condition.left; - if (mcolumn.equals(left)) { - return child; - } - } - } - } - return null; - } - - /** - * Note: I do not think that this is ever true. - */ - public boolean isFunky() { - return (relation == null); - } - - public boolean equals(Object obj) { - if (!(obj instanceof Table)) { - return false; - } - Table other = (Table) obj; - return getAlias().equals(other.getAlias()); - } - public int hashCode() { - return getAlias().hashCode(); - } - - public String toString() { - StringWriter sw = new StringWriter(256); - PrintWriter pw = new PrintWriter(sw); - print(pw, ""); - pw.flush(); - return sw.toString(); - } - - /** - * Prints this table and its children. - */ - public void print(PrintWriter pw, String prefix) { - pw.print(prefix); - pw.println("Table:"); - String subprefix = prefix + " "; - - pw.print(subprefix); - pw.print("alias="); - pw.println(getAlias()); - - if (this.relation != null) { - pw.print(subprefix); - pw.print("relation="); - pw.println(relation); - } - - pw.print(subprefix); - pw.println("Columns:"); - String subsubprefix = subprefix + " "; - - for (Column column : getColumns()) { - column.print(pw, subsubprefix); - pw.println(); - } - - if (this.joinCondition != null) { - this.joinCondition.print(pw, subprefix); - } - for (Table child : getChildren()) { - child.print(pw, subprefix); - } - } - - /** - * Returns whether this table has a column with the given name. - */ - public boolean containsColumn(String columnName) { - if (relation instanceof MondrianDef.Relation) { - return star.containsColumn( - ((MondrianDef.Relation) relation).getAlias(), - columnName); - } else { - // todo: Deal with join. - return false; - } - } - } - - public static class Condition { - private static final Logger LOGGER = LoggerFactory.getLogger(Condition.class); - - private final MondrianDef.Expression left; - private final MondrianDef.Expression right; - // set in Table constructor - Table table; - - Condition( - MondrianDef.Expression left, - MondrianDef.Expression right) - { - assert left != null; - assert right != null; - - if (!(left instanceof MondrianDef.Column)) { - // TODO: Will this ever print?? if not then left should be - // of type MondrianDef.Column. - LOGGER.debug( - "Condition.left NOT Column: " - + left.getClass().getName()); - } - this.left = left; - this.right = right; - } - public MondrianDef.Expression getLeft() { - return left; - } - public String getLeft(final SqlQuery query) { - return this.left.getExpression(query); - } - public MondrianDef.Expression getRight() { - return right; - } - public String getRight(final SqlQuery query) { - return this.right.getExpression(query); - } - public String toString(SqlQuery query) { - return left.getExpression(query) + " = " - + right.getExpression(query); - } - public int hashCode() { - return left.hashCode() ^ right.hashCode(); - } - - public boolean equals(Object obj) { - if (!(obj instanceof Condition)) { - return false; - } - Condition that = (Condition) obj; - return this.left.equals(that.left) - && this.right.equals(that.right); - } - - public String toString() { - StringWriter sw = new StringWriter(256); - PrintWriter pw = new PrintWriter(sw); - print(pw, ""); - pw.flush(); - return sw.toString(); - } - - /** - * Prints this table and its children. - */ - public void print(PrintWriter pw, String prefix) { - SqlQuery sqlQueuy = table.getSqlQuery(); - pw.print(prefix); - pw.println("Condition:"); - String subprefix = prefix + " "; - - pw.print(subprefix); - pw.print("left="); - // print the foreign key bit position if we can figure it out - if (left instanceof MondrianDef.Column) { - MondrianDef.Column c = (MondrianDef.Column) left; - Column col = table.star.getFactTable().lookupColumn(c.name); - if (col != null) { - pw.print(" ("); - pw.print(col.getBitPosition()); - pw.print(") "); - } - } - pw.println(left.getExpression(sqlQueuy)); - - pw.print(subprefix); - pw.print("right="); - pw.println(right.getExpression(sqlQueuy)); - } - } - - /** - * Creates a copy of an expression, everywhere replacing one alias - * with another. - */ - public static class AliasReplacer { - private final String oldAlias; - private final String newAlias; - - public AliasReplacer(String oldAlias, String newAlias) { - this.oldAlias = oldAlias; - this.newAlias = newAlias; - } - - private Condition visit(Condition condition) { - if (condition == null) { - return null; - } - if (newAlias.equals(oldAlias)) { - return condition; - } - return new Condition( - visit(condition.left), - visit(condition.right)); - } - - public MondrianDef.Expression visit(MondrianDef.Expression expression) { - if (expression == null) { - return null; - } - if (newAlias.equals(oldAlias)) { - return expression; - } - if (expression instanceof MondrianDef.Column) { - MondrianDef.Column column = (MondrianDef.Column) expression; - return new MondrianDef.Column(visit(column.table), column.name); - } else { - throw Util.newInternal("need to implement " + expression); - } - } - - private String visit(String table) { - return table.equals(oldAlias) - ? newAlias - : table; - } - } - - /** - * Comparator to compare columns based on their name - */ - public static class ColumnComparator implements Comparator { - - public static ColumnComparator instance = new ColumnComparator(); - - private ColumnComparator() { - } - - public int compare(Column o1, Column o2) { - return o1.getName().compareTo(o2.getName()); - } - } -} diff --git a/contact-center/app/src/main/java/mondrian/rolap/SqlStatement.java b/contact-center/app/src/main/java/mondrian/rolap/SqlStatement.java deleted file mode 100644 index 5d2dc5bf..00000000 --- a/contact-center/app/src/main/java/mondrian/rolap/SqlStatement.java +++ /dev/null @@ -1,576 +0,0 @@ -/* -// This software is subject to the terms of the Eclipse Public License v1.0 -// Agreement, available at the following URL: -// http://www.eclipse.org/legal/epl-v10.html. -// You must accept the terms of that agreement to use this software. -// -// Copyright (c) 2002-2013 Pentaho Corporation.. All rights reserved. -*/ -package mondrian.rolap; - -import com.cskefu.cc.acd.middleware.visitor.ACDVisBindingMw; -import mondrian.olap.*; -import mondrian.olap.Util.Functor1; -import mondrian.server.Execution; -import mondrian.server.Locus; -import mondrian.server.monitor.*; -import mondrian.server.monitor.SqlStatementEvent.Purpose; -import mondrian.util.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Proxy; - -import java.sql.*; -import java.sql.Connection; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Semaphore; -import java.util.concurrent.atomic.AtomicLong; -import javax.sql.DataSource; - -/** - * SqlStatement contains a SQL statement and associated resources throughout - * its lifetime. - * - *

The goal of SqlStatement is to make tracing, error-handling and - * resource-management easier. None of the methods throws a SQLException; - * if an error occurs in one of the methods, the method wraps the exception - * in a {@link RuntimeException} describing the high-level operation, logs - * that the operation failed, and throws that RuntimeException. - * - *

If methods succeed, the method generates lifecycle logging such as - * the elapsed time and number of rows fetched. - * - *

There are a few obligations on the caller. The caller must:

    - *
  • call the {@link #handle(Throwable)} method if one of the contained - * objects (say the {@link java.sql.ResultSet}) gives an error; - *
  • call the {@link #close()} method if all operations complete - * successfully. - *
  • increment the {@link #rowCount} field each time a row is fetched. - *
- * - *

The {@link #close()} method is idempotent. You are welcome to call it - * more than once. - * - *

SqlStatement is not thread-safe. - * - * @author jhyde - * @since 2.3 - */ -public class SqlStatement { - - private final static Logger SQL_LOGGER = LoggerFactory.getLogger("mondrian.sql"); - private final static Logger LOGGER = LoggerFactory.getLogger(SqlStatement.class); - - private static final String TIMING_NAME = "SqlStatement-"; - - // used for SQL logging, allows for a SQL Statement UID - private static final AtomicLong ID_GENERATOR = new AtomicLong(); - - private static final Semaphore querySemaphore = new Semaphore( - MondrianProperties.instance().QueryLimit.get(), true); - - private final DataSource dataSource; - private Connection jdbcConnection; - private ResultSet resultSet; - private final String sql; - private final List types; - private final int maxRows; - private final int firstRowOrdinal; - private final Locus locus; - private final int resultSetType; - private final int resultSetConcurrency; - private boolean haveSemaphore; - public int rowCount; - private long startTimeNanos; - private long startTimeMillis; - private final List accessors = new ArrayList<>(); - private State state = State.FRESH; - private final long id; - private final Functor1 callback; - - /** - * Creates a SqlStatement. - * - * @param dataSource Data source - * @param sql SQL - * @param types Suggested types of columns, or null; - * if present, must have one element for each SQL column; - * each not-null entry overrides deduced JDBC type of the column - * @param maxRows Maximum rows; <= 0 means no maximum - * @param firstRowOrdinal Ordinal of first row to skip to; <= 0 do not skip - * @param locus Execution context of this statement - * @param resultSetType Result set type - * @param resultSetConcurrency Result set concurrency - */ - public SqlStatement( - DataSource dataSource, - String sql, - List types, - int maxRows, - int firstRowOrdinal, - Locus locus, - int resultSetType, - int resultSetConcurrency, - Util.Functor1 callback) - { - this.callback = callback; - this.id = ID_GENERATOR.getAndIncrement(); - this.dataSource = dataSource; - this.sql = sql; - this.types = types; - this.maxRows = maxRows; - this.firstRowOrdinal = firstRowOrdinal; - this.locus = locus; - this.resultSetType = resultSetType; - this.resultSetConcurrency = resultSetConcurrency; - } - - /** - * Executes the current statement, and handles any SQLException. - */ - public void execute() { - assert state == State.FRESH : "cannot re-execute"; - state = State.ACTIVE; - Counters.SQL_STATEMENT_EXECUTE_COUNT.incrementAndGet(); - Counters.SQL_STATEMENT_EXECUTING_IDS.add(id); - String status = "failed"; - Statement statement = null; - try { - // Check execution state - locus.execution.checkCancelOrTimeout(); - - this.jdbcConnection = dataSource.getConnection(); - querySemaphore.acquire(); - haveSemaphore = true; - // Trace start of execution. - // TODO lecjy - if (SQL_LOGGER.isDebugEnabled()) { - StringBuilder sqllog = new StringBuilder(); - sqllog.append(id) - .append(": ") - .append(locus.component) - .append(": executing sql ["); - if (sql.indexOf('\n') >= 0) { - // SQL appears to be formatted as multiple lines. Make it - // start on its own line. - sqllog.append("\n"); - } - sqllog.append(sql); - sqllog.append(']'); - SQL_LOGGER.debug(sqllog.toString()); - } - - // Execute hook. - RolapUtil.ExecuteQueryHook hook = RolapUtil.getHook(); - if (hook != null) { - hook.onExecuteQuery(sql); - } - - // Check execution state - locus.execution.checkCancelOrTimeout(); - - startTimeNanos = System.nanoTime(); - startTimeMillis = System.currentTimeMillis(); - - if (resultSetType < 0 || resultSetConcurrency < 0) { - statement = jdbcConnection.createStatement(); - } else { - statement = jdbcConnection.createStatement( - resultSetType, - resultSetConcurrency); - } - if (maxRows > 0) { - statement.setMaxRows(maxRows); - } - - // First make sure to register with the execution instance. - if (getPurpose() != Purpose.CELL_SEGMENT) { - locus.execution.registerStatement(locus, statement); - } else { - if (callback != null) { - callback.apply(statement); - } - } - - locus.getServer().getMonitor().sendEvent( - new SqlStatementStartEvent( - startTimeMillis, - id, - locus, - sql, - getPurpose(), - getCellRequestCount())); - - this.resultSet = statement.executeQuery(sql.replaceAll("\"", "")); - - // skip to first row specified in request - this.state = State.ACTIVE; - if (firstRowOrdinal > 0) { - if (resultSetType == ResultSet.TYPE_FORWARD_ONLY) { - for (int i = 0; i < firstRowOrdinal; ++i) { - if (!this.resultSet.next()) { - this.state = State.DONE; - break; - } - } - } else { - if (!this.resultSet.absolute(firstRowOrdinal)) { - this.state = State.DONE; - } - } - } - - long timeMillis = System.currentTimeMillis(); - long timeNanos = System.nanoTime(); - final long executeNanos = timeNanos - startTimeNanos; - final long executeMillis = executeNanos / 1000000; - Util.addDatabaseTime(executeMillis); - status = ", exec " + executeMillis + " ms"; - - locus.getServer().getMonitor().sendEvent( - new SqlStatementExecuteEvent( - timeMillis, - id, - locus, - sql, - getPurpose(), - executeNanos)); - - // Compute accessors. They ensure that we use the most efficient - // method (e.g. getInt, getDouble, getObject) for the type of the - // column. Even if you are going to box the result into an object, - // it is better to use getInt than getObject; the latter might - // return something daft like a BigDecimal (does, on the Oracle JDBC - // driver). - accessors.clear(); - for (Type type : guessTypes()) { - accessors.add(createAccessor(accessors.size(), type)); - } - } catch (Throwable e) { - status = ", failed (" + e + ")"; - - // This statement was leaked to us. It is our responsibility - // to dispose of it. - Util.close(null, statement, null); - - // Now handle this exception. - throw handle(e); - } finally { - // TODO lecjy - SQL_LOGGER.debug(id + ": " + status); - - if (LOGGER.isDebugEnabled()) { - LOGGER.debug( - locus.component + ": executing sql [" + sql + "]" + status); - } - } - } - - /** - * Closes all resources (statement, result set) held by this - * SqlStatement. - * - *

If any of them fails, wraps them in a - * {@link RuntimeException} describing the high-level operation which - * this statement was performing. No further error-handling is required - * to produce a descriptive stack trace, unless you want to absorb the - * error.

- * - *

This method is idempotent.

- */ - public void close() { - if (state == State.CLOSED) { - return; - } - state = State.CLOSED; - - if (haveSemaphore) { - haveSemaphore = false; - querySemaphore.release(); - } - - // According to the JDBC spec, closing a statement automatically closes - // its result sets, and closing a connection automatically closes its - // statements. But let's be conservative and close everything - // explicitly. - SQLException ex = Util.close(resultSet, null, jdbcConnection); - resultSet = null; - jdbcConnection = null; - - if (ex != null) { - throw Util.newError( - ex, - locus.message + "; sql=[" + sql + "]"); - } - - long endTime = System.currentTimeMillis(); - long totalMs = endTime - startTimeMillis; - String status = - ", exec+fetch " + totalMs + " ms, " + rowCount + " rows"; - - locus.execution.getQueryTiming().markFull( - TIMING_NAME + locus.component, totalMs); - // TODO lecjy - SQL_LOGGER.debug(id + ": " + status); - - Counters.SQL_STATEMENT_CLOSE_COUNT.incrementAndGet(); - boolean remove = Counters.SQL_STATEMENT_EXECUTING_IDS.remove(id); - status += ", ex=" + Counters.SQL_STATEMENT_EXECUTE_COUNT.get() - + ", close=" + Counters.SQL_STATEMENT_CLOSE_COUNT.get() - + ", open=" + Counters.SQL_STATEMENT_EXECUTING_IDS; - // TODO lecjy - if (LOGGER.isDebugEnabled()) { - LOGGER.debug( - locus.component + ": done executing sql [" + sql + "]" - + status); - } - - if (!remove) { - throw new AssertionError( - "SqlStatement closed that was never executed: " + id); - } - - locus.getServer().getMonitor().sendEvent( - new SqlStatementEndEvent( - endTime, - id, - locus, - sql, - getPurpose(), - rowCount, - false, - null)); - } - - public ResultSet getResultSet() { - return resultSet; - } - - /** - * Handles an exception thrown from the ResultSet, implicitly calls - * {@link #close}, and returns an exception which includes the full - * stack, including a description of the high-level operation. - * - * @param e Exception - * @return Runtime exception - */ - public RuntimeException handle(Throwable e) { - RuntimeException runtimeException = - Util.newError(e, locus.message + "; sql=[" + sql + "]"); - try { - close(); - } catch (Throwable t) { - // ignore - } - return runtimeException; - } - - private Accessor createAccessor(int column, Type type) { - final int columnPlusOne = column + 1; - switch (type) { - case OBJECT: - return () -> resultSet.getObject(columnPlusOne); - case STRING: - return () -> resultSet.getString(columnPlusOne); - case INT: - return () -> { - final int val = resultSet.getInt(columnPlusOne); - if (val == 0 && resultSet.wasNull()) { - return null; - } - return val; - }; - case LONG: - return () -> { - final long val = resultSet.getLong(columnPlusOne); - if (val == 0 && resultSet.wasNull()) { - return null; - } - return val; - }; - case DOUBLE: - return () -> { - final double val = resultSet.getDouble(columnPlusOne); - if (val == 0 && resultSet.wasNull()) { - return null; - } - return val; - }; - default: - throw Util.unexpected(type); - } - } - - public List guessTypes() throws SQLException { - final ResultSetMetaData metaData = resultSet.getMetaData(); - final int columnCount = metaData.getColumnCount(); - assert this.types == null || this.types.size() == columnCount; - List types = new ArrayList<>(); - - for (int i = 0; i < columnCount; i++) { - final Type suggestedType = - this.types == null ? null : this.types.get(i); - // There might not be a schema constructed yet, - // so watch out here for NPEs. - RolapSchema schema = locus.execution.getMondrianStatement() - .getMondrianConnection() - .getSchema(); - - if (suggestedType != null) { - types.add(suggestedType); - } else if (schema != null && schema.getDialect() != null) { - types.add(schema.getDialect().getType(metaData, i)); - } else { - types.add(Type.OBJECT); - } - } - return types; - } - - public List getAccessors() throws SQLException { - return accessors; - } - - /** - * Returns the result set in a proxy which automatically closes this - * SqlStatement (and hence also the statement and result set) when the - * result set is closed. - * - *

This helps to prevent connection leaks. The caller still has to - * remember to call ResultSet.close(), of course. - * - * @return Wrapped result set - */ - public ResultSet getWrappedResultSet() { - return (ResultSet) Proxy.newProxyInstance( - null, - new Class[] {ResultSet.class}, - new MyDelegatingInvocationHandler(this)); - } - - private SqlStatementEvent.Purpose getPurpose() { - if (locus instanceof StatementLocus) { - return ((StatementLocus) locus).purpose; - } else { - return SqlStatementEvent.Purpose.OTHER; - } - } - - private int getCellRequestCount() { - if (locus instanceof StatementLocus) { - return ((StatementLocus) locus).cellRequestCount; - } else { - return 0; - } - } - - /** - * The approximate JDBC type of a column. - * - *

This type affects which {@link ResultSet} method we use to get values - * of this column: the default is {@link java.sql.ResultSet#getObject(int)}, - * but we'd prefer to use native values {@code getInt} and {@code getDouble} - * if possible. - */ - public enum Type { - OBJECT, - DOUBLE, - INT, - LONG, - STRING; - - public Object get(ResultSet resultSet, int column) throws SQLException { - switch (this) { - case OBJECT: - return resultSet.getObject(column + 1); - case STRING: - return resultSet.getString(column + 1); - case INT: - return resultSet.getInt(column + 1); - case LONG: - return resultSet.getLong(column + 1); - case DOUBLE: - return resultSet.getDouble(column + 1); - default: - throw Util.unexpected(this); - } - } - } - - public interface Accessor { - Object get() throws SQLException; - } - - /** - * Reflectively implements the {@link ResultSet} interface by routing method - * calls to the result set inside a {@link mondrian.rolap.SqlStatement}. - * When the result set is closed, so is the SqlStatement, and hence the - * JDBC connection and statement also. - */ - // must be public for reflection to work - public static class MyDelegatingInvocationHandler - extends DelegatingInvocationHandler - { - private final SqlStatement sqlStatement; - - /** - * Creates a MyDelegatingInvocationHandler. - * - * @param sqlStatement SQL statement - */ - MyDelegatingInvocationHandler(SqlStatement sqlStatement) { - this.sqlStatement = sqlStatement; - } - - protected Object getTarget() throws InvocationTargetException { - final ResultSet resultSet = sqlStatement.getResultSet(); - if (resultSet == null) { - throw new InvocationTargetException( - new SQLException( - "Invalid operation. Statement is closed.")); - } - return resultSet; - } - - /** - * Helper method to implement {@link java.sql.ResultSet#close()}. - * - * @throws SQLException on error - */ - public void close() throws SQLException { - sqlStatement.close(); - } - } - - private enum State { - FRESH, - ACTIVE, - DONE, - CLOSED - } - - public static class StatementLocus extends Locus { - private final SqlStatementEvent.Purpose purpose; - private final int cellRequestCount; - - public StatementLocus( - Execution execution, - String component, - String message, - SqlStatementEvent.Purpose purpose, - int cellRequestCount) - { - super( - execution, - component, - message); - this.purpose = purpose; - this.cellRequestCount = cellRequestCount; - } - } -} - -// End SqlStatement.java diff --git a/contact-center/app/src/main/java/mondrian/rolap/agg/AbstractQuerySpec.java b/contact-center/app/src/main/java/mondrian/rolap/agg/AbstractQuerySpec.java deleted file mode 100644 index f3060c58..00000000 --- a/contact-center/app/src/main/java/mondrian/rolap/agg/AbstractQuerySpec.java +++ /dev/null @@ -1,382 +0,0 @@ -/* -// This software is subject to the terms of the Eclipse Public License v1.0 -// Agreement, available at the following URL: -// http://www.eclipse.org/legal/epl-v10.html. -// You must accept the terms of that agreement to use this software. -// -// Copyright (C) 2005-2005 Julian Hyde -// Copyright (C) 2005-2013 Pentaho and others -// All Rights Reserved. -*/ -package mondrian.rolap.agg; - -import mondrian.olap.Util; -import mondrian.rolap.*; -import mondrian.rolap.sql.SqlQuery; -import mondrian.spi.Dialect; -import mondrian.util.Pair; - -import java.util.*; - -/** - * Base class for {@link QuerySpec} implementations. - * - * @author jhyde - * @author Richard M. Emberson - */ -public abstract class AbstractQuerySpec implements QuerySpec { - private final RolapStar star; - protected final boolean countOnly; - - /** - * Creates an AbstractQuerySpec. - * - * @param star Star which defines columns of interest and their - * relationships - * - * @param countOnly If true, generate no GROUP BY clause, so the query - * returns a single row containing a grand total - */ - protected AbstractQuerySpec(final RolapStar star, boolean countOnly) { - this.star = star; - this.countOnly = countOnly; - } - - /** - * Creates a query object. - * - * @return a new query object - */ - protected SqlQuery newSqlQuery() { - return getStar().getSqlQuery(); - } - - public RolapStar getStar() { - return star; - } - - /** - * Adds a measure to a query. - * - * @param i Ordinal of measure - * @param sqlQuery Query object - */ - protected void addMeasure(final int i, final SqlQuery sqlQuery) { - RolapStar.Measure measure = getMeasure(i); - if (!isPartOfSelect(measure)) { - return; - } - Util.assertTrue(measure.getTable() == getStar().getFactTable()); - measure.getTable().addToFrom(sqlQuery, false, true); - - String exprInner = - measure.getExpression() == null - ? "*" - : measure.generateExprString(sqlQuery); - String exprOuter = measure.getAggregator().getExpression(exprInner); - sqlQuery.addSelect( - exprOuter, - measure.getInternalType(), - getMeasureAlias(i)); - } - - protected abstract boolean isAggregate(); - - protected Map nonDistinctGenerateSql(SqlQuery sqlQuery) - { - // add constraining dimensions - RolapStar.Column[] columns = getColumns(); - int arity = columns.length; - if (countOnly) { - sqlQuery.addSelect("count(*)", SqlStatement.Type.INT); - } - for (int i = 0; i < arity; i++) { - RolapStar.Column column = columns[i]; - RolapStar.Table table = column.getTable(); - if (table.isFunky()) { - // this is a funky dimension -- ignore for now - continue; - } - table.addToFrom(sqlQuery, false, true); - - String expr = column.generateExprString(sqlQuery); - - StarColumnPredicate predicate = getColumnPredicate(i); - final String where = RolapStar.Column.createInExpr( - expr, - predicate, - column.getDatatype(), - sqlQuery); - if (!where.equals("true")) { - sqlQuery.addWhere(where); - } - - if (countOnly) { - continue; - } - - if (!isPartOfSelect(column)) { - continue; - } - - // some DB2 (AS400) versions throw an error, if a column alias is - // there and *not* used in a subsequent order by/group by - final Dialect dialect = sqlQuery.getDialect(); - final String alias; - final Dialect.DatabaseProduct databaseProduct = - dialect.getDatabaseProduct(); - if (databaseProduct == Dialect.DatabaseProduct.DB2_AS400) { - alias = - sqlQuery.addSelect(expr, column.getInternalType(), null); - } else { - alias = - sqlQuery.addSelect( - expr, column.getInternalType(), getColumnAlias(i)); - } - - if (isAggregate()) { - sqlQuery.addGroupBy(expr, alias); - } - - // Add ORDER BY clause to make the results deterministic. - // Derby has a bug with ORDER BY, so ignore it. - if (isOrdered()) { - sqlQuery.addOrderBy( - expr, - alias, - true, false, false, true); - } - } - - // Add compound member predicates - extraPredicates(sqlQuery); - - // add measures - for (int i = 0, count = getMeasureCount(); i < count; i++) { - addMeasure(i, sqlQuery); - } - - return Collections.emptyMap(); - } - - /** - * Allows subclasses to specify if a given column must - * be returned as part of the result set, in the select clause. - */ - protected boolean isPartOfSelect(RolapStar.Column col) { - return true; - } - - /** - * Allows subclasses to specify if a given column must - * be returned as part of the result set, in the select clause. - */ - protected boolean isPartOfSelect(RolapStar.Measure measure) { - return true; - } - - /** - * Whether to add an ORDER BY clause to make results deterministic. - * Necessary if query returns more than one row and results are for - * human consumption. - * - * @return whether to sort query - */ - protected boolean isOrdered() { - return false; - } - - public Pair> generateSqlQuery() { - SqlQuery sqlQuery = newSqlQuery(); - - int k = getDistinctMeasureCount(); - final Dialect dialect = sqlQuery.getDialect(); - final Map groupingSetsAliases; - if (!dialect.allowsCountDistinct() && k > 0 - || !dialect.allowsMultipleCountDistinct() && k > 1) - { - groupingSetsAliases = - distinctGenerateSql(sqlQuery, countOnly); - } else { - groupingSetsAliases = - nonDistinctGenerateSql(sqlQuery); - } - if (!countOnly) { - addGroupingFunction(sqlQuery); - addGroupingSets(sqlQuery, groupingSetsAliases); - } - return sqlQuery.toSqlAndTypes(); - } - - protected void addGroupingFunction(SqlQuery sqlQuery) { - throw new UnsupportedOperationException(); - } - - protected void addGroupingSets( - SqlQuery sqlQuery, - Map groupingSetsAliases) - { - throw new UnsupportedOperationException(); - } - - /** - * Returns the number of measures whose aggregation function is - * distinct-count. - * - * @return Number of distinct-count measures - */ - protected int getDistinctMeasureCount() { - int k = 0; - for (int i = 0, count = getMeasureCount(); i < count; i++) { - RolapStar.Measure measure = getMeasure(i); - if (measure.getAggregator().isDistinct()) { - ++k; - } - } - return k; - } - - /** - * Generates a SQL query to retrieve the values in this segment using - * an algorithm which converts distinct-aggregates to non-distinct - * aggregates over subqueries. - * - * @param outerSqlQuery Query to modify - * @param countOnly If true, only generate a single row: no need to - * generate a GROUP BY clause or put any constraining columns in the - * SELECT clause - * @return A map of aliases used in the inner query if grouping sets - * were enabled. - */ - protected Map distinctGenerateSql( - final SqlQuery outerSqlQuery, - boolean countOnly) - { - final Dialect dialect = outerSqlQuery.getDialect(); - final Dialect.DatabaseProduct databaseProduct = - dialect.getDatabaseProduct(); - final Map groupingSetsAliases = - new HashMap<>(); - // Generate something like - // - // select d0, d1, count(m0) - // from ( - // select distinct dim1.x as d0, dim2.y as d1, f.z as m0 - // from f, dim1, dim2 - // where dim1.k = f.k1 - // and dim2.k = f.k2) as dummyname - // group by d0, d1 - // - // or, if countOnly=true - // - // select count(m0) - // from ( - // select distinct f.z as m0 - // from f, dim1, dim2 - // where dim1.k = f.k1 - // and dim2.k = f.k2) as dummyname - - final SqlQuery innerSqlQuery = newSqlQuery(); - if (databaseProduct == Dialect.DatabaseProduct.GREENPLUM) { - innerSqlQuery.setDistinct(false); - } else { - innerSqlQuery.setDistinct(true); - } - // add constraining dimensions - RolapStar.Column[] columns = getColumns(); - int arity = columns.length; - for (int i = 0; i < arity; i++) { - RolapStar.Column column = columns[i]; - RolapStar.Table table = column.getTable(); - if (table.isFunky()) { - // this is a funky dimension -- ignore for now - continue; - } - table.addToFrom(innerSqlQuery, false, true); - String expr = column.generateExprString(innerSqlQuery); - StarColumnPredicate predicate = getColumnPredicate(i); - final String where = RolapStar.Column.createInExpr( - expr, - predicate, - column.getDatatype(), - innerSqlQuery); - if (!where.equals("true")) { - innerSqlQuery.addWhere(where); - } - if (countOnly) { - continue; - } - String alias = "d" + i; - alias = innerSqlQuery.addSelect(expr, null, alias); - if (databaseProduct == Dialect.DatabaseProduct.GREENPLUM) { - innerSqlQuery.addGroupBy(expr, alias); - } - final String quotedAlias = dialect.quoteIdentifier(alias); - outerSqlQuery.addSelectGroupBy(quotedAlias, null); - // Add this alias to the map of grouping sets aliases - groupingSetsAliases.put( - expr, - dialect.quoteIdentifier( - "dummyname." + alias)); - } - - // add predicates not associated with columns - extraPredicates(innerSqlQuery); - - // add measures - for (int i = 0, count = getMeasureCount(); i < count; i++) { - RolapStar.Measure measure = getMeasure(i); - - Util.assertTrue(measure.getTable() == getStar().getFactTable()); - measure.getTable().addToFrom(innerSqlQuery, false, true); - - String alias = getMeasureAlias(i); - String expr = measure.generateExprString(outerSqlQuery); - innerSqlQuery.addSelect( - expr, - measure.getInternalType(), - alias); - if (databaseProduct == Dialect.DatabaseProduct.GREENPLUM) { - innerSqlQuery.addGroupBy(expr, alias); - } - outerSqlQuery.addSelect( - measure.getAggregator().getNonDistinctAggregator() - .getExpression(dialect.quoteIdentifier(alias)), - measure.getInternalType()); - } - outerSqlQuery.addFrom(innerSqlQuery, "dummyname", true); - return groupingSetsAliases; - } - - /** - * Adds predicates not associated with columns. - * - * @param sqlQuery Query - */ - protected void extraPredicates(SqlQuery sqlQuery) { - List predicateList = getPredicateList(); - for (StarPredicate predicate : predicateList) { - for (RolapStar.Column column - : predicate.getConstrainedColumnList()) - { - final RolapStar.Table table = column.getTable(); - table.addToFrom(sqlQuery, false, true); - } - StringBuilder buf = new StringBuilder(); - predicate.toSql(sqlQuery, buf); - final String where = buf.toString(); - if (!where.equals("true")) { - sqlQuery.addWhere(where); - } - } - } - - /** - * Returns a list of predicates not associated with a particular column. - * - * @return list of non-column predicates - */ - protected List getPredicateList() { - return Collections.emptyList(); - } -} diff --git a/contact-center/app/src/main/java/mondrian/rolap/agg/DrillThroughQuerySpec.java b/contact-center/app/src/main/java/mondrian/rolap/agg/DrillThroughQuerySpec.java deleted file mode 100644 index f35dcfc2..00000000 --- a/contact-center/app/src/main/java/mondrian/rolap/agg/DrillThroughQuerySpec.java +++ /dev/null @@ -1,218 +0,0 @@ -/* -// This software is subject to the terms of the Eclipse Public License v1.0 -// Agreement, available at the following URL: -// http://www.eclipse.org/legal/epl-v10.html. -// You must accept the terms of that agreement to use this software. -// -// Copyright (C) 2005-2005 Julian Hyde -// Copyright (C) 2005-2013 Pentaho -// All Rights Reserved. -*/ - -package mondrian.rolap.agg; - -import mondrian.olap.MondrianDef; -import mondrian.olap.Util; -import mondrian.rolap.*; -import mondrian.rolap.sql.SqlQuery; -import mondrian.util.Pair; - -import java.util.*; - -/** - * Provides the information necessary to generate SQL for a drill-through - * request. - * - * @author jhyde - * @author Richard M. Emberson - */ -class DrillThroughQuerySpec extends AbstractQuerySpec { - private final DrillThroughCellRequest request; - private final List listOfStarPredicates; - private final List columnNames; - private final int maxColumnNameLength; - - public DrillThroughQuerySpec( - DrillThroughCellRequest request, - StarPredicate starPredicateSlicer, - boolean countOnly) - { - super(request.getMeasure().getStar(), countOnly); - this.request = request; - if (starPredicateSlicer != null) { - this.listOfStarPredicates = - Collections.singletonList(starPredicateSlicer); - } else { - this.listOfStarPredicates = Collections.emptyList(); - } - int tmpMaxColumnNameLength = - getStar().getSqlQueryDialect().getMaxColumnNameLength(); - if (tmpMaxColumnNameLength == 0) { - // From java.sql.DatabaseMetaData: "a result of zero means that - // there is no limit or the limit is not known" - maxColumnNameLength = Integer.MAX_VALUE; - } else { - maxColumnNameLength = tmpMaxColumnNameLength; - } - this.columnNames = computeDistinctColumnNames(); - } - - private List computeDistinctColumnNames() { - final List columnNames = new ArrayList<>(); - final Set columnNameSet = new HashSet<>(); - - final RolapStar.Column[] columns = getColumns(); - for (RolapStar.Column column : columns) { - addColumnName(column, columnNames, columnNameSet); - } - - addColumnName(request.getMeasure(), columnNames, columnNameSet); - - return columnNames; - } - - private void addColumnName( - final RolapStar.Column column, - final List columnNames, - final Set columnNameSet) - { - String columnName = makeAlias(column, columnNames, columnNameSet); - columnNames.add(columnName); - } - - private String makeAlias( - final RolapStar.Column column, - final List columnNames, - final Set columnNameSet) - { - String columnName = column.getName(); - if (columnName != null) { - // nothing - } else if (column.getExpression() instanceof MondrianDef.Column) { - columnName = ((MondrianDef.Column) column.getExpression()).name; - } else { - columnName = "c" + Integer.toString(columnNames.size()); - } - // Register the column name, and if it's not unique, append numeric - // suffixes until it is. Also make sure that it is within the - // range allowed by this SQL dialect. - String originalColumnName = columnName; - if (columnName.length() > maxColumnNameLength) { - columnName = columnName.substring(0, maxColumnNameLength); - } - for (int j = 0; !columnNameSet.add(columnName); j++) { - final String suffix = "_" + Integer.toString(j); - columnName = originalColumnName; - if (originalColumnName.length() + suffix.length() - > maxColumnNameLength) - { - columnName = - originalColumnName.substring( - 0, maxColumnNameLength - suffix.length()); - } - columnName += suffix; - } - - return columnName; - } - - @Override - protected boolean isPartOfSelect(RolapStar.Column col) { - return request.includeInSelect(col); - } - - @Override - protected boolean isPartOfSelect(RolapStar.Measure measure) { - return request.includeInSelect(measure); - } - - public int getMeasureCount() { - return request.getDrillThroughMeasures().size() > 0 - ? request.getDrillThroughMeasures().size() - : 1; - } - - public RolapStar.Measure getMeasure(final int i) { - return request.getDrillThroughMeasures().size() > 0 - ? request.getDrillThroughMeasures().get(i) - : request.getMeasure(); - } - - public String getMeasureAlias(final int i) { - return request.getDrillThroughMeasures().size() > 0 - ? request.getDrillThroughMeasures().get(i).getName() - : columnNames.get(columnNames.size() - 1); - } - - public RolapStar.Column[] getColumns() { - return request.getConstrainedColumns(); - } - - public String getColumnAlias(final int i) { - return columnNames.get(i); - } - - public StarColumnPredicate getColumnPredicate(final int i) { - final StarColumnPredicate constr = request.getValueAt(i); - return (constr == null) - ? LiteralStarPredicate.TRUE - : constr; - } - - public Pair> generateSqlQuery() { - SqlQuery sqlQuery = newSqlQuery(); - nonDistinctGenerateSql(sqlQuery); - return sqlQuery.toSqlAndTypes(); - } - - protected void addMeasure(final int i, final SqlQuery sqlQuery) { - RolapStar.Measure measure = getMeasure(i); - - if (!isPartOfSelect(measure)) { - return; - } - - Util.assertTrue(measure.getTable() == getStar().getFactTable()); - measure.getTable().addToFrom(sqlQuery, false, true); - - if (!countOnly) { - String expr = measure.generateExprString(sqlQuery); - sqlQuery.addSelect(expr, null, getMeasureAlias(i)); - } - } - - protected boolean isAggregate() { - return false; - } - - protected boolean isOrdered() { - return true; - } - - protected List getPredicateList() { - return listOfStarPredicates; - } - - protected void extraPredicates(SqlQuery sqlQuery) { - super.extraPredicates(sqlQuery); - - if (countOnly) { - return; - } - // generate the select list - final Set columnNameSet = new HashSet<>(); - columnNameSet.addAll(columnNames); - - List predicateList = getPredicateList(); - for (StarPredicate predicate : predicateList) { - for (RolapStar.Column column - : predicate.getConstrainedColumnList()) - { - sqlQuery.addSelect( - column.generateExprString(sqlQuery), - column.getInternalType(), - makeAlias(column, columnNames, columnNameSet)); - } - } - } -} \ No newline at end of file diff --git a/contact-center/app/src/main/java/mondrian/spi/impl/SqlStatisticsProvider.java b/contact-center/app/src/main/java/mondrian/spi/impl/SqlStatisticsProvider.java deleted file mode 100644 index 339f6805..00000000 --- a/contact-center/app/src/main/java/mondrian/spi/impl/SqlStatisticsProvider.java +++ /dev/null @@ -1,187 +0,0 @@ -/* -// This software is subject to the terms of the Eclipse Public License v1.0 -// Agreement, available at the following URL: -// http://www.eclipse.org/legal/epl-v10.html. -// You must accept the terms of that agreement to use this software. -// -// Copyright (C) 2012-2012 Pentaho -// All Rights Reserved. -*/ -package mondrian.spi.impl; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Arrays; - -import javax.sql.DataSource; - -import com.cskefu.cc.basic.MainUtils; - -import mondrian.rolap.RolapUtil; -import mondrian.rolap.SqlStatement; -import mondrian.server.Execution; -import mondrian.server.Locus; -import mondrian.spi.Dialect; -import mondrian.spi.StatisticsProvider; - -/** - * Implementation of {@link mondrian.spi.StatisticsProvider} that generates - * SQL queries to count rows and distinct values. - */ -public class SqlStatisticsProvider implements StatisticsProvider { - public int getTableCardinality( - Dialect dialect, - DataSource dataSource, - String catalog, - String schema, - String table, - Execution execution) - { - StringBuilder buf = new StringBuilder("select count(*) from "); - dialect.quoteIdentifier(buf, catalog, schema, table); - final String sql = buf.toString(); - SqlStatement stmt = - RolapUtil.executeQuery( - dataSource, - sql, - new Locus( - execution, - "SqlStatisticsProvider.getTableCardinality", - "Reading row count from table " - + Arrays.asList(catalog, schema, table))); - try { - ResultSet resultSet = stmt.getResultSet(); - if (resultSet.next()) { - ++stmt.rowCount; - return resultSet.getInt(1); - } - return -1; // huh? - } catch (SQLException e) { - throw stmt.handle(e); - } finally { - stmt.close(); - } - } - - public int getQueryCardinality( - Dialect dialect, - DataSource dataSource, - String sql, - Execution execution) - { - final StringBuilder buf = new StringBuilder(); - buf.append( - "select count(*) from (").append(sql).append(")"); - if (dialect.requiresAliasForFromQuery()) { - if (dialect.allowsAs()) { - buf.append(" as "); - } else { - buf.append(" "); - } - dialect.quoteIdentifier(buf, "init"); - } - final String countSql = buf.toString(); - SqlStatement stmt = - RolapUtil.executeQuery( - dataSource, - countSql, - new Locus( - execution, - "SqlStatisticsProvider.getQueryCardinality", - "Reading row count from query [" + sql + "]")); - try { - ResultSet resultSet = stmt.getResultSet(); - if (resultSet.next()) { - ++stmt.rowCount; - return resultSet.getInt(1); - } - return -1; // huh? - } catch (SQLException e) { - throw stmt.handle(e); - } finally { - stmt.close(); - } - } - - public int getColumnCardinality( - Dialect dialect, - DataSource dataSource, - String catalog, - String schema, - String table, - String column, - Execution execution) - { - final String sql = - generateColumnCardinalitySql( - dialect, schema, table, column); - if (sql == null) { - return -1; - } - String sqlId = MainUtils.md5(sql); - SqlStatement stmt = - RolapUtil.executeQuery( - dataSource, - sql, - new Locus( - execution, - "SqlStatisticsProvider.getColumnCardinality", - "Reading cardinality for column " - + Arrays.asList(catalog, schema, table, column))); - try { - ResultSet resultSet = stmt.getResultSet(); - if (resultSet.next()) { - ++stmt.rowCount; - int value = resultSet.getInt(1) ; - return value; - } - return -1; // huh? - } catch (SQLException e) { - throw stmt.handle(e); - } finally { - stmt.close(); - } - } - - private static String generateColumnCardinalitySql( - Dialect dialect, - String schema, - String table, - String column) - { - final StringBuilder buf = new StringBuilder(); - String exprString = dialect.quoteIdentifier(column); - if (dialect.allowsCountDistinct()) { - // e.g. "select count(distinct product_id) from product" - buf.append("select count(distinct ") - .append(exprString) - .append(") from "); - dialect.quoteIdentifier(buf, schema, table); - return buf.toString(); - } else if (dialect.allowsFromQuery()) { - // Some databases (e.g. Access) don't like 'count(distinct)', - // so use, e.g., "select count(*) from (select distinct - // product_id from product)" - buf.append("select count(*) from (select distinct ") - .append(exprString) - .append(" from "); - dialect.quoteIdentifier(buf, schema, table); - buf.append(")"); - if (dialect.requiresAliasForFromQuery()) { - if (dialect.allowsAs()) { - buf.append(" as "); - } else { - buf.append(' '); - } - dialect.quoteIdentifier(buf, "init"); - } - return buf.toString(); - } else { - // Cannot compute cardinality: this database neither supports COUNT - // DISTINCT nor SELECT in the FROM clause. - return null; - } - } -} - -// End SqlStatisticsProvider.java diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/ThumbnailParameter.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/ThumbnailParameter.java deleted file mode 100644 index 660b9e86..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/ThumbnailParameter.java +++ /dev/null @@ -1,1008 +0,0 @@ -package net.coobird.thumbnailator; - -import java.awt.Dimension; -import java.awt.image.BufferedImage; -import java.util.ArrayList; -import java.util.List; - -import net.coobird.thumbnailator.filters.ImageFilter; -import net.coobird.thumbnailator.resizers.FixedResizerFactory; -import net.coobird.thumbnailator.geometry.Region; -import net.coobird.thumbnailator.resizers.Resizer; -import net.coobird.thumbnailator.resizers.ResizerFactory; - -/** - * This class is used to specify the parameters to use when creating a thumbnail. - *

- * An instance of {@link ThumbnailParameter} is mutable -- it should not be - * reused for multiple resizes, as the parameters can change behind the scenes - * as the resizing process progresses. - * - * @author coobird - * - */ -public class ThumbnailParameter -{ - /** - * A constant used to denote that the output format of the thumbnail should - * be the same as the format of the original image. - */ - public static final String ORIGINAL_FORMAT = null; - - /** - * A constant used to denote that the output format of the thumbnail should - * be the determined from available information such as the file name of - * the thumbnail. - *

- * If a suitable output format cannot be determined, then the implementation - * should behave as if {@link #ORIGINAL_FORMAT} was specified. - */ - public static final String DETERMINE_FORMAT = "\0"; - - /** - * A constant used to denote that the output format type of the thumbnail - * should be the default type of the codec being used. - */ - public static final String DEFAULT_FORMAT_TYPE = null; - - /** - * A constant used to denote that the default compression quality settings - * should be used when creating the thumbnail. - */ - public static final float DEFAULT_QUALITY = Float.NaN; - - /** - * A constant used to denote that the image type of the original image - * should be used when creating the thumbnail. - */ - public static final int ORIGINAL_IMAGE_TYPE = -1; - - /** - * A constant used to denote that the default image type should be used - * when creating the thumbnail. - */ - public static final int DEFAULT_IMAGE_TYPE = BufferedImage.TYPE_INT_ARGB; - - /** - * The thumbnail size. - *

- * If this field is set, then the {@link #scalingFactor} field will be set - * as {@link Double#NaN} to indicate that it is not set. - */ - private final Dimension thumbnailSize; - - /** - * The scaling factor to apply to the width when creating a thumbnail from - * the original image. - *

- * If this field is set, then the {@link #thumbnailSize} field will be set - * as {@code null} to indicate that it is not set. - */ - private final double widthScalingFactor; - - /** - * The scaling factor to apply to the height when creating a thumbnail from - * the original image. - *

- * If this field is set, then the {@link #thumbnailSize} field will be set - * as {@code null} to indicate that it is not set. - */ - private final double heightScalingFactor; - - /** - * Indicated whether or not the thumbnail should retain the aspect ratio - * the same as the original image when the aspect ratio of the desired - * dimensions for the thumbnail does not match the ratio of the original - * image. - */ - private final boolean keepAspectRatio; - - /** - * The output format for the thumbnail. - *

- * A value of {@link ThumbnailParameter#ORIGINAL_FORMAT} indicates that the - * image format of the original image should be used as the output format. - *

- * A value of {@link ThumbnailParameter#DETERMINE_FORMAT} indicates that the - * output format of the thumbnail should be the determined from the - * information available, such as the output file name of the thumbnail. - */ - private final String outputFormat; - - /** - * The output format type for the thumbnail. - *

- * A value of {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE} indicates - * that the default type of the specified compression format should be used - * as the output format type. - */ - private final String outputFormatType; - - /** - * The output quality settings which will be used by the image compressor. - *

- * An acceptable value is in the range of {@code 0.0f} to {@code 1.0f}, - * where {@code 0.0f} is for the lowest quality setting and {@code 1.0f} for - * the highest quality setting. - *

- * A value of {@link Float#NaN} indicates that the default quality settings - * of the output codec should be used. - */ - private final float outputQuality; - - /** - * The image type of the {@code BufferedImage} used for the thumbnail. - */ - private final int imageType; - - /** - * {@link ImageFilter}s to apply to the thumbnail. - *

- * The filters will be applied after the original image has been resized. - */ - private final List filters; - - /** - * The {@link ResizerFactory} for obtaining a {@link Resizer} that is - * to be used when performing an image resizing operation. - */ - private final ResizerFactory resizerFactory; - - /** - * The region of the source image to use when creating a thumbnail. - *

- * A value of {@code null} represents that the entire source image should - * be used to create the thumbnail. - */ - private final Region sourceRegion; - - /** - * Whether or not to fit the thumbnail within the specified dimensions. - *

- * If {@code true} is specified, then the thumbnail will be sized to fit - * within the specified dimensions, if the thumbnail is going to exceed - * those dimensions. - */ - private final boolean fitWithinDimensions; - - /** - * Whether or not to use the Exif orientation metadata to orient the - * thumbnails. - */ - private final boolean useExifOrientation; - - /** - * Private constructor which sets all the required fields, and performs - * validation of the given arguments. - *

- * This constructor is to be called from all the public constructors. - * - * @param thumbnailSize The size of the thumbnail to generate. - * @param widthScalingFactor The scaling factor to apply to the width - * when creating a thumbnail from the original - * image. - * @param heightScalingFactor The scaling factor to apply to the height - * when creating a thumbnail from the original - * image. - * @param sourceRegion The region of the source image to use when - * creating a thumbnail. - * A value of {@code null} indicates that the - * entire source image should be used to create - * the thumbnail. - * @param keepAspectRatio Indicates whether or not the thumbnail should - * maintain the aspect ratio of the original image. - * @param outputFormat A string indicating the compression format - * that should be applied on the thumbnail. - * A value of - * {@link ThumbnailParameter#ORIGINAL_FORMAT} - * should be provided if the same image format as - * the original should be used for the thumbnail. - * A value of - * {@link ThumbnailParameter#DETERMINE_FORMAT} - * should be provided if the output format of the - * thumbnail should be the determined from the - * information available, such as the output file - * name of the thumbnail. - * @param outputFormatType A string indicating the compression type that - * should be used when writing the thumbnail. - * A value of - * {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE} - * should be provided if the thumbnail should be - * written using the default compression type of - * the codec specified in {@code outputFormat}. - * @param outputQuality A value from {@code 0.0f} to {@code 1.0f} which - * indicates the quality setting to use for the - * compression of the thumbnail. {@code 0.0f} - * indicates the lowest quality, {@code 1.0f} - * indicates the highest quality setting for the - * compression. - * {@link ThumbnailParameter#DEFAULT_QUALITY} - * should be specified when the codec's default - * compression quality settings should be used. - * @param imageType The {@link BufferedImage} image type of the - * thumbnail. - * A value of - * {@link ThumbnailParameter#DEFAULT_IMAGE_TYPE} - * should be specified when the default image - * type should be used when creating the thumbnail. - * @param filters The {@link ImageFilter}s to apply to the - * thumbnail. - * A value of {@code null} will be recognized as - * no filters are to be applied. - * The filters are applied after the original - * image has been resized. - * @param resizerFactory The {@link ResizerFactory} for obtaining a - * {@link Resizer} that is to be used when - * performing an image resizing operation. - * @param fitWithinDimensions Whether or not to fit the thumbnail within - * the specified dimensions. - *

- * If {@code true} is specified, then the - * thumbnail will be sized to fit within the - * specified dimensions, if the thumbnail is - * going to exceed those dimensions. - * @param useExifOrientation Whether or not to use the Exif metadata to - * determine the orientation of the thumbnail. - *

- * If {@code true} is specified, then the - * Exif metadata will be used to determine - * the orientation of the thumbnail. - * - * @throws IllegalArgumentException If the scaling factor is not a - * rational number or is less than or - * equal to 0, or if the - * {@link ResizerFactory} is null. - */ - private ThumbnailParameter( - Dimension thumbnailSize, - double widthScalingFactor, - double heightScalingFactor, - Region sourceRegion, - boolean keepAspectRatio, - String outputFormat, - String outputFormatType, - float outputQuality, - int imageType, - List filters, - ResizerFactory resizerFactory, - boolean fitWithinDimensions, - boolean useExifOrientation - ) - { - // The following 2 fields are set by the public constructors. - this.thumbnailSize = thumbnailSize; - this.widthScalingFactor = widthScalingFactor; - this.heightScalingFactor = heightScalingFactor; - - this.keepAspectRatio = keepAspectRatio; - - this.sourceRegion = sourceRegion; - this.outputFormat = outputFormat; - this.outputFormatType = outputFormatType; - - /* - * Note: - * The value of DEFAULT_QUALITY is Float.NaN which cannot be compared - * by using the regular == operator. Therefore, to check that NaN is - * being used, one must use the Float.NaN method. - */ - if ( (outputQuality < 0.0f || outputQuality > 1.0f) && - !Float.isNaN(outputQuality) ) - { - throw new IllegalArgumentException("The output quality must be " + - "between 0.0f and 1.0f, or Float.NaN to use the default " + - "compression quality of codec being used."); - } - - this.outputQuality = outputQuality; - this.imageType = imageType; - - // Creating a new ArrayList, as `filters` should be mutable as of 0.4.3. - if (filters == null) - { - this.filters = new ArrayList<>(); - } - else - { - this.filters = new ArrayList<>(filters); - } - - if (resizerFactory == null) - { - throw new IllegalArgumentException("Resizer cannot be null"); - } - - this.resizerFactory = resizerFactory; - this.fitWithinDimensions = fitWithinDimensions; - this.useExifOrientation = useExifOrientation; - } - - /** - * Perform validations on the {@code thumbnailSize} field. - */ - private void validateThumbnailSize() - { - if (thumbnailSize == null) - { - throw new IllegalArgumentException("Thumbnail size cannot be null."); - } - else if (thumbnailSize.width < 0 || thumbnailSize.height < 0) - { - throw new IllegalArgumentException("Thumbnail dimensions must be greater than 0."); - } - } - - /** - * Perform validations on the {@code scalingFactor} field. - */ - private void validateScalingFactor() - { - if (widthScalingFactor <= 0.0 || heightScalingFactor <= 0.0) - { - throw new IllegalArgumentException("Scaling factor is less than or equal to 0."); - } - else if (Double.isNaN(widthScalingFactor) || Double.isInfinite(widthScalingFactor)) - { - throw new IllegalArgumentException("Scaling factor must be a rational number."); - } - else if (Double.isNaN(heightScalingFactor) || Double.isInfinite(heightScalingFactor)) - { - throw new IllegalArgumentException("Scaling factor must be a rational number."); - } - } - - /** - * Creates an object holding the parameters needed in order to make a - * thumbnail. - * - * @param thumbnailSize The size of the thumbnail to generate. - * @param sourceRegion The region of the source image to use when - * creating a thumbnail. - * A value of {@code null} indicates that the - * entire source image should be used to create - * the thumbnail. - * @param keepAspectRatio Indicates whether or not the thumbnail should - * maintain the aspect ratio of the original image. - * @param outputFormat A string indicating the compression format - * that should be applied on the thumbnail. - * A value of - * {@link ThumbnailParameter#ORIGINAL_FORMAT} - * should be provided if the same image format as - * the original should be used for the thumbnail. - * A value of - * {@link ThumbnailParameter#DETERMINE_FORMAT} - * should be provided if the output format of the - * thumbnail should be the determined from the - * information available, such as the output file - * name of the thumbnail. - * @param outputFormatType A string indicating the compression type that - * should be used when writing the thumbnail. - * A value of - * {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE} - * should be provided if the thumbnail should be - * written using the default compression type of - * the codec specified in {@code outputFormat}. - * @param outputQuality A value from {@code 0.0f} to {@code 1.0f} which - * indicates the quality setting to use for the - * compression of the thumbnail. {@code 0.0f} - * indicates the lowest quality, {@code 1.0f} - * indicates the highest quality setting for the - * compression. - * {@link ThumbnailParameter#DEFAULT_QUALITY} - * should be specified when the codec's default - * compression quality settings should be used. - * @param imageType The {@link BufferedImage} image type of the - * thumbnail. - * A value of - * {@link ThumbnailParameter#DEFAULT_IMAGE_TYPE} - * should be specified when the default image - * type should be used when creating the thumbnail. - * @param filters The {@link ImageFilter}s to apply to the - * thumbnail. - * A value of {@code null} will be recognized as - * no filters are to be applied. - * The filters are applied after the original - * image has been resized. - * @param resizer The {@link Resizer} to use when performing the - * resizing operation to create a thumbnail. - * @param fitWithinDimensions Whether or not to fit the thumbnail within - * the specified dimensions. - *

- * If {@code true} is specified, then the - * thumbnail will be sized to fit within the - * specified dimensions, if the thumbnail is - * going to exceed those dimensions. - * @param useExifOrientation Whether or not to use the Exif metadata to - * determine the orientation of the thumbnail. - *

- * If {@code true} is specified, then the - * Exif metadata will be used to determine - * the orientation of the thumbnail. - * - * @throws IllegalArgumentException If size is {@code null} or if the - * dimensions are negative, or if the - * {@link Resizer} is null. - * @since 0.4.3 - */ - public ThumbnailParameter( - Dimension thumbnailSize, - Region sourceRegion, - boolean keepAspectRatio, - String outputFormat, - String outputFormatType, - float outputQuality, - int imageType, - List filters, - Resizer resizer, - boolean fitWithinDimensions, - boolean useExifOrientation - ) - { - this( - thumbnailSize, - Double.NaN, - Double.NaN, - sourceRegion, - keepAspectRatio, - outputFormat, - outputFormatType, - outputQuality, - imageType, - filters, - new FixedResizerFactory(resizer), - fitWithinDimensions, - useExifOrientation - ); - - validateThumbnailSize(); - } - - /** - * Creates an object holding the parameters needed in order to make a - * thumbnail. - * - * @param widthScalingFactor The scaling factor to apply to the width - * when creating a thumbnail from the original - * image. - * @param heightScalingFactor The scaling factor to apply to the height - * when creating a thumbnail from the original - * image. - * @param sourceRegion The region of the source image to use when - * creating a thumbnail. - * A value of {@code null} indicates that the - * entire source image should be used to create - * the thumbnail. - * @param keepAspectRatio Indicates whether or not the thumbnail should - * maintain the aspect ratio of the original image. - * @param outputFormat A string indicating the compression format - * that should be applied on the thumbnail. - * A value of - * {@link ThumbnailParameter#ORIGINAL_FORMAT} - * should be provided if the same image format as - * the original should be used for the thumbnail. - * A value of - * {@link ThumbnailParameter#DETERMINE_FORMAT} - * should be provided if the output format of the - * thumbnail should be the determined from the - * information available, such as the output file - * name of the thumbnail. - * @param outputFormatType A string indicating the compression type that - * should be used when writing the thumbnail. - * A value of - * {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE} - * should be provided if the thumbnail should be - * written using the default compression type of - * the codec specified in {@code outputFormat}. - * @param outputQuality A value from {@code 0.0f} to {@code 1.0f} which - * indicates the quality setting to use for the - * compression of the thumbnail. {@code 0.0f} - * indicates the lowest quality, {@code 1.0f} - * indicates the highest quality setting for the - * compression. - * {@link ThumbnailParameter#DEFAULT_QUALITY} - * should be specified when the codec's default - * compression quality settings should be used. - * @param imageType The {@link BufferedImage} image type of the - * thumbnail. - * A value of - * {@link ThumbnailParameter#DEFAULT_IMAGE_TYPE} - * should be specified when the default image - * type should be used when creating the thumbnail. - * @param filters The {@link ImageFilter}s to apply to the - * thumbnail. - * A value of {@code null} will be recognized as - * no filters are to be applied. - * The filters are applied after the original - * image has been resized. - * @param resizer The {@link Resizer} to use when performing the - * resizing operation to create a thumbnail. - * @param fitWithinDimensions Whether or not to fit the thumbnail within - * the specified dimensions. - *

- * If {@code true} is specified, then the - * thumbnail will be sized to fit within the - * specified dimensions, if the thumbnail is - * going to exceed those dimensions. - * @param useExifOrientation Whether or not to use the Exif metadata to - * determine the orientation of the thumbnail. - *

- * If {@code true} is specified, then the - * Exif metadata will be used to determine - * the orientation of the thumbnail. - * - * @throws IllegalArgumentException If the scaling factor is not a - * rational number or is less than or - * equal to 0, or if the - * {@link Resizer} is null. - * @since 0.4.3 - */ - public ThumbnailParameter( - double widthScalingFactor, - double heightScalingFactor, - Region sourceRegion, - boolean keepAspectRatio, - String outputFormat, - String outputFormatType, - float outputQuality, - int imageType, - List filters, - Resizer resizer, - boolean fitWithinDimensions, - boolean useExifOrientation - ) - { - this( - null, - widthScalingFactor, - heightScalingFactor, - sourceRegion, - keepAspectRatio, - outputFormat, - outputFormatType, - outputQuality, - imageType, - filters, - new FixedResizerFactory(resizer), - fitWithinDimensions, - useExifOrientation - ); - - validateScalingFactor(); - } - - /** - * Creates an object holding the parameters needed in order to make a - * thumbnail. - * - * @param thumbnailSize The size of the thumbnail to generate. - * @param sourceRegion The region of the source image to use when - * creating a thumbnail. - * A value of {@code null} indicates that the - * entire source image should be used to create - * the thumbnail. - * @param keepAspectRatio Indicates whether or not the thumbnail should - * maintain the aspect ratio of the original image. - * @param outputFormat A string indicating the compression format - * that should be applied on the thumbnail. - * A value of - * {@link ThumbnailParameter#ORIGINAL_FORMAT} - * should be provided if the same image format as - * the original should be used for the thumbnail. - * A value of - * {@link ThumbnailParameter#DETERMINE_FORMAT} - * should be provided if the output format of the - * thumbnail should be the determined from the - * information available, such as the output file - * name of the thumbnail. - * @param outputFormatType A string indicating the compression type that - * should be used when writing the thumbnail. - * A value of - * {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE} - * should be provided if the thumbnail should be - * written using the default compression type of - * the codec specified in {@code outputFormat}. - * @param outputQuality A value from {@code 0.0f} to {@code 1.0f} which - * indicates the quality setting to use for the - * compression of the thumbnail. {@code 0.0f} - * indicates the lowest quality, {@code 1.0f} - * indicates the highest quality setting for the - * compression. - * {@link ThumbnailParameter#DEFAULT_QUALITY} - * should be specified when the codec's default - * compression quality settings should be used. - * @param imageType The {@link BufferedImage} image type of the - * thumbnail. - * A value of - * {@link ThumbnailParameter#DEFAULT_IMAGE_TYPE} - * should be specified when the default image - * type should be used when creating the thumbnail. - * @param filters The {@link ImageFilter}s to apply to the - * thumbnail. - * A value of {@code null} will be recognized as - * no filters are to be applied. - * The filters are applied after the original - * image has been resized. - * @param resizerFactory The {@link ResizerFactory} for obtaining a - * {@link Resizer} that is to be used when - * performing an image resizing operation. - * @param fitWithinDimensions Whether or not to fit the thumbnail within - * the specified dimensions. - *

- * If {@code true} is specified, then the - * thumbnail will be sized to fit within the - * specified dimensions, if the thumbnail is - * going to exceed those dimensions. - * @param useExifOrientation Whether or not to use the Exif metadata to - * determine the orientation of the thumbnail. - *

- * If {@code true} is specified, then the - * Exif metadata will be used to determine - * the orientation of the thumbnail. - * - * @throws IllegalArgumentException If size is {@code null} or if the - * dimensions are negative, or if the - * {@link ResizerFactory} is null. - * @since 0.4.3 - */ - public ThumbnailParameter( - Dimension thumbnailSize, - Region sourceRegion, - boolean keepAspectRatio, - String outputFormat, - String outputFormatType, - float outputQuality, - int imageType, - List filters, - ResizerFactory resizerFactory, - boolean fitWithinDimensions, - boolean useExifOrientation - ) - { - this( - thumbnailSize, - Double.NaN, - Double.NaN, - sourceRegion, - keepAspectRatio, - outputFormat, - outputFormatType, - outputQuality, - imageType, - filters, - resizerFactory, - fitWithinDimensions, - useExifOrientation - ); - - validateThumbnailSize(); - } - - /** - * Creates an object holding the parameters needed in order to make a - * thumbnail. - * - * @param widthScalingFactor The scaling factor to apply to the width - * when creating a thumbnail from the original - * image. - * @param heightScalingFactor The scaling factor to apply to the height - * when creating a thumbnail from the original - * image. - * @param sourceRegion The region of the source image to use when - * creating a thumbnail. - * A value of {@code null} indicates that the - * entire source image should be used to create - * the thumbnail. - * @param keepAspectRatio Indicates whether or not the thumbnail should - * maintain the aspect ratio of the original image. - * @param outputFormat A string indicating the compression format - * that should be applied on the thumbnail. - * A value of - * {@link ThumbnailParameter#ORIGINAL_FORMAT} - * should be provided if the same image format as - * the original should be used for the thumbnail. - * A value of - * {@link ThumbnailParameter#DETERMINE_FORMAT} - * should be provided if the output format of the - * thumbnail should be the determined from the - * information available, such as the output file - * name of the thumbnail. - * @param outputFormatType A string indicating the compression type that - * should be used when writing the thumbnail. - * A value of - * {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE} - * should be provided if the thumbnail should be - * written using the default compression type of - * the codec specified in {@code outputFormat}. - * @param outputQuality A value from {@code 0.0f} to {@code 1.0f} which - * indicates the quality setting to use for the - * compression of the thumbnail. {@code 0.0f} - * indicates the lowest quality, {@code 1.0f} - * indicates the highest quality setting for the - * compression. - * {@link ThumbnailParameter#DEFAULT_QUALITY} - * should be specified when the codec's default - * compression quality settings should be used. - * @param imageType The {@link BufferedImage} image type of the - * thumbnail. - * A value of - * {@link ThumbnailParameter#DEFAULT_IMAGE_TYPE} - * should be specified when the default image - * type should be used when creating the thumbnail. - * @param filters The {@link ImageFilter}s to apply to the - * thumbnail. - * A value of {@code null} will be recognized as - * no filters are to be applied. - * The filters are applied after the original - * image has been resized. - * @param resizerFactory The {@link ResizerFactory} for obtaining a - * {@link Resizer} that is to be used when - * performing an image resizing operation. - * @param fitWithinDimensions Whether or not to fit the thumbnail within - * the specified dimensions. - *

- * If {@code true} is specified, then the - * thumbnail will be sized to fit within the - * specified dimensions, if the thumbnail is - * going to exceed those dimensions. - * @param useExifOrientation Whether or not to use the Exif metadata to - * determine the orientation of the thumbnail. - *

- * If {@code true} is specified, then the - * Exif metadata will be used to determine - * the orientation of the thumbnail. - * - * @throws IllegalArgumentException If the scaling factor is not a - * rational number or is less than or - * equal to 0, or if the - * {@link ResizerFactory} is null. - * @since 0.4.3 - */ - public ThumbnailParameter( - double widthScalingFactor, - double heightScalingFactor, - Region sourceRegion, - boolean keepAspectRatio, - String outputFormat, - String outputFormatType, - float outputQuality, - int imageType, - List filters, - ResizerFactory resizerFactory, - boolean fitWithinDimensions, - boolean useExifOrientation - ) - { - this( - null, - widthScalingFactor, - heightScalingFactor, - sourceRegion, - keepAspectRatio, - outputFormat, - outputFormatType, - outputQuality, - imageType, - filters, - resizerFactory, - fitWithinDimensions, - useExifOrientation - ); - - validateScalingFactor(); - } - - /** - * Returns the size of the thumbnail. - *

- * Returns {@code null} if the scaling factor is set rather than the - * explicit thumbnail size. - * - * @return The size of the thumbnail. - */ - public Dimension getSize() - { - if (thumbnailSize != null) - { - return (Dimension)thumbnailSize.clone(); - } - else - { - return null; - } - } - - /** - * Returns the scaling factor to apply to the width when creating the - * thumbnail. - *

- * Returns {@link Double#NaN} if the thumbnail size is set rather than the - * scaling factor. - * - * @return The width scaling factor for the thumbnail. - * @since 0.3.10 - */ - public double getWidthScalingFactor() - { - return widthScalingFactor; - } - - /** - * Returns the scaling factor to apply to the height when creating the - * thumbnail. - *

- * Returns {@link Double#NaN} if the thumbnail size is set rather than the - * scaling factor. - * - * @return The height scaling factor for the thumbnail. - * @since 0.3.10 - */ - public double getHeightScalingFactor() - { - return heightScalingFactor; - } - - /** - * Returns the type of image. The value returned is the constant used for - * image types of {@link BufferedImage}. - * - * @return The type of the image. - */ - public int getType() - { - return imageType; - } - - /** - * Returns whether or not the thumbnail is to maintain the aspect ratio of - * the source image when creating the thumbnail. - * - * @return {@code true} if the thumbnail is to maintain the aspect - * ratio of the original image, {@code false} otherwise. - */ - public boolean isKeepAspectRatio() - { - return keepAspectRatio; - } - - /** - * Returns the output format for the thumbnail. - *

- * If the output format is to use the same compression format as the - * original image, this method will return - * {@link ThumbnailParameter#ORIGINAL_FORMAT}. - *

- * If the output format should be determined from the information available - * such as the file name of the thumbnail, then this method will return - * {@link ThumbnailParameter#DETERMINE_FORMAT}. - * - * @return The output format for the thumbnail. - */ - public String getOutputFormat() - { - return outputFormat; - } - - /** - * Returns the output format type for the thumbnail. - *

- * If the default compression type of the compression format is to be used, - * then this method will return - * {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE}. - * - * @return The output format type for the thumbnail. - */ - public String getOutputFormatType() - { - return outputFormatType; - } - - /** - * Returns the compression quality settings for the thumbnail. - *

- * The value is in the range of {@code 0.0f} to {@code 1.0f}, - * where {@code 0.0f} is for the lowest quality setting and {@code 1.0f} for - * the highest quality setting. - *

- * If the default compression quality is to be used, then this method will - * return {@link ThumbnailParameter#DEFAULT_QUALITY}. - * - * @return The compression quality settings for the thumbnail. - */ - public float getOutputQuality() - { - return outputQuality; - } - - /** - * Returns the list of {@link ImageFilter}s which are applied to the - * thumbnail. - *

- * These filters are applied after the original image has been resized. - * - * @return The {@link ImageFilter}s which are applied to the thumbnail. - */ - public List getImageFilters() - { - return filters; - } - - /** - * Returns the default {@link Resizer} that will be used when performing the - * resizing operation to create a thumbnail. - * - * @return The default {@link Resizer} to use when performing a resize - * operation. - */ - public Resizer getResizer() - { - return resizerFactory.getResizer(); - } - - /** - * Returns the {@link ResizerFactory} for obtaining a {@link Resizer} which - * is to be used when performing the resizing operation to create a - * thumbnail. - * - * @return The {@link ResizerFactory} to use to obtain the - * {@link Resizer}. - */ - public ResizerFactory getResizerFactory() - { - return resizerFactory; - } - - /** - * Returns whether or not the original image type should be used for the - * thumbnail. - * - * @return {@code true} if the original image type should be used, - * {@code false} otherwise. - */ - public boolean useOriginalImageType() - { - return imageType == ORIGINAL_IMAGE_TYPE; - } - - /** - * Returns the region of the source image to use when creating a thumbnail, - * represented by a {@link Region} object. - * - * @return The {@code Region} object representing the source region - * to use when creating a thumbnail. - *

- * A value of {@code null} indicates that the entire source - * image should be used to create the thumbnail. - */ - public Region getSourceRegion() - { - return sourceRegion; - } - - /** - * Returns whether or not to fit the thumbnail within the specified - * dimensions. - * - * @return {@code true} is returned when the thumbnail should be sized - * to fit within the specified dimensions, if the thumbnail - * is going to exceed those dimensions. - * @since 0.4.0 - */ - public boolean fitWithinDimenions() - { - return fitWithinDimensions; - } - - /** - * Returns whether or not the Exif metadata should be used to determine - * the orientation of the thumbnail. - * - * @return {@code true} is returned when the Exif metadata should be - * used to decide the orientation of the thumbnail, - * {@code false} otherwise. - * @since 0.4.3 - */ - public boolean useExifOrientation() - { - return useExifOrientation; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/Thumbnailator.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/Thumbnailator.java deleted file mode 100644 index cd4ca9cc..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/Thumbnailator.java +++ /dev/null @@ -1,489 +0,0 @@ -package net.coobird.thumbnailator; - -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; - -import net.coobird.thumbnailator.builders.BufferedImageBuilder; -import net.coobird.thumbnailator.builders.ThumbnailParameterBuilder; -import net.coobird.thumbnailator.filters.ImageFilter; -import net.coobird.thumbnailator.makers.FixedSizeThumbnailMaker; -import net.coobird.thumbnailator.makers.ScaledThumbnailMaker; -import net.coobird.thumbnailator.name.Rename; -import net.coobird.thumbnailator.resizers.DefaultResizerFactory; -import net.coobird.thumbnailator.resizers.Resizer; -import net.coobird.thumbnailator.tasks.ThumbnailTask; - -/** - * This class provides static utility methods which perform generation of - * thumbnails using Thumbnailator. - *

- * When images are resized, the aspect ratio of the images are preserved. - * - * @author coobird - * - */ -public final class Thumbnailator -{ - /** - * This class is not intended to be instantiated. - */ - private Thumbnailator() {} - - /** - * Creates a thumbnail from parameters specified in a {@link ThumbnailTask}. - * - * @param task A {@link ThumbnailTask} to execute. - * @throws IOException Thrown when a problem occurs when creating a - * thumbnail. - */ - public static void createThumbnail(ThumbnailTask task) throws IOException - { - ThumbnailParameter param = task.getParam(); - - // Obtain the original image. - BufferedImage sourceImage = task.read(); - - // Decide the image type of the destination image. - int imageType = param.getType(); - /* - * If the imageType indicates that the image type of the original image - * should be used in the thumbnail, then obtain the image type of the - * original. - * - * If the original type is a custom type, then the default image type - * will be used. - */ - if (param.useOriginalImageType()) - { - int imageTypeToUse = sourceImage.getType(); - - if (imageTypeToUse == BufferedImage.TYPE_CUSTOM) - { - imageType = ThumbnailParameter.DEFAULT_IMAGE_TYPE; - } - else - { - imageType = sourceImage.getType(); - } - } - - BufferedImage destinationImage; - - if (param.getSize() != null) - { - // Get the dimensions of the original and thumbnail images. - int destinationWidth = param.getSize().width; - int destinationHeight = param.getSize().height; - - // Create the thumbnail. - destinationImage = - new FixedSizeThumbnailMaker() - .size(destinationWidth, destinationHeight) - .keepAspectRatio(param.isKeepAspectRatio()) - .fitWithinDimensions(param.fitWithinDimenions()) - .imageType(imageType) - .resizerFactory(param.getResizerFactory()) - .make(sourceImage); - } - else if (!Double.isNaN(param.getWidthScalingFactor())) - { - // Create the thumbnail. - destinationImage = - new ScaledThumbnailMaker() - .scale(param.getWidthScalingFactor(), param.getHeightScalingFactor()) - .imageType(imageType) - .resizerFactory(param.getResizerFactory()) - .make(sourceImage); - } - else - { - throw new IllegalStateException("Parameters to make thumbnail" + - " does not have scaling factor nor thumbnail size specified."); - } - - // Perform the image filters - for (ImageFilter filter : param.getImageFilters()) - { - destinationImage = filter.apply(destinationImage); - } - - // Write the thumbnail image to the destination. - task.write(destinationImage); - - sourceImage.flush(); - destinationImage.flush(); - } - - /** - * Creates a thumbnail. - *

- * The resulting thumbnail uses the default image type. - *

- * When the image is resized, the aspect ratio will be preserved. - *

- * When the specified dimensions does not have the same aspect ratio as the - * source image, the specified dimensions will be used as the absolute - * boundary of the thumbnail. - *

- * For example, if the source image of 100 pixels by 100 pixels, and the - * desired thumbnail size is 50 pixels by 100 pixels, then the resulting - * thumbnail will be 50 pixels by 50 pixels, as the constraint will be - * 50 pixels for the width, and therefore, by preserving the aspect ratio, - * the height will be required to be 50 pixels. - *

- * - * @param img The source image. - * @param width The width of the thumbnail. - * @param height The height of the thumbnail. - * @return Resulting thumbnail. - */ - public static BufferedImage createThumbnail( - BufferedImage img, - int width, - int height - ) - { - validateDimensions(width, height); - - Dimension imgSize = new Dimension(img.getWidth(), img.getHeight()); - Dimension thumbnailSize = new Dimension(width, height); - Resizer resizer = - DefaultResizerFactory.getInstance() - .getResizer(imgSize, thumbnailSize); - - BufferedImage thumbnailImage = - new FixedSizeThumbnailMaker(width, height, true, true) - .resizer(resizer) - .make(img); - - return thumbnailImage; - } - - /** - * Creates a thumbnail from an source image and writes the thumbnail to - * a destination file. - *

- * The image format to use for the thumbnail will be determined from the - * file extension. However, if the image format cannot be determined, then, - * the same image format as the original image will be used when writing - * the thumbnail. - * - * @param inFile The {@link File} from which image data is read. - * @param outFile The {@link File} to which thumbnail is written. - * @param width The width of the thumbnail. - * @param height The height of the thumbnail. - * @throws IOException Thrown when a problem occurs when reading from - * {@code File} representing an image file. - */ - public static void createThumbnail( - File inFile, - File outFile, - int width, - int height - ) throws IOException - { - validateDimensions(width, height); - - if (inFile == null) - { - throw new NullPointerException("Input file is null."); - } - else if (outFile == null) - { - throw new NullPointerException("Output file is null."); - } - - if (!inFile.exists()) - { - throw new IOException("Input file does not exist."); - } - - Thumbnails.of(inFile) - .size(width, height) - .toFile(outFile); - } - - /** - * Creates a thumbnail from an image file, and returns as a - * {@link BufferedImage}. - * - * @param f The {@link File} from which image data is read. - * @param width The width of the thumbnail. - * @param height The height of the thumbnail. - * @return The thumbnail image as a {@link BufferedImage}. - * @throws IOException Thrown when a problem occurs when reading from - * {@code File} representing an image file. - */ - public static BufferedImage createThumbnail( - File f, - int width, - int height - ) throws IOException - { - validateDimensions(width, height); - - if (f == null) - { - throw new NullPointerException("Input file is null."); - } - - return Thumbnails.of(f).size(width, height).asBufferedImage(); - } - - /** - * Creates a thumbnail from an {@link Image}. - *

- * The resulting {@link BufferedImage} uses the default image type. - *

- * When the image is resized, the aspect ratio will be preserved. - *

- * When the specified dimensions does not have the same aspect ratio as the - * source image, the specified dimensions will be used as the absolute - * boundary of the thumbnail. - * - * @param img The source image. - * @param width The width of the thumbnail. - * @param height The height of the thumbnail. - * @return The thumbnail image as an {@link Image}. - */ - public static Image createThumbnail( - Image img, - int width, - int height - ) - { - validateDimensions(width, height); - - // Copy the image from Image into a new BufferedImage. - BufferedImage srcImg = - new BufferedImageBuilder( - img.getWidth(null), - img.getHeight(null) - ).build(); - - Graphics g = srcImg.createGraphics(); - g.drawImage(img, width, height, null); - g.dispose(); - - return createThumbnail(srcImg, width, height); - } - - /** - * Creates a thumbnail from image data streamed from an {@link InputStream} - * and streams the data out to an {@link OutputStream}. - *

- * The thumbnail will be stored in the same format as the original image. - * - * @param is The {@link InputStream} from which to obtain - * image data. - * @param os The {@link OutputStream} to send thumbnail data to. - * @param width The width of the thumbnail. - * @param height The height of the thumbnail. - * @throws IOException Thrown when a problem occurs when reading from - * {@code File} representing an image file. - */ - public static void createThumbnail( - InputStream is, - OutputStream os, - int width, - int height - ) throws IOException - { - Thumbnailator.createThumbnail( - is, os, ThumbnailParameter.ORIGINAL_FORMAT, width, height); - } - - /** - * Creates a thumbnail from image data streamed from an {@link InputStream} - * and streams the data out to an {@link OutputStream}, with the specified - * format for the output data. - * - * @param is The {@link InputStream} from which to obtain - * image data. - * @param os The {@link OutputStream} to send thumbnail data to. - * @param format The image format to use to store the thumbnail data. - * @param width The width of the thumbnail. - * @param height The height of the thumbnail. - * @throws IOException Thrown when a problem occurs when reading from - * {@code File} representing an image file. - * @throws IllegalArgumentException If the specified output format is - * not supported. - */ - public static void createThumbnail( - InputStream is, - OutputStream os, - String format, - int width, - int height - ) throws IOException - { - validateDimensions(width, height); - - if (is == null) - { - throw new NullPointerException("InputStream is null."); - } - else if (os == null) - { - throw new NullPointerException("OutputStream is null."); - } - - Thumbnails.of(is) - .size(width, height) - .outputFormat(format) - .toOutputStream(os); - } - - /** - * Creates thumbnails from a specified {@link Collection} of {@link File}s. - * The filenames of the resulting thumbnails are determined by applying - * the specified {@link Rename}. - *

- * The order of the thumbnail {@code File}s in the returned - * {@code Collection} will be the same as the order as the source list. - * - * @param files A {@code Collection} containing {@code File} objects - * of image files. - * @param rename The renaming function to use. - * @param width The width of the thumbnail. - * @param height The height of the thumbnail. - * @throws IOException Thrown when a problem occurs when reading from - * {@code File} representing an image file. - * - * @deprecated This method has been deprecated in favor of using the - * {@link Thumbnails#fromFiles(Iterable)} interface. - * This method will be removed in 0.5.0, and will not be - * further maintained. - */ - public static Collection createThumbnailsAsCollection( - Collection files, - Rename rename, - int width, - int height - ) - throws IOException - { - validateDimensions(width, height); - - if (files == null) - { - throw new NullPointerException("Collection of Files is null."); - } - if (rename == null) - { - throw new NullPointerException("Rename is null."); - } - - ArrayList resultFiles = new ArrayList<>(); - - ThumbnailParameter param = - new ThumbnailParameterBuilder() - .size(width, height) - .build(); - - for (File inFile : files) - { - File outFile = - new File(inFile.getParent(), rename.apply(inFile.getName(), param)); - - createThumbnail(inFile, outFile, width, height); - - resultFiles.add(outFile); - } - - return Collections.unmodifiableList(resultFiles); - } - - /** - * Creates thumbnails from a specified {@code Collection} of {@code File}s. - * The filenames of the resulting thumbnails are determined by applying - * the specified {@code Rename} function. - * - * @param files A {@code Collection} containing {@code File} objects - * of image files. - * @param rename The renaming function to use. - * @param width The width of the thumbnail. - * @param height The height of the thumbnail. - * @throws IOException Thrown when a problem occurs when reading from - * {@code File} representing an image file. - * - * @deprecated This method has been deprecated in favor of using the - * {@link Thumbnails#fromFiles(Iterable)} interface. - * This method will be removed in 0.5.0, and will not be - * further maintained. - */ - public static void createThumbnails( - Collection files, - Rename rename, - int width, - int height - ) - throws IOException - { - validateDimensions(width, height); - - if (files == null) - { - throw new NullPointerException("Collection of Files is null."); - } - if (rename == null) - { - throw new NullPointerException("Rename is null."); - } - - ThumbnailParameter param = - new ThumbnailParameterBuilder() - .size(width, height) - .build(); - - for (File inFile : files) - { - File outFile = - new File(inFile.getParent(), rename.apply(inFile.getName(), param)); - - createThumbnail(inFile, outFile, width, height); - } - } - - /** - * Performs validation on the specified dimensions. - *

- * If any of the dimensions are less than or equal to 0, an - * {@code IllegalArgumentException} is thrown with an message specifying the - * reason for the exception. - *

- * This method is used to perform a check on the output dimensions of a - * thumbnail for the {@link Thumbnails#createThumbnail} methods. - * - * @param width The width to validate. - * @param height The height to validate. - */ - private static void validateDimensions(int width, int height) - { - if (width <= 0 && height <= 0) - { - throw new IllegalArgumentException( - "Destination image dimensions must not be less than " + - "0 pixels." - ); - } - else if (width <= 0 || height <= 0) - { - String dimension = width == 0 ? "width" : "height"; - - throw new IllegalArgumentException( - "Destination image " + dimension + " must not be " + - "less than or equal to 0 pixels." - ); - } - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/Thumbnails.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/Thumbnails.java deleted file mode 100644 index 954536e1..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/Thumbnails.java +++ /dev/null @@ -1,2787 +0,0 @@ -package net.coobird.thumbnailator; - -import java.awt.Dimension; -import java.awt.Rectangle; -import java.awt.RenderingHints; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.imageio.ImageIO; - -import net.coobird.thumbnailator.filters.Canvas; -import net.coobird.thumbnailator.filters.ImageFilter; -import net.coobird.thumbnailator.filters.Pipeline; -import net.coobird.thumbnailator.filters.Rotation; -import net.coobird.thumbnailator.filters.Watermark; -import net.coobird.thumbnailator.geometry.AbsoluteSize; -import net.coobird.thumbnailator.geometry.Coordinate; -import net.coobird.thumbnailator.geometry.Position; -import net.coobird.thumbnailator.geometry.Positions; -import net.coobird.thumbnailator.geometry.Region; -import net.coobird.thumbnailator.geometry.Size; -import net.coobird.thumbnailator.name.Rename; -import net.coobird.thumbnailator.resizers.BicubicResizer; -import net.coobird.thumbnailator.resizers.BilinearResizer; -import net.coobird.thumbnailator.resizers.DefaultResizerFactory; -import net.coobird.thumbnailator.resizers.FixedResizerFactory; -import net.coobird.thumbnailator.resizers.ProgressiveBilinearResizer; -import net.coobird.thumbnailator.resizers.Resizer; -import net.coobird.thumbnailator.resizers.ResizerFactory; -import net.coobird.thumbnailator.resizers.configurations.AlphaInterpolation; -import net.coobird.thumbnailator.resizers.configurations.Antialiasing; -import net.coobird.thumbnailator.resizers.configurations.Dithering; -import net.coobird.thumbnailator.resizers.configurations.Rendering; -import net.coobird.thumbnailator.resizers.configurations.ScalingMode; -import net.coobird.thumbnailator.tasks.SourceSinkThumbnailTask; -import net.coobird.thumbnailator.tasks.io.BufferedImageSink; -import net.coobird.thumbnailator.tasks.io.BufferedImageSource; -import net.coobird.thumbnailator.tasks.io.FileImageSink; -import net.coobird.thumbnailator.tasks.io.FileImageSource; -import net.coobird.thumbnailator.tasks.io.ImageSource; -import net.coobird.thumbnailator.tasks.io.InputStreamImageSource; -import net.coobird.thumbnailator.tasks.io.OutputStreamImageSink; -import net.coobird.thumbnailator.tasks.io.URLImageSource; -import net.coobird.thumbnailator.util.ThumbnailatorUtils; - -/** - * Provides a fluent interface to create thumbnails. - *

- * This is the main entry point for creating thumbnails with Thumbnailator. - *

- * By using the Thumbnailator's fluent interface, it is possible to write - * thumbnail generation code which resembles written English. - *

- *
Usage:
- *
- * The following example code demonstrates how to use the fluent interface - * to create a thumbnail from multiple files from a directory, resizing them to - * a maximum of 200 pixels by 200 pixels while preserving the aspect ratio of - * the original, then saving the resulting thumbnails as JPEG images with file - * names having {@code thumbnail.} appended to the beginning of the file name. - *

- *

-Thumbnails.of(directory.listFiles())
-    .size(200, 200)
-    .outputFormat("jpeg")
-    .asFiles(Rename.PREFIX_DOT_THUMBNAIL);
-
-// English: "Make thumbnails of files in the directory, with a size of 200x200,
-             with output format of JPEG, and save them as files while renaming
-             the files to be prefixed with a 'thumbnail.'."
- * 
- *
- *
- * For more examples, please visit the - * Thumbnailator project page. - *

- *

Important Implementation Notes

- * Upon calling one of the {@code Thumbnails.of(...)} methods, in the - * current implementation, an instance of an inner class of this class is - * returned. In most cases, the returned instance should not be used by - * storing it in a local variable, as changes in the internal implementation - * could break code in the future. - *

- * As a rule of thumb, always method chain from the {@code Thumbnails.of} - * all the way until the output method (e.g. {@code toFile}, {@code asBufferedImage}, - * etc.) is called without breaking them down into single statements. - * See the "Usage" section above for the intended use of the Thumbnailator's - * fluent interface. - *

- *
Unintended Use:
- *
- *
-// Unintended use - not recommended!
-Builder<File> instance = Thumbnails.of("path/to/image");
-instance.size(200, 200);
-instance.asFiles("path/to/thumbnail");
- * 
- *
- *
- * - * @author coobird - * - */ -public final class Thumbnails -{ - /** - * This class is not intended to be instantiated. - */ - private Thumbnails() {} - - /** - * Performs validation on the specified dimensions. - *

- * If any of the dimensions are less than or equal to 0, an - * {@code IllegalArgumentException} is thrown with an message specifying the - * reason for the exception. - *

- * This method is used to perform a check on the output dimensions of a - * thumbnail for the {@link Thumbnails#createThumbnail} methods. - * - * @param width The width to validate. - * @param height The height to validate. - */ - private static void validateDimensions(int width, int height) - { - if (width <= 0 && height <= 0) - { - throw new IllegalArgumentException( - "Destination image dimensions must not be less than " + - "0 pixels." - ); - } - else if (width <= 0 || height <= 0) - { - String dimension = width == 0 ? "width" : "height"; - - throw new IllegalArgumentException( - "Destination image " + dimension + " must not be " + - "less than or equal to 0 pixels." - ); - } - } - - private static void checkForNull(Object o, String message) - { - if (o == null) - { - throw new NullPointerException(message); - } - } - - private static void checkForEmpty(Object[] o, String message) - { - if (o.length == 0) - { - throw new IllegalArgumentException(message); - } - } - - private static void checkForEmpty(Iterable o, String message) - { - if (!o.iterator().hasNext()) - { - throw new IllegalArgumentException(message); - } - } - - /** - * Indicate to make thumbnails for images with the specified filenames. - * - * @param files File names of image files for which thumbnails - * are to be produced for. - * @return Reference to a builder object which is used to - * specify the parameters for creating the thumbnail. - * @throws NullPointerException If the argument is {@code null}. - * @throws IllegalArgumentException If the argument is an empty array. - */ - public static Builder of(String... files) - { - checkForNull(files, "Cannot specify null for input files."); - checkForEmpty(files, "Cannot specify an empty array for input files."); - return Builder.ofStrings(Arrays.asList(files)); - } - - /** - * Indicate to make thumbnails from the specified {@link File}s. - * - * @param files {@link File} objects of image files for which thumbnails - * are to be produced for. - * @return Reference to a builder object which is used to - * specify the parameters for creating the thumbnail. - * @throws NullPointerException If the argument is {@code null}. - * @throws IllegalArgumentException If the argument is an empty array. - */ - public static Builder of(File... files) - { - checkForNull(files, "Cannot specify null for input files."); - checkForEmpty(files, "Cannot specify an empty array for input files."); - return Builder.ofFiles(Arrays.asList(files)); - } - - /** - * Indicate to make thumbnails from the specified {@link URL}s. - * - * @param urls {@link URL} objects of image files for which thumbnails - * are to be produced for. - * @return Reference to a builder object which is used to - * specify the parameters for creating the thumbnail. - * @throws NullPointerException If the argument is {@code null}. - * @throws IllegalArgumentException If the argument is an empty array. - */ - public static Builder of(URL... urls) - { - checkForNull(urls, "Cannot specify null for input URLs."); - checkForEmpty(urls, "Cannot specify an empty array for input URLs."); - return Builder.ofUrls(Arrays.asList(urls)); - } - - /** - * Indicate to make thumbnails from the specified {@link InputStream}s. - * - * @param inputStreams {@link InputStream}s which provide the images - * for which thumbnails are to be produced for. - * @return Reference to a builder object which is used to - * specify the parameters for creating the thumbnail. - * @throws NullPointerException If the argument is {@code null}. - * @throws IllegalArgumentException If the argument is an empty array. - */ - public static Builder of(InputStream... inputStreams) - { - checkForNull(inputStreams, "Cannot specify null for InputStreams."); - checkForEmpty(inputStreams, "Cannot specify an empty array for InputStreams."); - return Builder.ofInputStreams(Arrays.asList(inputStreams)); - } - - /** - * Indicate to make thumbnails from the specified {@link BufferedImage}s. - * - * @param images {@link BufferedImage}s for which thumbnails - * are to be produced for. - * @return Reference to a builder object which is used to - * specify the parameters for creating the thumbnail. - * @throws NullPointerException If the argument is {@code null}. - * @throws IllegalArgumentException If the argument is an empty array. - */ - public static Builder of(BufferedImage... images) - { - checkForNull(images, "Cannot specify null for images."); - checkForEmpty(images, "Cannot specify an empty array for images."); - return Builder.ofBufferedImages(Arrays.asList(images)); - } - - /** - * Indicate to make thumbnails for images with the specified filenames. - * - * @param files File names of image files for which thumbnails - * are to be produced for. - * @return Reference to a builder object which is used to - * specify the parameters for creating the thumbnail. - * @throws NullPointerException If the argument is {@code null}. - * @throws IllegalArgumentException If the argument is an empty collection. - * @since 0.3.1 - */ - public static Builder fromFilenames(Iterable files) - { - checkForNull(files, "Cannot specify null for input files."); - checkForEmpty(files, "Cannot specify an empty collection for input files."); - return Builder.ofStrings(files); - } - - /** - * Indicate to make thumbnails from the specified {@link File}s. - * - * @param files {@link File} objects of image files for which thumbnails - * are to be produced for. - * @return Reference to a builder object which is used to - * specify the parameters for creating the thumbnail. - * @throws NullPointerException If the argument is {@code null}. - * @throws IllegalArgumentException If the argument is an empty collection. - * @since 0.3.1 - */ - public static Builder fromFiles(Iterable files) - { - checkForNull(files, "Cannot specify null for input files."); - checkForEmpty(files, "Cannot specify an empty collection for input files."); - return Builder.ofFiles(files); - } - - /** - * Indicate to make thumbnails for images with the specified {@link URL}s. - * - * @param urls URLs of the images for which thumbnails - * are to be produced. - * @return Reference to a builder object which is used to - * specify the parameters for creating the thumbnail. - * @throws NullPointerException If the argument is {@code null}. - * @throws IllegalArgumentException If the argument is an empty collection. - * @since 0.3.1 - */ - public static Builder fromURLs(Iterable urls) - { - checkForNull(urls, "Cannot specify null for input URLs."); - checkForEmpty(urls, "Cannot specify an empty collection for input URLs."); - return Builder.ofUrls(urls); - } - - /** - * Indicate to make thumbnails for images obtained from the specified - * {@link InputStream}s. - * - * @param inputStreams {@link InputStream}s which provide images for - * which thumbnails are to be produced. - * @return Reference to a builder object which is used to - * specify the parameters for creating the thumbnail. - * @throws NullPointerException If the argument is {@code null}. - * @throws IllegalArgumentException If the argument is an empty collection. - * @since 0.3.1 - */ - public static Builder fromInputStreams(Iterable inputStreams) - { - checkForNull(inputStreams, "Cannot specify null for InputStreams."); - checkForEmpty(inputStreams, "Cannot specify an empty collection for InputStreams."); - return Builder.ofInputStreams(inputStreams); - } - - /** - * Indicate to make thumbnails from the specified {@link BufferedImage}s. - * - * @param images {@link BufferedImage}s for which thumbnails - * are to be produced for. - * @return Reference to a builder object which is used to - * specify the parameters for creating the thumbnail. - * @throws NullPointerException If the argument is {@code null}. - * @throws IllegalArgumentException If the argument is an empty collection. - * @since 0.3.1 - */ - public static Builder fromImages(Iterable images) - { - checkForNull(images, "Cannot specify null for images."); - checkForEmpty(images, "Cannot specify an empty collection for images."); - return Builder.ofBufferedImages(images); - } - - /** - * The builder interface for Thumbnailator to set up the thumbnail - * generation schedule. - *

- * Thumbnailator is intended to be used by calling one of the - * {@code Thumbnails.of(...)} methods, then chaining methods such as - * {@link #size(int, int)} and {@link #outputQuality(double)} to set up - * the thumbnail generation parameters. (See "Intended Use" below.) - * The end result should be code that resembles English. - *

- * In most cases, holding an instance of this class in a local variable, - * such as seen in the "Unintended Use" example below, is more verbose - * and less future-proof, as changes to this class (which is just an - * inner class of the {@link Thumbnails} class) can lead to broken code - * when attempting to use future releases of Thumbnailator. - *

- *

- *
Intended Use:
- *
- *
-// Intended use - recommended!
-Thumbnails.of("path/to/image")
-    .size(200, 200)
-    .asFile("path/to/thumbnail");
-
-// English: "Make a thumbnail of 'path/to/image' with a size of 200x200,
-             and save it as a file to 'path/to/thumbnail'."
-	 * 
- *
- *
Unintended Use:
- *
- *
-// Unintended use - not recommended!
-Builder<File> instance = Thumbnails.of("path/to/image");
-instance.size(200, 200);
-instance.asFiles("path/to/thumbnail");
-	 * 
- *
- *
- *

- * An instance of this class provides the fluent interface in the form of - * method chaining. Through the fluent interface, the parameters used for - * the thumbnail creation, such as {@link #size(int, int)} and - * {@link #outputQuality(double)} can be set up. Finally, to execute the - * thumbnail creation, one of the output methods whose names start with - * {@code to} (e.g. {@link #toFiles(Rename)}) or {@code as} - * (e.g. {@link #asBufferedImages()}) is called. - *

- * An instance of this class is obtained by calling one of: - *

    - *
  • {@link Thumbnails#of(BufferedImage...)}
  • - *
  • {@link Thumbnails#of(File...)}
  • - *
  • {@link Thumbnails#of(String...)}
  • - *
  • {@link Thumbnails#of(InputStream...)}
  • - *
  • {@link Thumbnails#of(URL...)}
  • - *
  • {@link Thumbnails#fromImages(Iterable)}
  • - *
  • {@link Thumbnails#fromFiles(Iterable)}
  • - *
  • {@link Thumbnails#fromFilenames(Iterable)}
  • - *
  • {@link Thumbnails#fromInputStreams(Iterable)}
  • - *
  • {@link Thumbnails#fromURLs(Iterable)}
  • - *
- * - * @author coobird - * - */ - public static class Builder - { - private final Iterable> sources; - - private Builder(Iterable> sources) - { - this.sources = sources; - statusMap.put(Properties.OUTPUT_FORMAT, Status.OPTIONAL); - } - - private static final class StringImageSourceIterator implements - Iterable> - { - private final Iterable filenames; - - private StringImageSourceIterator(Iterable filenames) - { - this.filenames = filenames; - } - - public Iterator> iterator() - { - return new Iterator>() { - - final Iterator iter = filenames.iterator(); - - public boolean hasNext() - { - return iter.hasNext(); - } - - public ImageSource next() - { - return new FileImageSource(iter.next()); - } - - public void remove() - { - throw new UnsupportedOperationException(); - } - }; - } - } - - private static final class FileImageSourceIterator implements - Iterable> - { - private final Iterable files; - - private FileImageSourceIterator(Iterable files) - { - this.files = files; - } - - public Iterator> iterator() - { - return new Iterator>() { - - final Iterator iter = files.iterator(); - - public boolean hasNext() - { - return iter.hasNext(); - } - - public ImageSource next() - { - return new FileImageSource(iter.next()); - } - - public void remove() - { - throw new UnsupportedOperationException(); - } - }; - } - } - - private static final class URLImageSourceIterator implements - Iterable> - { - private final Iterable urls; - - private URLImageSourceIterator(Iterable urls) - { - this.urls = urls; - } - - public Iterator> iterator() - { - return new Iterator>() { - - final Iterator iter = urls.iterator(); - - public boolean hasNext() - { - return iter.hasNext(); - } - - public ImageSource next() - { - return new URLImageSource(iter.next()); - } - - public void remove() - { - throw new UnsupportedOperationException(); - } - }; - } - } - - private static final class InputStreamImageSourceIterator implements - Iterable> - { - private final Iterable inputStreams; - - private InputStreamImageSourceIterator(Iterable inputStreams) - { - this.inputStreams = inputStreams; - } - - public Iterator> iterator() - { - return new Iterator>() { - - final Iterator iter = inputStreams.iterator(); - - public boolean hasNext() - { - return iter.hasNext(); - } - - public ImageSource next() - { - return new InputStreamImageSource(iter.next()); - } - - public void remove() - { - throw new UnsupportedOperationException(); - } - }; - } - } - - private static final class BufferedImageImageSourceIterator implements - Iterable> - { - private final Iterable image; - - private BufferedImageImageSourceIterator(Iterable images) - { - this.image = images; - } - - public Iterator> iterator() - { - return new Iterator>() { - - final Iterator iter = image.iterator(); - - public boolean hasNext() - { - return iter.hasNext(); - } - - public ImageSource next() - { - return new BufferedImageSource(iter.next()); - } - - public void remove() - { - throw new UnsupportedOperationException(); - } - }; - } - } - - private static Builder ofStrings(Iterable filenames) - { - Iterable> iter = new StringImageSourceIterator(filenames); - return new Builder<>(iter); - } - - private static Builder ofFiles(Iterable files) - { - Iterable> iter = new FileImageSourceIterator(files); - return new Builder<>(iter); - } - - private static Builder ofUrls(Iterable urls) - { - Iterable> iter = new URLImageSourceIterator(urls); - return new Builder<>(iter); - } - - private static Builder ofInputStreams(Iterable inputStreams) - { - Iterable> iter = new InputStreamImageSourceIterator(inputStreams); - return new Builder<>(iter); - } - - private static Builder ofBufferedImages(Iterable images) - { - Iterable> iter = new BufferedImageImageSourceIterator(images); - return new Builder<>(iter); - } - - private final class BufferedImageIterable implements - Iterable - { - public Iterator iterator() - { - return new Iterator() { - - final Iterator> sourceIter = sources.iterator(); - - public boolean hasNext() - { - return sourceIter.hasNext(); - } - - public BufferedImage next() - { - ImageSource source = sourceIter.next(); - BufferedImageSink destination = new BufferedImageSink(); - - try - { - Thumbnailator.createThumbnail( - new SourceSinkThumbnailTask<>(makeParam(), source, destination) - ); - } - catch (IOException e) - { - return null; - } - - return destination.getSink(); - } - - public void remove() - { - throw new UnsupportedOperationException( - "Cannot remove elements from this iterator." - ); - } - }; - } - } - - /** - * Status of each property. - * - * @author coobird - * - */ - private static enum Status - { - OPTIONAL, - READY, - NOT_READY, - ALREADY_SET, - CANNOT_SET, - } - - /** - * Interface used by {@link Properties}. - * - * @author coobird - * - */ - private static interface Property - { - public String getName(); - } - - /** - * Enum of properties which can be set by this builder. - * - * @author coobird - * - */ - private static enum Properties implements Property - { - SIZE("size"), - WIDTH("width"), - HEIGHT("height"), - SCALE("scale"), - IMAGE_TYPE("imageType"), - SCALING_MODE("scalingMode"), - ALPHA_INTERPOLATION("alphaInterpolation"), - ANTIALIASING("antialiasing"), - DITHERING("dithering"), - RENDERING("rendering"), - KEEP_ASPECT_RATIO("keepAspectRatio"), - OUTPUT_FORMAT("outputFormat"), - OUTPUT_FORMAT_TYPE("outputFormatType"), - OUTPUT_QUALITY("outputQuality"), - RESIZER("resizer"), - SOURCE_REGION("sourceRegion"), - RESIZER_FACTORY("resizerFactory"), - ALLOW_OVERWRITE("allowOverwrite"), - CROP("crop"), - USE_EXIF_ORIENTATION("useExifOrientation"), - ; - - private final String name; - - private Properties(String name) - { - this.name = name; - } - - public String getName() - { - return name; - } - } - - /** - * Map to keep track of whether a property has been properly set or not. - */ - private final Map statusMap = new HashMap<>(); - - /** - * Populates the property map. - */ - { - statusMap.put(Properties.SIZE, Status.NOT_READY); - statusMap.put(Properties.WIDTH, Status.OPTIONAL); - statusMap.put(Properties.HEIGHT, Status.OPTIONAL); - statusMap.put(Properties.SCALE, Status.NOT_READY); - statusMap.put(Properties.SOURCE_REGION, Status.OPTIONAL); - statusMap.put(Properties.IMAGE_TYPE, Status.OPTIONAL); - statusMap.put(Properties.SCALING_MODE, Status.OPTIONAL); - statusMap.put(Properties.ALPHA_INTERPOLATION, Status.OPTIONAL); - statusMap.put(Properties.ANTIALIASING, Status.OPTIONAL); - statusMap.put(Properties.DITHERING, Status.OPTIONAL); - statusMap.put(Properties.RENDERING, Status.OPTIONAL); - statusMap.put(Properties.KEEP_ASPECT_RATIO, Status.OPTIONAL); - statusMap.put(Properties.OUTPUT_FORMAT, Status.OPTIONAL); - statusMap.put(Properties.OUTPUT_FORMAT_TYPE, Status.OPTIONAL); - statusMap.put(Properties.OUTPUT_QUALITY, Status.OPTIONAL); - statusMap.put(Properties.RESIZER, Status.OPTIONAL); - statusMap.put(Properties.RESIZER_FACTORY, Status.OPTIONAL); - statusMap.put(Properties.ALLOW_OVERWRITE, Status.OPTIONAL); - statusMap.put(Properties.CROP, Status.OPTIONAL); - statusMap.put(Properties.USE_EXIF_ORIENTATION, Status.OPTIONAL); - } - - /** - * Updates the property status map. - * - * @param property The property to update. - * @param newStatus The new status. - */ - private void updateStatus(Properties property, Status newStatus) - { - if (statusMap.get(property) == Status.ALREADY_SET) - { - throw new IllegalStateException( - property.getName() + " is already set."); - } - - /* - * The `newStatus != Status.CANNOT_SET` condition will allow the - * status to be set to CANNOT_SET to be set multiple times. - */ - if (newStatus != Status.CANNOT_SET && statusMap.get(property) == Status.CANNOT_SET) - { - throw new IllegalStateException( - property.getName() + " cannot be set."); - } - - statusMap.put(property, newStatus); - } - - /** - * An constant used to indicate that the imageType has not been - * specified. When this constant is encountered, one should use the - * {@link ThumbnailParameter#DEFAULT_IMAGE_TYPE} as the value for - * imageType. - */ - private static final int IMAGE_TYPE_UNSPECIFIED = -1; - - private static final int DIMENSION_NOT_SPECIFIED = -1; - - /* - * Defines the fields for the builder interface, and assigns the - * default values. - */ - private int width = DIMENSION_NOT_SPECIFIED; - private int height = DIMENSION_NOT_SPECIFIED; - private double scaleWidth = Double.NaN; - private double scaleHeight = Double.NaN; - - private Region sourceRegion; - - private int imageType = IMAGE_TYPE_UNSPECIFIED; - private boolean keepAspectRatio = true; - - private String outputFormat = ThumbnailParameter.DETERMINE_FORMAT; - private String outputFormatType = ThumbnailParameter.DEFAULT_FORMAT_TYPE; - private float outputQuality = ThumbnailParameter.DEFAULT_QUALITY; - - private ScalingMode scalingMode = ScalingMode.PROGRESSIVE_BILINEAR; - private AlphaInterpolation alphaInterpolation = AlphaInterpolation.DEFAULT; - private Dithering dithering = Dithering.DEFAULT; - private Antialiasing antialiasing = Antialiasing.DEFAULT; - private Rendering rendering = Rendering.DEFAULT; - - private ResizerFactory resizerFactory = DefaultResizerFactory.getInstance(); - - private boolean allowOverwrite = true; - - private boolean fitWithinDimenions = true; - - private boolean useExifOrientation = true; - - /** - * This field should be set to the {@link Position} to be used for - * cropping if cropping is enabled. If cropping is disabled, then - * this field should be left {@code null}. - */ - private Position croppingPosition = null; - - /** - * The {@link ImageFilter}s that should be applied when creating the - * thumbnail. - */ - private final Pipeline filterPipeline = new Pipeline(); - - /** - * Sets the size of the thumbnail. - *

- * For example, to create thumbnails which should fit within a - * bounding rectangle of 640 x 480, the following code can be used: - *


-Thumbnails.of(image)
-    .size(640, 480)
-    .toFile(thumbnail);
-		 * 
- *

- * In the above code, the thumbnail will preserve the aspect ratio - * of the original image. If the thumbnail should be forced to the - * specified size, the {@link #forceSize(int, int)} method can - * be used instead of this method. - *

- * Once this method is called, calling the {@link #scale(double)} method - * will result in an {@link IllegalStateException}. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param width The width of the thumbnail. - * @param height The height of the thumbnail. - * @return Reference to this object. - */ - public Builder size(int width, int height) - { - updateStatus(Properties.SIZE, Status.ALREADY_SET); - updateStatus(Properties.SCALE, Status.CANNOT_SET); - - validateDimensions(width, height); - this.width = width; - this.height = height; - - return this; - } - - /** - * Sets the width of the thumbnail. - *

- * The thumbnail will have the dimensions constrained by the specified - * width, and the aspect ratio of the original image will be preserved - * by the thumbnail. - *

- * Once this method is called, calling the {@link #size(int, int)} or - * the {@link #scale(double)} method will result in an - * {@link IllegalStateException}. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param width The width of the thumbnail. - * @return Reference to this object. - * @since 0.3.5 - */ - public Builder width(int width) - { - if (statusMap.get(Properties.SIZE) != Status.CANNOT_SET) - { - updateStatus(Properties.SIZE, Status.CANNOT_SET); - } - if (statusMap.get(Properties.SCALE) != Status.CANNOT_SET) - { - updateStatus(Properties.SCALE, Status.CANNOT_SET); - } - updateStatus(Properties.WIDTH, Status.ALREADY_SET); - - validateDimensions(width, Integer.MAX_VALUE); - this.width = width; - - return this; - } - - /** - * Sets the height of the thumbnail. - *

- * The thumbnail will have the dimensions constrained by the specified - * height, and the aspect ratio of the original image will be preserved - * by the thumbnail. - *

- * Once this method is called, calling the {@link #size(int, int)} or - * the {@link #scale(double)} method will result in an - * {@link IllegalStateException}. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param height The height of the thumbnail. - * @return Reference to this object. - * @since 0.3.5 - */ - public Builder height(int height) - { - if (statusMap.get(Properties.SIZE) != Status.CANNOT_SET) - { - updateStatus(Properties.SIZE, Status.CANNOT_SET); - } - if (statusMap.get(Properties.SCALE) != Status.CANNOT_SET) - { - updateStatus(Properties.SCALE, Status.CANNOT_SET); - } - updateStatus(Properties.HEIGHT, Status.ALREADY_SET); - - validateDimensions(Integer.MAX_VALUE, height); - this.height = height; - - return this; - } - - /** - * Sets the size of the thumbnail. - *

- * The thumbnails will be forced to the specified size, therefore, - * the aspect ratio of the original image will not be preserved in - * the thumbnails. Calling this method will be equivalent to calling - * the {@link #size(int, int)} method in conjunction with the - * {@link #keepAspectRatio(boolean)} method with the value {@code false}. - *

- * Once this method is called, calling the {@link #scale(double)} method - * will result in an {@link IllegalStateException}. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param width The width of the thumbnail. - * @param height The height of the thumbnail. - * @return Reference to this object. - * @since 0.3.2 - */ - public Builder forceSize(int width, int height) - { - updateStatus(Properties.SIZE, Status.ALREADY_SET); - updateStatus(Properties.KEEP_ASPECT_RATIO, Status.ALREADY_SET); - updateStatus(Properties.SCALE, Status.CANNOT_SET); - - validateDimensions(width, height); - this.width = width; - this.height = height; - this.keepAspectRatio = false; - - return this; - } - - /** - * Sets the scaling factor of the thumbnail. - *

- * For example, to create thumbnails which are 50% the size of the - * original, the following code can be used: - *


-Thumbnails.of(image)
-    .scale(0.5)
-    .toFile(thumbnail);
-		 * 
- *

- * Once this method is called, calling the {@link #size(int, int)} - * method, or the {@link #scale(double, double)} method, or the - * {@link #keepAspectRatio(boolean)} method will result in an - * {@link IllegalStateException}. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param scale The scaling factor to use when creating a - * thumbnail. - *

- * The value must be a {@code double} which is - * greater than {@code 0.0}, and not - * {@link Double#POSITIVE_INFINITY}. - * @return Reference to this object. - */ - public Builder scale(double scale) - { - return scale(scale, scale); - } - - /** - * Sets the scaling factor for the width and height of the thumbnail. - *

- * If the scaling factor for the width and height are not equal, then - * the thumbnail will not preserve the aspect ratio of the original - * image. - *

- * For example, to create thumbnails which are 50% the width of the - * original, while 75% the height of the original, the following code - * can be used: - *


-Thumbnails.of(image)
-    .scale(0.5, 0.75)
-    .toFile(thumbnail);
-		 * 
- *

- * Once this method is called, calling the {@link #size(int, int)} - * method, or the {@link #scale(double)} method, or the - * {@link #keepAspectRatio(boolean)} method will result in an - * {@link IllegalStateException}. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param scaleWidth The scaling factor to use for the width when - * creating a thumbnail. - *

- * The value must be a {@code double} which is - * greater than {@code 0.0}, and not - * {@link Double#POSITIVE_INFINITY}. - * @param scaleHeight The scaling factor to use for the height when - * creating a thumbnail. - *

- * The value must be a {@code double} which is - * greater than {@code 0.0}, and not - * {@link Double#POSITIVE_INFINITY}. - * @return Reference to this object. - * @since 0.3.10 - */ - public Builder scale(double scaleWidth, double scaleHeight) - { - updateStatus(Properties.SCALE, Status.ALREADY_SET); - updateStatus(Properties.SIZE, Status.CANNOT_SET); - updateStatus(Properties.KEEP_ASPECT_RATIO, Status.CANNOT_SET); - - if (scaleWidth <= 0.0 || scaleHeight <= 0.0) - { - throw new IllegalArgumentException( - "The scaling factor is equal to or less than 0." - ); - } - if (Double.isNaN(scaleWidth) || Double.isNaN(scaleHeight)) - { - throw new IllegalArgumentException( - "The scaling factor is not a number." - ); - } - if (Double.isInfinite(scaleWidth) || Double.isInfinite(scaleHeight)) - { - throw new IllegalArgumentException( - "The scaling factor cannot be infinity." - ); - } - - this.scaleWidth = scaleWidth; - this.scaleHeight = scaleHeight; - - return this; - } - - /** - * Specifies the source region from which the thumbnail is to be - * created from. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param sourceRegion Source region to use when creating a thumbnail. - *

- * @return Reference to this object. - * @throws NullPointerException If the source region object is - * {@code null}. - * @since 0.3.4 - */ - public Builder sourceRegion(Region sourceRegion) - { - if (sourceRegion == null) - { - throw new NullPointerException("Region cannot be null."); - } - - updateStatus(Properties.SOURCE_REGION, Status.ALREADY_SET); - this.sourceRegion = sourceRegion; - return this; - } - - /** - * Specifies the source region from which the thumbnail is to be - * created from. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param position Position of the source region. - * @param size Size of the source region. - * @return Reference to this object. - * @throws NullPointerException If the position and/or size is - * {@code null}. - * @since 0.3.4 - */ - public Builder sourceRegion(Position position, Size size) - { - if (position == null) - { - throw new NullPointerException("Position cannot be null."); - } - if (size == null) - { - throw new NullPointerException("Size cannot be null."); - } - - return sourceRegion(new Region(position, size)); - } - - /** - * Specifies the source region from which the thumbnail is to be - * created from. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param x The horizontal-compoennt of the top left-hand - * corner of the source region. - * @param y The vertical-compoennt of the top left-hand - * corner of the source region. - * @param width Width of the source region. - * @param height Height of the source region. - * @return Reference to this object. - * @throws IllegalArgumentException If the width and/or height is - * less than or equal to {@code 0}. - * @since 0.3.4 - */ - public Builder sourceRegion(int x, int y, int width, int height) - { - if (width <= 0 || height <= 0) - { - throw new IllegalArgumentException( - "Width and height must be greater than 0." - ); - } - - return sourceRegion( - new Coordinate(x, y), - new AbsoluteSize(width, height) - ); - } - - /** - * Specifies the source region from which the thumbnail is to be - * created from. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param position Position of the source region. - * @param width Width of the source region. - * @param height Height of the source region. - * @return Reference to this object. - * @throws NullPointerException If the position and/or size is - * {@code null}. - * @throws IllegalArgumentException If the width and/or height is - * less than or equal to {@code 0}. - * @since 0.3.4 - */ - public Builder sourceRegion(Position position, int width, int height) - { - if (position == null) - { - throw new NullPointerException("Position cannot be null."); - } - if (width <= 0 || height <= 0) - { - throw new IllegalArgumentException( - "Width and height must be greater than 0." - ); - } - - return sourceRegion( - position, - new AbsoluteSize(width, height) - ); - } - - /** - * Specifies the source region from which the thumbnail is to be - * created from. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param region A rectangular region which specifies the source - * region to use when creating the thumbnail. - * @throws NullPointerException If the region is {@code null}. - * @since 0.3.4 - */ - public Builder sourceRegion(Rectangle region) - { - if (region == null) - { - throw new NullPointerException("Region cannot be null."); - } - - return sourceRegion( - new Coordinate(region.x, region.y), - new AbsoluteSize(region.getSize()) - ); - } - - /** - * Crops the thumbnail to the size specified when calling the - * {@link #size(int, int)} method, positioned by the given - * {@link Position} object. - *

- * Calling this method will guarantee that the size of the thumbnail - * will be exactly the dimensions specified in the - * {@link #size(int, int)} method. - *

- * Internally, the resizing is performed in two steps. - * First, the thumbnail will be sized so that one of the dimensions will - * be sized exactly to the dimension specified in the {@code size} - * method, while allowing the other dimension to overhang the specified - * dimension. Then, the thumbnail will be cropped to the dimensions - * specified in the {@code size} method, positioned using the speficied - * {@link Position} object. - *

- * Once this method is called, calling the {@link #scale(double)} method - * will result in an {@link IllegalStateException}. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param position The position to which the thumbnail should be - * cropped to. For example, if - * {@link Positions#CENTER} is specified, the - * resulting thumbnail will be made by cropping to - * the center of the image. - * @throws NullPointerException If the position is {@code null}. - * @since 0.4.0 - */ - public Builder crop(Position position) - { - checkForNull(position, "Position cannot be null."); - - updateStatus(Properties.CROP, Status.ALREADY_SET); - updateStatus(Properties.SCALE, Status.CANNOT_SET); - - croppingPosition = position; - fitWithinDimenions = false; - return this; - } - - /** - * Specifies whether or not to overwrite files which already exist if - * they have been specified as destination files. - *

- * This method will change the output behavior of the following methods: - *

    - *
  • {@link #toFile(File)}
  • - *
  • {@link #toFile(String)}
  • - *
  • {@link #toFiles(Iterable)}
  • - *
  • {@link #toFiles(Rename)}
  • - *
  • {@link #asFiles(Iterable)}
  • - *
  • {@link #asFiles(Rename)}
  • - *
- * The behavior of methods which are not listed above will not be - * affected by calling this method. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param allowOverwrite If {@code true} then existing files will be - * overwritten if specified as a destination. - * If {@code false}, then the existing files - * will not be altered. For specific behavior, - * please refer to the specific output methods - * listed above. - * - * @since 0.3.7 - */ - public Builder allowOverwrite(boolean allowOverwrite) - { - updateStatus(Properties.ALLOW_OVERWRITE, Status.ALREADY_SET); - this.allowOverwrite = allowOverwrite; - - return this; - } - - /** - * Sets the image type of the thumbnail. - *

- * Calling this method to set this parameter is optional. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param type The image type of the thumbnail. - * @return Reference to this object. - */ - public Builder imageType(int type) - { - updateStatus(Properties.IMAGE_TYPE, Status.ALREADY_SET); - imageType = type; - return this; - } - - /** - * Sets the resizing scaling mode to use when creating the thumbnail. - *

- * Calling this method to set this parameter is optional. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param config The scaling mode to use. - * @return Reference to this object. - */ - public Builder scalingMode(ScalingMode config) - { - checkForNull(config, "Scaling mode is null."); - updateStatus(Properties.SCALING_MODE, Status.ALREADY_SET); - updateStatus(Properties.RESIZER, Status.CANNOT_SET); - updateStatus(Properties.RESIZER_FACTORY, Status.CANNOT_SET); - scalingMode = config; - return this; - } - - /** - * Sets the resizing operation to use when creating the thumbnail. - *

- * Calling this method to set this parameter is optional. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - *

- * This method cannot be called in conjunction with the - * {@link #resizerFactory(ResizerFactory)} method. - * - * @param resizer The scaling operation to use. - * @return Reference to this object. - */ - public Builder resizer(Resizer resizer) - { - checkForNull(resizer, "Resizer is null."); - updateStatus(Properties.RESIZER, Status.ALREADY_SET); - updateStatus(Properties.RESIZER_FACTORY, Status.CANNOT_SET); - updateStatus(Properties.SCALING_MODE, Status.CANNOT_SET); - this.resizerFactory = new FixedResizerFactory(resizer); - return this; - } - - /** - * Sets the {@link ResizerFactory} object to use to decide what kind of - * resizing operation is to be used when creating the thumbnail. - *

- * Calling this method to set this parameter is optional. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - *

- * This method cannot be called in conjunction with the - * {@link #resizer(Resizer)} method. - * - * @param resizerFactory The scaling operation to use. - * @return Reference to this object. - * @since 0.4.0 - */ - public Builder resizerFactory(ResizerFactory resizerFactory) - { - checkForNull(resizerFactory, "ResizerFactory is null."); - updateStatus(Properties.RESIZER_FACTORY, Status.ALREADY_SET); - updateStatus(Properties.RESIZER, Status.CANNOT_SET); - - // disable the methods which set parameters for the Resizer - updateStatus(Properties.SCALING_MODE, Status.CANNOT_SET); - updateStatus(Properties.ALPHA_INTERPOLATION, Status.CANNOT_SET); - updateStatus(Properties.DITHERING, Status.CANNOT_SET); - updateStatus(Properties.ANTIALIASING, Status.CANNOT_SET); - updateStatus(Properties.RENDERING, Status.CANNOT_SET); - - this.resizerFactory = resizerFactory; - return this; - } - - /** - * Sets the alpha interpolation mode when performing the resizing - * operation to generate the thumbnail. - *

- * Calling this method to set this parameter is optional. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - *

- * This method cannot be called in conjunction with the - * {@link #resizerFactory(ResizerFactory)} method. - * - * @param config The alpha interpolation mode. - * @return Reference to this object. - */ - public Builder alphaInterpolation(AlphaInterpolation config) - { - checkForNull(config, "Alpha interpolation is null."); - updateStatus(Properties.RESIZER_FACTORY, Status.CANNOT_SET); - updateStatus(Properties.ALPHA_INTERPOLATION, Status.ALREADY_SET); - alphaInterpolation = config; - return this; - } - - /** - * Sets the dithering mode when performing the resizing - * operation to generate the thumbnail. - *

- * Calling this method to set this parameter is optional. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - *

- * This method cannot be called in conjunction with the - * {@link #resizerFactory(ResizerFactory)} method. - * - * @param config The dithering mode. - * @return Reference to this object. - */ - public Builder dithering(Dithering config) - { - checkForNull(config, "Dithering is null."); - updateStatus(Properties.RESIZER_FACTORY, Status.CANNOT_SET); - updateStatus(Properties.DITHERING, Status.ALREADY_SET); - dithering = config; - return this; - } - - /** - * Sets the antialiasing mode when performing the resizing - * operation to generate the thumbnail. - *

- * Calling this method to set this parameter is optional. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException}. - *

- * This method cannot be called in conjunction with the - * {@link #resizerFactory(ResizerFactory)} method. - * - * @param config The antialiasing mode. - * @return Reference to this object. - */ - public Builder antialiasing(Antialiasing config) - { - checkForNull(config, "Antialiasing is null."); - updateStatus(Properties.RESIZER_FACTORY, Status.CANNOT_SET); - updateStatus(Properties.ANTIALIASING, Status.ALREADY_SET); - antialiasing = config; - return this; - } - - /** - * Sets the rendering mode when performing the resizing - * operation to generate the thumbnail. - *

- * Calling this method to set this parameter is optional. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - *

- * This method cannot be called in conjunction with the - * {@link #resizerFactory(ResizerFactory)} method. - * - * @param config The rendering mode. - * @return Reference to this object. - */ - public Builder rendering(Rendering config) - { - checkForNull(config, "Rendering is null."); - updateStatus(Properties.RESIZER_FACTORY, Status.CANNOT_SET); - updateStatus(Properties.RENDERING, Status.ALREADY_SET); - rendering = config; - return this; - } - - /** - * Sets whether or not to keep the aspect ratio of the original image - * for the thumbnail. - *

- * Calling this method without first calling the {@link #size(int, int)} - * method will result in an {@link IllegalStateException} to be thrown. - *

- * If this method is not called when, by default the aspect ratio of - * the original image is preserved for the thumbnail. - *

- * Calling this method after calling the {@link #scale(double)} method - * or the {@link #scale(double, double)} method will result in a - * {@link IllegalStateException}. - * - * @param keep {@code true} if the thumbnail is to maintain - * the aspect ratio of the original image, - * {@code false} otherwise. - * @return Reference to this object. - * - * @throws IllegalStateException If - *

    - *
  1. the {@link #size(int, int)} has - * not yet been called to specify the - * size of the thumbnail, or
  2. - *
  3. the {@link #scale(double)} - * method has been called, or
  4. - *
  5. the - * {@link #scale(double, double)} - * method has been called, or
  6. - *
  7. the {@link #width(int)} and/or - * {@link #height(int)} has been called - * and not preserving the aspect ratio - * is desired.
  8. - *
- */ - public Builder keepAspectRatio(boolean keep) - { - if (statusMap.get(Properties.SCALE) == Status.ALREADY_SET) - { - throw new IllegalStateException("Cannot specify whether to " + - "keep the aspect ratio if the scaling factor has " + - "already been specified."); - } - if (statusMap.get(Properties.SIZE) == Status.NOT_READY) - { - throw new IllegalStateException("Cannot specify whether to " + - "keep the aspect ratio unless the size parameter has " + - "already been specified."); - } - if ((statusMap.get(Properties.WIDTH) == Status.ALREADY_SET || - statusMap.get(Properties.HEIGHT) == Status.ALREADY_SET) && - !keep - ) - { - throw new IllegalStateException("The aspect ratio must be " + - "preserved when the width and/or height parameter " + - "has already been specified."); - } - - updateStatus(Properties.KEEP_ASPECT_RATIO, Status.ALREADY_SET); - keepAspectRatio = keep; - return this; - } - - /** - * Sets the output quality of the compression algorithm used to - * compress the thumbnail when it is written to an external destination - * such as a file or output stream. - *

- * The value is a {@code float} between {@code 0.0f} and {@code 1.0f} - * where {@code 0.0f} indicates the minimum quality and {@code 1.0f} - * indicates the maximum quality settings should be used for by the - * compression codec. - *

- * Calling this method to set this parameter is optional. - *

- * Calling this method in conjunction with {@link #asBufferedImage()} - * or {@link #asBufferedImages()} will not result in any changes to the - * final result. - *

- * Calling this method multiple times, or the - * {@link #outputQuality(double)} in conjunction with this method will - * result in an {@link IllegalStateException} to be thrown. - * - * @param quality The compression quality to use when writing - * the thumbnail. - * @return Reference to this object. - * @throws IllegalArgumentException If the argument is less than - * {@code 0.0f} or is greater than - * {@code 1.0f}. - */ - public Builder outputQuality(float quality) - { - if (quality < 0.0f || quality > 1.0f) - { - throw new IllegalArgumentException( - "The quality setting must be in the range 0.0f and " + - "1.0f, inclusive." - ); - } - updateStatus(Properties.OUTPUT_QUALITY, Status.ALREADY_SET); - outputQuality = quality; - return this; - } - - /** - * Sets the output quality of the compression algorithm used to - * compress the thumbnail when it is written to an external destination - * such as a file or output stream. - *

- * The value is a {@code double} between {@code 0.0d} and {@code 1.0d} - * where {@code 0.0d} indicates the minimum quality and {@code 1.0d} - * indicates the maximum quality settings should be used for by the - * compression codec. - *

- * This method is a convenience method for {@link #outputQuality(float)} - * where the {@code double} argument type is accepted instead of a - * {@code float}. - *

- * Calling this method to set this parameter is optional. - *

- * Calling this method in conjunction with {@link #asBufferedImage()} - * or {@link #asBufferedImages()} will not result in any changes to the - * final result. - *

- * Calling this method multiple times, or the - * {@link #outputQuality(float)} in conjunction with this method will - * result in an {@link IllegalStateException} to be thrown. - * - * @param quality The compression quality to use when writing - * the thumbnail. - * @return Reference to this object. - * @throws IllegalArgumentException If the argument is less than - * {@code 0.0d} or is greater than - * {@code 1.0d}. - */ - public Builder outputQuality(double quality) - { - if (quality < 0.0d || quality > 1.0d) - { - throw new IllegalArgumentException( - "The quality setting must be in the range 0.0d and " + - "1.0d, inclusive." - ); - } - - updateStatus(Properties.OUTPUT_QUALITY, Status.ALREADY_SET); - outputQuality = (float)quality; - if (outputQuality < 0.0f) - { - outputQuality = 0.0f; - } - else if (outputQuality > 1.0f) - { - outputQuality = 1.0f; - } - return this; - } - - /** - * Sets the compression format to use when writing the thumbnail. - *

- * For example, to set the output format to JPEG, the following code - * can be used: - *


-Thumbnails.of(image)
-    .size(640, 480)
-    .outputFormat("JPEG")
-    .toFile(thumbnail);
-		 * 
- * or, alternatively: - *

-Thumbnails.of(image)
-    .size(640, 480)
-    .outputFormat("jpg")
-    .toFile(thumbnail);
-		 * 
- *

- * Currently, whether or not the compression format string is valid - * dependents on whether the Java Image I/O API recognizes the string - * as a format that it supports for output. (Valid format names can - * be obtained by calling the {@link ImageIO#getWriterFormatNames()} - * method.) - *

- * Calling this method to set this parameter is optional. - *

- * Calling this method in conjunction with {@link #asBufferedImage()} - * or {@link #asBufferedImages()} will not result in any changes to the - * final result. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param format The compression format to use when writing - * the thumbnail. - * @return Reference to this object. - * @throws IllegalArgumentException If an unsupported format is - * specified. - */ - public Builder outputFormat(String format) - { - if (!ThumbnailatorUtils.isSupportedOutputFormat(format)) - { - throw new IllegalArgumentException( - "Specified format is not supported: " + format - ); - } - - updateStatus(Properties.OUTPUT_FORMAT, Status.ALREADY_SET); - outputFormat = format; - return this; - } - - /** - * Sets the compression format to use the same format as the original - * image. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @return Reference to this object. - * @since 0.4.0 - */ - public Builder useOriginalFormat() - { - updateStatus(Properties.OUTPUT_FORMAT, Status.ALREADY_SET); - outputFormat = ThumbnailParameter.ORIGINAL_FORMAT; - return this; - } - - /** - * Sets whether or not to use the Exif metadata when orienting the - * thumbnail. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @param useExifOrientation {@code true} if the Exif metadata - * should be used to determine the - * orientation of the thumbnail, - * {@code false} otherwise. - * @return Reference to this object. - * @since 0.4.3 - */ - public Builder useExifOrientation(boolean useExifOrientation) - { - updateStatus(Properties.USE_EXIF_ORIENTATION, Status.ALREADY_SET); - this.useExifOrientation = useExifOrientation; - return this; - } - - /** - * Indicates that the output format should be determined from the - * available information when writing the thumbnail image. - *

- * For example, calling this method will cause the output format to be - * determined from the file extension if thumbnails are written to - * files. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - * - * @return Reference to this object. - * @since 0.4.0 - */ - public Builder determineOutputFormat() - { - updateStatus(Properties.OUTPUT_FORMAT, Status.ALREADY_SET); - outputFormat = ThumbnailParameter.DETERMINE_FORMAT; - return this; - } - - private boolean isOutputFormatNotSet() - { - return outputFormat == null || ThumbnailParameter.DETERMINE_FORMAT.equals(outputFormat); - } - - /** - * Sets the compression format type of the thumbnail to write. - *

- * If the default type for the compression codec should be used, a - * value of {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE} should be - * used. - *

- * Calling this method to set this parameter is optional. - *

- * Calling this method multiple times will result in an - * {@link IllegalStateException} to be thrown. - *

- * Furthermore, if this method is called, then calling the - * {@link #outputFormat} method is disabled, in order to prevent - * cases where the output format type does not exist in the format - * specified for the {@code outputFormat} method. - * - * @param formatType The compression format type - * @return Reference to this object. - * @throws IllegalArgumentException If an unsupported format type is - * specified for the current output - * format type. Or, if the output - * format has not been specified before - * this method was called. - */ - public Builder outputFormatType(String formatType) - { - /* - * If the output format is the original format, and the format type - * is being specified, it's going to be likely that the specified - * type will not be present in all the formats, so we'll disallow - * it. (e.g. setting type to "JPEG", and if the original formats - * were JPEG and PNG, then we'd have a problem. - */ - if (formatType != ThumbnailParameter.DEFAULT_FORMAT_TYPE - && isOutputFormatNotSet()) - { - throw new IllegalArgumentException( - "Cannot set the format type if a specific output " + - "format has not been specified." - ); - } - - if (!ThumbnailatorUtils.isSupportedOutputFormatType(outputFormat, formatType)) - { - throw new IllegalArgumentException( - "Specified format type (" + formatType + ") is not " + - " supported for the format: " + outputFormat - ); - } - - /* - * If the output format type is set, then we'd better make the - * output format unchangeable, or else we'd risk having a type - * that is not part of the output format. - */ - updateStatus(Properties.OUTPUT_FORMAT_TYPE, Status.ALREADY_SET); - - if (!statusMap.containsKey(Properties.OUTPUT_FORMAT)) - { - updateStatus(Properties.OUTPUT_FORMAT, Status.CANNOT_SET); - } - outputFormatType = formatType; - return this; - } - - /** - * Sets the watermark to apply on the thumbnail. - *

- * This method can be called multiple times to apply multiple - * watermarks. - *

- * If multiple watermarks are to be applied, the watermarks will be - * applied in the order that this method is called. - *

- * Calling this method to set this parameter is optional. - * - * @param w The watermark to apply to the thumbnail. - * @return Reference to this object. - */ - public Builder watermark(Watermark w) - { - if (w == null) - { - throw new NullPointerException("Watermark is null."); - } - - filterPipeline.add(w); - - return this; - } - - /** - * Sets the image of the watermark to apply on the thumbnail. - *

- * This method is a convenience method for the - * {@link #watermark(Position, BufferedImage, float)} method, where - * the opacity is 50%, and the position is set to center of the - * thumbnail: - *

- *

-watermark(Positions.CENTER, image, 0.5f);
-		 * 
- * This method can be called multiple times to apply multiple - * watermarks. - *

- * If multiple watermarks are to be applied, the watermarks will be - * applied in the order that this method is called. - *

- * Calling this method to set this parameter is optional. - * - * @param image The image of the watermark. - * @return Reference to this object. - */ - public Builder watermark(BufferedImage image) - { - return watermark(Positions.CENTER, image, 0.5f); - } - - /** - * Sets the image and opacity of the watermark to apply on - * the thumbnail. - *

- * This method is a convenience method for the - * {@link #watermark(Position, BufferedImage, float)} method, where - * the opacity is 50%: - *

- *

-watermark(Positions.CENTER, image, opacity);
-		 * 
- * This method can be called multiple times to apply multiple - * watermarks. - *

- * If multiple watermarks are to be applied, the watermarks will be - * applied in the order that this method is called. - *

- * Calling this method to set this parameter is optional. - * - * @param image The image of the watermark. - * @param opacity The opacity of the watermark. - *

- * The value should be between {@code 0.0f} and - * {@code 1.0f}, where {@code 0.0f} is completely - * transparent, and {@code 1.0f} is completely - * opaque. - * @return Reference to this object. - */ - public Builder watermark(BufferedImage image, float opacity) - { - return watermark(Positions.CENTER, image, opacity); - } - - /** - * Sets the image and opacity and position of the watermark to apply on - * the thumbnail. - *

- * This method can be called multiple times to apply multiple - * watermarks. - *

- * If multiple watermarks are to be applied, the watermarks will be - * applied in the order that this method is called. - *

- * Calling this method to set this parameter is optional. - * - * @param position The position of the watermark. - * @param image The image of the watermark. - * @param opacity The opacity of the watermark. - *

- * The value should be between {@code 0.0f} and - * {@code 1.0f}, where {@code 0.0f} is completely - * transparent, and {@code 1.0f} is completely - * opaque. - * @return Reference to this object. - */ - public Builder watermark(Position position, BufferedImage image, float opacity) - { - filterPipeline.add(new Watermark(position, image, opacity)); - return this; - } - - /* - * rotation - */ - - /** - * Sets the amount of rotation to apply to the thumbnail. - *

- * The thumbnail will be rotated clockwise by the angle specified. - *

- * This method can be called multiple times to apply multiple - * rotations. - *

- * If multiple rotations are to be applied, the rotations will be - * applied in the order that this method is called. - *

- * Calling this method to set this parameter is optional. - * - * @param angle Angle in degrees. - * @return Reference to this object. - */ - public Builder rotate(double angle) - { - filterPipeline.add(Rotation.newRotator(angle)); - return this; - } - - - /* - * other filters - */ - - /** - * Adds a {@link ImageFilter} to apply to the thumbnail. - *

- * This method can be called multiple times to apply multiple - * filters. - *

- * If multiple filters are to be applied, the filters will be - * applied in the order that this method is called. - *

- * Calling this method to set this parameter is optional. - * - * @param filter An image filter to apply to the thumbnail. - * @return Reference to this object. - */ - public Builder addFilter(ImageFilter filter) - { - if (filter == null) - { - throw new NullPointerException("Filter is null."); - } - - filterPipeline.add(filter); - return this; - } - - /** - * Adds multiple {@link ImageFilter}s to apply to the thumbnail. - *

- * This method can be called multiple times to apply multiple - * filters. - *

- * If multiple filters are to be applied, the filters will be - * applied in the order that this method is called. - *

- * Calling this method to set this parameter is optional. - * - * @param filters A list of filters to apply to the thumbnail. - * @return Reference to this object. - */ - public Builder addFilters(List filters) - { - if (filters == null) - { - throw new NullPointerException("Filters is null."); - } - - filterPipeline.addAll(filters); - return this; - } - - /** - * Checks whether the builder is ready to create thumbnails. - * - * @throws IllegalStateException If the builder is not ready to - * create thumbnails, due to some - * parameters not being set. - */ - private void checkReadiness() - { - for (Map.Entry s : statusMap.entrySet()) - { - if (s.getValue() == Status.NOT_READY) { - throw new IllegalStateException(s.getKey().getName() + - " is not set."); - } - } - } - - /** - * Returns a {@link Resizer} which is suitable for the current - * builder state. - * - * @param mode The scaling mode to use to create thumbnails. - * @return The {@link Resizer} which is suitable for the - * specified scaling mode and builder state. - */ - private Resizer makeResizer(ScalingMode mode) - { - Map hints = - new HashMap<>(); - - hints.put(RenderingHints.KEY_ALPHA_INTERPOLATION, alphaInterpolation.getValue()); - hints.put(RenderingHints.KEY_DITHERING, dithering.getValue()); - hints.put(RenderingHints.KEY_ANTIALIASING, antialiasing.getValue()); - hints.put(RenderingHints.KEY_RENDERING, rendering.getValue()); - - if (mode == ScalingMode.BILINEAR) - { - return new BilinearResizer(hints); - } - else if (mode == ScalingMode.BICUBIC) - { - return new BicubicResizer(hints); - } - else if (mode == ScalingMode.PROGRESSIVE_BILINEAR) - { - return new ProgressiveBilinearResizer(hints); - } - else - { - return new ProgressiveBilinearResizer(hints); - } - } - - private void prepareResizerFactory() - { - /* - * If the scalingMode has been set, then use scalingMode to obtain - * a resizer, else, use the resizer field. - */ - if (statusMap.get(Properties.SCALING_MODE) == Status.ALREADY_SET) - { - this.resizerFactory = - new FixedResizerFactory(makeResizer(scalingMode)); - } - } - - /** - * Returns a {@link ThumbnailParameter} from the current builder state. - * - * @return A {@link ThumbnailParameter} from the current - * builder state. - */ - private ThumbnailParameter makeParam() - { - prepareResizerFactory(); - - int imageTypeToUse = imageType; - if (imageType == IMAGE_TYPE_UNSPECIFIED) - { - imageTypeToUse = ThumbnailParameter.ORIGINAL_IMAGE_TYPE; - } - - /* - * croppingPosition being non-null means that a crop should - * take place. - */ - if (croppingPosition != null) - { - filterPipeline.addFirst(new Canvas(width, height, croppingPosition)); - } - - if (Double.isNaN(scaleWidth)) - { - // If the dimensions were specified, do the following. - - // Check that at least one dimension is specified. - // If it's not, it's a bug. - if ( - width == DIMENSION_NOT_SPECIFIED && - height == DIMENSION_NOT_SPECIFIED - ) - { - throw new IllegalStateException( - "The width or height must be specified. If this " + - "exception is thrown, it is due to a bug in the " + - "Thumbnailator library." - ); - } - - // Set the unspecified dimension to a default value. - if (width == DIMENSION_NOT_SPECIFIED) - { - width = Integer.MAX_VALUE; - } - if (height == DIMENSION_NOT_SPECIFIED) - { - height = Integer.MAX_VALUE; - } - - return new ThumbnailParameter( - new Dimension(width, height), - sourceRegion, - keepAspectRatio, - outputFormat, - outputFormatType, - outputQuality, - imageTypeToUse, - filterPipeline.getFilters(), - resizerFactory, - fitWithinDimenions, - useExifOrientation - ); - } - else - { - // If the scaling factor was specified - return new ThumbnailParameter( - scaleWidth, - scaleHeight, - sourceRegion, - keepAspectRatio, - outputFormat, - outputFormatType, - outputQuality, - imageTypeToUse, - filterPipeline.getFilters(), - resizerFactory, - fitWithinDimenions, - useExifOrientation - ); - } - } - - /** - * Create the thumbnails and return as a {@link Iterable} of - * {@link BufferedImage}s. - *

- * For situations where multiple thumbnails are being generated, this - * method is preferred over the {@link #asBufferedImages()} method, - * as (1) the processing does not have to complete before the method - * returns and (2) the thumbnails can be retrieved one at a time, - * potentially reducing the number of thumbnails which need to be - * retained in the heap memory, potentially reducing the chance of - * {@link OutOfMemoryError}s from occurring. - *

- * If an {@link IOException} occurs during the processing of the - * thumbnail, the {@link Iterable} will return a {@code null} for that - * element. - * - * @return An {@link Iterable} which will provide an - * {@link Iterator} which returns thumbnails as - * {@link BufferedImage}s. - */ - public Iterable iterableBufferedImages() - { - checkReadiness(); - /* - * TODO To get the precise error information, there would have to - * be an exchange notification mechanism. - */ - return new BufferedImageIterable(); - } - - /** - * Create the thumbnails and return as a {@link List} of - * {@link BufferedImage}s. - *

- *

Note about performance

- * If there are many thumbnails generated at once, it is possible that - * the Java virtual machine's heap space will run out and an - * {@link OutOfMemoryError} could result. - *

- * If many thumbnails are being processed at once, then using the - * {@link #iterableBufferedImages()} method would be preferable. - * - * @return A list of thumbnails. - * @throws IOException If an problem occurred during - * the reading of the original - * images. - */ - public List asBufferedImages() throws IOException - { - checkReadiness(); - - List thumbnails = new ArrayList<>(); - - // Create thumbnails - for (ImageSource source : sources) - { - BufferedImageSink destination = new BufferedImageSink(); - - Thumbnailator.createThumbnail( - new SourceSinkThumbnailTask<>(makeParam(), source, destination) - ); - - thumbnails.add(destination.getSink()); - } - - return thumbnails; - } - - /** - * Creates a thumbnail and returns it as a {@link BufferedImage}. - *

- * To call this method, the thumbnail must have been created from a - * single source. - * - * @return A thumbnail as a {@link BufferedImage}. - * @throws IOException If an problem occurred during - * the reading of the original - * image. - * @throws IllegalArgumentException If multiple original images are - * specified. - */ - public BufferedImage asBufferedImage() throws IOException - { - checkReadiness(); - - Iterator> iter = sources.iterator(); - ImageSource source = iter.next(); - - if (iter.hasNext()) - { - throw new IllegalArgumentException("Cannot create one thumbnail from multiple original images."); - } - - BufferedImageSink destination = new BufferedImageSink(); - - Thumbnailator.createThumbnail( - new SourceSinkThumbnailTask<>(makeParam(), source, destination) - ); - - return destination.getSink(); - } - - /** - * Creates the thumbnails and stores them to the files, and returns - * a {@link List} of {@link File}s to the thumbnails. - *

- * When the destination file exists, and overwriting files has been - * disabled by calling the {@link #allowOverwrite(boolean)} method - * with {@code false}, then the thumbnail with the destination file - * already existing will not be written and the corresponding - * {@code File} object will not be included in the {@code List} returned - * by this method. - *

- * The file names for the thumbnails are obtained from the given - * {@link Iterable}. - * - * @param iterable An {@link Iterable} which returns an - * {@link Iterator} which returns file names - * which should be assigned to each thumbnail. - * @throws IOException If a problem occurs while reading the - * original images or writing the thumbnails - * to files. - * @since 0.3.7 - */ - public void asFiles(Iterable iterable) throws IOException - { - checkReadiness(); - - if (iterable == null) - { - throw new NullPointerException("File name iterable is null."); - } - - List destinationFiles = new ArrayList<>(); - - Iterator filenameIter = iterable.iterator(); - - for (ImageSource source : sources) - { - if (!filenameIter.hasNext()) - { - throw new IndexOutOfBoundsException( - "Not enough file names provided by iterator." - ); - } - - ThumbnailParameter param = makeParam(); - - FileImageSink destination = new FileImageSink(filenameIter.next(), allowOverwrite); - - try - { - Thumbnailator.createThumbnail( - new SourceSinkThumbnailTask<>(param, source, destination) - ); - - destinationFiles.add(destination.getSink()); - } - catch (IllegalArgumentException e) - { - /* - * Handle the IllegalArgumentException which is thrown when - * the destination file already exists by not adding the - * current file to the destinationFiles list. - */ - } - } - - } - - /** - * Creates the thumbnails and stores them to the files. - *

- * When the destination file exists, and overwriting files has been - * disabled by calling the {@link #allowOverwrite(boolean)} method - * with {@code false}, then the thumbnail with the destination file - * already existing will not be written. - *

- * The file names for the thumbnails are obtained from the given - * {@link Iterable}. - * - * @param iterable An {@link Iterable} which returns an - * {@link Iterator} which returns file names - * which should be assigned to each thumbnail. - * @throws IOException If a problem occurs while reading the - * original images or writing the thumbnails - * to files. - * @since 0.3.7 - */ - public void toFiles(Iterable iterable) throws IOException - { - asFiles(iterable); - } - - /** - * Creates thumbnails and stores them to files using the - * {@link Rename} function to determine the filenames. The thubnail - * files are returned as a {@link List}. - *

- * When the destination file exists, and overwriting files has been - * disabled by calling the {@link #allowOverwrite(boolean)} method - * with {@code false}, then the thumbnail with the destination file - * already existing will not be written and the corresponding - * {@code File} object will not be included in the {@code List} returned - * by this method. - *

- * To call this method, the thumbnails must have been creates from - * files by calling the {@link Thumbnails#of(File...)} method. - * - * @param rename The rename function which is used to - * determine the filenames of the thumbnail - * files to write. - * @return A list of {@link File}s of the thumbnails - * which were created. - * @throws IOException If a problem occurs while reading the - * original images or writing the thumbnails - * to files. - * @throws IllegalStateException If the original images are not - * from files. - * @since 0.3.7 - */ - public List asFiles(Rename rename) throws IOException - { - return asFiles(null, rename); - } - - /** - * Creates thumbnails and stores them to files in the directory - * specified by the given {@link File} object, and using the - * {@link Rename} function to determine the filenames. The thubnail - * files are returned as a {@link List}. - *

- * When the destination file exists, and overwriting files has been - * disabled by calling the {@link #allowOverwrite(boolean)} method - * with {@code false}, then the thumbnail with the destination file - * already existing will not be written and the corresponding - * {@code File} object will not be included in the {@code List} returned - * by this method. - *

- * Extra caution should be taken when using this method, as there are - * no protections in place to prevent file name collisions resulting - * from creating thumbnails from files in separate directories but - * having the same name. In such a case, the behavior will be depend - * on the behavior of the {@link #allowOverwrite(boolean)} as - * described in the previous paragraph. - *

- * To call this method, the thumbnails must have been creates from - * files by calling the {@link Thumbnails#of(File...)} method. - * - * @param destinationDir The destination directory to which the - * thumbnails should be written to. - * @param rename The rename function which is used to - * determine the filenames of the thumbnail - * files to write. - * @return A list of {@link File}s of the thumbnails - * which were created. - * @throws IOException If a problem occurs while reading the - * original images or writing the thumbnails - * to files. - * @throws IllegalStateException If the original images are not - * from files. - * @throws IllegalArgumentException If the destination directory - * is not a directory. - * @since 0.4.7 - */ - public List asFiles(File destinationDir, Rename rename) throws IOException - { - checkReadiness(); - - if (rename == null) - { - throw new NullPointerException("Rename is null."); - } - - if (destinationDir != null && !destinationDir.isDirectory()) - { - throw new IllegalArgumentException("Given destination is not a directory."); - } - - List destinationFiles = new ArrayList<>(); - - for (ImageSource source : sources) - { - if (!(source instanceof FileImageSource)) - { - throw new IllegalStateException("Cannot create thumbnails to files if original images are not from files."); - } - - ThumbnailParameter param = makeParam(); - - File f = ((FileImageSource)source).getSource(); - - File actualDestDir = destinationDir == null ? f.getParentFile() : destinationDir; - File destinationFile = - new File(actualDestDir, rename.apply(f.getName(), param)); - - FileImageSink destination = new FileImageSink(destinationFile, allowOverwrite); - - try - { - Thumbnailator.createThumbnail( - new SourceSinkThumbnailTask<>(param, source, destination) - ); - - destinationFiles.add(destination.getSink()); - } - catch (IllegalArgumentException e) - { - /* - * Handle the IllegalArgumentException which is thrown when - * the destination file already exists by not adding the - * current file to the destinationFiles list. - */ - } - } - - return destinationFiles; - } - - /** - * Creates thumbnails and stores them to files using the - * {@link Rename} function to determine the filenames. - *

- * When the destination file exists, and overwriting files has been - * disabled by calling the {@link #allowOverwrite(boolean)} method - * with {@code false}, then the thumbnail with the destination file - * already existing will not be written. - *

- * To call this method, the thumbnails must have been creates from - * files by calling the {@link Thumbnails#of(File...)} method. - * - * @param rename The rename function which is used to - * determine the filenames of the thumbnail - * files to write. - * @throws IOException If a problem occurs while reading the - * original images or writing the thumbnails - * to files. - * thumbnails to files. - * @throws IllegalStateException If the original images are not - * from files. - * @since 0.3.7 - */ - public void toFiles(Rename rename) throws IOException - { - toFiles(null, rename); - } - - /** - * Creates thumbnails and stores them to files in the directory - * specified by the given {@link File} object, and using the - * {@link Rename} function to determine the filenames. - *

- * When the destination file exists, and overwriting files has been - * disabled by calling the {@link #allowOverwrite(boolean)} method - * with {@code false}, then the thumbnail with the destination file - * already existing will not be written. - *

- * Extra caution should be taken when using this method, as there are - * no protections in place to prevent file name collisions resulting - * from creating thumbnails from files in separate directories but - * having the same name. In such a case, the behavior will be depend - * on the behavior of the {@link #allowOverwrite(boolean)} as - * described in the previous paragraph. - *

- * To call this method, the thumbnails must have been creates from - * files by calling the {@link Thumbnails#of(File...)} method. - * - * @param destinationDir The destination directory to which the - * thumbnails should be written to. - * @param rename The rename function which is used to - * determine the filenames of the thumbnail - * files to write. - * @throws IOException If a problem occurs while reading the - * original images or writing the thumbnails - * to files. - * thumbnails to files. - * @throws IllegalStateException If the original images are not - * from files. - * @throws IllegalArgumentException If the destination directory - * is not a directory. - * @since 0.4.7 - */ - public void toFiles(File destinationDir, Rename rename) throws IOException - { - asFiles(destinationDir, rename); - } - - /** - * Create a thumbnail and writes it to a {@link File}. - *

- * When the destination file exists, and overwriting files has been - * disabled by calling the {@link #allowOverwrite(boolean)} method - * with {@code false}, then an {@link IllegalArgumentException} will - * be thrown. - *

- * To call this method, the thumbnail must have been created from a - * single source. - * - * @param outFile The file to which the thumbnail is to be - * written to. - * @throws IOException If a problem occurs while reading the - * original images or writing the thumbnails - * to files. - * @throws IllegalArgumentException If multiple original image files - * are specified, or if the - * destination file exists, and - * overwriting files is disabled. - */ - public void toFile(File outFile) throws IOException - { - checkReadiness(); - - Iterator> iter = sources.iterator(); - ImageSource source = iter.next(); - - if (iter.hasNext()) - { - throw new IllegalArgumentException("Cannot output multiple thumbnails to one file."); - } - - FileImageSink destination = new FileImageSink(outFile, allowOverwrite); - - Thumbnailator.createThumbnail( - new SourceSinkThumbnailTask<>(makeParam(), source, destination) - ); - } - - /** - * Create a thumbnail and writes it to a {@link File}. - *

- * When the destination file exists, and overwriting files has been - * disabled by calling the {@link #allowOverwrite(boolean)} method - * with {@code false}, then an {@link IllegalArgumentException} will - * be thrown. - *

- * To call this method, the thumbnail must have been created from a - * single source. - * - * @param outFilepath The file to which the thumbnail is to be - * written to. - * @throws IOException If a problem occurs while reading the - * original images or writing the thumbnails - * to files. - * @throws IllegalArgumentException If multiple original image files - * are specified, or if the - * destination file exists, and - * overwriting files is disabled. - */ - public void toFile(String outFilepath) throws IOException - { - checkReadiness(); - - Iterator> iter = sources.iterator(); - ImageSource source = iter.next(); - - if (iter.hasNext()) - { - throw new IllegalArgumentException("Cannot output multiple thumbnails to one file."); - } - - FileImageSink destination = new FileImageSink(outFilepath, allowOverwrite); - - Thumbnailator.createThumbnail( - new SourceSinkThumbnailTask<>(makeParam(), source, destination) - ); - } - - /** - * Create a thumbnail and writes it to a {@link OutputStream}. - *

- * To call this method, the thumbnail must have been created from a - * single source. - * - * @param os The output stream to which the thumbnail - * is to be written to. - * @throws IOException If a problem occurs while reading the - * original images or writing the thumbnails. - * @throws IllegalArgumentException If multiple original image files - * are specified. - * @throws IllegalStateException If the output format has not - * been specified through the - * {@link #outputFormat(String)} - * method. - */ - public void toOutputStream(OutputStream os) throws IOException - { - checkReadiness(); - - Iterator> iter = sources.iterator(); - ImageSource source = iter.next(); - - if (iter.hasNext()) - { - throw new IllegalArgumentException("Cannot output multiple thumbnails to a single OutputStream."); - } - - /* - * if the image is from a BufferedImage, then we require that the - * output format be set. (or else, we can't tell what format to - * output as!) - */ - if (source instanceof BufferedImageSource) - { - if (isOutputFormatNotSet()) - { - throw new IllegalStateException( - "Output format not specified." - ); - } - } - - OutputStreamImageSink destination = new OutputStreamImageSink(os); - - Thumbnailator.createThumbnail( - new SourceSinkThumbnailTask<>(makeParam(), source, destination) - ); - } - - /** - * Creates the thumbnails and writes them to {@link OutputStream}s - * provided by the {@link Iterable}. - * - * @param iterable An {@link Iterable} which returns an - * {@link Iterator} which returns the - * output stream which should be assigned to - * each thumbnail. - * @throws IOException If a problem occurs while reading the - * original images or writing the thumbnails. - * @throws IllegalStateException If the output format has not - * been specified through the - * {@link #outputFormat(String)} - * method. - */ - public void toOutputStreams(Iterable iterable) throws IOException - { - checkReadiness(); - - if (iterable == null) - { - throw new NullPointerException("OutputStream iterable is null."); - } - - Iterator osIter = iterable.iterator(); - - for (ImageSource source : sources) - { - /* - * if the image is from a BufferedImage, then we require that the - * output format be set. (or else, we can't tell what format to - * output as!) - */ - if (source instanceof BufferedImageSource) - { - if (isOutputFormatNotSet()) - { - throw new IllegalStateException( - "Output format not specified." - ); - } - } - - if (!osIter.hasNext()) - { - throw new IndexOutOfBoundsException( - "Not enough file names provided by iterator." - ); - } - - OutputStreamImageSink destination = new OutputStreamImageSink(osIter.next()); - - Thumbnailator.createThumbnail( - new SourceSinkThumbnailTask<>(makeParam(), source, destination) - ); - } - } - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/builders/BufferedImageBuilder.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/builders/BufferedImageBuilder.java deleted file mode 100644 index 3c7c597e..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/builders/BufferedImageBuilder.java +++ /dev/null @@ -1,155 +0,0 @@ -package net.coobird.thumbnailator.builders; - -import java.awt.Dimension; -import java.awt.image.BufferedImage; - -/** - * A builder for creating {@link BufferedImage} with specified parameters. - * - * @author coobird - * - */ -public final class BufferedImageBuilder -{ - /** - * The default image type of the {@link BufferedImage}s to be created - * by this builder. - */ - private static final int DEFAULT_TYPE = BufferedImage.TYPE_INT_ARGB; - - /** - * The image type to use for the {@link BufferedImage} that is to be - * created. - */ - private int imageType; - - /** - * The width to use for the {@link BufferedImage} that is to be created. - */ - private int width; - - /** - * The height to use for the {@link BufferedImage} that is to be created. - */ - private int height; - - /** - * Instantiates a {@code BufferedImageBuilder} with the specified size, and - * the default image type. - * - * @param size The size of the {@link BufferedImage} to build. - */ - public BufferedImageBuilder(Dimension size) - { - this(size.width, size.height); - } - - /** - * Instantiates a {@code BufferedImageBuilder} with the specified size and - * image type. - * - * @param size The size of the {@link BufferedImage} to build. - * @param imageType The image type of the {@link BufferedImage} to build. - */ - public BufferedImageBuilder(Dimension size, int imageType) - { - this(size.width, size.height, imageType); - } - - /** - * Instantiates a {@code BufferedImageBuilder} with the specified size, and - * the default image type. - * - * @param width The width of the {@link BufferedImage} to build. - * @param height The height of the {@link BufferedImage} to build. - */ - public BufferedImageBuilder(int width, int height) - { - this(width, height, DEFAULT_TYPE); - } - - /** - * Instantiates a {@code BufferedImageBuilder} with the specified size and - * image type. - * - * @param width The width of the {@link BufferedImage} to build. - * @param height The height of the {@link BufferedImage} to build. - * @param imageType The image type of the {@link BufferedImage} to build. - */ - public BufferedImageBuilder(int width, int height, int imageType) - { - size(width, height); - imageType(imageType); - } - - /** - * Generates a new {@code BufferedImage}. - * - * @return Returns a newly created {@link BufferedImage} from the - * parameters set in the {@link BufferedImageBuilder}. - */ - public BufferedImage build() - { - return new BufferedImage(width, height, imageType); - } - - /** - * Sets the type of the image of the {@link BufferedImage}. - * - * @param imageType The image type to use. - */ - public void imageType(int imageType) - { - this.imageType = imageType; - - } - - /** - * Sets the size for the {@code BufferedImage}. - * - * @param width The width of the image to create. - * @param height The height of the image to create. - */ - public void size(int width, int height) - { - width(width); - height(height); - - } - - /** - * Sets the width for the {@link BufferedImage}. - * - * @param width The width of the image to create. - */ - public void width(int width) - { - if (width <= 0) - { - throw new IllegalArgumentException( - "Width must be greater than 0." - ); - } - - this.width = width; - - } - - /** - * Sets the height for the {@link BufferedImage}. - * - * @param height The height of the image to create. - */ - public void height(int height) - { - if (height <= 0) - { - throw new IllegalArgumentException( - "Height must be greater than 0." - ); - } - - this.height = height; - - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/builders/ThumbnailParameterBuilder.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/builders/ThumbnailParameterBuilder.java deleted file mode 100644 index 6f37c7fd..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/builders/ThumbnailParameterBuilder.java +++ /dev/null @@ -1,406 +0,0 @@ -package net.coobird.thumbnailator.builders; - -import java.awt.Dimension; -import java.awt.image.BufferedImage; -import java.util.Collections; -import java.util.List; - -import net.coobird.thumbnailator.ThumbnailParameter; -import net.coobird.thumbnailator.filters.ImageFilter; -import net.coobird.thumbnailator.resizers.DefaultResizerFactory; -import net.coobird.thumbnailator.resizers.FixedResizerFactory; -import net.coobird.thumbnailator.geometry.Region; -import net.coobird.thumbnailator.resizers.Resizer; -import net.coobird.thumbnailator.resizers.ResizerFactory; - -/** - * A builder for generating {@link ThumbnailParameter}. - *

- * The default values assigned to the {@link ThumbnailParameter} created by - * the {@link ThumbnailParameterBuilder} are as follows: - *

- *

- *
width
- *
Unassigned. Must be set by the {@link #size(int, int)} method.
- *
height
- *
Unassigned. Must be set by the {@link #size(int, int)} method.
- *
scaling factor
- *
Unassigned. Must be set by the {@link #scale(double)} method or - * {@link #scale(double, double)} method.
- *
source region
- *
Uses the entire source image.
- *
image type
- *
See {@link ThumbnailParameter#DEFAULT_IMAGE_TYPE}. Same as - * {@link BufferedImage#TYPE_INT_ARGB}.
- *
aspect ratio
- *
Maintain the aspect ratio of the original image.
- *
output quality
- *
See {@link ThumbnailParameter#DEFAULT_QUALITY}.
- *
output format
- *
See {@link ThumbnailParameter#ORIGINAL_FORMAT}. Maintains the same - * image format as the original image.
- *
output format type
- *
See {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE}. Uses the default - * format type of the codec used to create the thumbnail image.
- *
image filters
- *
None.
- *
resizer factory
- *
{@link DefaultResizerFactory} is used.
- *
resizer
- *
The default {@link Resizer} returned by the {@link ResizerFactory}.
- *
use of Exif metadata for orientation
- *
Use the Exif metadata to determine the orientation of the thumbnail.
- *
- * - * @author coobird - * - */ -public final class ThumbnailParameterBuilder -{ - private static final int UNINITIALIZED = -1; - - private int width = UNINITIALIZED; - private int height = UNINITIALIZED; - private double widthScalingFactor = Double.NaN; - private double heightScalingFactor = Double.NaN; - private int imageType = ThumbnailParameter.DEFAULT_IMAGE_TYPE; - private boolean keepAspectRatio = true; - private float thumbnailQuality = ThumbnailParameter.DEFAULT_QUALITY; - private String thumbnailFormat = ThumbnailParameter.ORIGINAL_FORMAT; - private String thumbnailFormatType = ThumbnailParameter.DEFAULT_FORMAT_TYPE; - private List filters = Collections.emptyList(); - private ResizerFactory resizerFactory = DefaultResizerFactory.getInstance(); - private Region sourceRegion = null; - private boolean fitWithinDimensions = true; - private boolean useExifOrientation = true; - - /** - * Creates an instance of a {@link ThumbnailParameterBuilder}. - */ - public ThumbnailParameterBuilder() - { - } - - /** - * Sets the image type fo the thumbnail. - * - * @param type The image type of the thumbnail. - * @return A reference to this object. - */ - public ThumbnailParameterBuilder imageType(int type) - { - imageType = type; - return this; - } - - /** - * Sets the size of the thumbnail. - * - * @param size The dimensions of the thumbnail. - * @return A reference to this object. - */ - public ThumbnailParameterBuilder size(Dimension size) - { - size(size.width, size.height); - return this; - } - - /** - * Sets the size of the thumbnail. - * - * @param width The width of the thumbnail. - * @param height The height of the thumbnail. - * @return A reference to this object. - * @throws IllegalArgumentException If the widht or height is less than 0. - */ - public ThumbnailParameterBuilder size(int width, int height) - { - if (width < 0) - { - throw new IllegalArgumentException("Width must be greater than 0."); - } - if (height < 0) - { - throw new IllegalArgumentException("Height must be greater than 0."); - } - - this.width = width; - this.height = height; - return this; - } - - /** - * Sets the scaling factor of the thumbnail. - * - * @param scalingFactor The scaling factor of the thumbnail. - * @return A reference to this object. - * @throws IllegalArgumentException If the scaling factor is not a - * rational number, or if it is less - * than {@code 0.0}. - */ - public ThumbnailParameterBuilder scale(double scalingFactor) - { - return scale(scalingFactor, scalingFactor); - } - - /** - * Sets the scaling factor of the thumbnail. - * - * @param widthScalingFactor The scaling factor to use for the width - * when creating the thumbnail. - * @param heightScalingFactor The scaling factor to use for the height - * when creating the thumbnail. - * @return A reference to this object. - * @throws IllegalArgumentException If the scaling factor is not a - * rational number, or if it is less - * than {@code 0.0}. - * @since 0.3.10 - */ - public ThumbnailParameterBuilder scale(double widthScalingFactor, double heightScalingFactor) - { - if (widthScalingFactor <= 0.0 || heightScalingFactor <= 0.0) - { - throw new IllegalArgumentException("Scaling factor is less than or equal to 0."); - } - else if (Double.isNaN(widthScalingFactor) || Double.isInfinite(widthScalingFactor)) - { - throw new IllegalArgumentException("Scaling factor must be a rational number."); - } - else if (Double.isNaN(heightScalingFactor) || Double.isInfinite(heightScalingFactor)) - { - throw new IllegalArgumentException("Scaling factor must be a rational number."); - } - - this.widthScalingFactor = widthScalingFactor; - this.heightScalingFactor = heightScalingFactor; - return this; - } - - /** - * Sets the region of the source image to use when creating a thumbnail. - * - * @param sourceRegion The region of the source image to use when - * creating a thumbnail. - * @return A reference to this object. - * @since 0.3.4 - */ - public ThumbnailParameterBuilder region(Region sourceRegion) - { - this.sourceRegion = sourceRegion; - return this; - } - - /** - * Sets whether or not the thumbnail is to maintain the aspect ratio of - * the original image. - * - * @param keep {@code true} if the aspect ratio of the original image - * is to be maintained in the thumbnail, {@code false} - * otherwise. - * @return A reference to this object. - */ - public ThumbnailParameterBuilder keepAspectRatio(boolean keep) - { - this.keepAspectRatio = keep; - return this; - } - - /** - * Sets the compression quality setting of the thumbnail. - *

- * An acceptable value is in the range of {@code 0.0f} to {@code 1.0f}, - * where {@code 0.0f} is for the lowest quality setting and {@code 1.0f} for - * the highest quality setting. - *

- * If the default compression quality is to be used, then the value - * {@link ThumbnailParameter#DEFAULT_QUALITY} should be used. - * - * @param quality The compression quality setting of the thumbnail. - * @return A reference to this object. - */ - public ThumbnailParameterBuilder quality(float quality) - { - this.thumbnailQuality = quality; - return this; - } - - /** - * Sets the output format of the thumbnail. - * - * @param format The output format of the thumbnail. - * @return A reference to this object. - */ - public ThumbnailParameterBuilder format(String format) - { - this.thumbnailFormat = format; - return this; - } - - /** - * Sets the output format type of the thumbnail. - * - * @param formatType The output format type of the thumbnail. - * @return A reference to this object. - */ - public ThumbnailParameterBuilder formatType(String formatType) - { - this.thumbnailFormatType = formatType; - return this; - } - - /** - * Sets the {@link ImageFilter}s to apply to the thumbnail. - *

- * These filters will be applied after the original image is resized. - * - * @param filters The output format type of the thumbnail. - * @return A reference to this object. - */ - public ThumbnailParameterBuilder filters(List filters) - { - if (filters == null) - { - throw new NullPointerException("Filters is null."); - } - - this.filters = filters; - return this; - } - - /** - * Sets the {@link Resizer} to use when performing the resizing operation - * to create the thumbnail. - *

- * Calling this method after {@link #resizerFactory(ResizerFactory)} will - * cause the {@link ResizerFactory} used by the resulting - * {@link ThumbnailParameter} to only return the specified {@link Resizer}. - * - * @param resizer The {@link Resizer} to use when creating the - * thumbnail. - * @return A reference to this object. - */ - public ThumbnailParameterBuilder resizer(Resizer resizer) - { - if (resizer == null) - { - throw new NullPointerException("Resizer is null."); - } - - this.resizerFactory = new FixedResizerFactory(resizer); - return this; - } - - /** - * Sets the {@link ResizerFactory} to use to obtain a {@link Resizer} when - * performing the resizing operation to create the thumbnail. - *

- * Calling this method after {@link #resizer(Resizer)} could result in - * {@link Resizer}s not specified in the {@code resizer} method to be used - * when creating thumbnails. - * - * - * @param resizerFactory The {@link ResizerFactory} to use when obtaining - * a {@link Resizer} to create the thumbnail. - * @return A reference to this object. - * @since 0.4.0 - */ - public ThumbnailParameterBuilder resizerFactory(ResizerFactory resizerFactory) - { - if (resizerFactory == null) - { - throw new NullPointerException("Resizer is null."); - } - - this.resizerFactory = resizerFactory; - return this; - } - - /** - * Sets whether or not the thumbnail should fit within the specified - * dimensions. - * - * @param fit {@code true} if the thumbnail should be sized to fit - * within the specified dimensions, if the thumbnail - * is going to exceed those dimensions. - * @return A reference to this object. - * @since 0.4.0 - */ - public ThumbnailParameterBuilder fitWithinDimensions(boolean fit) - { - this.fitWithinDimensions = fit; - return this; - } - - /** - * Sets whether or not the Exif metadata should be used to determine the - * orientation of the thumbnail. - * - * @param use {@code true} if the Exif metadata should be used - * to determine the orientation of the thumbnail, - * {@code false} otherwise. - * @return A reference to this object. - * @since 0.4.3 - */ - public ThumbnailParameterBuilder useExifOrientation(boolean use) - { - this.useExifOrientation = use; - return this; - } - - /** - * Returns a {@link ThumbnailParameter} from the parameters which are - * currently set. - *

- * This method will throw a {@link IllegalArgumentException} required - * parameters for the {@link ThumbnailParameter} have not been set. - * - * @return A {@link ThumbnailParameter} with parameters set through - * the use of this builder. - * @throws IllegalStateException If neither the size nor the scaling - * factor has been set. - */ - public ThumbnailParameter build() - { - if (!Double.isNaN(widthScalingFactor)) - { - // If scaling factor has been set. - return new ThumbnailParameter( - widthScalingFactor, - heightScalingFactor, - sourceRegion, - keepAspectRatio, - thumbnailFormat, - thumbnailFormatType, - thumbnailQuality, - imageType, - filters, - resizerFactory, - fitWithinDimensions, - useExifOrientation - ); - - } - else if (width != UNINITIALIZED && height != UNINITIALIZED) - { - return new ThumbnailParameter( - new Dimension(width, height), - sourceRegion, - keepAspectRatio, - thumbnailFormat, - thumbnailFormatType, - thumbnailQuality, - imageType, - filters, - resizerFactory, - fitWithinDimensions, - useExifOrientation - ); - } - else - { - throw new IllegalStateException( - "The size nor the scaling factor has been set." - ); - } - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/builders/package-info.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/builders/package-info.java deleted file mode 100644 index 6bd18b0e..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/builders/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This package provides classes which provides convenient builders for classes - * which are used by Thumbnailator. - */ -package net.coobird.thumbnailator.builders; diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Canvas.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Canvas.java deleted file mode 100644 index 94af371b..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Canvas.java +++ /dev/null @@ -1,183 +0,0 @@ -package net.coobird.thumbnailator.filters; - -import java.awt.Color; -import java.awt.Graphics; -import java.awt.Point; -import java.awt.image.BufferedImage; - -import net.coobird.thumbnailator.geometry.Position; - -/** - * An {@link ImageFilter} which will enclose an image into a specified - * enclosing image. - *

- * The intended use of this {@code ImageFilter} is to take an image and place - * it inside of a larger image, creating a border around the original image. - * This can be useful when the dimensions of a thumbnail must always be the - * same dimensions, and the original images are of differing dimensions. - *

- * The fill color used for the enclosing image can be specified, along with - * whether or not to crop an image if it is larger than the enclosing image. - * - * @author coobird - * @since 0.3.2 - * - */ -public class Canvas implements ImageFilter -{ - /** - * The width of the enclosing image. - */ - private final int width; - - /** - * The width of the enclosing image. - */ - private final int height; - - /** - * The positioning of the enclosed image. - */ - private final Position position; - - /** - * The fill color for the background. - */ - private final Color fillColor; - - /** - * Whether or not to crop the enclosed image if the enclosing image is - * smaller than the enclosed image. - */ - private final boolean crop; - - /** - * Instantiates a {@code Canvas} filter. - *

- * No fill color will be applied to the filtered image. If the image to - * filter does not have a transparency channel, the image will be filled - * black. - *

- * Crops the enclosed image if the enclosing image is smaller. - * - * @param width The width of the filtered image. - * @param height The height of the filtered image. - * @param position The position to place the enclosed image. - */ - public Canvas(int width, int height, Position position) - { - this(width, height, position, true, null); - } - - /** - * Instantiates a {@code Canvas} filter. - *

- * No fill color will be applied to the filtered image. If the image to - * filter does not have a transparency channel, the image will be filled - * black. - * - * @param width The width of the filtered image. - * @param height The height of the filtered image. - * @param position The position to place the enclosed image. - * @param crop Whether or not to crop the enclosed image if the - * enclosed image has dimensions which are larger than - * the specified {@code width} and {@code height}. - */ - public Canvas(int width, int height, Position position, boolean crop) - { - this(width, height, position, crop, null); - } - - /** - * Instantiates a {@code Canvas} filter. - *

- * Crops the enclosed image if the enclosing image is smaller. - * - * @param width The width of the filtered image. - * @param height The height of the filtered image. - * @param position The position to place the enclosed image. - * @param fillColor The color to fill portions of the image which is - * not covered by the enclosed image. Portions of the - * image which is transparent will be filled with - * the specified color as well. - */ - public Canvas(int width, int height, Position position, Color fillColor) - { - this(width, height, position, true, fillColor); - } - - /** - * Instantiates a {@code Canvas} filter. - * - * @param width The width of the filtered image. - * @param height The height of the filtered image. - * @param position The position to place the enclosed image. - * @param crop Whether or not to crop the enclosed image if the - * enclosed image has dimensions which are larger than - * the specified {@code width} and {@code height}. - * @param fillColor The color to fill portions of the image which is - * not covered by the enclosed image. Portions of the - * image which is transparent will be filled with - * the specified color as well. - */ - public Canvas(int width, int height, Position position, boolean crop, Color fillColor) - { - super(); - this.width = width; - this.height = height; - this.position = position; - this.crop = crop; - this.fillColor = fillColor; - } - - public BufferedImage apply(BufferedImage img) - { - int widthToUse = width; - int heightToUse = height; - - /* - * To prevent cropping when cropping is disabled, if the dimension of - * the enclosed image exceeds the dimension of the enclosing image, - * then the enclosing image will have its dimension enlarged. - * - */ - if (!crop && img.getWidth() > width) - { - widthToUse = img.getWidth(); - } - if (!crop && img.getHeight() > height) - { - heightToUse = img.getHeight(); - } - - Point p = position.calculate( - widthToUse, heightToUse, img.getWidth(), img.getHeight(), - 0, 0, 0, 0 - ); - - BufferedImage finalImage = - new BufferedImage(widthToUse, heightToUse, img.getType()); - - Graphics g = finalImage.getGraphics(); - - if (fillColor == null && !img.getColorModel().hasAlpha()) - { - /* - * Fulfills the specification to use a black fill color for images - * w/o alpha, if the fill color isn't specified. - */ - g.setColor(Color.black); - g.fillRect(0, 0, width, height); - } - else if (fillColor != null) - { - g.setColor(fillColor); - g.fillRect(0, 0, widthToUse, heightToUse); - } - - g.drawImage(img, p.x, p.y, null); - g.dispose(); - - return finalImage; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Caption.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Caption.java deleted file mode 100644 index 335564ba..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Caption.java +++ /dev/null @@ -1,133 +0,0 @@ -package net.coobird.thumbnailator.filters; - -import java.awt.AlphaComposite; -import java.awt.Color; -import java.awt.Font; -import java.awt.Graphics2D; -import java.awt.Point; -import java.awt.image.BufferedImage; - -import net.coobird.thumbnailator.geometry.Position; -import net.coobird.thumbnailator.util.BufferedImages; - -/** - * An {@link ImageFilter} which will overlay a text caption to an image. - * - * @author coobird - * - */ -public class Caption implements ImageFilter -{ - /** - * The text of the caption. - */ - private final String caption; - - /** - * The font of text to add. - */ - private final Font font; - - /** - * The color of the text to add. - */ - private final Color c; - - /** - * The opacity level of the text to add. - *

- * The value should be between {@code 0.0f} to {@code 1.0f}, where - * {@code 0.0f} is completely transparent, and {@code 1.0f} is completely - * opaque. - */ - private final float alpha; - - /** - * The position at which the text should be drawn. - */ - private final Position position; - - /** - * The insets for the text to draw. - */ - private final int insets; - - /** - * Instantiates a filter which adds a text caption to an image. - * - * @param caption The text of the caption. - * @param font The font of the caption. - * @param c The color of the caption. - * @param alpha The opacity level of caption. - *

- * The value should be between {@code 0.0f} and - * {@code 1.0f}, where {@code 0.0f} is completely - * transparent, and {@code 1.0f} is completely opaque. - * @param position The position of the caption. - * @param insets The inset size around the caption. - */ - public Caption(String caption, Font font, Color c, float alpha, - Position position, int insets) - { - this.caption = caption; - this.font = font; - this.c = c; - this.alpha = alpha; - this.position = position; - this.insets = insets; - } - - /** - * Instantiates a filter which adds a text caption to an image. - *

- * The opacity of the caption will be 100% opaque. - * - * @param caption The text of the caption. - * @param font The font of the caption. - * @param c The color of the caption. - * @param position The position of the caption. - * @param insets The inset size around the caption. - */ - public Caption(String caption, Font font, Color c, Position position, - int insets) - { - this.caption = caption; - this.font = font; - this.c = c; - this.alpha = 1.0f; - this.position = position; - this.insets = insets; - } - - public BufferedImage apply(BufferedImage img) - { - BufferedImage newImage = BufferedImages.copy(img); - - Graphics2D g = newImage.createGraphics(); - g.setFont(font); - g.setColor(c); - g.setComposite( - AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha) - ); - - int imageWidth = img.getWidth(); - int imageHeight = img.getHeight(); - - int captionWidth = g.getFontMetrics().stringWidth(caption); - int captionHeight = g.getFontMetrics().getHeight() / 2; - - Point p = position.calculate( - imageWidth, imageHeight, captionWidth, 0, - insets, insets, insets, insets - ); - - double yRatio = p.y / (double)img.getHeight(); - int yOffset = (int)((1.0 - yRatio) * captionHeight); - - g.drawString(caption, p.x, p.y + yOffset); - - g.dispose(); - - return newImage; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Colorize.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Colorize.java deleted file mode 100644 index 45f7c35c..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Colorize.java +++ /dev/null @@ -1,94 +0,0 @@ -package net.coobird.thumbnailator.filters; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.image.BufferedImage; - -import net.coobird.thumbnailator.builders.BufferedImageBuilder; - -/** - * An image filter which will add a color tint to an image. - * - * @author coobird - * - */ -public final class Colorize implements ImageFilter -{ - /** - * The color to tint a target image with. - */ - private final Color c; - - /** - * Instantiates this filter with the color to use to tint the target image - * with. - *

- * Note: If the provided {@link Color} does not have an alpha channel - * (transparency channel), then the target image will be painted with an - * opaque color, resulting in an image with only the specified color. - * - * @param c Color to tint with. - */ - public Colorize(Color c) - { - this.c = c; - } - - /** - * Instantiates this filter with the color to use to tint the target image - * with and the transparency level provided as a {@code float} ranging from - * {@code 0.0f} to {@code 1.0f}, where {@code 0.0f} indicates completely - * transparent, and {@code 1.0f} indicates completely opaque. - * - * @param c Color to tint with. - * @param alpha The opacity of the tint. - */ - public Colorize(Color c, float alpha) - { - this(c, (int)(255 * alpha)); - } - - /** - * Instantiates this filter with the color to use to tint the target image - * with and the transparency level provided as a {@code int} ranging from - * {@code 0} to {@code 255}, where {@code 0} indicates completely - * transparent, and {@code 255} indicates completely opaque. - * - * @param c Color to tint with. - * @param alpha The opacity of the tint. - */ - public Colorize(Color c, int alpha) - { - if (alpha > 255 || alpha < 0) - { - throw new IllegalArgumentException( - "Specified alpha value is outside the range of allowed " + - "values."); - } - - int r = c.getRed(); - int g = c.getGreen(); - int b = c.getBlue(); - int a = alpha; - - this.c = new Color(r, g, b, a); - } - - public BufferedImage apply(BufferedImage img) - { - int width = img.getWidth(); - int height = img.getHeight(); - - BufferedImage newImage = new BufferedImageBuilder(width, height).build(); - - Graphics2D g = newImage.createGraphics(); - g.drawImage(img, 0, 0, null); - - g.setColor(c); - g.fillRect(0, 0, width, height); - - g.dispose(); - - return newImage; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Flip.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Flip.java deleted file mode 100644 index 700c8009..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Flip.java +++ /dev/null @@ -1,49 +0,0 @@ -package net.coobird.thumbnailator.filters; - -import java.awt.Graphics; -import java.awt.image.BufferedImage; - -import net.coobird.thumbnailator.builders.BufferedImageBuilder; - -/** - * A class containing flip transformation filters. - * - * @author coobird - * - */ -public class Flip { - - /** - * An image filter which performs a horizontal flip of the image. - */ - public static final ImageFilter HORIZONTAL = img -> { - int width = img.getWidth(); - int height = img.getHeight(); - - BufferedImage newImage = - new BufferedImageBuilder(width, height).build(); - - Graphics g = newImage.getGraphics(); - g.drawImage(img, width, 0, 0, height, 0, 0, width, height, null); - g.dispose(); - - return newImage; - }; - - /** - * An image filter which performs a vertical flip of the image. - */ - public static final ImageFilter VERTICAL = img -> { - int width = img.getWidth(); - int height = img.getHeight(); - - BufferedImage newImage = - new BufferedImageBuilder(width, height).build(); - - Graphics g = newImage.getGraphics(); - g.drawImage(img, 0, height, width, 0, 0, 0, width, height, null); - g.dispose(); - - return newImage; - }; -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/ImageFilter.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/ImageFilter.java deleted file mode 100644 index 8c5ed1e2..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/ImageFilter.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.coobird.thumbnailator.filters; - -import java.awt.image.BufferedImage; - -/** - * This interface is to be implemented by classes which performs an image - * filtering operation on a {@link BufferedImage}. - *

- * The general contract for classes implementing {@link ImageFilter} is that - * they should not change the contents of the {@link BufferedImage} which is - * given as the argument for the {@link #apply(BufferedImage)} method. - *

- * The filter should make a copy of the given {@link BufferedImage}, and - * perform the filtering operations on the copy, then return the copy. - * - * @author coobird - * - */ -public interface ImageFilter -{ - /** - * Applies a image filtering operation on an image. - * - * @param img The image to apply the filtering on. - * @return The resulting image after applying this filter. - */ - public BufferedImage apply(BufferedImage img); -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Pipeline.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Pipeline.java deleted file mode 100644 index 4ffceb67..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Pipeline.java +++ /dev/null @@ -1,144 +0,0 @@ -package net.coobird.thumbnailator.filters; - -import java.awt.image.BufferedImage; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import net.coobird.thumbnailator.util.BufferedImages; - -/** - * An {@link ImageFilter} which will apply multiple {@link ImageFilter}s in a - * specific order. - * - * @author coobird - * - */ -public final class Pipeline implements ImageFilter -{ - /** - * A list of image filters to apply. - */ - private final List filtersToApply; - - /** - * An unmodifiable list of image filters to apply. - * Used by the {@link #getFilters()} method. - * - * This object is created by Collections.unmodifiableList which provides - * an unmodifiable view of the original list. - * - * Therefore, any changes to the original list will also be "visible" from - * this list as well. - */ - private final List unmodifiableFiltersToApply; - - /** - * Instantiates a new {@link Pipeline} with no image filters to apply. - */ - public Pipeline() - { - this(Collections.emptyList()); - } - - /** - * Instantiates a new {@link Pipeline} with an array of {@link ImageFilter}s - * to apply. - * - * @param filters An array of {@link ImageFilter}s to apply. - */ - public Pipeline(ImageFilter... filters) - { - this(Arrays.asList(filters)); - } - - /** - * Instantiates a new {@link Pipeline} with a list of {@link ImageFilter}s - * to apply. - * - * @param filters A list of {@link ImageFilter}s to apply. - */ - public Pipeline(List filters) - { - if (filters == null) - { - throw new NullPointerException("Cannot instantiate with a null" + - "list of image filters."); - } - - filtersToApply = new ArrayList<>(filters); - unmodifiableFiltersToApply = - Collections.unmodifiableList(filtersToApply); - } - - /** - * Adds an {@code ImageFilter} to the pipeline. - */ - public void add(ImageFilter filter) - { - if (filter == null) - { - throw new NullPointerException("An image filter must not be null."); - } - - filtersToApply.add(filter); - } - - /** - * Adds an {@code ImageFilter} to the beginning of the pipeline. - */ - public void addFirst(ImageFilter filter) - { - if (filter == null) - { - throw new NullPointerException("An image filter must not be null."); - } - - filtersToApply.add(0, filter); - } - - /** - * Adds a {@code List} of {@code ImageFilter}s to the pipeline. - * - * @param filters A list of filters to add to the pipeline. - */ - public void addAll(List filters) - { - if (filters == null) - { - throw new NullPointerException("A list of image filters must not be null."); - } - - filtersToApply.addAll(filters); - } - - /** - * Returns a list of {@link ImageFilter}s which will be applied by this - * {@link Pipeline}. - * - * @return A list of filters which are applied by this - * pipeline. - */ - public List getFilters() - { - return unmodifiableFiltersToApply; - } - - public BufferedImage apply(BufferedImage img) - { - if (filtersToApply.isEmpty()) - { - return img; - } - - BufferedImage image = BufferedImages.copy(img); - - for (ImageFilter filter : filtersToApply) - { - image = filter.apply(image); - } - - return image; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Rotation.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Rotation.java deleted file mode 100644 index 292bb127..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Rotation.java +++ /dev/null @@ -1,152 +0,0 @@ -package net.coobird.thumbnailator.filters; - -import java.awt.Graphics2D; -import java.awt.RenderingHints; -import java.awt.image.BufferedImage; - -import net.coobird.thumbnailator.builders.BufferedImageBuilder; - -/** - * A class containing rotation filters. - *

- * Aside from the three {@link Rotator}s provided as class constants, a - * {@link Rotator} which performs a rotation by an arbituary angle can be - * obtained through the {@link Rotation#newRotator(double)} method. - * - * @author coobird - * - */ -public class Rotation -{ - /** - * This class is not intended to be instantiated. - */ - private Rotation() {} - - /** - * An {@link ImageFilter} which applies a rotation to an image. - *

- * An instance of a {@link Rotator} can be obtained through the - * {@link Rotation#newRotator(double)} method. - * - * @author coobird - * - */ - public abstract static class Rotator implements ImageFilter - { - /** - * This class is not intended to be instantiated. - */ - private Rotator() {} - } - - /** - * Creates a new instance of {@code Rotator} which rotates an image at - * the specified angle. - *

- * When the {@link Rotator} returned by this method is applied, the image - * will be rotated clockwise by the specified angle. - * - * @param angle The angle at which the instance of {@code Rotator} - * is to rotate a image it acts upon. - * @return An instance of {@code Rotator} which will rotate - * a given image. - */ - public static Rotator newRotator(final double angle) - { - Rotator r = new Rotator() { - - private double[] calculatePosition(double x, double y, double angle) - { - angle = Math.toRadians(angle); - - double nx = (Math.cos(angle) * x) - (Math.sin(angle) * y); - double ny = (Math.sin(angle) * x) + (Math.cos(angle) * y); - - return new double[] {nx, ny}; - } - - public BufferedImage apply(BufferedImage img) - { - int width = img.getWidth(); - int height = img.getHeight(); - - BufferedImage newImage; - - double[][] newPositions = new double[4][]; - newPositions[0] = calculatePosition(0, 0, angle); - newPositions[1] = calculatePosition(width, 0, angle); - newPositions[2] = calculatePosition(0, height, angle); - newPositions[3] = calculatePosition(width, height, angle); - - double minX = Math.min( - Math.min(newPositions[0][0], newPositions[1][0]), - Math.min(newPositions[2][0], newPositions[3][0]) - ); - double maxX = Math.max( - Math.max(newPositions[0][0], newPositions[1][0]), - Math.max(newPositions[2][0], newPositions[3][0]) - ); - double minY = Math.min( - Math.min(newPositions[0][1], newPositions[1][1]), - Math.min(newPositions[2][1], newPositions[3][1]) - ); - double maxY = Math.max( - Math.max(newPositions[0][1], newPositions[1][1]), - Math.max(newPositions[2][1], newPositions[3][1]) - ); - - int newWidth = (int)Math.round(maxX - minX); - int newHeight = (int)Math.round(maxY - minY); - newImage = new BufferedImageBuilder(newWidth, newHeight).build(); - - Graphics2D g = newImage.createGraphics(); - - /* - * TODO consider RenderingHints to use. - * The following are hints which have been chosen to give - * decent image quality. In the future, there may be a need - * to have a way to change these settings. - */ - g.setRenderingHint( - RenderingHints.KEY_INTERPOLATION, - RenderingHints.VALUE_INTERPOLATION_BILINEAR - ); - g.setRenderingHint( - RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_ON - ); - - double w = newWidth / 2.0; - double h = newHeight / 2.0; - g.rotate(Math.toRadians(angle), w, h); - int centerX = (int)Math.round((newWidth - width) / 2.0); - int centerY = (int)Math.round((newHeight - height) / 2.0); - - g.drawImage(img, centerX, centerY, null); - g.dispose(); - - return newImage; - } - }; - - return r; - } - - /** - * A {@code Rotator} which will rotate a specified image to the left 90 - * degrees. - */ - public static final Rotator LEFT_90_DEGREES = newRotator(-90); - - /** - * A {@code Rotator} which will rotate a specified image to the right 90 - * degrees. - */ - public static final Rotator RIGHT_90_DEGREES = newRotator(90); - - /** - * A {@code Rotator} which will rotate a specified image to the 180 degrees. - */ - public static final Rotator ROTATE_180_DEGREES = newRotator(180); -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Transparency.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Transparency.java deleted file mode 100644 index 3d48553d..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Transparency.java +++ /dev/null @@ -1,88 +0,0 @@ -package net.coobird.thumbnailator.filters; - -import java.awt.AlphaComposite; -import java.awt.Graphics2D; -import java.awt.image.BufferedImage; - -/** - * An image filter which will make an image transparent. - *

- * The resulting image will always have an image type of - * {@link BufferedImage#TYPE_INT_ARGB}. - * - * @author coobird - * - */ -public class Transparency implements ImageFilter -{ - /** - * The alpha composite to use when drawing the transparent image. - */ - private final AlphaComposite composite; - - /** - * Instantiates a {@link Transparency} filter with the specified opacity. - * - * @param alpha The opacity of the resulting image. The value should be - * between {@code 0.0f} (transparent) to {@code 1.0f} - * (opaque), inclusive. - * @throws IllegalArgumentException If the specified opacity is outside of - * the range specified above. - */ - public Transparency(float alpha) - { - super(); - - if (alpha < 0.0f || alpha > 1.0f) - { - throw new IllegalArgumentException( - "The alpha must be between 0.0f and 1.0f, inclusive."); - } - - this.composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha); - } - - /** - * Instantiates a {@link Transparency} filter with the specified opacity. - *

- * This is a convenience constructor for the - * {@link Transparency#Transparency(float)} constructor. - * - * @param alpha The opacity of the resulting image. The value should be - * between {@code 0.0f} (transparent) to {@code 1.0f} - * (opaque), inclusive. - * @throws IllegalArgumentException If the specified opacity is outside of - * the range specified above. - */ - public Transparency(double alpha) - { - this((float)alpha); - } - - public BufferedImage apply(BufferedImage img) - { - int width = img.getWidth(); - int height = img.getHeight(); - - BufferedImage finalImage = - new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); - - Graphics2D g = finalImage.createGraphics(); - g.setComposite(composite); - g.drawImage(img, 0, 0, null); - g.dispose(); - - return finalImage; - } - - /** - * Returns the opacity of this filter. - * - * @return The opacity in the range of {@code 0.0f} (transparent) to - * {@code 1.0f} (opaque). - */ - public float getAlpha() - { - return composite.getAlpha(); - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Watermark.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Watermark.java deleted file mode 100644 index 4c83d4d4..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/Watermark.java +++ /dev/null @@ -1,102 +0,0 @@ -package net.coobird.thumbnailator.filters; - -import java.awt.AlphaComposite; -import java.awt.Graphics2D; -import java.awt.Point; -import java.awt.image.BufferedImage; - -import net.coobird.thumbnailator.builders.BufferedImageBuilder; -import net.coobird.thumbnailator.geometry.Position; - -/** - * This class applies a watermark to an image. - * - * @author coobird - * - */ -public class Watermark implements ImageFilter -{ - /** - * The position of the watermark. - */ - private final Position position; - - /** - * The watermark image. - */ - private final BufferedImage watermarkImg; - - /** - * The opacity of the watermark. - */ - private final float opacity; - - - /** - * Instantiates a filter which applies a watermark to an image. - * - * @param position The position of the watermark. - * @param watermarkImg The watermark image. - * @param opacity The opacity of the watermark. - *

- * The value should be between {@code 0.0f} and - * {@code 1.0f}, where {@code 0.0f} is completely - * transparent, and {@code 1.0f} is completely - * opaque. - */ - public Watermark(Position position, BufferedImage watermarkImg, - float opacity) - { - if (position == null) - { - throw new NullPointerException("Position is null."); - } - if (watermarkImg == null) - { - throw new NullPointerException("Watermark image is null."); - } - if (opacity > 1.0f || opacity < 0.0f) - { - throw new IllegalArgumentException("Opacity is out of range of " + - "between 0.0f and 1.0f."); - } - - this.position = position; - this.watermarkImg = watermarkImg; - this.opacity = opacity; - } - - public BufferedImage apply(BufferedImage img) - { - int width = img.getWidth(); - int height = img.getHeight(); - int type = img.getType(); - - BufferedImage imgWithWatermark = - new BufferedImageBuilder(width, height, type).build(); - - int watermarkWidth = watermarkImg.getWidth(); - int watermarkHeight = watermarkImg.getHeight(); - - Point p = position.calculate( - width, height, watermarkWidth, watermarkHeight, - 0, 0, 0, 0 - ); - - Graphics2D g = imgWithWatermark.createGraphics(); - - // Draw the actual image. - g.drawImage(img, 0, 0, null); - - // Draw the watermark on top. - g.setComposite( - AlphaComposite.getInstance(AlphaComposite.SRC_OVER, opacity) - ); - - g.drawImage(watermarkImg, p.x, p.y, null); - - g.dispose(); - - return imgWithWatermark; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/package-info.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/package-info.java deleted file mode 100644 index 55c77b57..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/filters/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This package provides classes which perform filtering operations on images, - * such as adding watermark, text captions, and color tints. - */ -package net.coobird.thumbnailator.filters; diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/AbsoluteSize.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/AbsoluteSize.java deleted file mode 100644 index 571bae5a..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/AbsoluteSize.java +++ /dev/null @@ -1,75 +0,0 @@ -package net.coobird.thumbnailator.geometry; - -import java.awt.Dimension; - -/** - * A {@link Size} object which indicates that the size of the enclosed object - * should be the specified absolute size. - * - * @author coobird - * @since 0.3.4 - * - */ -public class AbsoluteSize implements Size -{ - /** - * The size of the object. - */ - private final Dimension size; - - /** - * Instantiates an object which indicates size of an object. - * - * @param size Size of the enclosed object. - * @throws NullPointerException If the size is {@code null}. - */ - public AbsoluteSize(Dimension size) - { - if (size == null) - { - throw new NullPointerException("Size cannot be null."); - } - this.size = new Dimension(size); - } - - /** - * Instantiates an object which indicates size of an object. - * - * @param width Width of the enclosed object. - * @param height Height of the enclosed object. - * @throws IllegalArgumentException If the width and/or height is less - * than or equal to {@code 0}. - */ - public AbsoluteSize(int width, int height) - { - if (width <= 0 || height <= 0) - { - throw new IllegalArgumentException( - "Width and height must be greater than 0." - ); - } - this.size = new Dimension(width, height); - } - - public Dimension calculate(int width, int height) - { - if (width <= 0 || height <= 0) - { - throw new IllegalArgumentException( - "Width and height must be greater than 0." - ); - } - return new Dimension(size); - } - - /** - * Returns a {@code String} representation of this object. - * - * @return {@code String} representation of this object. - */ - @Override - public String toString() - { - return "AbsoluteSize [width=" + size.width + ", height=" + size.height + "]"; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Coordinate.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Coordinate.java deleted file mode 100644 index 2b6c80d6..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Coordinate.java +++ /dev/null @@ -1,48 +0,0 @@ -package net.coobird.thumbnailator.geometry; - -import java.awt.Point; - -/** - * This class calculates the position of an image which is to be enclosed, - * using an absolute coordinate at which the image should be located. - * - * @author coobird - * - */ -public final class Coordinate implements Position -{ - /** - * The horizontal position of the image to be enclosed. - */ - private final int x; - - /** - * The vertical position of the image to be enclosed. - */ - private final int y; - - /** - * Instantiates an object which calculates the position of an image, using - * the given coordinates. - * - * @param x The horizontal component of the top-left corner of the - * image to be enclosed. - * @param y The vertical component of the top-left corner of the - * image to be enclosed. - */ - public Coordinate(int x, int y) - { - this.x = x; - this.y = y; - } - - public Point calculate(int enclosingWidth, int enclosingHeight, int width, - int height, int insetLeft, int insetRight, int insetTop, - int insetBottom) - { - int x = this.x + insetLeft; - int y = this.y + insetTop; - - return new Point(x, y); - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Position.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Position.java deleted file mode 100644 index ab53819e..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Position.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.coobird.thumbnailator.geometry; - -import java.awt.Point; - -/** - * This interface is implemented by classes which calculate how to position an - * object inside of an enclosing object. - * - * @author coobird - * - */ -public interface Position -{ - /** - * Calculates the position of an object enclosed by an enclosing object. - * - * @param enclosingWidth The width of the enclosing object that is - * to contain the enclosed object. - * @param enclosingHeight The height of the enclosing object that is - * to contain the enclosed object. - * @param width The width of the object that is to be - * placed inside an enclosing object. - * @param height The height of the object that is to be - * placed inside an enclosing object. - * @param insetLeft The inset on the left-hand side of the - * object to be enclosed. - * @param insetRight The inset on the right-hand side of the - * object to be enclosed. - * @param insetTop The inset on the top side of the - * object to be enclosed. - * @param insetBottom The inset on the bottom side of the - * object to be enclosed. - * @return The position to place the object. - */ - public Point calculate( - int enclosingWidth, int enclosingHeight, int width, int height, - int insetLeft, int insetRight, int insetTop, int insetBottom - ); -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Positions.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Positions.java deleted file mode 100644 index 67f3f004..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Positions.java +++ /dev/null @@ -1,172 +0,0 @@ -package net.coobird.thumbnailator.geometry; - -import java.awt.Point; - -import net.coobird.thumbnailator.filters.Caption; -import net.coobird.thumbnailator.filters.ImageFilter; -import net.coobird.thumbnailator.filters.Watermark; - -/** - * An enum of predefined {@link Position}s. - *

- * Primary use of this enum is for selecting a position to place watermarks - * (using the {@link Watermark} class), captions (using the {@link Caption} - * class) and other {@link ImageFilter}s. - * - * @author coobird - * - */ -public enum Positions implements Position -{ - /** - * Calculates the {@link Point} at which an enclosed image should be placed - * if it is to be placed at the top left-hand corner of the enclosing - * image. - */ - TOP_LEFT() - { - public Point calculate(int enclosingWidth, int enclosingHeight, - int width, int height, int insetLeft, int insetRight, - int insetTop, int insetBottom) - { - int x = insetLeft; - int y = insetTop; - return new Point(x, y); - } - }, - - /** - * Calculates the {@link Point} at which an enclosed image should be placed - * if it is to be horizontally centered at the top of the enclosing image. - */ - TOP_CENTER() - { - public Point calculate(int enclosingWidth, int enclosingHeight, - int width, int height, int insetLeft, int insetRight, - int insetTop, int insetBottom) - { - int x = (enclosingWidth / 2) - (width / 2); - int y = insetTop; - return new Point(x, y); - } - }, - - /** - * Calculates the {@link Point} at which an enclosed image should be placed - * if it is to be placed at the top right-hand corner of the enclosing - * image. - */ - TOP_RIGHT() - { - public Point calculate(int enclosingWidth, int enclosingHeight, - int width, int height, int insetLeft, int insetRight, - int insetTop, int insetBottom) - { - int x = enclosingWidth - width - insetRight; - int y = insetTop; - return new Point(x, y); - } - }, - - /** - * Calculates the {@link Point} at which an enclosed image should be placed - * if it is to be placed vertically centered at the left-hand corner of - * the enclosing image. - */ - CENTER_LEFT() - { - public Point calculate(int enclosingWidth, int enclosingHeight, - int width, int height, int insetLeft, int insetRight, - int insetTop, int insetBottom) - { - int x = insetLeft; - int y = (enclosingHeight / 2) - (height / 2); - return new Point(x, y); - } - }, - - /** - * Calculates the {@link Point} at which an enclosed image should be placed - * horizontally and vertically centered in the enclosing image. - */ - CENTER() - { - public Point calculate(int enclosingWidth, int enclosingHeight, - int width, int height, int insetLeft, int insetRight, - int insetTop, int insetBottom) - { - int x = (enclosingWidth / 2) - (width / 2); - int y = (enclosingHeight / 2) - (height / 2); - return new Point(x, y); - } - }, - - /** - * Calculates the {@link Point} at which an enclosed image should be placed - * if it is to be placed vertically centered at the right-hand corner of - * the enclosing image. - */ - CENTER_RIGHT() - { - public Point calculate(int enclosingWidth, int enclosingHeight, - int width, int height, int insetLeft, int insetRight, - int insetTop, int insetBottom) - { - int x = enclosingWidth - width - insetRight; - int y = (enclosingHeight / 2) - (height / 2); - return new Point(x, y); - } - }, - - /** - * Calculates the {@link Point} at which an enclosed image should be placed - * if it is to be placed at the bottom left-hand corner of the enclosing - * image. - */ - BOTTOM_LEFT() - { - public Point calculate(int enclosingWidth, int enclosingHeight, - int width, int height, int insetLeft, int insetRight, - int insetTop, int insetBottom) - { - int x = insetLeft; - int y = enclosingHeight - height - insetBottom; - return new Point(x, y); - } - }, - - /** - * Calculates the {@link Point} at which an enclosed image should be placed - * if it is to be horizontally centered at the bottom of the enclosing - * image. - */ - BOTTOM_CENTER() - { - public Point calculate(int enclosingWidth, int enclosingHeight, - int width, int height, int insetLeft, int insetRight, - int insetTop, int insetBottom) - { - int x = (enclosingWidth / 2) - (width / 2); - int y = enclosingHeight - height - insetBottom; - return new Point(x, y); - } - }, - - /** - * Calculates the {@link Point} at which an enclosed image should be placed - * if it is to be placed at the bottom right-hand corner of the enclosing - * image. - */ - BOTTOM_RIGHT() - { - public Point calculate(int enclosingWidth, int enclosingHeight, - int width, int height, int insetLeft, int insetRight, - int insetTop, int insetBottom) - { - int x = enclosingWidth - width - insetRight; - int y = enclosingHeight - height - insetBottom; - return new Point(x, y); - } - }, - ; -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Region.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Region.java deleted file mode 100644 index 98bd823e..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Region.java +++ /dev/null @@ -1,108 +0,0 @@ -package net.coobird.thumbnailator.geometry; - -import java.awt.Dimension; -import java.awt.Point; -import java.awt.Rectangle; - -/** - * A representation of a region, using a {@link Position} object and a - * {@link Dimension} object. - * - * @author coobird - * @since 0.3.4 - * - */ -public final class Region -{ - /** - * Position of the region. - */ - private final Position position; - - /** - * Size of the region. - */ - private final Size size; - - /** - * Instantiates a representation of a region from a {@link Position} and - * {@link Size}. - * - * @param position Position of the region. - * @param size Size of the region. - * @throws NullPointerException When the position and/or the size is - * {@code null}. - */ - public Region(Position position, Size size) - { - super(); - if (position == null) - { - throw new NullPointerException("Position cannot be null."); - } - if (size == null) - { - throw new NullPointerException("Size cannot be null."); - } - - this.position = position; - this.size = size; - } - - /** - * Returns the position of the region. - * - * @return Position of the region. - */ - public Position getPosition() - { - return position; - } - - /** - * Returns the size of the region. - * - * @return Size of the region. - */ - public Size getSize() - { - return size; - } - - /** - * Calculates the position and size of the enclosed region, relative to the - * enclosing region. - *

- * The portions of the enclosed region which lies outside of the enclosing - * region are ignored. Effectively, the {@link Rectangle} returned by this - * method is a intersection of the enclosing and enclose regions. - * - * @param width Width of the enclosing region. - * @param height Height of the enclosing region. - * @return Position and size of the enclosed region. - */ - public Rectangle calculate(int width, int height) - { - Dimension d = size.calculate(width, height); - - Point p = position.calculate( - width, height, d.width, d.height, 0, 0, 0, 0 - ); - - Rectangle outerRectangle = new Rectangle(0, 0, width, height); - Rectangle innerRectangle = new Rectangle(p, d); - - return outerRectangle.intersection(innerRectangle); - } - - /** - * Returns a {@code String} representation of this region. - * - * @return {@code String} representation of this region. - */ - @Override - public String toString() - { - return "Region [position=" + position + ", size=" + size + "]"; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/RelativeSize.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/RelativeSize.java deleted file mode 100644 index d30c9e0b..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/RelativeSize.java +++ /dev/null @@ -1,64 +0,0 @@ -package net.coobird.thumbnailator.geometry; - -import java.awt.Dimension; - -/** - * Calculates the size of an enclosed object relative to the enclosing object. - * - * @author coobird - * @since 0.3.4 - * - */ -public class RelativeSize implements Size -{ - /** - * The scaling factor to use for the enclosed object. - */ - private final double scalingFactor; - - /** - * Instantiates an object which calculates the size of an object, using - * the given scaling factor. - * - * @param scalingFactor The scaling factor to use to determine the - * size of the enclosing object. - * @throws IllegalArgumentException When the scaling factor is not within - * the range of {@code 0.0d} and - * {@code 1.0d}, inclusive. - */ - public RelativeSize(double scalingFactor) - { - super(); - if (scalingFactor < 0.0d || scalingFactor > 1.0d) - { - throw new IllegalArgumentException( - "The scaling factor must be between 0.0d and 1.0d, inclusive." - ); - } - this.scalingFactor = scalingFactor; - } - - public Dimension calculate(int width, int height) - { - if (width <= 0 || height <= 0) - { - throw new IllegalArgumentException( - "Width and height must be greater than 0." - ); - } - int newWidth = (int)Math.round(width * scalingFactor); - int newHeight = (int)Math.round(height * scalingFactor); - return new Dimension(newWidth, newHeight); - } - - /** - * Returns a {@code String} representation of this object. - * - * @return {@code String} representation of this object. - */ - @Override - public String toString() - { - return "RelativeSize [scalingFactor=" + scalingFactor + "]"; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Size.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Size.java deleted file mode 100644 index ffad163a..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/Size.java +++ /dev/null @@ -1,27 +0,0 @@ -package net.coobird.thumbnailator.geometry; - -import java.awt.Dimension; - -/** - * This interface is implemented by classes which calculate the size of an - * object inside of an enclosing object. - * - * @author coobird - * @since 0.3.4 - * - */ -public interface Size -{ - /** - * Calculates the size of the object. - * - * @param width Width of the object which encloses the object - * for which the size should be determined. - * @param height Height of the object which encloses the object - * for which the size should be determined. - * @return Calculated size of the object. - * @throws IllegalArgumentException If the width and/or height is less than - * or equal to {@code 0}. - */ - public Dimension calculate(int width, int height); -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/package-info.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/package-info.java deleted file mode 100644 index 90a389b5..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/geometry/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This package contains classes used to specify positioning of watermarks and - * other objects in Thumbnailator. - */ -package net.coobird.thumbnailator.geometry; diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/makers/FixedSizeThumbnailMaker.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/makers/FixedSizeThumbnailMaker.java deleted file mode 100644 index 42876bf9..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/makers/FixedSizeThumbnailMaker.java +++ /dev/null @@ -1,303 +0,0 @@ -package net.coobird.thumbnailator.makers; - -import java.awt.image.BufferedImage; - -/** - * A {@link ThumbnailMaker} which resizes an image to a specified dimension - * when producing a thumbnail. - *

- * Optionally, if the aspect ratio of the thumbnail is to be maintained the same - * as the original image (by calling the {@link #keepAspectRatio(boolean)} - * method with the value {@code true}), then the dimensions specified by the - * {@link #size(int, int)} method, {@link #FixedSizeThumbnailMaker(int, int)} or - * {@link #FixedSizeThumbnailMaker(int, int, boolean)} constructor will be used - * as the maximum constraint of dimensions of the thumbnail. - *

- * In other words, when the aspect ratio is to be kept constant, then - * thumbnails which are created will be sized to fit inside the dimensions - * specified by the size parameter. - *

- * Upon calculating the size of the thumbnail, if any of the dimensions are - * {@code 0}, then that dimension will be promoted to {@code 1}, regardless of - * whether the aspect ratio of the original image is to be maintained. This will - * lead to some thumbnails not preserving the aspect ratio of the original - * image, even if {@link #keepAspectRatio(boolean)} has been {@code true}. - *

- *

- *
Usage:
- *
- * The following example demonstrates how to create a thumbnail which fits - * within 200 pixels by 200 pixels, while preserving the aspect ratio of the - * source image: - *
-BufferedImage img = ImageIO.read(new File("sourceImage.jpg"));
-
-BufferedImage thumbnail = new FixedSizeThumbnailMaker()
-        .size(200, 200)
-        .keepAspectRatio(true)
-        .make(img);
- * 
- *
- *
- * - * @author coobird - * - */ -public final class FixedSizeThumbnailMaker extends ThumbnailMaker -{ - private static final String PARAM_SIZE = "size"; - private static final String PARAM_KEEP_RATIO = "keepRatio"; - private static final String PARAM_FIT_WITHIN = "fitWithinDimensions"; - - private int width; - private int height; - private boolean keepRatio; - private boolean fitWithinDimensions; - - /** - * Creates a {@link FixedSizeThumbnailMaker}. - *

- * The size of the resulting thumbnail, and whether or not the aspect ratio - * of the original image should be maintained in the thumbnail must be - * set before this instance is able to produce thumbnails. - */ - public FixedSizeThumbnailMaker() - { - super(); - ready.unset(PARAM_SIZE); - ready.unset(PARAM_KEEP_RATIO); - ready.unset(PARAM_FIT_WITHIN); - } - - /** - * Creates a {@link FixedSizeThumbnailMaker} which creates thumbnails - * with the specified size. - *

- * Before this instance is able to produce thumbnails, whether or not the - * aspect ratio of the original image should be maintained in the thumbnail - * must be specified by calling the {@link #keepAspectRatio(boolean)} - * method. - * - * @param width The width of the thumbnail to produce. - * @param height The height of the thumbnails to produce. - */ - public FixedSizeThumbnailMaker(int width, int height) - { - this(); - size(width, height); - } - - /** - * Creates a {@link FixedSizeThumbnailMaker} which creates thumbnails - * with the specified size. Whether or not the aspect ratio of the original - * image should be preserved by the thumbnail is also specified at - * instantiation. - * - * @param width The width of the thumbnail to produce. - * @param height The height of the thumbnails to produce. - * @param aspectRatio Whether or not to maintain the aspect ratio in the - * thumbnail the same as the original image. - *

- * If {@code true} is specified, then the - * thumbnail image will have the same aspect ratio - * as the original image. - */ - public FixedSizeThumbnailMaker(int width, int height, boolean aspectRatio) - { - this(); - size(width, height); - keepAspectRatio(aspectRatio); - } - - /** - * Creates a {@link FixedSizeThumbnailMaker} which creates thumbnails - * with the specified size. Whether or not the aspect ratio of the original - * image should be preserved by the thumbnail, and whether to fit the - * thumbnail within the given dimensions is also specified at - * instantiation. - * - * @param width The width of the thumbnail to produce. - * @param height The height of the thumbnails to produce. - * @param aspectRatio Whether or not to maintain the aspect ratio in the - * thumbnail the same as the original image. - *

- * If {@code true} is specified, then the - * thumbnail image will have the same aspect ratio - * as the original image. - * @param fit Whether or not to fit the thumbnail within the - * specified dimensions. - *

- * If {@code true} is specified, then the thumbnail - * will be sized to fit within the specified - * {@code width} and {@code height}. - */ - public FixedSizeThumbnailMaker(int width, int height, boolean aspectRatio, boolean fit) - { - this(); - size(width, height); - keepAspectRatio(aspectRatio); - fitWithinDimensions(fit); - } - - /** - * Sets the size of the thumbnail to produce. - * - * @param width The width of the thumbnail to produce. - * @param height The height of the thumbnails to produce. - * @return A reference to this object. - * @throws IllegalStateException If the size has already - * been previously set, or if the - * {@code width} or {@code height} is less - * than or equal to zero. - */ - public FixedSizeThumbnailMaker size(int width, int height) - { - if (ready.isSet(PARAM_SIZE)) - { - throw new IllegalStateException( - "The size has already been set." - ); - } - - if (width <= 0) - { - throw new IllegalArgumentException( - "Width must be greater than zero." - ); - } - if (height <= 0) - { - throw new IllegalArgumentException( - "Height must be greater than zero." - ); - } - - this.width = width; - this.height = height; - - ready.set(PARAM_SIZE); - return this; - } - - /** - * Sets whether or not the thumbnail is to maintain the aspect ratio of - * the original image. - * - * @param keep Whether or not to maintain the aspect ratio in the - * thumbnail the same as the original image. - *

- * If {@code true} is specified, then the - * thumbnail image will have the same aspect ratio - * as the original image. - * @return A reference to this object. - * @throws IllegalStateException If whether to keep the aspect ratio has - * already been previously set. - */ - public FixedSizeThumbnailMaker keepAspectRatio(boolean keep) - { - if (ready.isSet(PARAM_KEEP_RATIO)) - { - throw new IllegalStateException( - "Whether to keep the aspect ratio has already been set." - ); - } - this.keepRatio = keep; - - ready.set(PARAM_KEEP_RATIO); - return this; - } - - /** - * Sets whether or not the thumbnail should fit within the specified - * dimensions. - *

- * When the dimensions of a thumbnail will exceed the specified dimensions, - * with the aspect ratio of the original being preserved, then if this - * method was called with {@code false}, then the resulting thumbnail will - * have the larger dimension align with the specified dimension, and the - * other will exceed the given dimension. - *

- * When {@link #keepAspectRatio(boolean)} is {@code false}, then calling - * this method with {@code true} or {@code false} makes no difference, as - * the thumbnail dimensions will be exactly the given dimensions. - * - * @param fit Whether or not to maintain the aspect ratio in the - * thumbnail the same as the original image. - *

- * If {@code true} is specified, then the - * thumbnail image will have the same aspect ratio - * as the original image. - * @return A reference to this object. - * @throws IllegalStateException If whether to keep the aspect ratio has - * already been previously set. - * @since 0.4.0 - */ - public FixedSizeThumbnailMaker fitWithinDimensions(boolean fit) - { - if (ready.isSet(PARAM_FIT_WITHIN)) - { - throw new IllegalStateException( - "Whether to fit within dimensions has already been set." - ); - } - this.fitWithinDimensions = fit; - - ready.set(PARAM_FIT_WITHIN); - return this; - } - - @Override - public BufferedImage make(BufferedImage img) - { - int targetWidth = this.width; - int targetHeight = this.height; - - if (keepRatio) - { - int sourceWidth = img.getWidth(); - int sourceHeight = img.getHeight(); - - double sourceRatio = (double)sourceWidth / (double)sourceHeight; - double targetRatio = (double)targetWidth / (double)targetHeight; - - /* - * If the ratios are not the same, then the appropriate - * width and height must be picked. - */ - if (Double.compare(sourceRatio, targetRatio) != 0) - { - if (fitWithinDimensions) - { - if (sourceRatio > targetRatio) - { - targetWidth = width; - targetHeight = (int)Math.round(targetWidth / sourceRatio); - } - else - { - targetWidth = (int)Math.round(targetHeight * sourceRatio); - targetHeight = height; - } - } - else - { - if (sourceRatio > targetRatio) - { - targetWidth = (int)Math.round(targetHeight * sourceRatio); - targetHeight = height; - } - else - { - targetWidth = width; - targetHeight = (int)Math.round(targetWidth / sourceRatio); - } - } - } - } - - targetWidth = (targetWidth == 0) ? 1 : targetWidth; - targetHeight = (targetHeight == 0) ? 1 : targetHeight; - - return super.makeThumbnail(img, targetWidth, targetHeight); - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/makers/ScaledThumbnailMaker.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/makers/ScaledThumbnailMaker.java deleted file mode 100644 index f90ed76e..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/makers/ScaledThumbnailMaker.java +++ /dev/null @@ -1,176 +0,0 @@ -package net.coobird.thumbnailator.makers; - -import java.awt.image.BufferedImage; - -/** - * A {@link ThumbnailMaker} which scales an image by a specified scaling factor - * when producing a thumbnail. - *

- * Upon calculating the size of the thumbnail, if any of the dimensions are - * {@code 0}, then that dimension will be promoted to {@code 1}. This will - * cause some resizing operations to not preserve the aspect ratio of the - * original image. - *

- *

- *
Usage:
- *
- * The following example demonstrates how to create a thumbnail which is 25% - * the size of the source image: - *
-BufferedImage img = ImageIO.read(new File("sourceImage.jpg"));
-BufferedImage thumbnail = new ScaledThumbnailMaker()
-        .scale(0.25)
-        .make(img);
- * 
- *
- *
- * It is also possible to independently specify the scaling factor for the - * width and height. (If the two scaling factors are not equal then the aspect - * ratio of the original image will not be preserved.) - *

- *

- *
Usage:
- *
- * The following example demonstrates how to create a thumbnail which is scaled - * 50% in the width and 75% in the height: - *
-BufferedImage img = ImageIO.read(new File("sourceImage.jpg"));
-BufferedImage thumbnail = new ScaledThumbnailMaker()
-        .scale(0.50, 0.75)
-        .make(img);
- * 
- *
- *
- *
- * - * @author coobird - * - */ -public final class ScaledThumbnailMaker extends ThumbnailMaker -{ - private static final String PARAM_SCALE = "scale"; - - /** - * The scaling factor to apply to the width when resizing an image to - * create a thumbnail. - */ - private double widthFactor; - - /** - * The scaling factor to apply to the height when resizing an image to - * create a thumbnail. - */ - private double heightFactor; - - /** - *

- * Creates an instance of {@code ScaledThumbnailMaker} without the - * scaling factor specified. - *

- *

- * To use this {@code ScaledThumbnailMaker}, one must specify the - * scaling factor to use by calling the {@link #scale(double)} method - * before generating a thumbnail. - *

- */ - public ScaledThumbnailMaker() - { - super(); - ready.unset(PARAM_SCALE); - } - - /** - * Creates an instance of {@code ScaledThumbnailMaker} with the specified - * scaling factor. - * - * @param factor The scaling factor to apply when resizing an - * image to create a thumbnail. - */ - public ScaledThumbnailMaker(double factor) - { - this(); - scale(factor); - } - - /** - * Creates an instance of {@code ScaledThumbnailMaker} with the specified - * scaling factors for the width and height. - * - * @param widthFactor The scaling factor to apply to the width when - * resizing an image to create a thumbnail. - * @param heightFactor The scaling factor to apply to the height when - * resizing an image to create a thumbnail. - * @since 0.3.10 - */ - public ScaledThumbnailMaker(double widthFactor, double heightFactor) - { - this(); - scale(widthFactor, heightFactor); - } - - /** - *

- * Sets the scaling factor for the thumbnail. - *

- *

- * The aspect ratio of the resulting image is unaltered from the original. - *

- * - * @param factor The scaling factor to apply when resizing an - * image to create a thumbnail. - * @throws IllegalStateException If the scaling factor has already - * been previously set. - */ - public void scale(double factor) - { - scale(factor, factor); - } - - /** - *

- * Sets the scaling factors for the thumbnail. - *

- * - * @param widthFactor The scaling factor to apply to the width when - * resizing an image to create a thumbnail. - * @param heightFactor The scaling factor to apply to the height when - * resizing an image to create a thumbnail. - * @return A reference to this object. - * @throws IllegalStateException If the scaling factor has already - * been previously set. - * @since 0.3.10 - */ - public ScaledThumbnailMaker scale(double widthFactor, double heightFactor) - { - if (ready.isSet(PARAM_SCALE)) - { - throw new IllegalStateException( - "The scaling factor has already been set." - ); - } - - if (widthFactor <= 0 || heightFactor <= 0) - { - throw new IllegalArgumentException( - "The scaling factor must be greater than zero." - ); - } - - this.widthFactor = widthFactor; - this.heightFactor = heightFactor; - ready.set(PARAM_SCALE); - return this; - } - - @Override - public BufferedImage make(BufferedImage img) - { - int width = (int)Math.round(img.getWidth() * widthFactor); - int height = (int)Math.round(img.getHeight() * heightFactor); - - width = (width == 0) ? 1 : width; - height = (height == 0) ? 1 : height; - - return super.makeThumbnail(img, width, height); - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/makers/ThumbnailMaker.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/makers/ThumbnailMaker.java deleted file mode 100644 index c7d10977..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/makers/ThumbnailMaker.java +++ /dev/null @@ -1,294 +0,0 @@ -package net.coobird.thumbnailator.makers; - -import java.awt.Dimension; -import java.awt.image.BufferedImage; -import java.util.HashMap; -import java.util.Map; - -import net.coobird.thumbnailator.builders.BufferedImageBuilder; -import net.coobird.thumbnailator.resizers.FixedResizerFactory; -import net.coobird.thumbnailator.resizers.Resizer; -import net.coobird.thumbnailator.resizers.DefaultResizerFactory; -import net.coobird.thumbnailator.resizers.ResizerFactory; - -/** - * An abstract class which provides support functionalities for - * {@link ThumbnailMaker} implementations. - * - * @author coobird - * - */ -public abstract class ThumbnailMaker -{ - /** - * String used for an exception message. - */ - private static final String NOT_READY_FOR_MAKE = "Maker not ready to " + - "make thumbnail."; - - /** - * Used when determining whether the "imageType" parameter has been set - * already or not. - */ - private static final String PARAM_IMAGE_TYPE = "imageType"; - - - /** - * Used when determining whether the "resizer" parameter has been set - * already or not. - */ - private static final String PARAM_RESIZER = "resizer"; - - /** - * Used when determining whether the "resizerFactory" parameter has been set - * already or not. - */ - private static final String PARAM_RESIZERFACTORY = "resizerFactory"; - - /** - * Class which keeps track of the parameters being set for the - * {@link ThumbnailMaker}. - *

- * This class provides functionality to determine whether or not all the - * required parameters have been set or not. - * - * @author coobird - * - */ - protected final static class ReadinessTracker - { - private final Map alreadySetMap = - new HashMap<>(); - - /** - * Returns whether or not the {@link ThumbnailMaker} has all its - * required parameter set to be able to make a thumbnail. - * - * @return {@code true} if the {@link ThumbnailMaker} is ready - * to make thumbnails, {@code false} otherwise. - */ - protected boolean isReady() - { - for (Map.Entry entry : alreadySetMap.entrySet()) - { - if (!entry.getValue()) - { - return false; - } - } - return true; - } - - /** - * Tells the {@link ReadinessTracker} that the given parameter has not - * yet been set by the {@link ThumbnailMaker}. - * - * @param parameterName The parameter which has not been set. - */ - protected void unset(String parameterName) - { - alreadySetMap.put(parameterName, false); - } - - /** - * Tells the {@link ReadinessTracker} that the given parameter has been - * set by the {@link ThumbnailMaker}. - * - * @param parameterName The parameter to be marked as being set. - */ - protected void set(String parameterName) - { - alreadySetMap.put(parameterName, true); - } - - /** - * Returns whether the specified parameter has already been set. - * - * @param parameterName The parameter to check whether it has been - * already set or not - * @return {@code true} if the parameter has been set, - * {@code false} otherwise. - */ - protected boolean isSet(String parameterName) - { - return alreadySetMap.get(parameterName); - } - } - - /** - * Object used to keep track whether the required parameters for creating - * a thumbnail has been set. - */ - protected final ReadinessTracker ready; - - /** - * Default image type of the thumbnails created by {@link ThumbnailMaker}. - */ - private static final int DEFAULT_IMAGE_TYPE = BufferedImage.TYPE_INT_ARGB; - - /** - * The image type of the resulting thumbnail. - */ - protected int imageType; - - /** - * The {@link ResizerFactory} which is used to obtain a {@link Resizer} - * for the resizing operation. - *

- * By delaying the decision of picking the {@link Resizer} to use until - * when the thumbnail is to be created could lead to a more suitable - * {@link Resizer} being picked, as the dimensions for the source and - * destination images are known at that time. - */ - protected ResizerFactory resizerFactory; - - /** - * Creates and initializes an instance of {@link ThumbnailMaker}. - */ - public ThumbnailMaker() - { - ready = new ReadinessTracker(); - ready.unset(PARAM_IMAGE_TYPE); - ready.unset(PARAM_RESIZER); - ready.unset(PARAM_RESIZERFACTORY); - defaultImageType(); - defaultResizerFactory(); - } - - /** - * Makes a thumbnail. - * - * @param img The source image. - * @return The thumbnail created from the source image, using the - * parameters set by the {@link ThumbnailMaker}. - */ - public abstract BufferedImage make(BufferedImage img); - - /** - * Makes a thumbnail of the specified dimensions, from the specified - * source image. - * - * @param img The source image. - * @param width The target width of the thumbnail. - * @param height The target height of the thumbnail. - * @return The thumbnail image. - * @throws IllegalStateException If the {@code ThumbnailMaker} is - * not ready to create thumbnails. - * @throws IllegalArgumentException If the width and/or height is less - * than or equal to zero. - */ - protected BufferedImage makeThumbnail( - BufferedImage img, - int width, - int height - ) - { - if (!ready.isReady()) - { - throw new IllegalStateException(ThumbnailMaker.NOT_READY_FOR_MAKE); - } - - if (width <= 0) - { - throw new IllegalArgumentException( - "Width must be greater than zero." - ); - } - if (height <= 0) - { - throw new IllegalArgumentException( - "Height must be greater than zero." - ); - } - - BufferedImage thumbnailImage = - new BufferedImageBuilder(width, height, imageType).build(); - - Dimension imgSize = new Dimension(img.getWidth(), img.getHeight()); - Dimension thumbnailSize = new Dimension(width, height); - - Resizer resizer = resizerFactory.getResizer(imgSize, thumbnailSize); - - resizer.resize(img, thumbnailImage); - - return thumbnailImage; - } - - /** - * Sets the type for the {@link BufferedImage} to produce. - * - * @param imageType The type of the {@code BufferedImage}. - * @return A reference to this object. - */ - public ThumbnailMaker imageType(int imageType) - { - this.imageType = imageType; - ready.set(PARAM_IMAGE_TYPE); - return this; - } - - /** - * Sets the type of the {@link BufferedImage} to be the default type. - */ - public void defaultImageType() - { - imageType(DEFAULT_IMAGE_TYPE); - } - - /** - * Sets the {@link Resizer} which is used for the resizing operation. - * - * @param resizer The {@link Resizer} to use when resizing the image - * to create the thumbnail. - * @return A reference to this object. - */ - public ThumbnailMaker resizer(Resizer resizer) - { - this.resizerFactory = new FixedResizerFactory(resizer); - ready.set(PARAM_RESIZER); - ready.set(PARAM_RESIZERFACTORY); - return this; - } - - /** - * Sets the {@link Resizer} to use the default {@link Resizer}. - * - * @return A reference to this object. - */ - public ThumbnailMaker defaultResizer() - { - return defaultResizerFactory(); - } - - /** - * Sets the {@link ResizerFactory} which is used to obtain a {@link Resizer} - * for the resizing operation. - * - * @param resizerFactory The {@link ResizerFactory} to obtain the - * {@link Resizer} used when resizing the image - * to create the thumbnail. - * @return A reference to this object. - * @since 0.4.0 - */ - public ThumbnailMaker resizerFactory(ResizerFactory resizerFactory) - { - this.resizerFactory = resizerFactory; - ready.set(PARAM_RESIZER); - ready.set(PARAM_RESIZERFACTORY); - return this; - } - - /** - * Sets the {@link ResizerFactory} to use {@link DefaultResizerFactory}. - * - * @return A reference to this object. - * @since 0.4.0 - */ - public ThumbnailMaker defaultResizerFactory() - { - this.resizerFactory = DefaultResizerFactory.getInstance(); - ready.set(PARAM_RESIZER); - ready.set(PARAM_RESIZERFACTORY); - return this; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/makers/package-info.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/makers/package-info.java deleted file mode 100644 index 21055d16..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/makers/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This package provides classes which can be used to make thumbnails given - * parameters to create the images. - */ -package net.coobird.thumbnailator.makers; diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/name/ConsecutivelyNumberedFilenames.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/name/ConsecutivelyNumberedFilenames.java deleted file mode 100644 index b7eec0d8..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/name/ConsecutivelyNumberedFilenames.java +++ /dev/null @@ -1,297 +0,0 @@ -package net.coobird.thumbnailator.name; - -import java.io.File; -import java.io.IOException; -import java.util.Formatter; -import java.util.Iterator; - -/** - * This class is used to produce file names based on a given format string - * and an internal counter which increments every time a new file name - * is produced. - * - * @author coobird - * - */ -public class ConsecutivelyNumberedFilenames implements Iterable -{ - /** - * The iterator to return upon the {@link #iterator()} method being called. - */ - private final Iterator iter; - - /** - * Instantiates an {@code ConsecutivelyNumberedFilenames} object which - * returns {@link File}s with file names which are consecutively numbered - * beginning from {@code 0}. - *

- *

File name sequence

- *
    - *
  1. 0
  2. - *
  3. 1
  4. - *
  5. 2
  6. - *
  7. 3
  8. - *
- * and so on. - */ - public ConsecutivelyNumberedFilenames() - { - this.iter = new ConsecutivelyNumberedFilenamesIterator(new File("").getParentFile(), "%d", 0); - } - - /** - * Instantiates an {@code ConsecutivelyNumberedFilenames} object which - * returns {@link File}s with file names which are consecutively numbered - * beginning from the given value. - *

- *

File name sequence

- * For a case where the given value is {@code 5}: - *
    - *
  1. 5
  2. - *
  3. 6
  4. - *
  5. 7
  6. - *
  7. 8
  8. - *
- * and so on. - * - * @param start The value from which to start counting. - */ - public ConsecutivelyNumberedFilenames(int start) - { - this.iter = new ConsecutivelyNumberedFilenamesIterator(new File("").getParentFile(), "%d", start); - } - - /** - * Instantiates an {@code ConsecutivelyNumberedFilenames} object which - * returns {@link File}s with file names which are consecutively numbered - * beginning from {@code 0}, with the directory specified. - *

- *

File name sequence

- * For a case where the parent directory is {@code /foo/bar/}: - *
    - *
  1. /foo/bar/0
  2. - *
  3. /foo/bar/1
  4. - *
  5. /foo/bar/2
  6. - *
  7. /foo/bar/3
  8. - *
- * and so on. - * - * @param dir The directory in which the files are to be located. - * @throws IOException If the specified directory path is not a directory, - * or if does not exist. - */ - public ConsecutivelyNumberedFilenames(File dir) throws IOException - { - checkDirectory(dir); - this.iter = new ConsecutivelyNumberedFilenamesIterator(dir, "%d", 0); - } - - /** - * Instantiates an {@code ConsecutivelyNumberedFilenames} object which - * returns {@link File}s with file names which are based on a format string. - * The numbering will be consecutive from {@code 0}. - *

- * The format string should contain the string {@code %d} which will be - * replaced with a consecutively counted number. Additional formatting - * can be applied. For more details, please refer to the section on - * Numeric formatting in the Java API specification for the - * {@link Formatter} class. - *

- *

File name sequence

- * For a case where the format string is {@code image-%d}: - *
    - *
  1. image-0
  2. - *
  3. image-1
  4. - *
  5. image-2
  6. - *
  7. image-3
  8. - *
- * and so on. - * - * @param format The format string to use. - */ - public ConsecutivelyNumberedFilenames(String format) - { - this.iter = new ConsecutivelyNumberedFilenamesIterator(new File("").getParentFile(), format, 0); - } - - /** - * Instantiates an {@code ConsecutivelyNumberedFilenames} object which - * returns {@link File}s with file names which are consecutively numbered - * beginning from from the given value, with the directory specified. - *

- *

File name sequence

- * For a case where the parent directory is {@code /foo/bar/}, and the - * specified value is {@code 5}: - *
    - *
  1. /foo/bar/5
  2. - *
  3. /foo/bar/6
  4. - *
  5. /foo/bar/7
  6. - *
  7. /foo/bar/8
  8. - *
- * and so on. - * - * @param dir The directory in which the files are to be located. - * @param start The value from which to start counting. - * @throws IOException If the specified directory path is not a directory, - * or if does not exist. - */ - public ConsecutivelyNumberedFilenames(File dir, int start) throws IOException - { - checkDirectory(dir); - this.iter = new ConsecutivelyNumberedFilenamesIterator(dir, "%d", start); - } - - /** - * Instantiates an {@code ConsecutivelyNumberedFilenames} object which - * returns {@link File}s with file names which are based on a format string, - * located in the directory specified. The numbering will be consecutively - * counted from {@code 0}. - *

- * The format string should contain the string {@code %d} which will be - * replaced with a consecutively counted number. Additional formatting - * can be applied. For more details, please refer to the section on - * Numeric formatting in the Java API specification for the - * {@link Formatter} class. - *

- *

File name sequence

- * For a case where the parent directory is {@code /foo/bar/}, - * with the format string {@code image-%d}: - *
    - *
  1. /foo/bar/image-0
  2. - *
  3. /foo/bar/image-1
  4. - *
  5. /foo/bar/image-2
  6. - *
  7. /foo/bar/image-3
  8. - *
- * and so on. - * - * @param dir The directory in which the files are to be located. - * @param format The format string to use. - * @throws IOException If the specified directory path is not a directory, - * or if does not exist. - */ - public ConsecutivelyNumberedFilenames(File dir, String format) throws IOException - { - checkDirectory(dir); - this.iter = new ConsecutivelyNumberedFilenamesIterator(dir, format, 0); - } - - /** - * Instantiates an {@code ConsecutivelyNumberedFilenames} object which - * returns {@link File}s with file names which are based on a format string. - * The numbering will be consecutive from the specified value. - *

- * The format string should contain the string {@code %d} which will be - * replaced with a consecutively counted number. Additional formatting - * can be applied. For more details, please refer to the section on - * Numeric formatting in the Java API specification for the - * {@link Formatter} class. - *

- *

File name sequence

- * For a case where the parent directory is {@code /foo/bar/}, and the - * specified value is {@code 5}, with the format string {@code image-%d}: - *
    - *
  1. image-5
  2. - *
  3. image-6
  4. - *
  5. image-7
  6. - *
  7. image-8
  8. - *
- * and so on. - * - * @param format The format string to use. - * @param start The value from which to start counting. - */ - public ConsecutivelyNumberedFilenames(String format, int start) - { - this.iter = new ConsecutivelyNumberedFilenamesIterator(new File("").getParentFile(), format, start); - } - - /** - * Instantiates an {@code ConsecutivelyNumberedFilenames} object which - * returns {@link File}s with file names which are based on a format string, - * located in the directory specified. The numbering will be consecutive - * from the specified value. - *

- * The format string should contain the string {@code %d} which will be - * replaced with a consecutively counted number. Additional formatting - * can be applied. For more details, please refer to the section on - * Numeric formatting in the Java API specification for the - * {@link Formatter} class. - *

- *

File name sequence

- * For a case where the parent directory is {@code /foo/bar/}, and the - * specified value is {@code 5}, with format string {@code image-%d}: - *
    - *
  1. /foo/bar/image-5
  2. - *
  3. /foo/bar/image-6
  4. - *
  5. /foo/bar/image-7
  6. - *
  7. /foo/bar/image-8
  8. - *
- * and so on. - * - * @param dir The directory in which the files are to be located. - * @param format The format string to use. - * @param start The value from which to start counting. - * @throws IOException If the specified directory path is not a directory, - * or if does not exist. - */ - public ConsecutivelyNumberedFilenames(File dir, String format, int start) throws IOException - { - checkDirectory(dir); - this.iter = new ConsecutivelyNumberedFilenamesIterator(dir, format, start); - } - - private static void checkDirectory(File dir) throws IOException - { - if (!dir.isDirectory()) - { - throw new IOException( - "Specified path is not a directory or does not exist." - ); - } - } - - private static class ConsecutivelyNumberedFilenamesIterator implements Iterator - { - private final File dir; - private final String format; - private int count; - - public ConsecutivelyNumberedFilenamesIterator(File dir, String format, int start) - { - super(); - this.dir = dir; - this.format = format; - this.count = start; - } - - public boolean hasNext() - { - return true; - } - - public File next() - { - File f = new File(dir, String.format(format, count)); - count++; - return f; - } - - public void remove() - { - throw new UnsupportedOperationException( - "Cannot remove elements from this iterator." - ); - } - } - - /** - * Returns an iterator which generates file names according to the rules - * specified by this object. - * - * @return An iterator which generates file names. - */ - public Iterator iterator() - { - return iter; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/name/Rename.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/name/Rename.java deleted file mode 100644 index 50eaf41a..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/name/Rename.java +++ /dev/null @@ -1,218 +0,0 @@ -package net.coobird.thumbnailator.name; - -import net.coobird.thumbnailator.ThumbnailParameter; - -/** - * This class is used to rename file names. - * - * @author coobird - * - */ -public abstract class Rename -{ - /** - * A {@code Rename} which does not alter the given file name. - *

- * Note: The {@link #apply(String, ThumbnailParameter)} method does not use - * the {@code param} parameter. A value of {@code null} for {@code param} is - * permitted. - *

- *

Example
- *
    - *
  • Before: {@code picture.jpg}
  • - *
  • After: {@code picture.jpg}
  • - *
- */ - public static final Rename NO_CHANGE = new Rename() { - @Override - public String apply(String name, ThumbnailParameter param) - { - return name; - } - }; - - /** - * Appends {@code thumbnail.} to the beginning of the file name. - *

- * Note: The {@link #apply(String, ThumbnailParameter)} method does not use - * the {@code param} parameter. A value of {@code null} for {@code param} is - * permitted. - *

- *

Example
- *
    - *
  • Before: {@code picture.jpg}
  • - *
  • After: {@code thumbnail.picture.jpg}
  • - *
- */ - public static final Rename PREFIX_DOT_THUMBNAIL = new Rename() { - @Override - public String apply(String fileName, ThumbnailParameter param) - { - return appendPrefix(fileName, "thumbnail."); - } - }; - - /** - * Appends {@code thumbnail-} to the beginning of the file name. - *

- * Note: The {@link #apply(String, ThumbnailParameter)} method does not use - * the {@code param} parameter. A value of {@code null} for {@code param} is - * permitted. - *

- *

Example
- *
    - *
  • Before: {@code picture.jpg}
  • - *
  • After: {@code thumbnail-picture.jpg}
  • - *
- * - * @deprecated Please use the correctly spelled - * {@link Rename#PREFIX_HYPHEN_THUMBNAIL}. This constant - * will be removed in Thumbnailator 0.5.0. - */ - @Deprecated - public static final Rename PREFIX_HYPTHEN_THUMBNAIL = Rename.PREFIX_HYPHEN_THUMBNAIL; - - /** - * Appends {@code thumbnail-} to the beginning of the file name. - *

- * Note: The {@link #apply(String, ThumbnailParameter)} method does not use - * the {@code param} parameter. A value of {@code null} for {@code param} is - * permitted. - *

- *

Example
- *
    - *
  • Before: {@code picture.jpg}
  • - *
  • After: {@code thumbnail-picture.jpg}
  • - *
- */ - public static final Rename PREFIX_HYPHEN_THUMBNAIL = new Rename() { - @Override - public String apply(String fileName, ThumbnailParameter param) - { - return appendPrefix(fileName, "thumbnail-"); - } - }; - - /** - * Appends {@code .thumbnail} to the file name prior to the extension of - * the file. - *

- * Note: The {@link #apply(String, ThumbnailParameter)} method does not use - * the {@code param} parameter. A value of {@code null} for {@code param} is - * permitted. - *

- *

Example
- *
    - *
  • Before: {@code picture.jpg}
  • - *
  • After: {@code picture.thumbnail.jpg}
  • - *
- */ - public static final Rename SUFFIX_DOT_THUMBNAIL = new Rename() { - @Override - public String apply(String fileName, ThumbnailParameter param) - { - return appendSuffix(fileName, ".thumbnail"); - } - }; - - /** - * Appends {@code -thumbnail} to the file name prior to the extension of - * the file. - *

- * Note: The {@link #apply(String, ThumbnailParameter)} method does not use - * the {@code param} parameter. A value of {@code null} for {@code param} is - * permitted. - *

- *

Example
- *
    - *
  • Before: {@code picture.jpg}
  • - *
  • After: {@code picture-thumbnail.jpg}
  • - *
- * - * @deprecated Please use the correctly spelled - * {@link Rename#SUFFIX_HYPHEN_THUMBNAIL}. This constant - * will be removed in Thumbnailator 0.5.0. - */ - @Deprecated - public static final Rename SUFFIX_HYPTHEN_THUMBNAIL = Rename.SUFFIX_HYPHEN_THUMBNAIL; - - /** - * Appends {@code -thumbnail} to the file name prior to the extension of - * the file. - *

- * Note: The {@link #apply(String, ThumbnailParameter)} method does not use - * the {@code param} parameter. A value of {@code null} for {@code param} is - * permitted. - *

- *

Example
- *
    - *
  • Before: {@code picture.jpg}
  • - *
  • After: {@code picture-thumbnail.jpg}
  • - *
- */ - public static final Rename SUFFIX_HYPHEN_THUMBNAIL = new Rename() { - @Override - public String apply(String fileName, ThumbnailParameter param) - { - return appendSuffix(fileName, "-thumbnail"); - } - }; - - /** - * The default constructor is intended only to be called implicitly - * by the classes implementing the functionality of the {@link Rename} - * class. - */ - protected Rename() {} - - /** - * Applies the function performed by this {@code Rename} on the - * specified name and thumbnail creation parameters. - * - * @param name Name to apply the function on. - * The file name should not include the directory - * in which the file resides in. - * @param param Parameters used to create the thumbnail. - * @return The name after the function has been applied. - */ - public abstract String apply(String name, ThumbnailParameter param); - - /** - * Appends a suffix to a filename. - * - * @param fileName File name to add a suffix on. - * @param suffix The suffix to add. - * @return File name with specified suffixed affixed. - */ - protected String appendSuffix(String fileName, String suffix) - { - String newFileName = ""; - - int indexOfDot = fileName.lastIndexOf('.'); - - if (indexOfDot != -1) - { - newFileName = fileName.substring(0, indexOfDot); - newFileName += suffix; - newFileName += fileName.substring(indexOfDot); - } - else - { - newFileName = fileName + suffix; - } - - return newFileName; - } - - /** - * Appends a prefix to a filename. - * - * @param fileName File name to add a prefix on. - * @param prefix The prefix to add. - * @return File name with the specified prefix affixed. - */ - protected String appendPrefix(String fileName, String prefix) - { - return prefix + fileName; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/name/package-info.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/name/package-info.java deleted file mode 100644 index fdf951a7..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/name/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This package contains classes used to generate file names when saving - * thumbnail images to files. - */ -package net.coobird.thumbnailator.name; diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/package-info.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/package-info.java deleted file mode 100644 index 781aa090..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This package contains classes which provide the core functionalities of - * Thumbnailator. - */ -package net.coobird.thumbnailator; diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/AbstractResizer.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/AbstractResizer.java deleted file mode 100644 index 92cb3f0f..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/AbstractResizer.java +++ /dev/null @@ -1,122 +0,0 @@ -package net.coobird.thumbnailator.resizers; - -import java.awt.Graphics2D; -import java.awt.RenderingHints; -import java.awt.image.BufferedImage; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -/** - * A class which performs a resize operation on a source image and outputs the - * result to a destination image. - * - * @author coobird - * - */ -public abstract class AbstractResizer implements Resizer -{ - /** - * Rendering hints to use when resizing an image. - */ - protected final Map RENDERING_HINTS; - - /** - * Field used to hold the rendering hints in an unmodifiable form. - */ - protected final Map UNMODIFIABLE_RENDERING_HINTS; - - protected static final RenderingHints.Key KEY_INTERPOLATION = - RenderingHints.KEY_INTERPOLATION; - - /** - * Initializes the {@link AbstractResizer}. - * - * @param interpolationValue The rendering hint value to use for the - * interpolation hint. - * @param hints Other rendering hints to add. - */ - protected AbstractResizer( - Object interpolationValue, - Map hints - ) - { - RENDERING_HINTS = new HashMap<>(); - RENDERING_HINTS.put(KEY_INTERPOLATION, interpolationValue); - - if ( - hints.containsKey(KEY_INTERPOLATION) - && !interpolationValue.equals(hints.get(KEY_INTERPOLATION)) - ) - { - throw new IllegalArgumentException("Cannot change the " + - "RenderingHints.KEY_INTERPOLATION value."); - } - - RENDERING_HINTS.putAll(hints); - - UNMODIFIABLE_RENDERING_HINTS = Collections.unmodifiableMap(RENDERING_HINTS); - } - - /** - *

- * Performs a resize operation from a source image and outputs to a - * destination image. - *

- *

- * If the source or destination image is {@code null}, then a - * {@link NullPointerException} will be thrown. - *

- * - * @param srcImage The source image. - * @param destImage The destination image. - * - * @throws NullPointerException When the source and/or the destination - * image is {@code null}. - */ - public void resize(BufferedImage srcImage, BufferedImage destImage) - { - performChecks(srcImage, destImage); - - int width = destImage.getWidth(); - int height = destImage.getHeight(); - - Graphics2D g = destImage.createGraphics(); - - g.setRenderingHints(RENDERING_HINTS); - - g.drawImage(srcImage, 0, 0, width, height, null); - g.dispose(); - } - - /** - * Performs checks on the source and destination image to see if they are - * images which can be processed. - * - * @param srcImage The source image. - * @param destImage The destination image. - */ - protected void performChecks(BufferedImage srcImage, BufferedImage destImage) - { - if (srcImage == null || destImage == null) - { - throw new NullPointerException( - "The source and/or destination image is null." - ); - } - } - - /** - * Returns the rendering hints that the resizer uses. - *

- * The keys and values used for the rendering hints are those defined in - * the {@link RenderingHints} class. - * - * @see RenderingHints - * @return Rendering hints used when resizing the image. - */ - public Map getRenderingHints() - { - return UNMODIFIABLE_RENDERING_HINTS; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/BicubicResizer.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/BicubicResizer.java deleted file mode 100644 index 177fd8a3..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/BicubicResizer.java +++ /dev/null @@ -1,55 +0,0 @@ -package net.coobird.thumbnailator.resizers; - -import java.awt.RenderingHints; -import java.awt.image.BufferedImage; -import java.util.Collections; -import java.util.Map; - -/** - * Image resizer class using bicubic interpolation for the resizing operation. - * - * @author coobird - * - */ -public class BicubicResizer extends AbstractResizer -{ - /** - * Instantiates a {@link BicubicResizer} with default rendering hints. - */ - public BicubicResizer() - { - this(Collections.emptyMap()); - } - - /** - * Instantiates a {@link BicubicResizer} with the specified rendering hints. - * - * @param hints Additional rendering hints to apply. - */ - public BicubicResizer(Map hints) - { - super(RenderingHints.VALUE_INTERPOLATION_BICUBIC, hints); - } - - /** - *

- * Resizes an image using bicubic interpolation. - *

- *

- * If the source and/or destination image is {@code null}, then a - * {@link NullPointerException} will be thrown. - *

- * - * @param srcImage The source image. - * @param destImage The destination image. - * - * @throws NullPointerException When the source and/or the destination - * image is {@code null}. - */ - @Override - public void resize(BufferedImage srcImage, BufferedImage destImage) - throws NullPointerException - { - super.resize(srcImage, destImage); - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/BilinearResizer.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/BilinearResizer.java deleted file mode 100644 index 28a700e4..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/BilinearResizer.java +++ /dev/null @@ -1,56 +0,0 @@ -package net.coobird.thumbnailator.resizers; - -import java.awt.RenderingHints; -import java.awt.image.BufferedImage; -import java.util.Collections; -import java.util.Map; - -/** - * Image resizer class using bilinear interpolation for the resizing operation. - * - * @author coobird - * - */ -public class BilinearResizer extends AbstractResizer -{ - /** - * Instantiates a {@link BilinearResizer} with default rendering hints. - */ - public BilinearResizer() - { - this(Collections.emptyMap()); - } - - /** - * Instantiates a {@link BilinearResizer} with the specified rendering - * hints. - * - * @param hints Additional rendering hints to apply. - */ - public BilinearResizer(Map hints) - { - super(RenderingHints.VALUE_INTERPOLATION_BILINEAR, hints); - } - - /** - *

- * Resizes an image using bilinear interpolation. - *

- *

- * If the source and/or destination image is {@code null}, then a - * {@link NullPointerException} will be thrown. - *

- * - * @param srcImage The source image. - * @param destImage The destination image. - * - * @throws NullPointerException When the source and/or the destination - * image is {@code null}. - */ - @Override - public void resize(BufferedImage srcImage, BufferedImage destImage) - throws NullPointerException - { - super.resize(srcImage, destImage); - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/DefaultResizerFactory.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/DefaultResizerFactory.java deleted file mode 100644 index 642aa3c9..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/DefaultResizerFactory.java +++ /dev/null @@ -1,134 +0,0 @@ -package net.coobird.thumbnailator.resizers; - -import java.awt.Dimension; - - -/** - * This class provides factory methods which provides suitable {@link Resizer}s - * for a given situation. - * - *
- *
{@code Resizer}s returned by this {@code ResizerFactory}:
- *
- * The {@link Resizer}s returned by this {@link ResizerFactory} depends upon - * the size of the source and destination images. The conditions and the - * {@link Resizer}s returned are as follows: - * - *
    - *
  • Default via {@link #getResizer()} - *
    • {@link ProgressiveBilinearResizer}
    - *
  • - *
  • Destination image has the same dimensions as the source image via - * {@link #getResizer(Dimension, Dimension)} - *
    • {@link NullResizer}
    - *
  • - *
  • Both the width and height of the destination image is larger than the - * source image via {@link #getResizer(Dimension, Dimension)} - *
    • {@link BicubicResizer}
    - *
  • - *
  • Both the width and height of the destination image is smaller in the - * source image by a factor larger than 2, - * via {@link #getResizer(Dimension, Dimension)} - *
    • {@link ProgressiveBilinearResizer}
    - *
  • - *
  • Both the width and height of the destination image is smaller in the - * source image not by a factor larger than 2, - * via {@link #getResizer(Dimension, Dimension)} - *
    • {@link BilinearResizer}
    - *
  • - *
  • Other conditions not described via - * {@link #getResizer(Dimension, Dimension)} - *
    • {@link ProgressiveBilinearResizer}
    - *
  • - *
- *
- *
- * - *
- *
Usage:
- *
- * The following example code demonstrates how to use {@link DefaultResizerFactory} - * in order to obtain the optimal {@link Resizer}, and using that in order to - * perform the resizing operation. - *

- *

-BufferedImage sourceImage = new BufferedImageBuilder(400, 400).build();
-BufferedImage destImage = new BufferedImageBuilder(200, 200).build();
-
-Dimension sourceSize = new Dimension(sourceImage.getWidth(), sourceImage.getHeight());
-Dimension destSize = new Dimension(destImage.getWidth(), destImage.getHeight());
-
-// Obtain the optimal Resizer for this resizing operation.
-Resizer resizer = DefaultResizerFactory.getInstance().getResizer(sourceSize, destSize);
-
-// Perform the resizing using the Resizer obtained from the ResizerFactory.
-resizer.resize(sourceImage, destImage);
- * 
- *
- *
- * When a specific {@link Resizer} is required, the {@link Resizers} - * {@code enum} is another way to obtain {@link Resizer}s. - *

- * - * @see Resizers - * - * @author coobird - * @since 0.4.0 - * - */ -public class DefaultResizerFactory implements ResizerFactory -{ - private static final DefaultResizerFactory INSTANCE = new DefaultResizerFactory(); - - /** - * This class is not intended to be instantiated via the constructor. - */ - private DefaultResizerFactory() {} - - /** - * Returns an instance of this class. - * - * @return An instance of this class. - */ - public static ResizerFactory getInstance() - { - return INSTANCE; - } - - public Resizer getResizer() - { - return Resizers.PROGRESSIVE; - } - - public Resizer getResizer(Dimension originalSize, Dimension thumbnailSize) - { - int origWidth = originalSize.width; - int origHeight = originalSize.height; - int thumbWidth = thumbnailSize.width; - int thumbHeight = thumbnailSize.height; - - if (thumbWidth < origWidth && thumbHeight < origHeight) - { - if (thumbWidth < (origWidth / 2) && thumbHeight < (origHeight / 2)) - { - return Resizers.PROGRESSIVE; - } - else - { - return Resizers.BILINEAR; - } - } - else if (thumbWidth > origWidth && thumbHeight > origHeight) - { - return Resizers.BICUBIC; - } - else if (thumbWidth == origWidth && thumbHeight == origHeight) - { - return Resizers.NULL; - } - else - { - return getResizer(); - } - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/FixedResizerFactory.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/FixedResizerFactory.java deleted file mode 100644 index ea59a023..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/FixedResizerFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.coobird.thumbnailator.resizers; - -import java.awt.Dimension; - -/** - * A {@link ResizerFactory} that returns a specific {@link Resizer} - * unconditionally. - * - * @author coobird - * @since 0.4.0 - */ -public class FixedResizerFactory implements ResizerFactory -{ - /** - * The resizer which is to be returned unconditionally by this class. - */ - private final Resizer resizer; - - /** - * Creates an instance of the {@link FixedResizerFactory} which returns - * the speicifed {@link Resizer} under all circumstances. - * - * @param resizer The {@link Resizer} instance that is to be returned - * under all circumstances. - */ - public FixedResizerFactory(Resizer resizer) - { - this.resizer = resizer; - } - - public Resizer getResizer() - { - return resizer; - } - - public Resizer getResizer(Dimension originalSize, Dimension thumbnailSize) - { - return resizer; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/NullResizer.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/NullResizer.java deleted file mode 100644 index a1d81302..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/NullResizer.java +++ /dev/null @@ -1,53 +0,0 @@ -package net.coobird.thumbnailator.resizers; - -import java.awt.Graphics; -import java.awt.RenderingHints; -import java.awt.RenderingHints.Key; -import java.awt.image.BufferedImage; -import java.util.Collections; -import java.util.Map; - -/** - * A {@link Resizer} which does not actually resize the image. - *

- * The source image will be drawn at the origin of the destination image. - * - * @author coobird - * @since 0.4.0 - * - */ -public class NullResizer extends AbstractResizer -{ - /** - * Instantiates the {@code NullResizer} which draws the source image at - * the origin of the destination image. - */ - public NullResizer() - { - this( - RenderingHints.VALUE_INTERPOLATION_BILINEAR, - Collections.emptyMap() - ); - } - - /** - * This constructor is {@code private} to prevent the rendering hints - * from being set, as this {@link Resizer} does not perform any resizing. - * - * @param interpolationValue Not used. - * @param hints Not used. - */ - private NullResizer(Object interpolationValue, Map hints) - { - super(interpolationValue, hints); - } - - public void resize(BufferedImage srcImage, BufferedImage destImage) - { - super.performChecks(srcImage, destImage); - - Graphics g = destImage.getGraphics(); - g.drawImage(srcImage, 0, 0, null); - g.dispose(); - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/ProgressiveBilinearResizer.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/ProgressiveBilinearResizer.java deleted file mode 100644 index a55df51b..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/ProgressiveBilinearResizer.java +++ /dev/null @@ -1,142 +0,0 @@ -package net.coobird.thumbnailator.resizers; - -import java.awt.AlphaComposite; -import java.awt.Graphics2D; -import java.awt.RenderingHints; -import java.awt.image.BufferedImage; -import java.util.Collections; -import java.util.Map; - -/** - * A {@link Resizer} which performs resizing operations by using - * progressive bilinear scaling. - *

- * The resizing technique used in this class is based on the technique - * discussed in Chapter 4: Images of - * Filthy Rich Clients - * by Chet Haase and Romain Guy. - *

- * The actual implemenation of the technique is independent of the code which - * is provided in the book. - * - * @author coobird - * - */ -public class ProgressiveBilinearResizer extends AbstractResizer -{ - /** - * Instantiates a {@link ProgressiveBilinearResizer} with default - * rendering hints. - */ - public ProgressiveBilinearResizer() - { - this(Collections.emptyMap()); - } - - /** - * Instantiates a {@link ProgressiveBilinearResizer} with the specified - * rendering hints. - * - * @param hints Additional rendering hints to apply. - */ - public ProgressiveBilinearResizer(Map hints) - { - super(RenderingHints.VALUE_INTERPOLATION_BILINEAR, hints); - } - - /** - * Resizes an image using the progressive bilinear scaling technique. - *

- * If the source and/or destination image is {@code null}, then a - * {@link NullPointerException} will be thrown. - * - * @param srcImage The source image. - * @param destImage The destination image. - * - * @throws NullPointerException When the source and/or the destination - * image is {@code null}. - */ - @Override - public void resize(BufferedImage srcImage, BufferedImage destImage) - throws NullPointerException - { - super.performChecks(srcImage, destImage); - - int currentWidth = srcImage.getWidth(); - int currentHeight = srcImage.getHeight(); - - final int targetWidth = destImage.getWidth(); - final int targetHeight = destImage.getHeight(); - - // If multi-step downscaling is not required, perform one-step. - if ((targetWidth * 2 >= currentWidth) && (targetHeight * 2 >= currentHeight)) - { - Graphics2D g = destImage.createGraphics(); - g.drawImage(srcImage, 0, 0, targetWidth, targetHeight, null); - g.dispose(); - return; - } - - // Temporary image used for in-place resizing of image. - BufferedImage tempImage = new BufferedImage( - currentWidth, - currentHeight, - destImage.getType() - ); - - Graphics2D g = tempImage.createGraphics(); - g.setRenderingHints(RENDERING_HINTS); - g.setComposite(AlphaComposite.Src); - - /* - * Determine the size of the first resize step should be. - * 1) Beginning from the target size - * 2) Increase each dimension by 2 - * 3) Until reaching the original size - */ - int startWidth = targetWidth; - int startHeight = targetHeight; - - while (startWidth < currentWidth && startHeight < currentHeight) - { - startWidth *= 2; - startHeight *= 2; - } - - currentWidth = startWidth / 2; - currentHeight = startHeight / 2; - - // Perform first resize step. - g.drawImage(srcImage, 0, 0, currentWidth, currentHeight, null); - - // Perform an in-place progressive bilinear resize. - while ( (currentWidth >= targetWidth * 2) && (currentHeight >= targetHeight * 2) ) - { - currentWidth /= 2; - currentHeight /= 2; - - if (currentWidth < targetWidth) - { - currentWidth = targetWidth; - } - if (currentHeight < targetHeight) - { - currentHeight = targetHeight; - } - - g.drawImage( - tempImage, - 0, 0, currentWidth, currentHeight, - 0, 0, currentWidth * 2, currentHeight * 2, - null - ); - } - - g.dispose(); - - // Draw the resized image onto the destination image. - Graphics2D destg = destImage.createGraphics(); - destg.drawImage(tempImage, 0, 0, targetWidth, targetHeight, 0, 0, currentWidth, currentHeight, null); - destg.dispose(); - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/Resizer.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/Resizer.java deleted file mode 100644 index ec0527b9..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/Resizer.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.coobird.thumbnailator.resizers; - -import java.awt.image.BufferedImage; - -/** - * This interface is implemented by classes which perform resizing operations. - * - * @author coobird - * - */ -public interface Resizer -{ - /** - * Resizes an image. - *

- * The source image is resized to fit the dimensions of the destination - * image and drawn. - * - * @param srcImage The source image. - * @param destImage The destination image. - */ - public void resize(BufferedImage srcImage, BufferedImage destImage); -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/ResizerFactory.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/ResizerFactory.java deleted file mode 100644 index a370a985..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/ResizerFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -package net.coobird.thumbnailator.resizers; - -import java.awt.Dimension; - -/** - * This interface is implemented by all classes which will return a - * {@link Resizer} that should be used when creating a thumbnail. - * - * @author coobird - * @since 0.4.0 - * - */ -public interface ResizerFactory -{ - /** - * Returns the default {@link Resizer}. - * - * @return The default {@code Resizer}. - */ - public Resizer getResizer(); - - /** - * Returns a suitable {@link Resizer}, given the {@link Dimension}s of the - * original image and the thumbnail image. - * - * @param originalSize The size of the original image. - * @param thumbnailSize The size of the thumbnail. - * @return The suitable {@code Resizer} to perform the - * resizing operation for the given condition. - */ - public Resizer getResizer(Dimension originalSize, Dimension thumbnailSize); -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/Resizers.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/Resizers.java deleted file mode 100644 index 100bb719..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/Resizers.java +++ /dev/null @@ -1,76 +0,0 @@ -package net.coobird.thumbnailator.resizers; - -import java.awt.image.BufferedImage; - -/** - * This enum can be used to select a specific {@link Resizer} in order - * to perform a resizing operation. - *

- * The instance held by a value of this enum is a single instance. When using - * specific implementations of {@link Resizer}s, it is preferable to obtain - * an instance of a {@link Resizer} through this enum or the - * {@link DefaultResizerFactory} class in order to prevent many instances of the - * {@link Resizer} class implementations from being instantiated. - *

- *

- *
Usage:
- *
- * The following example code demonstrates how to use the {@link Resizers} enum - * in order to resize an image using bilinear interpolation: - *

- *

-BufferedImage sourceImage = new BufferedImageBuilder(400, 400).build();
-BufferedImage destImage = new BufferedImageBuilder(200, 200).build();
-
-Resizers.BILINEAR.resize(sourceImage, destImage);
- * 
- *
- *
- * - * @see DefaultResizerFactory - * - * @author coobird - * - */ -public enum Resizers implements Resizer -{ - /** - * A {@link Resizer} which does not perform resizing operations. The source - * image will be drawn at the origin of the destination image. - */ - NULL(new NullResizer()), - - /** - * A {@link Resizer} which performs resizing operations using - * bilinear interpolation. - */ - BILINEAR(new BilinearResizer()), - - /** - * A {@link Resizer} which performs resizing operations using - * bicubic interpolation. - */ - BICUBIC(new BicubicResizer()), - - /** - * A {@link Resizer} which performs resizing operations using - * progressive bilinear scaling. - *

- * For details on this technique, refer to the documentation of the - * {@link ProgressiveBilinearResizer} class. - */ - PROGRESSIVE(new ProgressiveBilinearResizer()) - ; - - private final Resizer resizer; - - private Resizers(Resizer resizer) - { - this.resizer = resizer; - } - - public void resize(BufferedImage srcImage, BufferedImage destImage) - { - resizer.resize(srcImage, destImage); - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/AlphaInterpolation.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/AlphaInterpolation.java deleted file mode 100644 index 9680087b..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/AlphaInterpolation.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - */ -package net.coobird.thumbnailator.resizers.configurations; - -import java.awt.RenderingHints; -import java.awt.RenderingHints.Key; - -/** - * An enum which is used to specify the alpha interpolation settings of the - * resizing operations. - * - * @author coobird - * - */ -public enum AlphaInterpolation implements ResizerConfiguration -{ - /** - * A hint used to emphasize speed when performing alpha interpolation. - */ - SPEED(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED), - - /** - * A hint used to emphasize quality when performing alpha interpolation. - */ - QUALITY(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY), - - /** - * A hint which indicates to use the default alpha interpolation settings. - */ - DEFAULT(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT), - ; - - /** - * The field used to hold the rendering hint. - */ - private final Object value; - - /** - * Instantiates this enum. - * - * @param value The rendering hint value. - */ - private AlphaInterpolation(Object value) - { - this.value = value; - } - - public Key getKey() - { - return RenderingHints.KEY_ALPHA_INTERPOLATION; - } - - public Object getValue() - { - return value; - } -} \ No newline at end of file diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/Antialiasing.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/Antialiasing.java deleted file mode 100644 index de06bf13..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/Antialiasing.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - */ -package net.coobird.thumbnailator.resizers.configurations; - -import java.awt.RenderingHints; -import java.awt.RenderingHints.Key; - -/** - * An enum which is used to specify the antialiasing settings of the - * resizing operations. - * - * @author coobird - * - */ -public enum Antialiasing implements ResizerConfiguration -{ - /** - * A hint to enable antialiasing. - */ - ON(RenderingHints.VALUE_ANTIALIAS_ON), - - /** - * A hint to disable antialiasing. - */ - OFF(RenderingHints.VALUE_ANTIALIAS_OFF), - - /** - * A hint to use the default antialiasing settings. - */ - DEFAULT(RenderingHints.VALUE_ANTIALIAS_DEFAULT), - ; - - /** - * The field used to hold the rendering hint. - */ - private final Object value; - - /** - * Instantiates this enum. - * - * @param value The rendering hint value. - */ - private Antialiasing(Object value) - { - this.value = value; - } - - public Key getKey() - { - return RenderingHints.KEY_ANTIALIASING; - } - - public Object getValue() - { - return value; - } -} \ No newline at end of file diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/Dithering.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/Dithering.java deleted file mode 100644 index 2c6d81cc..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/Dithering.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - */ -package net.coobird.thumbnailator.resizers.configurations; - -import java.awt.RenderingHints; -import java.awt.RenderingHints.Key; - -/** - * An enum which is used to specify the dithering settings of the - * resizing operations. - * - * @author coobird - * - */ -public enum Dithering implements ResizerConfiguration -{ - /** - * A hint used to enable dithering. - */ - ENABLE(RenderingHints.VALUE_DITHER_ENABLE), - - /** - * A hint used to disable dithering. - */ - DISABLE(RenderingHints.VALUE_DITHER_DISABLE), - - /** - * A hint to use the default dithering settings. - */ - DEFAULT(RenderingHints.VALUE_DITHER_DEFAULT), - ; - - /** - * The field used to hold the rendering hint. - */ - private final Object value; - - /** - * Instantiates this enum. - * - * @param value The rendering hint value. - */ - private Dithering(Object value) - { - this.value = value; - } - - public Key getKey() - { - return RenderingHints.KEY_DITHERING; - } - - public Object getValue() - { - return value; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/Rendering.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/Rendering.java deleted file mode 100644 index f3ae7ed4..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/Rendering.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - */ -package net.coobird.thumbnailator.resizers.configurations; - -import java.awt.RenderingHints; -import java.awt.RenderingHints.Key; - -/** - * An enum which is used to specify the dithering settings of the - * resizing operations. - * - * @author coobird - * - */ -public enum Rendering implements ResizerConfiguration -{ - /** - * A hint used to emphasize speed when rendering. - */ - SPEED(RenderingHints.VALUE_RENDER_SPEED), - - /** - * A hint used to emphasize quality when rendering. - */ - QUALITY(RenderingHints.VALUE_RENDER_QUALITY), - - /** - * A hint to use the default rendering settings. - */ - DEFAULT(RenderingHints.VALUE_RENDER_DEFAULT), - ; - - /** - * - */ - private final Object value; - - /** - * @param value - */ - private Rendering(Object value) - { - this.value = value; - } - - public Key getKey() - { - return RenderingHints.KEY_ALPHA_INTERPOLATION; - } - - public Object getValue() - { - return value; - } -} \ No newline at end of file diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/ResizerConfiguration.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/ResizerConfiguration.java deleted file mode 100644 index 1f72cb00..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/ResizerConfiguration.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.coobird.thumbnailator.resizers.configurations; - -import java.awt.RenderingHints; - -import net.coobird.thumbnailator.resizers.Resizer; - -/** - * An interface which are implemented by classes and enums which provide - * configuration information for {@link Resizer}s. - * - * @author coobird - * - */ -public interface ResizerConfiguration -{ - /** - * Returns a rendering hint key. - * - * @return Rendering hint key. - */ - public RenderingHints.Key getKey(); - - /** - * Returns a rendering hint value. - * - * @return Rendering hint value. - */ - public Object getValue(); -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/ScalingMode.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/ScalingMode.java deleted file mode 100644 index 8c0fee8b..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/ScalingMode.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * - */ -package net.coobird.thumbnailator.resizers.configurations; - -import net.coobird.thumbnailator.resizers.ProgressiveBilinearResizer; - -/** - * An enum which is used to specify how to scale images when creating - * thumbnails. - * - * @author coobird - * - */ -public enum ScalingMode -{ - /** - * A hint to use bilinear interpolation when resizing images. - */ - BILINEAR, - - /** - * A hint to use bicubic interpolation when resizing images. - */ - BICUBIC, - - /** - * A hint to use progressing bilinear interpolation when resizing images. - *

- * For details on this technique, refer to the documentation of the - * {@link ProgressiveBilinearResizer} class. - */ - PROGRESSIVE_BILINEAR, - ; -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/package-info.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/package-info.java deleted file mode 100644 index 9aebd2f9..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/configurations/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -/** - * This package provides enums which are used to set rendering hints used when - * using {@link net.coobird.thumbnailator.resizers.Resizers} to create - * thumbnails. - */ -package net.coobird.thumbnailator.resizers.configurations; diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/package-info.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/package-info.java deleted file mode 100644 index 7239881f..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/resizers/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This package provides classes which perform image resizing operations which - * is used to create thumbnails with Thumbnailator. - */ -package net.coobird.thumbnailator.resizers; diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/FileThumbnailTask.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/FileThumbnailTask.java deleted file mode 100644 index 90cdb16f..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/FileThumbnailTask.java +++ /dev/null @@ -1,77 +0,0 @@ -package net.coobird.thumbnailator.tasks; - -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; - -import net.coobird.thumbnailator.ThumbnailParameter; -import net.coobird.thumbnailator.tasks.io.FileImageSink; -import net.coobird.thumbnailator.tasks.io.FileImageSource; - -/** - * A thumbnail generation schedule which reads and writes data from and to a - * {@link File}. - *

- * Only the first image included in the image file will be read. Subsequent - * images included in the image file will be ignored. - * - * @author coobird - * - */ -public class FileThumbnailTask extends ThumbnailTask -{ - /** - * The {@link SourceSinkThumbnailTask} used to perform the schedule. - */ - private final SourceSinkThumbnailTask task; - - /** - * Creates a {@link ThumbnailTask} in which image data is read from the - * specified {@link File} and is output to a specified {@link File}, using - * the parameters provided in the specified {@link ThumbnailParameter}. - * - * @param param The parameters to use to create the thumbnail. - * @param sourceFile The {@link File} from which image data is read. - * @param destinationFile The {@link File} to which thumbnail is written. - * @throws NullPointerException If the parameter is {@code null}. - */ - public FileThumbnailTask(ThumbnailParameter param, File sourceFile, File destinationFile) - { - super(param); - this.task = new SourceSinkThumbnailTask<>( - param, - new FileImageSource(sourceFile), - new FileImageSink(destinationFile) - ); - } - - @Override - public BufferedImage read() throws IOException - { - return task.read(); - } - - @Override - public void write(BufferedImage img) throws IOException - { - task.write(img); - } - - @Override - public ThumbnailParameter getParam() - { - return task.getParam(); - } - - @Override - public File getSource() - { - return task.getSource(); - } - - @Override - public File getDestination() - { - return task.getDestination(); - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/SourceSinkThumbnailTask.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/SourceSinkThumbnailTask.java deleted file mode 100644 index ab47e300..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/SourceSinkThumbnailTask.java +++ /dev/null @@ -1,117 +0,0 @@ -package net.coobird.thumbnailator.tasks; - -import java.awt.image.BufferedImage; -import java.io.IOException; - -import net.coobird.thumbnailator.ThumbnailParameter; -import net.coobird.thumbnailator.tasks.io.ImageSink; -import net.coobird.thumbnailator.tasks.io.ImageSource; - -/** - * A {@link ThumbnailTask} which holds an {@link ImageSource} from which the - * image is read or retrieved, and an {@link ImageSink} to which the thumbnail - * is stored or written. - *

- * This class will take care of handing off information from the - * {@link ImageSource} to the {@link ImageSink}. For example, the output format - * that should be used by the {@link ImageSink} will be handed off if the - * {@link ThumbnailParameter#ORIGINAL_FORMAT} parameter is set. - * - * @author coobird - * - * @param The source class from which the source image is retrieved - * or read. - * @param The destination class to which the thumbnail is stored - * or written. - */ -public class SourceSinkThumbnailTask extends ThumbnailTask -{ - /** - * The source from which the image is retrieved or read. - */ - private final ImageSource source; - - /** - * The destination to which the thumbnail is stored or written. - */ - private final ImageSink destination; - - /** - * Creates a {@link ThumbnailTask} in which an image is retrived from the - * specified {@link ImageSource} and written to the specified - * {@link ImageSink}, using the parameters provided in the specified - * {@link ThumbnailParameter}. - * - * @param param The parameters to use to create the thumbnail. - * @param source The source from which the image is retrieved - * or read from. - * @param destination The destination to which the thumbnail is - * stored or written to. - * @throws NullPointerException If either the parameter, - * {@link ImageSource} or {@link ImageSink} - * is {@code null}. - */ - public SourceSinkThumbnailTask(ThumbnailParameter param, ImageSource source, ImageSink destination) - { - super(param); - if (source == null) - { - throw new NullPointerException("ImageSource cannot be null."); - } - if (destination == null) - { - throw new NullPointerException("ImageSink cannot be null."); - } - - source.setThumbnailParameter(param); - this.source = source; - - destination.setThumbnailParameter(param); - this.destination = destination; - } - - @Override - public BufferedImage read() throws IOException - { - BufferedImage img = source.read(); - inputFormatName = source.getInputFormatName(); - - return img; - } - - @Override - public void write(BufferedImage img) throws IOException - { - String paramOutputFormat = param.getOutputFormat(); - String formatName = null; - - if (ThumbnailParameter.DETERMINE_FORMAT.equals(paramOutputFormat)) - { - paramOutputFormat = destination.preferredOutputFormatName(); - } - - if (paramOutputFormat == ThumbnailParameter.ORIGINAL_FORMAT) - { - formatName = inputFormatName; - } - else - { - formatName = paramOutputFormat; - } - - destination.setOutputFormatName(formatName); - destination.write(img); - } - - @Override - public S getSource() - { - return source.getSource(); - } - - @Override - public D getDestination() - { - return destination.getSink(); - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/StreamThumbnailTask.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/StreamThumbnailTask.java deleted file mode 100644 index d081453b..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/StreamThumbnailTask.java +++ /dev/null @@ -1,82 +0,0 @@ -package net.coobird.thumbnailator.tasks; - -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import net.coobird.thumbnailator.ThumbnailParameter; -import net.coobird.thumbnailator.tasks.io.InputStreamImageSource; -import net.coobird.thumbnailator.tasks.io.OutputStreamImageSink; - -/** - * A thumbnail generation schedule which streams data from an {@link InputStream} - * to an {@link OutputStream}. - *

- * This class does not close the {@link InputStream} and {@link OutputStream} - * upon the completion of processing. - *

- * Only the first image obtained from the data stream will be read. Subsequent - * images will be ignored. - * - * @author coobird - * - */ -public class StreamThumbnailTask extends ThumbnailTask -{ - /** - * The {@link SourceSinkThumbnailTask} used to perform the schedule. - */ - private final SourceSinkThumbnailTask task; - - /** - * Creates a {@link ThumbnailTask} in which streamed image data from the - * specified {@link InputStream} is output to a specified - * {@link OutputStream}, using the parameters provided in the specified - * {@link ThumbnailParameter}. - * - * @param param The parameters to use to create the thumbnail. - * @param is The {@link InputStream} from which to obtain image data. - * @param os The {@link OutputStream} to send thumbnail data to. - * @throws NullPointerException If the parameter is {@code null}. - */ - public StreamThumbnailTask(ThumbnailParameter param, InputStream is, OutputStream os) - { - super(param); - this.task = new SourceSinkThumbnailTask<>( - param, - new InputStreamImageSource(is), - new OutputStreamImageSink(os) - ); - } - - @Override - public BufferedImage read() throws IOException - { - return task.read(); - } - - @Override - public void write(BufferedImage img) throws IOException - { - task.write(img); - } - - @Override - public ThumbnailParameter getParam() - { - return task.getParam(); - } - - @Override - public InputStream getSource() - { - return task.getSource(); - } - - @Override - public OutputStream getDestination() - { - return task.getDestination(); - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/ThumbnailTask.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/ThumbnailTask.java deleted file mode 100644 index 9455355e..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/ThumbnailTask.java +++ /dev/null @@ -1,107 +0,0 @@ -package net.coobird.thumbnailator.tasks; - -import java.awt.image.BufferedImage; -import java.io.IOException; - -import net.coobird.thumbnailator.ThumbnailParameter; - -/** - * This class is used by {@link ThumbnailTask} implementations which is used - * when creating thumbnails from external sources and destinations. - *

- * If the image handled by a {@link ThumbnailTask} contains multiple images, - * only the first image will be read by the {@link #read()} method. Any - * subsequent images will be ignored. - * - * @param The class from which the image is retrieved or read. - * @param The class to which the thumbnail is stored or written. - * - * @author coobird - * - */ -public abstract class ThumbnailTask -{ - /** - * The parameters to use when creating a thumbnail. - */ - protected final ThumbnailParameter param; - - /** - * String indicating the image format of the input image. - *

- * To be used for situtions where the output image format should be the - * same as the input image format. - */ - protected String inputFormatName; - - /** - * Constant used to obtain the first image when reading an image file. - */ - protected static final int FIRST_IMAGE_INDEX = 0; - - /** - * Instantiates a {@link ThumbnailTask} with the parameters to use when - * creating thumbnails. - * - * @param param The parameters to use when creating thumbnails. - * @throws NullPointerException If the parameter is {@code null}. - */ - protected ThumbnailTask(ThumbnailParameter param) - { - if (param == null) - { - throw new NullPointerException("The parameter is null."); - } - this.param = param; - } - - /** - * Reads a source image. - * - * @return The image which was obtained from the source. - * @throws IOException Thrown when an I/O problem occurs when reading - * from the image source. - */ - /* - * Future changes note: The public interface of this method may have to be - * changed to support reading images tile-by-tile. This change may be - * required in order to support large images. - */ - public abstract BufferedImage read() throws IOException; - - /** - * Writes the thumbnail to the destination. - * - * @param img The image to write. - * @throws UnsupportedFormatException When an image file which is to be - * read or written is unsupported. - * @throws IOException Thrown when an I/O problem occurs when writing the - * image. - */ - public abstract void write(BufferedImage img) throws IOException; - - /** - * Returns the {@link ThumbnailParameter} for this {@link ThumbnailTask}, - * used when performing a thumbnail generation operation. - * - * @return The parameters to use when generating thumbnails. - */ - public ThumbnailParameter getParam() - { - return param; - } - - /** - * Returns the source from which the source image is retrieved or read. - * - * @return The source. - */ - public abstract S getSource(); - - /** - * Returns the destination to which the thumbnail is stored or written. - * - * @return The destination. - */ - public abstract D getDestination(); -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/UnsupportedFormatException.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/UnsupportedFormatException.java deleted file mode 100644 index 5055c932..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/UnsupportedFormatException.java +++ /dev/null @@ -1,63 +0,0 @@ -package net.coobird.thumbnailator.tasks; - -import java.io.IOException; - -/** - * An exception used to indicate that the specified format could not be - * used in an operation. - * - * @author coobird - * - */ -public class UnsupportedFormatException extends IOException -{ - /** - * An ID used for serialization. - */ - private static final long serialVersionUID = 1254432584303852552L; - - /** - * The format name which was not supported. - */ - private final String formatName; - - /** - * A constant which is used to indicate an unknown format. - */ - public static final String UNKNOWN = ""; - - /** - * Instantiates a {@link UnsupportedFormatException} with the unsupported - * format. - * - * @param formatName Format name. - */ - public UnsupportedFormatException(String formatName) - { - super(); - this.formatName = formatName; - } - - /** - * Instantiates a {@link UnsupportedFormatException} with the unsupported - * format and a detailed message. - * - * @param formatName Format name. - * @param s A message detailing the exception. - */ - public UnsupportedFormatException(String formatName, String s) - { - super(s); - this.formatName = formatName; - } - - /** - * Returns the format name which is not supported. - * - * @return Format name. - */ - public String getFormatName() - { - return formatName; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/AbstractImageSink.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/AbstractImageSink.java deleted file mode 100644 index 2af8195a..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/AbstractImageSink.java +++ /dev/null @@ -1,58 +0,0 @@ -package net.coobird.thumbnailator.tasks.io; - -import java.awt.image.BufferedImage; -import java.io.IOException; - -import net.coobird.thumbnailator.ThumbnailParameter; - -/** - * An abstract class for {@link ImageSink}s. - * - * @author coobird - * - */ -public abstract class AbstractImageSink implements ImageSink -{ - /** - * The name of the format to output the image as. - */ - protected String outputFormat; - - /** - * The parameters that should be used when storing the image. - */ - protected ThumbnailParameter param; - - /** - * Default constructor. - */ - protected AbstractImageSink() {} - - public void setOutputFormatName(String format) - { - outputFormat = format; - } - - public void setThumbnailParameter(ThumbnailParameter param) - { - this.param = param; - } - - public void write(BufferedImage img) throws IOException - { - if (img == null) - { - throw new NullPointerException("Cannot write a null image."); - } - - if (ThumbnailParameter.DETERMINE_FORMAT.equals(outputFormat)) - { - outputFormat = preferredOutputFormatName(); - } - } - - public String preferredOutputFormatName() - { - return ThumbnailParameter.ORIGINAL_FORMAT; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/AbstractImageSource.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/AbstractImageSource.java deleted file mode 100644 index 9e547466..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/AbstractImageSource.java +++ /dev/null @@ -1,67 +0,0 @@ -package net.coobird.thumbnailator.tasks.io; - -import net.coobird.thumbnailator.ThumbnailParameter; - -/** - * An abstract class for {@link ImageSource}s. - * - * @author coobird - * - */ -public abstract class AbstractImageSource implements ImageSource -{ - /** - * The image format of the input image. - */ - protected String inputFormatName; - - /** - * The parameters that should be used when retrieving the image. - */ - protected ThumbnailParameter param; - - /** - * Indicates whether the input has already been read. - */ - protected boolean hasReadInput = false; - - /** - * Default constructor. - */ - protected AbstractImageSource() {} - - /** - * Indicates that the {@link ImageSource} has completed reading the input - * file, and returns the value given in the argument. - *

- * This method should be used by implementation classes when returning - * the result of the {@link #read()} method, as shown in the following - * example code: -

-return finishedReading(sourceImage);
-
- * - * @param The return value type. - * @param returnValue The return value of the {@link #read()} method. - * @return The return value of the {@link #read()} method. - */ - protected V finishedReading(V returnValue) - { - hasReadInput = true; - return returnValue; - } - - public void setThumbnailParameter(ThumbnailParameter param) - { - this.param = param; - } - - public String getInputFormatName() - { - if (!hasReadInput) - { - throw new IllegalStateException("Input has not been read yet."); - } - return inputFormatName; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/BufferedImageSink.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/BufferedImageSink.java deleted file mode 100644 index 05036bf1..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/BufferedImageSink.java +++ /dev/null @@ -1,54 +0,0 @@ -package net.coobird.thumbnailator.tasks.io; - -import java.awt.image.BufferedImage; -import java.io.IOException; - -/** - * An {@link ImageSink} which stores the resulting thumbnail to a - * {@link BufferedImage}. - * - * @author coobird - * - */ -public class BufferedImageSink extends AbstractImageSink -{ - /** - * The {@link BufferedImage} which holds the thumbnail. - */ - private BufferedImage img; - - /** - * Indicates whether the thumbnail has been written to this object. - */ - private boolean written = false; - - public void write(BufferedImage img) throws IOException - { - super.write(img); - - this.img = img; - written = true; - } - - /** - * Returns the thumbnail. - * - * @return The thumbnail. - * @throws IllegalStateException If a thumbnail has not been stored to - * this {@link BufferedImageSink} yet. - */ - public BufferedImage getSink() - { - if (!written) - { - throw new IllegalStateException("BufferedImageSink has not been written to yet."); - } - return img; - } - - @Override - public void setOutputFormatName(String format) - { - // do nothing - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/BufferedImageSource.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/BufferedImageSource.java deleted file mode 100644 index f529b569..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/BufferedImageSource.java +++ /dev/null @@ -1,64 +0,0 @@ -package net.coobird.thumbnailator.tasks.io; - -import java.awt.Rectangle; -import java.awt.image.BufferedImage; -import java.io.IOException; - -import net.coobird.thumbnailator.geometry.Region; - -/** - * An {@link ImageSource} which uses a {@link BufferedImage} as the source - * image. - * - * @author coobird - * - */ -public class BufferedImageSource extends AbstractImageSource -{ - /** - * The image that should be used as the source for making a thumbnail. - */ - private final BufferedImage img; - - /** - * Instantiates a {@link BufferedImageSource} object with the - * {@link BufferedImage} that should be used as the source image for making - * thumbnails. - * - * @param img The source image. - * @throws NullPointerException If the image is null. - */ - public BufferedImageSource(BufferedImage img) - { - super(); - - if (img == null) - { - throw new NullPointerException("Image cannot be null."); - } - - this.img = img; - } - - public BufferedImage read() throws IOException - { - inputFormatName = null; - - if (param != null && param.getSourceRegion() != null) - { - Region region = param.getSourceRegion(); - Rectangle r = region.calculate(img.getWidth(), img.getHeight()); - - return finishedReading(img.getSubimage(r.x, r.y, r.width, r.height)); - } - else - { - return finishedReading(img); - } - } - - public BufferedImage getSource() - { - return img; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/FileImageSink.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/FileImageSink.java deleted file mode 100644 index 5798f930..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/FileImageSink.java +++ /dev/null @@ -1,454 +0,0 @@ -package net.coobird.thumbnailator.tasks.io; - -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; - -import javax.imageio.IIOImage; -import javax.imageio.ImageIO; -import javax.imageio.ImageReader; -import javax.imageio.ImageWriteParam; -import javax.imageio.ImageWriter; -import javax.imageio.stream.ImageOutputStream; - -import net.coobird.thumbnailator.ThumbnailParameter; -import net.coobird.thumbnailator.tasks.UnsupportedFormatException; -import net.coobird.thumbnailator.util.BufferedImages; -import net.coobird.thumbnailator.util.ThumbnailatorUtils; - -/** - * An {@link ImageSink} which writes the resulting thumbnail to a file. - *

- * Under certain circumstances, the destination file can change in the course - * of processing. - *

- * This can occur in cases where the file extension does not - * match the output format set by the {@link #setOutputFormatName(String)} - * method. In this case, the file name will have a file extension corresponding - * to the output format set in the above method to be appended to the file - * name originally provided when instantiating the {@link FileImageSink} object. - * - * @author coobird - * - */ -public class FileImageSink extends AbstractImageSink -{ - /** - * The file to which the thumbnail is written to. - *

- * Under certain circumstances, the {@link File} object can be replaced - * in the course of processing. This can occur in cases where the file - * extension has been changed due to incongruence between the extension - * and the desired output format. - */ - private File destinationFile; - - private final boolean allowOverwrite; - - /** - * Instantiates a {@link FileImageSink} with the file to which the thumbnail - * should be written to. - *

- * The output format to use will be determined from the file extension. - * If another format should be used, then the - * {@link #setOutputFormatName(String)} should be called with the desired - * output format name. - *

- * When the destination file exists, then this {@code FileImageSink} will - * overwrite the existing file. - * - * @param destinationFile The destination file. - * @throws NullPointerException If the specified file is {@code null}. - */ - public FileImageSink(File destinationFile) - { - this(destinationFile, true); - } - - /** - * Instantiates a {@link FileImageSink} with the file to which the thumbnail - * should be written to. - *

- * The output format to use will be determined from the file extension. - * If another format should be used, then the - * {@link #setOutputFormatName(String)} should be called with the desired - * output format name. - * - * @param destinationFile The destination file. - * @param allowOverwrite Whether or not the {@code FileImageSink} - * should overwrite the destination file if - * it already exists. - * @throws NullPointerException If the specified file is {@code null}. - */ - public FileImageSink(File destinationFile, boolean allowOverwrite) - { - super(); - - if (destinationFile == null) - { - throw new NullPointerException("File cannot be null."); - } - - this.destinationFile = destinationFile; - this.outputFormat = getExtension(destinationFile); - this.allowOverwrite = allowOverwrite; - } - - /** - * Instantiates a {@link FileImageSink} with the file to which the thumbnail - * should be written to. - *

- * The output format to use will be determined from the file extension. - * If another format should be used, then the - * {@link #setOutputFormatName(String)} should be called with the desired - * output format name. - *

- * When the destination file exists, then this {@code FileImageSink} will - * overwrite the existing file. - * - * @param destinationFilePath The destination file path. - * @throws NullPointerException If the specified file path is {@code null}. - */ - public FileImageSink(String destinationFilePath) - { - this(destinationFilePath, true); - } - - /** - * Instantiates a {@link FileImageSink} with the file to which the thumbnail - * should be written to. - *

- * The output format to use will be determined from the file extension. - * If another format should be used, then the - * {@link #setOutputFormatName(String)} should be called with the desired - * output format name. - * - * @param destinationFilePath The destination file path. - * @param allowOverwrite Whether or not the {@code FileImageSink} - * should overwrite the destination file if - * it already exists. - * @throws NullPointerException If the specified file path is {@code null}. - */ - public FileImageSink(String destinationFilePath, boolean allowOverwrite) - { - super(); - - if (destinationFilePath == null) - { - throw new NullPointerException("File cannot be null."); - } - - this.destinationFile = new File(destinationFilePath); - this.outputFormat = getExtension(destinationFile); - this.allowOverwrite = allowOverwrite; - } - - /** - * Determines whether an specified format name and file extension are - * for the same format. - * - * @param formatName Format name. - * @param fileExtension File extension. - * @return Returns {@code true} if the specified file - * extension is valid for the specified format. - */ - private static boolean isMatchingFormat(String formatName, String fileExtension) - { - if (formatName == null || fileExtension == null) - { - return false; - } - - ImageWriter iw; - try - { - iw = ImageIO.getImageWritersByFormatName(formatName).next(); - } - catch (NoSuchElementException e) - { - return false; - } - - String[] suffixes = iw.getOriginatingProvider().getFileSuffixes(); - - for (String suffix : suffixes) - { - if (fileExtension.equalsIgnoreCase(suffix)) - { - return true; - } - } - return false; - } - - /** - * Returns the file extension of the given {@link File}. - * - * @param f The file. - * @return The extension of the file. - */ - private static String getExtension(File f) - { - String fileName = f.getName(); - if ( - fileName.indexOf('.') != -1 - && fileName.lastIndexOf('.') != fileName.length() - 1 - ) - { - int lastIndex = fileName.lastIndexOf('.'); - return fileName.substring(lastIndex + 1); - } - - return null; - } - - @Override - public String preferredOutputFormatName() - { - String fileExtension = getExtension(destinationFile); - - if (fileExtension != null) - { - Iterator rIter = ImageIO.getImageReadersBySuffix(fileExtension); - - if (rIter.hasNext()) - { - try - { - return rIter.next().getFormatName(); - } - catch (IOException e) - { - return ThumbnailParameter.ORIGINAL_FORMAT; - } - } - } - - return outputFormat; - } - - /** - * Writes the resulting image to a file. - * - * @param img The image to write. - * @throws UnsupportedFormatException When an unsupported format has been - * specified by the - * {@link #setOutputFormatName(String)} - * method, or if the output format - * has not been set and cannot be - * determined from the file name. - * @throws IOException When a problem occurs while writing - * the image. - * @throws NullPointerException If the image is {@code null}. - * @throws IllegalArgumentException If this {@code FileImageSink} does - * not permit overwriting the - * destination file and the destination - * file already exists. - */ - public void write(BufferedImage img) throws IOException - { - super.write(img); - - /* TODO refactor. - * The following code has been adapted from the - * StreamThumbnailTask.write method. - */ - - /* - * Add or replace the file extension of the output file. - * - * If the file extension matches the output format's extension, - * then leave as is. - * - * Else, append the extension for the output format to the filename. - */ - String fileExtension = getExtension(destinationFile); - - String formatName = outputFormat; - if (formatName != null && (fileExtension == null || !isMatchingFormat(formatName, fileExtension))) - { - destinationFile = new File(destinationFile.getAbsolutePath()); - } - - if (!allowOverwrite && destinationFile.exists()) { - throw new IllegalArgumentException("The destination file exists."); - } - - /* - * If a formatName is not specified, then attempt to determine it from - * the file extension. - */ - if (formatName == null && fileExtension != null) - { - Iterator rIter = ImageIO.getImageReadersBySuffix(fileExtension); - - if (rIter.hasNext()) - { - formatName = rIter.next().getFormatName(); - } - } - - if (formatName == null) - { - throw new UnsupportedFormatException( - formatName, - "Could not determine output format." - ); - } - - // Checks for available writers for the format. - Iterator writers = - ImageIO.getImageWritersByFormatName(formatName); - - if (!writers.hasNext()) - { - throw new UnsupportedFormatException( - formatName, - "No suitable ImageWriter found for " + formatName + "." - ); - } - - ImageWriter writer = writers.next(); - - ImageWriteParam writeParam = writer.getDefaultWriteParam(); - if (writeParam.canWriteCompressed() && param != null) - { - writeParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); - - /* - * Sets the compression format type, if specified. - * - * Note: - * The value to denote that the codec's default compression type - * should be used is null. - */ - if (param.getOutputFormatType() != ThumbnailParameter.DEFAULT_FORMAT_TYPE) - { - writeParam.setCompressionType(param.getOutputFormatType()); - } - else - { - List supportedFormats = - ThumbnailatorUtils.getSupportedOutputFormatTypes(formatName); - - if (!supportedFormats.isEmpty()) - { - writeParam.setCompressionType(supportedFormats.get(0)); - } - } - - /* - * Sets the compression quality, if specified. - * - * Note: - * The value to denote that the codec's default compression quality - * should be used is Float.NaN. - */ - if (!Float.isNaN(param.getOutputQuality())) - { - writeParam.setCompressionQuality(param.getOutputQuality()); - } - } - - /* - * Here, an explicit FileOutputStream is being created, as using a - * File object directly to obtain an ImageOutputStream was causing - * a problem where if the destination file already exists, then the - * image data was being written to the beginning of the file rather than - * creating a new file. - */ - ImageOutputStream ios; - FileOutputStream fos; - - /* - * The following two lines used to be surrounded by a try-catch, - * but it has been removed, as the IOException which it was - * throwing in the catch block was not giving good feedback as to - * what was causing the original IOException. - * - * It would have been informative to have the IOException which - * caused this problem, but the IOException in Java 5 does not - * have a "cause" parameter. - * - * The "cause" parameter has been introduced in Java 6: - * http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html#IOException%28java.lang.String,%20java.lang.Throwable%29 - * - * TODO Whether to surround this portion of code in a try-catch - * again is debatable, as it wouldn't really add more utility. - * - * Furthermore, there are other calls in this method which will - * throw IOExceptions, but they are not surrounded by try-catch - * blocks. (A similar example exists in the OutputStreamImageSink - * where the ImageIO.createImageOutputStream is not surrounded - * in a try-catch.) - * - * Related issue: - * http://code.google.com/p/thumbnailator/issues/detail?id=37 - */ - fos = new FileOutputStream(destinationFile); - ios = ImageIO.createImageOutputStream(fos); - - if (ios == null || fos == null) - { - throw new IOException("Could not open output file."); - } - - /* - * Note: - * The following code is a workaround for the JPEG writer which ships - * with the JDK. - * - * At issue is, that the JPEG writer appears to write the alpha - * channel when it should not. To circumvent this, images which are - * to be saved as a JPEG will be copied to another BufferedImage without - * an alpha channel before it is saved. - * - * Also, the BMP writer appears not to support ARGB, so an RGB image - * will be produced before saving. - */ - if ( - formatName.equalsIgnoreCase("jpg") - || formatName.equalsIgnoreCase("jpeg") - || formatName.equalsIgnoreCase("bmp") - ) - { - img = BufferedImages.copy(img, BufferedImage.TYPE_INT_RGB); - } - - writer.setOutput(ios); - writer.write(null, new IIOImage(img, null, null), writeParam); - - /* - * Dispose the writer to free resources. - * - * This seems to be the main culprit of `OutOfMemoryError`s which - * started to frequently appear with Java 7 Update 21. - * - * Issue: - * http://code.google.com/p/thumbnailator/issues/detail?id=42 - */ - writer.dispose(); - - ios.close(); - fos.close(); - } - - /** - * Returns the detination file of the thumbnail image. - *

- * If the final destination of the thumbnail changes in the course of - * writing the thumbnail. (For example, if the file extension for the given - * destination did not match the destination file format, then the correct - * file extension could be appended.) - * - * @return the destinationFile - */ - public File getSink() - { - return destinationFile; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/FileImageSource.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/FileImageSource.java deleted file mode 100644 index 011bebc4..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/FileImageSource.java +++ /dev/null @@ -1,236 +0,0 @@ -package net.coobird.thumbnailator.tasks.io; - -import java.awt.Rectangle; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.lang.reflect.Field; -import java.util.Iterator; -import java.util.List; - -import javax.imageio.ImageIO; -import javax.imageio.ImageReadParam; -import javax.imageio.ImageReader; -import javax.imageio.stream.ImageInputStream; - -import net.coobird.thumbnailator.filters.ImageFilter; -import net.coobird.thumbnailator.geometry.Region; -import net.coobird.thumbnailator.tasks.UnsupportedFormatException; -import net.coobird.thumbnailator.util.exif.ExifFilterUtils; -import net.coobird.thumbnailator.util.exif.ExifUtils; -import net.coobird.thumbnailator.util.exif.Orientation; - -/** - * An {@link ImageSource} which reads the source image from a file. - * - * @author coobird - * - */ -public class FileImageSource extends AbstractImageSource -{ - /** - * The index used to obtain the first image in an image file. - */ - private static final int FIRST_IMAGE_INDEX = 0; - - /** - * The file from which the image should be obtained. - */ - private final File sourceFile; - - /** - * Instantiates a {@link FileImageSource} with the specified file as - * the source image. - * - * @param sourceFile The source image file. - * @throws NullPointerException If the image is null. - */ - public FileImageSource(File sourceFile) - { - super(); - - if (sourceFile == null) - { - throw new NullPointerException("File cannot be null."); - } - - this.sourceFile = sourceFile; - } - - /** - * Instantiates a {@link FileImageSource} with the specified file as - * the source image. - * - * @param sourceFilePath The filepath of the source image file. - * @throws NullPointerException If the image is null. - */ - public FileImageSource(String sourceFilePath) - { - super(); - - if (sourceFilePath == null) - { - throw new NullPointerException("File cannot be null."); - } - - this.sourceFile = new File(sourceFilePath); - } - - public BufferedImage read() throws IOException - { - if (!sourceFile.exists()) - { - throw new FileNotFoundException( - "Could not find file: " + sourceFile.getAbsolutePath() - ); - } - - /* TODO refactor. - * The following code has been adapted from the - * StreamThumbnailTask.read method. - */ - ImageInputStream iis = ImageIO.createImageInputStream(sourceFile); - - if (iis == null) - { - throw new IOException( - "Could not open file: " + sourceFile.getAbsolutePath()); - } - - Iterator readers = ImageIO.getImageReaders(iis); - if (!readers.hasNext()) - { - String sourcePath = sourceFile.getPath(); - throw new UnsupportedFormatException( - UnsupportedFormatException.UNKNOWN, - "No suitable ImageReader found for " + sourcePath + "." - ); - } - - ImageReader reader = readers.next(); - reader.setInput(iis); - inputFormatName = reader.getFormatName(); - - try - { - if (param.useExifOrientation()) - { - Orientation orientation; - orientation = - ExifUtils.getExifOrientation(reader, FIRST_IMAGE_INDEX); - - // Skip this code block if there's no rotation needed. - if (orientation != null && orientation != Orientation.TOP_LEFT) - { - List filters = param.getImageFilters(); - - // EXIF orientation filter is added to the beginning, as - // it should be performed early to prevent mis-orientation - // in later filters. - filters.add(0, ExifFilterUtils.getFilterForOrientation(orientation)); - } - } - } - catch (Exception e) - { - // If something goes wrong, then skip the orientation-related - // processing. - // TODO Ought to have some way to track errors. - } - - BufferedImage img; - - ImageReadParam irParam = reader.getDefaultReadParam(); - int width = reader.getWidth(FIRST_IMAGE_INDEX); - int height = reader.getHeight(FIRST_IMAGE_INDEX); - - if (param != null && param.getSourceRegion() != null) - { - Region region = param.getSourceRegion(); - Rectangle sourceRegion = region.calculate(width, height); - - irParam.setSourceRegion(sourceRegion); - } - - /* - * FIXME Workaround to enable subsampling for large source images. - * - * Issue: - * https://code.google.com/p/thumbnailator/issues/detail?id=69 - */ - if (param != null && - "true".equals(System.getProperty("thumbnailator.conserveMemoryWorkaround")) && - width > 1800 && height > 1800 && - (width * height * 4 > Runtime.getRuntime().freeMemory() / 4) - ) - { - int subsampling = 1; - - // Calculate the maximum subsampling that can be used. - if (param.getSize() != null && (param.getSize().width * 2 < width && param.getSize().height * 2 < height)) - { - double widthScaling = (double)width / (double)param.getSize().width; - double heightScaling = (double)height / (double)param.getSize().height; - subsampling = (int)Math.floor(Math.min(widthScaling, heightScaling)); - } - else if (param.getSize() == null) - { - subsampling = (int)Math.max(1, Math.floor(1 / Math.max(param.getHeightScalingFactor(), param.getWidthScalingFactor()))); - } - - // Prevent excessive subsampling that can ruin image quality. - // This will ensure that at least a 600 x 600 image will be used as source. - for (; (width / subsampling) < 600 || (height / subsampling) < 600; subsampling--); - - // If scaling factor based resize is used, need to change the scaling factor. - if (param.getSize() == null) - { - try - { - Class c = param.getClass(); - Field heightField = c.getDeclaredField("heightScalingFactor"); - Field widthField = c.getDeclaredField("widthScalingFactor"); - heightField.setAccessible(true); - widthField.setAccessible(true); - heightField.set(param, param.getHeightScalingFactor() * (double)subsampling); - widthField.set(param, param.getWidthScalingFactor() * (double)subsampling); - } - catch (Exception e) - { - // If we can't update the parameter, then disable subsampling. - subsampling = 1; - } - } - - irParam.setSourceSubsampling(subsampling, subsampling, 0, 0); - } - - img = reader.read(FIRST_IMAGE_INDEX, irParam); - - /* - * Dispose the reader to free resources. - * - * This seems to be one of the culprits which was causing - * `OutOfMemoryError`s which began appearing frequently with - * Java 7 Update 21. - * - * Issue: - * http://code.google.com/p/thumbnailator/issues/detail?id=42 - */ - reader.dispose(); - iis.close(); - - return finishedReading(img); - } - - /** - * Returns the source file from which an image is read. - * - * @return The {@code File} representation of the source file. - */ - public File getSource() - { - return sourceFile; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/ImageSink.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/ImageSink.java deleted file mode 100644 index b54f311f..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/ImageSink.java +++ /dev/null @@ -1,65 +0,0 @@ -package net.coobird.thumbnailator.tasks.io; - -import java.awt.image.BufferedImage; -import java.io.IOException; - -import net.coobird.thumbnailator.ThumbnailParameter; - -/** - * An interface to be implemented by classes which stores the image resulting - * from a thumbnail generation schedule. - * - * @param The destination class to which the thumbnail is stored - * or written. - * - * @author coobird - * - */ -public interface ImageSink -{ - /** - * Writes the resulting image to a destination. - * - * @param img The image to write or store. - * @throws IOException When a problem occurs while writing or storing - * the image. - * @throws NullPointerException If the image is {@code null}. - */ - public void write(BufferedImage img) throws IOException; - - /** - * Sets the output format of the resulting image. - *

- * For {@link ImageSink}s which stores raw images, the format name specified - * by this method may be ignored. - * - * @param format File format with which to store the image. - */ - public void setOutputFormatName(String format); - - /** - * Sets the {@link ThumbnailParameter} from which to retrieve parameters - * to use when storing the image. - * - * @param param The {@link ThumbnailParameter} with image - * writing parameters. - */ - public void setThumbnailParameter(ThumbnailParameter param); - - /** - * Returns the output format to use from information provided for the - * output image. - *

- * If the output format cannot be determined, then - * {@link ThumbnailParameter#ORIGINAL_FORMAT} should be returned. - */ - public String preferredOutputFormatName(); - - /** - * Returns the destination to which the thumbnail will be stored or - * written. - * - * @return The destination for the thumbnail image. - */ - public T getSink(); -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/ImageSource.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/ImageSource.java deleted file mode 100644 index a57e7bd3..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/ImageSource.java +++ /dev/null @@ -1,54 +0,0 @@ -package net.coobird.thumbnailator.tasks.io; - -import java.awt.image.BufferedImage; -import java.io.IOException; - -import net.coobird.thumbnailator.ThumbnailParameter; - -/** - * An interface to be implemented by classes which read or retrieve images - * from which a thumbnail should be produced. - * - * @param The source class from which the source image is retrieved - * or read. - * @author coobird - * - */ -public interface ImageSource -{ - /** - * Retrieves the image from the source. - * - * @return The image. - * @throws IOException When a problem occurs while reading or obtaining - * the image. - */ - public BufferedImage read() throws IOException; - - /** - * Returns the name of the image format. - * - * @return The image format name. If there is no - * image format information, then - * {@code null} will be returned. - * @throws IllegalStateException If the source image has not been - * read yet. - */ - public String getInputFormatName(); - - /** - * Sets the {@link ThumbnailParameter} from which to retrieve parameters - * to use when retrieving the image. - * - * @param param The {@link ThumbnailParameter} with image - * reading parameters. - */ - public void setThumbnailParameter(ThumbnailParameter param); - - /** - * Returns the source from which the image is read or retrieved. - * - * @return The source of the image. - */ - public T getSource(); -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/InputStreamImageSource.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/InputStreamImageSource.java deleted file mode 100644 index 568b3a20..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/InputStreamImageSource.java +++ /dev/null @@ -1,201 +0,0 @@ -package net.coobird.thumbnailator.tasks.io; - -import java.awt.Rectangle; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Field; -import java.util.Iterator; -import java.util.List; - -import javax.imageio.ImageIO; -import javax.imageio.ImageReadParam; -import javax.imageio.ImageReader; -import javax.imageio.stream.ImageInputStream; - -import net.coobird.thumbnailator.filters.ImageFilter; -import net.coobird.thumbnailator.geometry.Region; -import net.coobird.thumbnailator.tasks.UnsupportedFormatException; -import net.coobird.thumbnailator.util.exif.ExifFilterUtils; -import net.coobird.thumbnailator.util.exif.ExifUtils; -import net.coobird.thumbnailator.util.exif.Orientation; - -/** - * An {@link ImageSource} which uses an {@link InputStream} to read the - * source image. - * - * @author coobird - * - */ -public class InputStreamImageSource extends AbstractImageSource -{ - /** - * The index used to obtain the first image in an image file. - */ - private static final int FIRST_IMAGE_INDEX = 0; - - /** - * The {@link InputStream} from which the source image is to be read. - */ - private final InputStream is; - - /** - * Instantiates an {@link InputStreamImageSource} with the - * {@link InputStream} which will be used to read the source image. - * - * @param is The {@link InputStream} which is to be used to obtain - * the source image. - * @throws NullPointerException If the {@link InputStream} is - * {@code null}. - */ - public InputStreamImageSource(InputStream is) - { - super(); - - if (is == null) - { - throw new NullPointerException("InputStream cannot be null."); - } - - this.is = is; - } - - public BufferedImage read() throws IOException - { - ImageInputStream iis = ImageIO.createImageInputStream(is); - - if (iis == null) - { - throw new IOException("Could not open InputStream."); - } - - Iterator readers = ImageIO.getImageReaders(iis); - if (!readers.hasNext()) - { - throw new UnsupportedFormatException( - UnsupportedFormatException.UNKNOWN, - "No suitable ImageReader found for source data." - ); - } - - ImageReader reader = readers.next(); - reader.setInput(iis); - inputFormatName = reader.getFormatName(); - - try - { - if (param.useExifOrientation()) - { - Orientation orientation; - orientation = - ExifUtils.getExifOrientation(reader, FIRST_IMAGE_INDEX); - - // Skip this code block if there's no rotation needed. - if (orientation != null && orientation != Orientation.TOP_LEFT) - { - List filters = param.getImageFilters(); - - // EXIF orientation filter is added to the beginning, as - // it should be performed early to prevent mis-orientation - // in later filters. - filters.add(0, ExifFilterUtils.getFilterForOrientation(orientation)); - } - } - } - catch (Exception e) - { - // If something goes wrong, then skip the orientation-related - // processing. - // TODO Ought to have some way to track errors. - } - - BufferedImage img; - - ImageReadParam irParam = reader.getDefaultReadParam(); - int width = reader.getWidth(FIRST_IMAGE_INDEX); - int height = reader.getHeight(FIRST_IMAGE_INDEX); - - if (param != null && param.getSourceRegion() != null) - { - Region region = param.getSourceRegion(); - Rectangle sourceRegion = region.calculate(width, height); - - irParam.setSourceRegion(sourceRegion); - } - - /* - * FIXME Workaround to enable subsampling for large source images. - * - * Issue: - * https://code.google.com/p/thumbnailator/issues/detail?id=69 - */ - if (param != null && - "true".equals(System.getProperty("thumbnailator.conserveMemoryWorkaround")) && - width > 1800 && height > 1800 && - (width * height * 4 > Runtime.getRuntime().freeMemory() / 4) - ) - { - int subsampling = 1; - - // Calculate the maximum subsampling that can be used. - if (param.getSize() != null && (param.getSize().width * 2 < width && param.getSize().height * 2 < height)) - { - double widthScaling = (double)width / (double)param.getSize().width; - double heightScaling = (double)height / (double)param.getSize().height; - subsampling = (int)Math.floor(Math.min(widthScaling, heightScaling)); - } - else if (param.getSize() == null) - { - subsampling = (int)Math.max(1, Math.floor(1 / Math.max(param.getHeightScalingFactor(), param.getWidthScalingFactor()))); - } - - // Prevent excessive subsampling that can ruin image quality. - // This will ensure that at least a 600 x 600 image will be used as source. - for (; (width / subsampling) < 600 || (height / subsampling) < 600; subsampling--); - - // If scaling factor based resize is used, need to change the scaling factor. - if (param.getSize() == null) - { - try - { - Class c = param.getClass(); - Field heightField = c.getDeclaredField("heightScalingFactor"); - Field widthField = c.getDeclaredField("widthScalingFactor"); - heightField.setAccessible(true); - widthField.setAccessible(true); - heightField.set(param, param.getHeightScalingFactor() * (double)subsampling); - widthField.set(param, param.getWidthScalingFactor() * (double)subsampling); - } - catch (Exception e) - { - // If we can't update the parameter, then disable subsampling. - subsampling = 1; - } - } - - irParam.setSourceSubsampling(subsampling, subsampling, 0, 0); - } - - img = reader.read(FIRST_IMAGE_INDEX, irParam); - - /* - * Dispose the reader to free resources. - * - * This seems to be one of the culprits which was causing - * `OutOfMemoryError`s which began appearing frequently with - * Java 7 Update 21. - * - * Issue: - * http://code.google.com/p/thumbnailator/issues/detail?id=42 - */ - reader.dispose(); - iis.close(); - - return finishedReading(img); - } - - public InputStream getSource() - { - return is; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/OutputStreamImageSink.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/OutputStreamImageSink.java deleted file mode 100644 index c3862a10..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/OutputStreamImageSink.java +++ /dev/null @@ -1,185 +0,0 @@ -package net.coobird.thumbnailator.tasks.io; - -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.OutputStream; -import java.util.Iterator; -import java.util.List; - -import javax.imageio.IIOImage; -import javax.imageio.ImageIO; -import javax.imageio.ImageWriteParam; -import javax.imageio.ImageWriter; -import javax.imageio.stream.ImageOutputStream; - -import net.coobird.thumbnailator.ThumbnailParameter; -import net.coobird.thumbnailator.tasks.UnsupportedFormatException; -import net.coobird.thumbnailator.util.BufferedImages; -import net.coobird.thumbnailator.util.ThumbnailatorUtils; - -/** - * An {@link ImageSink} which specifies an {@link OutputStream} to which the - * thumbnail image should be written to. - * - * @author coobird - * - */ -public class OutputStreamImageSink extends AbstractImageSink -{ - /** - * The {@link OutputStream} to which the thumbnail image is to be - * written to. - */ - private final OutputStream os; - - /** - * Instantiates an {@link OutputStreamImageSink} with the - * {@link OutputStream} to which the thumbnail should be written to. - * - * @param os The {@link OutputStream} to write the thumbnail to. - * @throws NullPointerException If the {@link OutputStream} is - * {@code null}. - */ - public OutputStreamImageSink(OutputStream os) - { - super(); - - if (os == null) - { - throw new NullPointerException("OutputStream cannot be null."); - } - - this.os = os; - } - - /** - * Writes the resulting image to the {@link OutputStream}. - * - * @param img The image to write. - * @throws UnsupportedFormatException When an unsupported format has been - * specified by the - * {@link #setOutputFormatName(String)} - * method. - * @throws IOException When a problem occurs while writing - * the image. - * @throws NullPointerException If the image is {@code null}. - * @throws IllegalStateException If the output format has not been set - * by calling the - * {@link #setOutputFormatName(String)} - * method. - */ - public void write(BufferedImage img) throws IOException - { - super.write(img); - - if (outputFormat == null) - { - throw new IllegalStateException("Output format has not been set."); - } - - String formatName = outputFormat; - - Iterator writers = - ImageIO.getImageWritersByFormatName(formatName); - - if (!writers.hasNext()) - { - throw new UnsupportedFormatException( - formatName, - "No suitable ImageWriter found for " + formatName + "." - ); - } - - ImageWriter writer = writers.next(); - - ImageWriteParam writeParam = writer.getDefaultWriteParam(); - if (writeParam.canWriteCompressed() && param != null) - { - writeParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); - - /* - * Sets the compression format type, if specified. - * - * Note: - * The value to denote that the codec's default compression type - * should be used is null. - */ - if (param.getOutputFormatType() != ThumbnailParameter.DEFAULT_FORMAT_TYPE) - { - writeParam.setCompressionType(param.getOutputFormatType()); - } - else - { - List supportedFormats = - ThumbnailatorUtils.getSupportedOutputFormatTypes(formatName); - - if (!supportedFormats.isEmpty()) - { - writeParam.setCompressionType(supportedFormats.get(0)); - } - } - - /* - * Sets the compression quality, if specified. - * - * Note: - * The value to denote that the codec's default compression quality - * should be used is Float.NaN. - */ - if (!Float.isNaN(param.getOutputQuality())) - { - writeParam.setCompressionQuality(param.getOutputQuality()); - } - } - - ImageOutputStream ios = ImageIO.createImageOutputStream(os); - - if (ios == null) - { - throw new IOException("Could not open OutputStream."); - } - - /* - * Note: - * The following code is a workaround for the JPEG writer which ships - * with the JDK. - * - * At issue is, that the JPEG writer appears to write the alpha - * channel when it should not. To circumvent this, images which are - * to be saved as a JPEG will be copied to another BufferedImage without - * an alpha channel before it is saved. - * - * Also, the BMP writer appears not to support ARGB, so an RGB image - * will be produced before saving. - */ - if ( - formatName.equalsIgnoreCase("jpg") - || formatName.equalsIgnoreCase("jpeg") - || formatName.equalsIgnoreCase("bmp") - ) - { - img = BufferedImages.copy(img, BufferedImage.TYPE_INT_RGB); - } - - writer.setOutput(ios); - writer.write(null, new IIOImage(img, null, null), writeParam); - - /* - * Dispose the writer to free resources. - * - * This seems to be the main culprit of `OutOfMemoryError`s which - * started to frequently appear with Java 7 Update 21. - * - * Issue: - * http://code.google.com/p/thumbnailator/issues/detail?id=42 - */ - writer.dispose(); - - ios.close(); - } - - public OutputStream getSink() - { - return os; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/URLImageSource.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/URLImageSource.java deleted file mode 100644 index 7ef5caf1..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/URLImageSource.java +++ /dev/null @@ -1,179 +0,0 @@ -package net.coobird.thumbnailator.tasks.io; - -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.Proxy; -import java.net.URL; - -/** - * An {@link ImageSource} which retrieves a source image from a URL. - * - * @author coobird - * - */ -public class URLImageSource extends AbstractImageSource -{ - /** - * The URL from which to retrieve the source image. - */ - private final URL url; - - /** - * The proxy to use to callOutConnect to the image URL. - *

- * If a proxy is not required, then this field will be {@code null}. - */ - private final Proxy proxy; - - /** - * Instantiates an {@link URLImageSource} with the URL from which the - * source image should be retrieved from. - * - * @param url URL to the source image. - * @throws NullPointerException If the URL is null - */ - public URLImageSource(URL url) - { - super(); - - if (url == null) - { - throw new NullPointerException("URL cannot be null."); - } - - this.url = url; - this.proxy = null; - } - - /** - * Instantiates an {@link URLImageSource} with the URL from which the - * source image should be retrieved from. - * - * @param url URL to the source image. - * @throws NullPointerException If the URL is null - * @throws MalformedURLException If the URL is not valid. - */ - public URLImageSource(String url) throws MalformedURLException - { - super(); - - if (url == null) - { - throw new NullPointerException("URL cannot be null."); - } - - this.url = new URL(url); - this.proxy = null; - } - - /** - * Instantiates an {@link URLImageSource} with the URL from which the - * source image should be retrieved from, along with the proxy to use - * to callOutConnect to the aforementioned URL. - * - * @param url URL to the source image. - * @param proxy Proxy to use to callOutConnect to the URL. - * @throws NullPointerException If the URL and or the proxy is null - */ - public URLImageSource(URL url, Proxy proxy) - { - super(); - - if (url == null) - { - throw new NullPointerException("URL cannot be null."); - } - else if (proxy == null) - { - throw new NullPointerException("Proxy cannot be null."); - } - - this.url = url; - this.proxy = proxy; - } - - /** - * Instantiates an {@link URLImageSource} with the URL from which the - * source image should be retrieved from, along with the proxy to use - * to callOutConnect to the aforementioned URL. - * - * @param url URL to the source image. - * @param proxy Proxy to use to callOutConnect to the URL. - * @throws NullPointerException If the URL and or the proxy is null - * @throws MalformedURLException If the URL is not valid. - */ - public URLImageSource(String url, Proxy proxy) throws MalformedURLException - { - super(); - - if (url == null) - { - throw new NullPointerException("URL cannot be null."); - } - else if (proxy == null) - { - throw new NullPointerException("Proxy cannot be null."); - } - - this.url = new URL(url); - this.proxy = proxy; - } - - public BufferedImage read() throws IOException - { - InputStreamImageSource source; - try - { - if (proxy != null) - { - source = new InputStreamImageSource(url.openConnection(proxy).getInputStream()); - } - else - { - source = new InputStreamImageSource(url.openStream()); - } - } - catch (IOException e) - { - throw new IOException("Could not open connection to URL: " + url); - } - - source.setThumbnailParameter(param); - - BufferedImage img; - try - { - img = source.read(); - } - catch (Exception e) - { - throw new IOException("Could not obtain image from URL: " + url); - } - - this.inputFormatName = source.getInputFormatName(); - - return finishedReading(img); - } - - /** - * Returns the URL from which the source image is retrieved from. - * - * @return the url The URL to the source image.s - */ - public URL getSource() - { - return url; - } - - /** - * Returns the proxy to use when connecting to the URL to retrieve the - * source image. - * - * @return the proxy The proxy used to callOutConnect to a URL. - */ - public Proxy getProxy() - { - return proxy; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/package-info.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/package-info.java deleted file mode 100644 index 9c3d496c..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/io/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -/** - * This package provides classes which perform image input and output - * operations in conjunction with the - * {@link net.coobird.thumbnailator.tasks.SourceSinkThumbnailTask} class. - */ -package net.coobird.thumbnailator.tasks.io; diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/package-info.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/package-info.java deleted file mode 100644 index 23329431..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/tasks/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -/** - * This package provides classes which perform image input and output - * operations, which can be used to aid in creating and writing thumbnails - * to and from external sources. - */ -package net.coobird.thumbnailator.tasks; diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/BufferedImages.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/util/BufferedImages.java deleted file mode 100644 index 15f7bd7e..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/BufferedImages.java +++ /dev/null @@ -1,53 +0,0 @@ -package net.coobird.thumbnailator.util; - -import java.awt.Graphics; -import java.awt.image.BufferedImage; - -/** - * This class provides convenience methods for using {@link BufferedImage}s. - * - * @author coobird - * - */ -public final class BufferedImages -{ - /** - * This class is not intended to be instantiated. - */ - private BufferedImages() {} - - /** - * Returns a {@link BufferedImage} which is a graphical copy of the - * specified image. - * - * @param img The image to copy. - * @return A copy of the specified image. - */ - public static BufferedImage copy(BufferedImage img) - { - return copy(img, img.getType()); - } - - /** - * Returns a {@link BufferedImage} with the specified image type, where the - * graphical content is a copy of the specified image. - * - * @param img The image to copy. - * @param imageType The image type for the image to return. - * @return A copy of the specified image. - */ - public static BufferedImage copy(BufferedImage img, int imageType) - { - int width = img.getWidth(); - int height = img.getHeight(); - - BufferedImage newImage = new BufferedImage(width, height, imageType); - Graphics g = newImage.createGraphics(); - - g.drawImage(img, 0, 0, null); - - g.dispose(); - - return newImage; - } -} \ No newline at end of file diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/ThumbnailatorUtils.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/util/ThumbnailatorUtils.java deleted file mode 100644 index 0159d316..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/ThumbnailatorUtils.java +++ /dev/null @@ -1,154 +0,0 @@ -package net.coobird.thumbnailator.util; - -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import javax.imageio.ImageIO; -import javax.imageio.ImageWriter; - -import net.coobird.thumbnailator.ThumbnailParameter; - -/** - * A utility class for Thumbnailator. - * - * @author coobird - * - */ -public final class ThumbnailatorUtils -{ - /** - * This class is not intended to be instantiated. - */ - private ThumbnailatorUtils() {} - - /** - * Returns a {@link List} of supported output formats. - * - * @return A {@link List} of supported output formats. If no formats - * are supported, an empty list is returned. - */ - public static List getSupportedOutputFormats() - { - String[] formats = ImageIO.getWriterFormatNames(); - - if (formats == null) - { - return Collections.emptyList(); - } - else - { - return Arrays.asList(formats); - } - } - - /** - * Returns whether a specified format is supported for output. - * - * @param format The format to check whether it is supported or not. - * @return {@code true} if the format is supported, {@code false} - * otherwise. - */ - public static boolean isSupportedOutputFormat(String format) - { - if (format == ThumbnailParameter.ORIGINAL_FORMAT) - { - return true; - } - - for (String supportedFormat : getSupportedOutputFormats()) - { - if (supportedFormat.equals(format)) - { - return true; - } - } - - return false; - } - - /** - * Returns a {@link List} of supported output formats types for a specified - * output format. - * - * @return A {@link List} of supported output formats types. If no - * formats types are supported, or if compression is not - * supported for the specified format, then an empty list - * is returned. - */ - public static List getSupportedOutputFormatTypes(String format) - { - if (format == ThumbnailParameter.ORIGINAL_FORMAT) - { - return Collections.emptyList(); - } - - Iterator writers = ImageIO.getImageWritersByFormatName(format); - if (!writers.hasNext()) - { - return Collections.emptyList(); - } - - String[] types; - try - { - types = writers.next().getDefaultWriteParam().getCompressionTypes(); - } - catch (UnsupportedOperationException e) - { - return Collections.emptyList(); - } - - if (types == null) - { - return Collections.emptyList(); - } - else - { - return Arrays.asList(types); - } - } - - /** - * Returns whether a specified format type is supported for a specified - * output format. - * - * @param format The format to check whether it is supported or not. - * @param type The format type to check whether it is supported or not. - * @return {@code true} if the format type is supported by the - * specified supported format, {@code false} otherwise. - */ - public static boolean isSupportedOutputFormatType(String format, String type) - { - if (!isSupportedOutputFormat(format)) - { - return false; - } - - if (format == ThumbnailParameter.ORIGINAL_FORMAT - && type == ThumbnailParameter.DEFAULT_FORMAT_TYPE) - { - return true; - } - else if (format == ThumbnailParameter.ORIGINAL_FORMAT - && type != ThumbnailParameter.DEFAULT_FORMAT_TYPE) - { - return false; - } - else if (type == ThumbnailParameter.DEFAULT_FORMAT_TYPE) - { - return true; - } - - for (String supportedType : getSupportedOutputFormatTypes(format)) - { - if (supportedType.equals(type)) - { - return true; - } - } - - return false; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/ExifFilterUtils.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/ExifFilterUtils.java deleted file mode 100644 index dcb9fea1..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/ExifFilterUtils.java +++ /dev/null @@ -1,70 +0,0 @@ -package net.coobird.thumbnailator.util.exif; - -import net.coobird.thumbnailator.filters.Flip; -import net.coobird.thumbnailator.filters.ImageFilter; -import net.coobird.thumbnailator.filters.Pipeline; -import net.coobird.thumbnailator.filters.Rotation; - -/** - * An utility class which returns a suitable {@link ImageFilter} to perform - * the transformations necessary to properly orient an image according to the - * Exif metadata. - * - * @author coobird - * - */ -public final class ExifFilterUtils -{ - /** - * This class should not be instantiated. - */ - private ExifFilterUtils() {}; - - /** - * Returns a {@link ImageFilter} which will perform the transformations - * required to properly orient the thumbnail according to the Exif - * orientation. - * - * @param orientation The Exif orientation - * @return {@link ImageFilter}s required to properly - * orient the image. - */ - public static ImageFilter getFilterForOrientation(Orientation orientation) - { - Pipeline filters = new Pipeline(); - - if (orientation == Orientation.TOP_RIGHT) - { - filters.add(Flip.HORIZONTAL); - } - else if (orientation == Orientation.BOTTOM_RIGHT) - { - filters.add(Rotation.ROTATE_180_DEGREES); - } - else if (orientation == Orientation.BOTTOM_LEFT) - { - filters.add(Rotation.ROTATE_180_DEGREES); - filters.add(Flip.HORIZONTAL); - } - else if (orientation == Orientation.LEFT_TOP) - { - filters.add(Rotation.RIGHT_90_DEGREES); - filters.add(Flip.HORIZONTAL); - } - else if (orientation == Orientation.RIGHT_TOP) - { - filters.add(Rotation.RIGHT_90_DEGREES); - } - else if (orientation == Orientation.RIGHT_BOTTOM) - { - filters.add(Rotation.LEFT_90_DEGREES); - filters.add(Flip.HORIZONTAL); - } - else if (orientation == Orientation.LEFT_BOTTOM) - { - filters.add(Rotation.LEFT_90_DEGREES); - } - - return filters; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/ExifUtils.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/ExifUtils.java deleted file mode 100644 index c1f5f57b..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/ExifUtils.java +++ /dev/null @@ -1,185 +0,0 @@ -package net.coobird.thumbnailator.util.exif; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import javax.imageio.ImageReader; -import javax.imageio.metadata.IIOMetadata; -import javax.imageio.metadata.IIOMetadataNode; - -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * An utility class used to obtain the orientation information from a given - * Exif metadata. - * - * @author coobird - * - */ -public final class ExifUtils -{ - - private static final String EXIF_MAGIC_STRING = "Exif"; - - /** - * This class should not be instantiated. - */ - private ExifUtils() {}; - - /** - * Returns the orientation obtained from the Exif metadata. - * - * @param reader An {@link ImageReader} which is reading the - * target image. - * @param imageIndex The index of the image from which the Exif - * metadata should be read from. - * @return The orientation information obtained from the - * Exif metadata, as a {@link Orientation} enum. - * @throws IOException When an error occurs during reading. - * @throws IllegalArgumentException If the {@link ImageReader} does not - * have the target image set, or if the - * reader does not have a JPEG open. - */ - public static Orientation getExifOrientation(ImageReader reader, int imageIndex) throws IOException - { - IIOMetadata metadata = reader.getImageMetadata(imageIndex); - Node rootNode = metadata.getAsTree("javax_imageio_jpeg_image_1.0"); - - NodeList childNodes = rootNode.getChildNodes(); - - // Look for the APP1 containing Exif data, and retrieve it. - for (int i = 0; i < childNodes.getLength(); i++) - { - if ("markerSequence".equals(childNodes.item(i).getNodeName())) - { - NodeList markerSequenceChildren = childNodes.item(i).getChildNodes(); - - for (int j = 0; j < markerSequenceChildren.getLength(); j++) - { - IIOMetadataNode metadataNode = (IIOMetadataNode)(markerSequenceChildren.item(j)); - - byte[] bytes = (byte[])metadataNode.getUserObject(); - if (bytes == null) - { - continue; - } - - byte[] magicNumber = new byte[4]; - ByteBuffer.wrap(bytes).get(magicNumber); - - if (EXIF_MAGIC_STRING.equals(new String(magicNumber))) - { - return getOrientationFromExif(bytes); - } - } - } - } - - return null; - } - - private static Orientation getOrientationFromExif(byte[] exifData) - { - - // Needed to make byte-wise reading easier. - ByteBuffer buffer = ByteBuffer.wrap(exifData); - - byte[] exifId = new byte[4]; - buffer.get(exifId); - - if (!EXIF_MAGIC_STRING.equals(new String(exifId))) - { - return null; - } - - // read the \0 after the Exif - buffer.get(); - // read the padding byte - buffer.get(); - - byte[] tiffHeader = new byte[8]; - buffer.get(tiffHeader); - - /* - * The first 2 bytes of the TIFF header contains either: - * "II" for Intel byte alignment (little endian), or - * "MM" for Motorola byte alignment (big endian) - */ - ByteOrder bo; - if (tiffHeader[0] == 'I' && tiffHeader[1] == 'I') - { - bo = ByteOrder.LITTLE_ENDIAN; - } - else - { - bo = ByteOrder.BIG_ENDIAN; - } - - byte[] numFields = new byte[2]; - buffer.get(numFields); - - int nFields = ByteBuffer.wrap(numFields).order(bo).getShort(); - - byte[] ifd = new byte[12]; - for (int i = 0; i < nFields; i++) - { - buffer.get(ifd); - IfdStructure ifdStructure = readIFD(ifd, bo); - - // Return the orientation from the orientation IFD - if (ifdStructure.getTag() == 0x0112) - { - return Orientation.typeOf(ifdStructure.getOffsetValue()); - } - } - - return null; - } - - private static IfdStructure readIFD(byte[] ifd, ByteOrder bo) - { - ByteBuffer buffer = ByteBuffer.wrap(ifd).order(bo); - - short tag = buffer.getShort(); - short type = buffer.getShort(); - int count = buffer.getInt(); - - IfdType ifdType = IfdType.typeOf(type); - int offsetValue = 0; - - /* - * Per section 4.6.2 of the Exif Spec, if value is smaller than - * 4 bytes, it will exist in the earlier byte. - */ - int byteSize = count * ifdType.size(); - - if (byteSize <= 4) { - if (ifdType == IfdType.SHORT) - { - for (int i = 0; i < count; i++) - { - offsetValue = (int)buffer.getShort(); - } - } - else if (ifdType == IfdType.BYTE || ifdType == IfdType.ASCII || ifdType == IfdType.UNDEFINED) - { - for (int i = 0; i < count; i++) - { - offsetValue = (int)buffer.get(); - } - } - else - { - offsetValue = buffer.getInt(); - } - } - else - { - offsetValue = buffer.getInt(); - } - - return new IfdStructure(tag, type, count, offsetValue); - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/IfdStructure.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/IfdStructure.java deleted file mode 100644 index bbfcb1d7..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/IfdStructure.java +++ /dev/null @@ -1,156 +0,0 @@ -package net.coobird.thumbnailator.util.exif; - -/** - * IFD structure as defined in Section 4.6.2 of the Exif Specification - * version 2.3. - * - * @author coobird - * - */ -public class IfdStructure -{ - private final int tag; - private final IfdType type; - private final int count; - private final int offsetValue; - - /** - * Instantiates a IFD with the given attributes. - * - * @param tag The tag element. - * @param type The type element. - * @param count The count of values. - * @param offsetValue The offset or value. - */ - public IfdStructure(int tag, int type, int count, int offsetValue) - { - super(); - this.tag = tag; - this.type = IfdType.typeOf(type); - this.count = count; - this.offsetValue = offsetValue; - } - - /** - * Returns the tag element in the IFD structure. - * @return An integer representation of the tag element. - * Should be a value between 0x00 to 0xFF. - */ - public int getTag() - { - return tag; - } - - /** - * Returns the type element in the IFD structure. - * @return An {@link IfdType} enum indicating the type. - */ - public IfdType getType() - { - return type; - } - - /** - * Returns the count element in the IFD structure, indicating the number - * of values the value field.. - * @return A count indicating the number of values. - */ - public int getCount() - { - return count; - } - - /** - * Returns either the offset or value of the IFD. - * @return Either the offset or value. The type of the returned value - * can be determined by the return of the {@link #isOffset()} - * or {@link #isValue()} method. - */ - public int getOffsetValue() - { - return offsetValue; - } - - /** - * Returns whether the value returned by the {@link #getOffsetValue()} - * method is an actual value. - * @return {@code true} if the value returned by the - * {@link #getOffsetValue()} method is a value, {@code false} - * otherwise. - */ - public boolean isValue() - { - /* - * The offsetValue field contains a value if the size of the value is - * less than or equal to 4 bytes see "Value Offset" in Section 4.6.3 - * of the Exif version 2.3 specification. - */ - return type.size() * count <= 4; - } - - /** - * Returns whether the value returned by the {@link #getOffsetValue()} - * method is an offset value. - * @return {@code true} if the value returned by the - * {@link #getOffsetValue()} method is a offset value, - * {@code false} otherwise. - */ - public boolean isOffset() - { - return !isValue(); - } - - /** - * Returns the calculated hash code for this object. - * @return Hash code for this object. - */ - @Override - public int hashCode() - { - final int prime = 31; - int result = 1; - result = prime * result + count; - result = prime * result + offsetValue; - result = prime * result + tag; - result = prime * result + ((type == null) ? 0 : type.hashCode()); - return result; - } - - /** - * Returns whether this object is equal to the given object. - * @return {@code true} if the given object and this object is - * equivalent, {@code false} otherwise. - */ - @Override - public boolean equals(Object obj) - { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - IfdStructure other = (IfdStructure) obj; - if (count != other.count) - return false; - if (offsetValue != other.offsetValue) - return false; - if (tag != other.tag) - return false; - if (type != other.type) - return false; - return true; - } - - /** - * Returns a textual {@link String} reprensentation of this object. - * @return A textual representation of this object. - */ - @Override - public String toString() - { - return "IfdStructure [tag=" + Integer.toHexString(tag) + - ", type=" + type + ", count=" + count + - ", offsetValue=" + offsetValue + "]"; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/IfdType.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/IfdType.java deleted file mode 100644 index 736f402a..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/IfdType.java +++ /dev/null @@ -1,113 +0,0 @@ -package net.coobird.thumbnailator.util.exif; - -/** - * This enum corresponds to the types of data present in an IFD, - * as defined in Section 4.6.2 of the Exif Specification version 2.3. - * - * @author coobird - * - */ -public enum IfdType -{ - /** - * An 8-bit unsigned integer value. - */ - BYTE(1, 1), - - /** - * An 8-bit value containing a single 7-bit ASCII character. - * The final byte is NULL-terminated. - */ - ASCII(2, 1), - - /** - * A 16-bit unsigned integer value. - */ - SHORT(3, 2), - - /** - * A 32-bit unsigned integer value. - */ - LONG(4, 4), - - /** - * Two {@link #LONG} values, where the first {@code LONG} is the - * numerator, while the second {@code LONG} is the denominator. - */ - RATIONAL(5, LONG.size() * 2), - - /** - * An 8-bit value which can be value as defined elsewhere. - */ - UNDEFINED(7, 1), - - /** - * A 32-bit signed integer value using 2's complement. - */ - SLONG(9, 4), - - /** - * Two {@link #SLONG} values, where the first {@code SLONG} is the - * numerator, while the second {@code SLONG} is the denominator. - */ - SRATIONAL(5, SLONG.size() * 2), - ; - - private final int value; - private final int size; - - private IfdType(int value, int size) - { - this.value = value; - this.size = size; - } - - /** - * Returns the size in bytes for this IFD type. - * @return Size in bytes for this IFD type. - */ - public int size() - { - return size; - } - - /** - * Returns the IFD type as a type value. - * @return IFD type as a type value. - */ - public int value() - { - return value; - } - - /** - * Returns the {@link IfdType} corresponding to the given IFD type value. - * - * @param value The IFD type value. - * @return {@link IfdType} corresponding to the IDF type value. - * Return {@code null} if the given value does not - * correspond to a valid {@link IfdType}. - */ - public static IfdType typeOf(int value) - { - for (IfdType type : IfdType.values()) - { - if (type.value == value) - { - return type; - } - } - - return null; - } - - /** - * Returns a textual {@link String} reprensentation of this enum. - * @return A textual representation of this enum. - */ - @Override - public String toString() - { - return "IfdType [type=" + this.name() + ", value=" + value + ", size=" + size + "]"; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/Orientation.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/Orientation.java deleted file mode 100644 index d0a81850..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/Orientation.java +++ /dev/null @@ -1,122 +0,0 @@ -package net.coobird.thumbnailator.util.exif; - -/** - * Representation for the Orientation (Tag 274) in the Exif metadata, as - * defined in Section 4.6.4 of the Exif Specification version 2.3. - * - * @author coobird - * - */ -public enum Orientation -{ - /** - * Orientation 1. - *

    - *
  • First row: visual top of the image
  • - *
  • First column: visual left-hand side of the image
  • - *
- */ - TOP_LEFT(1), - - /** - * Orientation 2. - *
    - *
  • First row: visual top of the image
  • - *
  • First column: visual right-hand side of the image
  • - *
- */ - TOP_RIGHT(2), - - /** - * Orientation 3. - *
    - *
  • First row: visual bottom of the image
  • - *
  • First column: visual right-hand side of the image
  • - *
- */ - BOTTOM_RIGHT(3), - - /** - * Orientation 4. - *
    - *
  • First row: visual bottom of the image
  • - *
  • First column: visual left-hand side of the image
  • - *
- */ - BOTTOM_LEFT(4), - - /** - * Orientation 5. - *
    - *
  • First row: visual left-hand side of the image
  • - *
  • First column: visual top of the image
  • - *
- */ - LEFT_TOP(5), - - /** - * Orientation 6. - *
    - *
  • First row: visual right-hand side of the image
  • - *
  • First column: visual top of the image
  • - *
- */ - RIGHT_TOP(6), - - /** - * Orientation 7. - *
    - *
  • First row: visual right-hand side of the image
  • - *
  • First column: visual bottom of the image
  • - *
- */ - RIGHT_BOTTOM(7), - - /** - * Orientation 8. - *
    - *
  • First row: visual left-hand side of the image
  • - *
  • First column: visual bottom of the image
  • - *
- */ - LEFT_BOTTOM(8), - ; - - private final int value; - private Orientation(int value) - { - this.value = value; - } - - /** - * Returns the {@link Orientation} corresponding to the given orientation - * value. - * - * @param value The orientation value. - * @return {@link Orientation} corresponding to the orientation - * value. Return {@code null} if the given value does not - * correspond to a valid {@link Orientation}. - */ - public static Orientation typeOf(int value) - { - for (Orientation orientation : Orientation.values()) - { - if (orientation.value == value) - { - return orientation; - } - } - - return null; - } - - /** - * Returns a textual {@link String} reprensentation of this enum. - * @return A textual representation of this enum. - */ - @Override - public String toString() - { - return "Orientation [type=" + value + "]"; - } -} diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/package-info.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/package-info.java deleted file mode 100644 index ea20de8b..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/exif/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * This package contains utilities classes used to handle Exif metadata. - */ -package net.coobird.thumbnailator.util.exif; diff --git a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/package-info.java b/contact-center/app/src/main/java/net/coobird/thumbnailator/util/package-info.java deleted file mode 100644 index e222e199..00000000 --- a/contact-center/app/src/main/java/net/coobird/thumbnailator/util/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * This package contains utilities classes used by Thumbnailator. - */ -package net.coobird.thumbnailator.util; diff --git a/contact-center/app/src/main/java/org/eigenbase/resgen/ShadowResourceBundle.java b/contact-center/app/src/main/java/org/eigenbase/resgen/ShadowResourceBundle.java deleted file mode 100644 index b5e0504e..00000000 --- a/contact-center/app/src/main/java/org/eigenbase/resgen/ShadowResourceBundle.java +++ /dev/null @@ -1,259 +0,0 @@ -/* -// Licensed to Julian Hyde under one or more contributor license -// agreements. See the NOTICE file distributed with this work for -// additional information regarding copyright ownership. -// -// Julian Hyde licenses this file to you 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 org.eigenbase.resgen; - -import java.io.IOException; -import java.io.InputStream; -import java.security.PrivilegedAction; -import java.util.*; - -/** - * ShadowResourceBundle is an abstract base class for - * {@link ResourceBundle} classes which are backed by a properties file. When - * the class is created, it loads a properties file with the same name as the - * class. - * - *

In the standard scheme (see {@link ResourceBundle}), - * if you call {@link ResourceBundle#getBundle}("foo.MyResource"), - * it first looks for a class called foo.MyResource, then - * looks for a file called foo/MyResource.properties. If it finds - * the file, it creates a {@link PropertyResourceBundle} and loads the class. - * The problem is if you want to load the .properties file - * into a dedicated class; ShadowResourceBundle helps with this - * case. - * - *

You should create a class as follows:

- * - *
package foo;
- *class MyResource extends org.eigenbase.resgen.ShadowResourceBundle {
- *    public MyResource() throws java.io.IOException {
- *    }
- *}
- * - *
Then when you call - * {@link ResourceBundle#getBundle ResourceBundle.getBundle("foo.MyResource")}, - * it will find the class before the properties file, but still automatically - * load the properties file based upon the name of the class. - */ -public abstract class ShadowResourceBundle extends ResourceBundle { - private PropertyResourceBundle bundle; - private static final ThreadLocal mapThreadToLocale = new ThreadLocal(); - protected static final Object[] emptyObjectArray = new Object[0]; - - /** - * Creates a ShadowResourceBundle, and reads resources from - * a .properties file with the same name as the current class. - * For example, if the class is called foo.MyResource_en_US, - * reads from foo/MyResource_en_US.properties, then - * foo/MyResource_en.properties, then - * foo/MyResource.properties. - */ - protected ShadowResourceBundle() throws IOException { - super(); - Class clazz = getClass(); - InputStream stream = openPropertiesFile(clazz); - if (stream == null) { - throw new IOException("could not open properties file for " + getClass()); - } - MyPropertyResourceBundle previousBundle = - new MyPropertyResourceBundle(stream); - bundle = previousBundle; - stream.close(); - // Now load properties files for parent locales, which we deduce from - // the names of our super-class, and its super-class. - while (true) { - clazz = clazz.getSuperclass(); - if (clazz == null || - clazz == ShadowResourceBundle.class || - !ResourceBundle.class.isAssignableFrom(clazz)) { - break; - } - stream = openPropertiesFile(clazz); - if (stream == null) { - continue; - } - MyPropertyResourceBundle newBundle = - new MyPropertyResourceBundle(stream); - stream.close(); - if (previousBundle != null) { - previousBundle.setParentTrojan(newBundle); - } else { - bundle = newBundle; - } - previousBundle = newBundle; - } - } - - static class MyPropertyResourceBundle extends PropertyResourceBundle { - public MyPropertyResourceBundle(InputStream stream) throws IOException { - super(stream); - } - - void setParentTrojan(ResourceBundle parent) { - super.setParent(parent); - } - } - - /** - * Opens the properties file corresponding to a given class. The code is - * copied from {@link ResourceBundle}. - */ - private static InputStream openPropertiesFile(Class clazz) { - final ClassLoader loader = clazz.getClassLoader(); - final String resName = clazz.getName().replace('.', '/') + ".properties"; - return (InputStream)java.security.AccessController.doPrivileged( - (PrivilegedAction) () -> { - if (loader != null) { - return loader.getResourceAsStream(resName); - } else { - return ClassLoader.getSystemResourceAsStream(resName); - } - } - ); - } - - public Enumeration getKeys() { - return bundle.getKeys(); - } - - protected Object handleGetObject(String key) - throws MissingResourceException { - return bundle.getObject(key); - } - - /** - * Returns the instance of the baseName resource bundle for - * the current thread's locale. For example, if called with - * "mondrian.olap.MondrianResource", from a thread which has called {@link - * #setThreadLocale}({@link Locale#FRENCH}), will get an instance of - * "mondrian.olap.MondrianResource_FR" from the cache. - * - *

This method should be called from a derived class, with the proper - * casting:

- * - *
class MyResource extends ShadowResourceBundle {
-     *    ...
-     *    /**
-     *      * Retrieves the instance of {@link MyResource} appropriate
-     *      * to the current locale. If this thread has specified a locale
-     *      * by calling {@link #setThreadLocale}, this locale is used,
-     *      * otherwise the default locale is used.
-     *      **/
-     *    public static MyResource instance() {
-     *       return (MyResource) instance(MyResource.class.getName());
-     *    }
-     *    ...
-     * }
- * - * @deprecated This method does not work correctly in dynamically - * loaded jars. - */ - protected static ResourceBundle instance(String baseName) { - return instance(baseName, getThreadLocale()); - } - /** - * Returns the instance of the baseName resource bundle - * for the given locale. - * - *

This method should be called from a derived class, with the proper - * casting:

- * - *
class MyResource extends ShadowResourceBundle {
-     *    ...
-     *
-     *    /**
-     *      * Retrieves the instance of {@link MyResource} appropriate
-     *      * to the given locale.
-     *      **/
-     *    public static MyResource instance(Locale locale) {
-     *       return (MyResource) instance(MyResource.class.getName(), locale);
-     *    }
-     *    ...
-     * }
- * - * @deprecated This method does not work correctly in dynamically - * loaded jars. - */ - protected static ShadowResourceBundle instance( - String baseName, Locale locale) { - if (locale == null) { - locale = Locale.getDefault(); - } - ResourceBundle bundle = ResourceBundle.getBundle(baseName, locale); - return instance(baseName, locale, bundle); - } - - /** - * Returns the instance of the baseName resource bundle - * for the given locale. - * - *

This method should be called from a derived class, with the proper - * casting:

- * - *
class MyResource extends ShadowResourceBundle {
-     *    ...
-     *
-     *    /**
-     *      * Retrieves the instance of {@link MyResource} appropriate
-     *      * to the given locale.
-     *      **/
-     *    public static MyResource instance(Locale locale) {
-     *       return (MyResource) instance(
-     *           MyResource.class.getName(), locale,
-     *           ResourceBundle.getBundle(MyResource.class.getName(), locale));
-     *    }
-     *    ...
-     * }
- */ - protected static ShadowResourceBundle instance( - String baseName, Locale locale, ResourceBundle bundle) - { - if (bundle instanceof PropertyResourceBundle) { - throw new ClassCastException( - "ShadowResourceBundle.instance('" + baseName + "','" + - locale + "') found " + - baseName + "_" + locale + ".properties but not " + - baseName + "_" + locale + ".class"); - } - return (ShadowResourceBundle) bundle; - } - - /** Returns the preferred locale of the current thread, or - * the default locale if the current thread has not called {@link - * #setThreadLocale}. */ - protected static Locale getThreadOrDefaultLocale() { - Locale locale = getThreadLocale(); - if (locale == null) { - return Locale.getDefault(); - } else { - return locale; - } - } - - /** Sets the locale for the current thread. Used by {@link - * #instance(String,Locale)}. */ - public static void setThreadLocale(Locale locale) { - mapThreadToLocale.set(locale); - } - - /** Returns the preferred locale of the current thread, or null if the - * thread has not called {@link #setThreadLocale}. */ - public static Locale getThreadLocale() { - return (Locale) mapThreadToLocale.get(); - } -} diff --git a/contact-center/app/src/test/java/com/chatopera/cc/basic/MainContextTest.java b/contact-center/app/src/test/java/com/chatopera/cc/basic/MainContextTest.java index 5cafc481..d06e664c 100644 --- a/contact-center/app/src/test/java/com/chatopera/cc/basic/MainContextTest.java +++ b/contact-center/app/src/test/java/com/chatopera/cc/basic/MainContextTest.java @@ -1,18 +1,16 @@ /* - * Copyright (C) 2017 优客服-多渠道客服系统 - * Modifications copyright (C) 2018-2023 Chatopera Inc, - * - * 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 - * + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2018- Jun. 2023 Chatopera Inc, , Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (C) 2017 优客服-多渠道客服系统, Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.chatopera.cc.basic; diff --git a/contact-center/app/src/test/java/com/chatopera/cc/util/CronToolsTest.java b/contact-center/app/src/test/java/com/chatopera/cc/util/CronToolsTest.java index 6e341cb4..eedeee31 100644 --- a/contact-center/app/src/test/java/com/chatopera/cc/util/CronToolsTest.java +++ b/contact-center/app/src/test/java/com/chatopera/cc/util/CronToolsTest.java @@ -1,17 +1,15 @@ -/* - * Copyright (C) 2019-2022 Chatopera Inc, - * - * 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 - * +/* + * Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. + * , Licensed under the Chunsong Public + * License, Version 1.0 (the "License"), https://docs.cskefu.com/licenses/v1.html * 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. + * Copyright (C) 2019-2022 Chatopera Inc, , + * Licensed under the Apache License, Version 2.0, + * http://www.apache.org/licenses/LICENSE-2.0 */ package com.chatopera.cc.util; diff --git a/contact-center/root/pom.xml b/contact-center/root/pom.xml index fce5bb10..afe57047 100644 --- a/contact-center/root/pom.xml +++ b/contact-center/root/pom.xml @@ -305,6 +305,12 @@ juel-impl 2.2.7 + + + net.coobird + thumbnailator + 0.4.19 + cglib