mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Check service group parent type
This commit is contained in:
parent
0329ee614c
commit
30d28b7a19
2 changed files with 18 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
||||||
package io.xpipe.ext.base.service;
|
package io.xpipe.ext.base.service;
|
||||||
|
|
||||||
|
import io.xpipe.app.util.Validators;
|
||||||
import io.xpipe.core.store.NetworkTunnelStore;
|
import io.xpipe.core.store.NetworkTunnelStore;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
|
@ -14,4 +15,12 @@ import lombok.extern.jackson.Jacksonized;
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@Jacksonized
|
@Jacksonized
|
||||||
@JsonTypeName("customServiceGroup")
|
@JsonTypeName("customServiceGroup")
|
||||||
public class CustomServiceGroupStore extends AbstractServiceGroupStore<NetworkTunnelStore> {}
|
public class CustomServiceGroupStore extends AbstractServiceGroupStore<NetworkTunnelStore> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkComplete() throws Throwable {
|
||||||
|
super.checkComplete();
|
||||||
|
Validators.isType(getParent(), NetworkTunnelStore.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package io.xpipe.ext.base.service;
|
package io.xpipe.ext.base.service;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
import io.xpipe.app.storage.DataStoreEntry;
|
import io.xpipe.app.storage.DataStoreEntry;
|
||||||
import io.xpipe.app.storage.DataStoreEntryRef;
|
import io.xpipe.app.storage.DataStoreEntryRef;
|
||||||
import io.xpipe.app.util.FixedHierarchyStore;
|
import io.xpipe.app.util.FixedHierarchyStore;
|
||||||
|
import io.xpipe.app.util.Validators;
|
||||||
import io.xpipe.core.store.DataStore;
|
import io.xpipe.core.store.DataStore;
|
||||||
import io.xpipe.core.store.FixedChildStore;
|
import io.xpipe.core.store.FixedChildStore;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.experimental.FieldDefaults;
|
import lombok.experimental.FieldDefaults;
|
||||||
|
@ -23,6 +23,12 @@ import java.util.List;
|
||||||
public class FixedServiceGroupStore extends AbstractServiceGroupStore<FixedServiceCreatorStore>
|
public class FixedServiceGroupStore extends AbstractServiceGroupStore<FixedServiceCreatorStore>
|
||||||
implements DataStore, FixedHierarchyStore {
|
implements DataStore, FixedHierarchyStore {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkComplete() throws Throwable {
|
||||||
|
super.checkComplete();
|
||||||
|
Validators.isType(getParent(),FixedServiceCreatorStore.class);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public List<? extends DataStoreEntryRef<? extends FixedChildStore>> listChildren(DataStoreEntry self)
|
public List<? extends DataStoreEntryRef<? extends FixedChildStore>> listChildren(DataStoreEntry self)
|
||||||
|
|
Loading…
Reference in a new issue