axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Veithen <andreas.veit...@gmail.com>
Subject Re: Concern regarding axis2 deployment of same file with a different modified time
Date Thu, 19 Oct 2017 18:35:35 GMT
On Thu, Oct 19, 2017 at 3:52 PM, Sasikala Kottegoda <sasikala@wso2.com>
wrote:

> Hi all,
>
> We are using apache axis2 version 1.6.1 for the deployment of our artifacts
>

I guess it's the forked version of Axis2 that WSO2 bases its products on.
In that case, you can just modify that code.


> and the flow that takes place is as follows:
>
> [image: Inline image 1]
>
> What is expected here is for the artifacts that are
> deployed/undeployed/redployed to be commited to svn. What we could observe
> was that, when we add the same artifact to the deployment directoy, within
> axis2, it is considered as modified file since the last modified time of
> the file has changed. Thus the redployment takes place. However, since it
> is the same file that was redeployed, the md5sum will not be changed hence
> svn commit will not take place. Would it be a better approach if we modify
> the axis2 engine so that an artifact is cosidered modified if and only if
> it's md5sum has changed?
>
> Right now, the isModified() method of WSInfoList is as follows:
>
> private boolean isModified(File file, WSInfo wsInfo) {
>     long currentTimeStamp = wsInfo.getLastModifiedDate();
>
>     setLastModifiedDate(file, wsInfo);
>
>     return (currentTimeStamp != wsInfo.getLastModifiedDate());
> }
>
> My suggestion is to improve it as below:
>
> private boolean isModified(File file, WSInfo wsInfo) {
>
>     long previousModifiedDate = wsInfo.getLastModifiedDate();
>     setLastModifiedDate(file, wsInfo);
>     String previousMD5Sum = wsInfo.getMd5Sum();
>     setMD5Sum(file, wsInfo);
>     String currentMd5Sum = wsInfo.getMd5Sum();
>
>     if ((wsInfo.getLastModifiedDate() != previousModifiedDate) && (wsInfo.getMd5Sum().equals(previousMD5Sum)))
{
>         log.info("The file has been touched without a modification. Thus not considered
for redeployment");
>     }
>     return (!wsInfo.getMd5Sum().equals(previousMD5Sum));
>
> }
>
> Any suggestion is warmly welcome.
>
> Thank you,
> Sasikala
>
> --
> Sasikala Kottegoda
> *Senior Software Engineer*
> WSO2 Inc., http://wso2.com/
> lean. enterprise. middleware
> Mobile: +94 774835928 <+94%2077%20483%205928>
>
> [image: https://wso2.com/signature] <https://wso2.com/signature>
>

Mime
View raw message