2525import javax .inject .Inject ;
2626import javax .naming .ConfigurationException ;
2727
28- import org .apache .log4j .Logger ;
2928import org .apache .cloudstack .api .command .user .vpn .ListRemoteAccessVpnsCmd ;
3029import org .apache .cloudstack .api .command .user .vpn .ListVpnUsersCmd ;
3130import org .apache .cloudstack .context .CallContext ;
3231import org .apache .cloudstack .framework .config .ConfigKey ;
3332import org .apache .cloudstack .framework .config .Configurable ;
3433import org .apache .cloudstack .framework .config .dao .ConfigurationDao ;
34+ import org .apache .log4j .Logger ;
3535
3636import com .cloud .configuration .Config ;
3737import com .cloud .domain .DomainVO ;
8181import com .cloud .utils .db .JoinBuilder ;
8282import com .cloud .utils .db .SearchBuilder ;
8383import com .cloud .utils .db .SearchCriteria ;
84- import com .cloud .utils .db .TransactionCallback ;
85- import com .cloud .utils .db .TransactionCallbackNoReturn ;
8684import com .cloud .utils .db .SearchCriteria .Op ;
8785import com .cloud .utils .db .Transaction ;
86+ import com .cloud .utils .db .TransactionCallback ;
87+ import com .cloud .utils .db .TransactionCallbackNoReturn ;
8888import com .cloud .utils .db .TransactionCallbackWithException ;
8989import com .cloud .utils .db .TransactionStatus ;
9090import com .cloud .utils .net .NetUtils ;
@@ -592,6 +592,8 @@ public Pair<List<? extends RemoteAccessVpn>, Integer> searchForRemoteAccessVpns(
592592 // do some parameter validation
593593 Account caller = CallContext .current ().getCallingAccount ();
594594 Long ipAddressId = cmd .getPublicIpId ();
595+ Long vpnId = cmd .getId ();
596+ Long networkId = cmd .getNetworkId ();
595597 List <Long > permittedAccounts = new ArrayList <Long >();
596598
597599 if (ipAddressId != null ) {
@@ -619,6 +621,8 @@ public Pair<List<? extends RemoteAccessVpn>, Integer> searchForRemoteAccessVpns(
619621 _accountMgr .buildACLSearchBuilder (sb , domainId , isRecursive , permittedAccounts , listProjectResourcesCriteria );
620622
621623 sb .and ("serverAddressId" , sb .entity ().getServerAddressId (), Op .EQ );
624+ sb .and ("id" , sb .entity ().getId (), Op .EQ );
625+ sb .and ("networkId" , sb .entity ().getNetworkId (), Op .EQ );
622626 sb .and ("state" , sb .entity ().getState (), Op .EQ );
623627
624628 SearchCriteria <RemoteAccessVpnVO > sc = sb .create ();
@@ -630,6 +634,14 @@ public Pair<List<? extends RemoteAccessVpn>, Integer> searchForRemoteAccessVpns(
630634 if (ipAddressId != null ) {
631635 sc .setParameters ("serverAddressId" , ipAddressId );
632636 }
637+
638+ if (vpnId != null ) {
639+ sc .setParameters ("id" , vpnId );
640+ }
641+
642+ if (networkId != null ) {
643+ sc .setParameters ("networkId" , networkId );
644+ }
633645
634646 Pair <List <RemoteAccessVpnVO >, Integer > result = _remoteAccessVpnDao .searchAndCount (sc , filter );
635647 return new Pair <List <? extends RemoteAccessVpn >, Integer > (result .first (), result .second ());
0 commit comments