Class PermStructDef
- java.lang.Object
-
- com.automation_pros.odva.cip.data.StructDef
-
- com.automation_pros.odva.cip.data.PermStructDef
-
- All Implemented Interfaces:
PermissionedItem
public class PermStructDef extends StructDef implements PermissionedItem
Permissions are relatively fine-grained in Logix applications. It is possible that a structure member might be readable or writable individually, but the structure as a whole not be. To effectively optimize access, successes should propagate inward, while failures propagate outward.Inward propagation in this hierarchy is easy--the references are always present. Outward propagation from a structure to a user of the structure requires the users to subscribe to notifications.
Subscribers are tracked with weak references to ensure garbage collection is efficient. Failures are reported to the subscribers.
Omron structures do not have this granularity, but certain types and cases may have read or write failure conditions preloaded based on the probe results.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.data.StructDef
StructDef.Aligner, StructDef.ForceAligner, StructDef.LogixAligner, StructDef.SimpleAligner
-
Nested classes/interfaces inherited from interface com.automation_pros.odva.cip.data.PermissionedItem
PermissionedItem.LgxPermTracker
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<java.lang.ref.WeakReference<PermissionedItem>>
readSubs
static org.slf4j.Logger
sLogger
protected PermissionedItem.LgxPermTracker
tracker
protected java.util.Set<java.lang.ref.WeakReference<PermissionedItem>>
writeSubs
-
Fields inherited from class com.automation_pros.odva.cip.data.StructDef
ALIGN1, ALIGN2, ALIGN2C, ALIGN4, ALIGN4L, ALIGN8, ALIGN8L, aligner, altAlign, applicationCRC, copyCache, CRCstring, createCtx, depth, documentation, index, logixCompatible, logixCRC, maxAlign, maxSize, members, minSize, nestingSeg, size, structSeg, templateInstance, typeName
-
-
Constructor Summary
Constructors Constructor Description PermStructDef(java.lang.String typeName, int alignment, java.util.List<? extends StructMember> members)
PermStructDef(java.lang.String typeName, AnonStructSeg anon, DataContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSubscriber(PermissionedItem permItem)
Add an outer item to be notified of read and write failures on this structure.protected java.util.Set<java.lang.ref.WeakReference<PermissionedItem>>
getReadSubs()
PermissionedItem.LgxPermTracker
getTracker()
protected java.util.Set<java.lang.ref.WeakReference<PermissionedItem>>
getWriteSubs()
void
setReadFailed()
void
setReadSuccess()
void
setWriteFailed()
void
setWriteSuccess()
java.lang.String
toString()
-
Methods inherited from class com.automation_pros.odva.cip.data.StructDef
checkCircular, getAlignment, getApplicationCRC, getBooleanAt, getCopyMap, getDocumentation, getEffectiveCRC, getLogixCRC, getMember, getMember, getMemberAt, getNestingSeg, getStructSeg, getTemplateInstance, setApplicationCRC, setDocumentation, setTemplateInstance, toDetailString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.automation_pros.odva.cip.data.PermissionedItem
hasReadFailed, hasReadSucceeded, hasWriteFailed, hasWriteSucceeded
-
-
-
-
Field Detail
-
sLogger
public static final org.slf4j.Logger sLogger
-
tracker
protected PermissionedItem.LgxPermTracker tracker
-
readSubs
protected java.util.Set<java.lang.ref.WeakReference<PermissionedItem>> readSubs
-
writeSubs
protected java.util.Set<java.lang.ref.WeakReference<PermissionedItem>> writeSubs
-
-
Constructor Detail
-
PermStructDef
public PermStructDef(java.lang.String typeName, AnonStructSeg anon, DataContext ctx)
-
PermStructDef
public PermStructDef(java.lang.String typeName, int alignment, java.util.List<? extends StructMember> members)
-
-
Method Detail
-
getTracker
public PermissionedItem.LgxPermTracker getTracker()
- Specified by:
getTracker
in interfacePermissionedItem
-
getReadSubs
protected java.util.Set<java.lang.ref.WeakReference<PermissionedItem>> getReadSubs()
-
getWriteSubs
protected java.util.Set<java.lang.ref.WeakReference<PermissionedItem>> getWriteSubs()
-
addSubscriber
public void addSubscriber(PermissionedItem permItem)
Add an outer item to be notified of read and write failures on this structure. If either such has already occurred, the would-be subscriber will be synchronously notified. If either has not occurred, the subscription will be set up for that case.- Parameters:
permItem
-
-
setReadSuccess
public void setReadSuccess()
- Specified by:
setReadSuccess
in interfacePermissionedItem
-
setReadFailed
public void setReadFailed()
- Specified by:
setReadFailed
in interfacePermissionedItem
-
setWriteSuccess
public void setWriteSuccess()
- Specified by:
setWriteSuccess
in interfacePermissionedItem
-
setWriteFailed
public void setWriteFailed()
- Specified by:
setWriteFailed
in interfacePermissionedItem
-
-