19package org.sleuthkit.datamodel;
21import java.util.Collections;
23import java.util.Optional;
24import java.util.ResourceBundle;
37 private static final ResourceBundle bundle = ResourceBundle.getBundle(
"org.sleuthkit.datamodel.Bundle");
39 final static Long NO_ACCOUNT =
null;
40 final static String NO_OWNER_ID =
null;
44 private final long osAccountObjId;
45 private final long realmId;
46 private final String loginName;
47 private final String addr;
49 private final String signature;
54 private final String fullName;
58 private final Long creationTime;
60 private List<OsAccountAttribute> osAccountAttributes =
null;
67 UNKNOWN(0, bundle.getString(
"OsAccountStatus.Unknown.text")),
68 ACTIVE(1, bundle.getString(
"OsAccountStatus.Active.text")),
69 DISABLED(2, bundle.getString(
"OsAccountStatus.Disabled.text")),
71 DELETED(3, bundle.getString(
"OsAccountStatus.Deleted.text")),
72 NON_EXISTENT(4, bundle.getString(
"OsAccountStatus.NonExistent.text"));
75 private final String name;
109 if (statusType.ordinal() == statusId) {
127 private final int id;
128 private final String name;
145 if (type.ordinal() == typeId) {
158 UNKNOWN(0, bundle.getString(
"OsAccountType.Unknown.text")),
159 SERVICE(1, bundle.getString(
"OsAccountType.Service.text")),
160 INTERACTIVE(2, bundle.getString(
"OsAccountType.Interactive.text"));
162 private final int id;
163 private final String name;
197 if (accountType.ordinal() == typeId) {
224 OsAccount(
SleuthkitCase sleuthkitCase,
long osAccountobjId,
long realmId, String loginName, String uniqueId, String signature,
227 super(sleuthkitCase, osAccountobjId, signature);
229 this.sleuthkitCase = sleuthkitCase;
230 this.osAccountObjId = osAccountobjId;
231 this.realmId = realmId;
232 this.loginName = loginName;
233 this.addr = uniqueId;
234 this.signature = signature;
235 this.fullName = fullName;
236 this.creationTime = creationTime;
237 this.osAccountType = accountType;
238 this.osAccountStatus = accountStatus;
239 this.osAccountDbStatus = accountDbStatus;
248 synchronized void setAttributesInternal(List<OsAccountAttribute> osAccountAttributes) {
249 this.osAccountAttributes = osAccountAttributes;
260 return osAccountObjId;
270 return Optional.ofNullable(addr);
290 return Optional.ofNullable(loginName);
298 String getSignature() {
308 return Optional.ofNullable(fullName);
317 return Optional.ofNullable(creationTime);
326 return Optional.ofNullable(osAccountType);
335 return Optional.ofNullable(osAccountStatus);
344 return osAccountDbStatus;
355 if (osAccountAttributes ==
null) {
356 osAccountAttributes = sleuthkitCase.getOsAccountManager().getOsAccountAttributes(
this);
358 return Collections.unmodifiableList(osAccountAttributes);
369 return sleuthkitCase.getOsAccountManager().getOsAccountInstances(
this);
379 return sleuthkitCase;
402 throw new UnsupportedOperationException(
"Not supported yet.");
406 public <T> T accept(SleuthkitItemVisitor<T> v) {
407 return v.visit(
this);
420 private final long osAccountObjId;
421 private final Long hostId;
422 private final Long sourceObjId;
437 super(attributeType, valueInt);
439 this.osAccountObjId = osAccount.
getId();
440 this.hostId = (host !=
null ? host.
getHostId() :
null);
441 this.sourceObjId = (sourceObj !=
null ? sourceObj.
getId() :
null);
455 super(attributeType, valueLong);
457 this.osAccountObjId = osAccount.
getId();
458 this.hostId = (host !=
null ? host.
getHostId() :
null);
459 this.sourceObjId = (sourceObj !=
null ? sourceObj.
getId() :
null);
473 super(attributeType, valueDouble);
475 this.osAccountObjId = osAccount.
getId();
476 this.hostId = (host !=
null ? host.
getHostId() :
null);
477 this.sourceObjId = (sourceObj !=
null ? sourceObj.
getId() :
null);
491 super(attributeType, valueString);
493 this.osAccountObjId = osAccount.
getId();
494 this.hostId = (host !=
null ? host.
getHostId() :
null);
495 this.sourceObjId = (sourceObj !=
null ? sourceObj.
getId() :
null);
509 super(attributeType, valueBytes);
511 this.osAccountObjId = osAccount.
getId();
512 this.hostId = (host !=
null ? host.
getHostId() :
null);
513 this.sourceObjId = (sourceObj !=
null ? sourceObj.
getId() :
null);
536 valueInt, valueLong, valueDouble, valueString, valueBytes,
538 this.osAccountObjId = osAccount.
getId();
539 this.hostId = (host !=
null ? host.
getHostId() :
null);
540 this.sourceObjId = (sourceObj !=
null ? sourceObj.
getId() :
null);
549 return Optional.ofNullable(hostId);
558 return osAccountObjId;
567 return Optional.ofNullable(sourceObjId);
AbstractAttribute(BlackboardAttribute.Type attributeType, int valueInt)
AbstractContent(SleuthkitCase db, long obj_id, String name)
Optional< Long > getHostId()
OsAccountAttribute(BlackboardAttribute.Type attributeType, int valueInt, OsAccount osAccount, Host host, Content sourceObj)
long getOsAccountObjectId()
Optional< Long > getSourceObjectId()
OsAccountAttribute(BlackboardAttribute.Type attributeType, long valueLong, OsAccount osAccount, Host host, Content sourceObj)
OsAccountAttribute(BlackboardAttribute.Type attributeType, byte[] valueBytes, OsAccount osAccount, Host host, Content sourceObj)
OsAccountAttribute(BlackboardAttribute.Type attributeType, String valueString, OsAccount osAccount, Host host, Content sourceObj)
OsAccountAttribute(BlackboardAttribute.Type attributeType, double valueDouble, OsAccount osAccount, Host host, Content sourceObj)
SleuthkitCase getSleuthkitCase()
synchronized List< OsAccountAttribute > getExtendedOsAccountAttributes()
OsAccountDbStatus getOsAccountDbStatus()
Optional< OsAccountStatus > getOsAccountStatus()
Optional< String > getLoginName()
synchronized List< OsAccountInstance > getOsAccountInstances()
int read(byte[] buf, long offset, long len)
Optional< OsAccountType > getOsAccountType()
Optional< String > getFullName()
Optional< Long > getCreationTime()
Optional< String > getAddr()
OsAccountDbStatus(int id, String name)
static OsAccountDbStatus fromID(int typeId)
static OsAccountStatus fromID(int statusId)
OsAccountStatus(int id, String name)
static OsAccountType fromID(int typeId)
OsAccountType(int id, String name)